join clips and status control to same 'operate' page
[rugen] / src / page_clips.c
index 50b8912..aeefc74 100644 (file)
@@ -47,6 +47,8 @@ typedef struct
        // TODO: This comes out later
        int mode;
        GtkWidget *modes[ 4 ];
+
+       struct page_t *parent_page;
 }
 *page_clips, page_clips_t;
 
@@ -155,7 +157,13 @@ static void list_queue( page_clips this, int clip )
                GtkCellRenderer *renderer;
                GtkTreeViewColumn *column;
 
-               list_store = gtk_list_store_new( 6, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT );
+               list_store = gtk_list_store_new( 6,
+                       G_TYPE_BOOLEAN,
+                       G_TYPE_STRING,
+                       G_TYPE_STRING,
+                       G_TYPE_STRING,
+                       G_TYPE_STRING,
+                       G_TYPE_INT );
                gtk_tree_view_set_model( GTK_TREE_VIEW( treeview ), GTK_TREE_MODEL( list_store ) );
                
                renderer = gtk_cell_renderer_toggle_new( );
@@ -188,9 +196,17 @@ static void list_queue( page_clips this, int clip )
        
        for ( index = 0; index < mvcp_list_count( list ); index ++ )
        {
+               char tc1[12], tc2[12], tc3[12];
                mvcp_list_get( list, index, &entry );
                gtk_list_store_append( list_store, &iter );
-               gtk_list_store_set( list_store, &iter, 0, index == clip, 1, ( int )entry.in, 2, ( int )entry.out, 3, ( int )entry.size, 4, entry.full, 5, entry.clip, -1 );
+               gtk_list_store_set( list_store, &iter,
+                       0, index == clip,
+                       1, frames2tc( entry.in, entry.fps, tc1),
+                       2, frames2tc( entry.out, entry.fps, tc2),
+                       3, frames2tc( entry.size, entry.fps, tc3),
+                       4, entry.full,
+                       5, entry.clip,
+                       -1 );
        }
 
        this->clip = clip;
@@ -474,7 +490,7 @@ void on_mode_change( GtkMenuItem *menuitem, gpointer data )
 static GtkWidget *this_page_get_widget( page_clips this )
 {
        if ( this->widget == NULL )
-               this->widget = create_page_clips( );
+               this->widget = this->parent_page->get_widget(this->parent_page);
        return this->widget;
 }
 
@@ -519,12 +535,13 @@ static void this_page_close( page_clips this )
                free( this );
 }
 
-page page_clips_init( dv1394app app )
+page page_clips_init( dv1394app app, struct page_t *parent_page)
 {
        page_clips this = calloc( 1, sizeof( page_clips_t ) );
        GtkWidget *widget;
        int index = 0;
 
+       this->parent_page = parent_page;
        this->parent.get_widget = ( GtkWidget *(*)( page ) )this_page_get_widget;
        this->parent.get_toolbar_info = this_page_get_toolbar_info;
        this->parent.on_connect = ( void (*)( page ) )this_page_on_connect;