join clips and status control to same 'operate' page
[rugen] / src / dv1394app.c
index 995539a..c462b50 100644 (file)
@@ -244,10 +244,12 @@ static gboolean on_transport_pressed( GtkWidget *button, gpointer data )
                
                case 11:
                        mvcp_unit_set( dv, unit, "eof", "loop");
+                       this->eof = 0;
                        break;
 
                case 12:
                        mvcp_unit_set( dv, unit, "eof", "pause");
+                       this->eof = 0;
                        break;
 
                default:
@@ -399,8 +401,7 @@ dv1394app dv1394app_init( GtkWidget *window, char *instance )
 //             gtk_signal_connect( GTK_OBJECT( widget ), "clicked", GTK_SIGNAL_FUNC( on_item_quit_activate ), this );
                
                /* Initialise the pages. */
-               dv1394app_register_page( this, page_status_init( this ) );
-               dv1394app_register_page( this, page_clips_init( this ) );
+               dv1394app_register_page( this, page_operate_init( this ) );
                dv1394app_register_page( this, page_command_init( this ) );
                this->guard = 1;
                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( this->page_buttons[ 0 ] ), TRUE );
@@ -553,3 +554,25 @@ void dv1394app_close( dv1394app this )
                page_close( this->pages[ -- this->page_count ] );
        free( this );
 }
+
+char* frames2tc( int f, float fps, char* buf )
+{
+       int tc[4] = { 0, 0, 0, 0 };
+       float d;
+       int t;
+
+       if ( fps )
+       {
+               d = f / fps;
+               t = d;
+
+               tc[0] = (d - t) * fps;
+               tc[1] = t % 60; t /= 60;
+               tc[2] = t % 60; t /= 60;
+               tc[3] = t % 24;
+       }
+
+       sprintf(buf, "%.2d:%.2d:%.2d:%.2d", tc[3], tc[2], tc[1], tc[0]);
+
+       return buf;
+}