Fix build against melted and mvcp.
[rugen] / src / page_clips.c
index cab01cc..27d9205 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * page_clips.c -- Clips Page Handling
  * Copyright (C) 2002-2003 Charles Yates <charles.yates@pandora.be>
+ * Copyright (C) 2010 Dan Dennedy <dan@dennedy.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,7 +31,6 @@
 #include "interface.h"
 #include "support.h"
 #include "dv1394app.h"
-#include "util.h"
 #include "page.h"
 
 typedef struct 
@@ -38,7 +38,7 @@ typedef struct
        struct page_t parent;
        dv1394app app;
        GtkWidget *widget;
-       valerie dv;
+       mvcp dv;
        char *path;
        int unit;
        int generation;
@@ -59,12 +59,12 @@ static void list_clips( page_clips this, char *path )
        GtkWidget *label = lookup_widget( this_page_get_widget( this ), "label_directory" );
        if ( path != NULL )
        {
-               valerie_dir dir = valerie_dir_init( this->dv, path );
+               mvcp_dir dir = mvcp_dir_init( this->dv, path );
                GtkListStore *dir_store = NULL;
                GtkListStore *clip_store = NULL;
                GtkTreeIter iter;
                int index;
-               valerie_dir_entry_t entry;
+               mvcp_dir_entry_t entry;
 
                free( this->path );
                this->path = strdup( path );
@@ -108,9 +108,9 @@ static void list_clips( page_clips this, char *path )
                        gtk_list_store_set( dir_store, &iter, 0, "..", -1 );
                }
                
-               for ( index = 0; index < valerie_dir_count( dir ); index ++ )
+               for ( index = 0; index < mvcp_dir_count( dir ); index ++ )
                {
-                       valerie_dir_get( dir, index, &entry );
+                       mvcp_dir_get( dir, index, &entry );
                        if ( strchr( entry.name, '/' ) )
                        {
                                gtk_list_store_append( dir_store, &iter );
@@ -123,7 +123,7 @@ static void list_clips( page_clips this, char *path )
                        }
                }
                                              
-               valerie_dir_close( dir );
+               mvcp_dir_close( dir );
        }
        else
        {
@@ -143,12 +143,12 @@ static void list_clips( page_clips this, char *path )
 static void list_queue( page_clips this, int clip )
 {
        GtkWidget *treeview = lookup_widget( this_page_get_widget( this ), "treeview1" );
-       valerie_list list = valerie_list_init( this->dv, dv1394app_get_selected_unit( this->app ) );
+       mvcp_list list = mvcp_list_init( this->dv, dv1394app_get_selected_unit( this->app ) );
        GtkListStore *list_store = NULL;
        GtkTreeIter iter;
        GtkTreePath *path;
        int index;
-       valerie_list_entry_t entry;
+       mvcp_list_entry_t entry;
 
        if ( gtk_tree_view_get_model( GTK_TREE_VIEW( treeview ) ) == NULL )
        {
@@ -186,22 +186,22 @@ static void list_queue( page_clips this, int clip )
        
        this->generation = list->generation;
        
-       for ( index = 0; index < valerie_list_count( list ); index ++ )
+       for ( index = 0; index < mvcp_list_count( list ); index ++ )
        {
-               valerie_list_get( list, index, &entry );
+               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 );
        }
 
        this->clip = clip;
-       if ( clip < valerie_list_count( list ) )
+       if ( clip < mvcp_list_count( list ) )
        {
                path = gtk_tree_path_new_from_indices( this->clip, -1 );
                gtk_tree_view_scroll_to_cell( GTK_TREE_VIEW( treeview ), path, NULL, TRUE, 0.5, 0 );
                gtk_tree_path_free( path );
        }
        
-       valerie_list_close( list );
+       mvcp_list_close( list );
 }
 
 static void list_active( page_clips this, int clip )
@@ -252,17 +252,17 @@ static gboolean on_ok( GtkWidget *dummy, gpointer data )
                        switch( this->mode )
                        {
                                case 0:
-                                       valerie_unit_load_back( this->dv, dv1394app_get_selected_unit( this->app ), temp );
-                                       valerie_unit_play( this->dv, dv1394app_get_selected_unit( this->app ) );
+                                       mvcp_unit_load_back( this->dv, dv1394app_get_selected_unit( this->app ), temp );
+                                       mvcp_unit_play( this->dv, dv1394app_get_selected_unit( this->app ) );
                                        break;
                                case 1: 
-                                       valerie_unit_load( this->dv, dv1394app_get_selected_unit( this->app ), temp );
+                                       mvcp_unit_load( this->dv, dv1394app_get_selected_unit( this->app ), temp );
                                        break;
                                case 2: 
-                                       valerie_unit_append( this->dv, dv1394app_get_selected_unit( this->app ), temp, -1, -1 );
+                                       mvcp_unit_append( this->dv, dv1394app_get_selected_unit( this->app ), temp, -1, -1 );
                                        break;
                                case 3:
-                                       valerie_unit_clip_insert( this->dv, dv1394app_get_selected_unit( this->app ), valerie_relative, 1, temp, -1, -1 );
+                                       mvcp_unit_clip_insert( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 1, temp, -1, -1 );
                                        break;
                        }
                        
@@ -323,8 +323,8 @@ static gboolean on_queue_item( GtkWidget *dummy, gpointer data )
        if ( gtk_tree_selection_get_selected( select, &model, &iter ) )
        {
                gtk_tree_model_get( model, &iter, 5, &clip,     -1 );
-               valerie_unit_clip_goto( this->dv, dv1394app_get_selected_unit( this->app ), valerie_absolute, clip, 0 );
-               valerie_unit_play( this->dv, dv1394app_get_selected_unit( this->app ) );
+               mvcp_unit_clip_goto( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_absolute, clip, 0 );
+               mvcp_unit_play( this->dv, dv1394app_get_selected_unit( this->app ) );
        }
        
        return TRUE;
@@ -392,28 +392,28 @@ static gboolean on_refresh( GtkWidget *button, gpointer data )
 static gboolean on_up( GtkWidget *dummy, gpointer data )
 {
        page_clips this = data;
-       valerie_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), valerie_relative, 0, valerie_relative, -1 );
+       mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 0, mvcp_relative, -1 );
        return TRUE;
 }
 
 static gboolean on_down( GtkWidget *dummy, gpointer data )
 {
        page_clips this = data;
-       valerie_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), valerie_relative, 0, valerie_relative, 1 );
+       mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 0, mvcp_relative, 1 );
        return TRUE;
 }
 
 static gboolean on_remove( GtkWidget *dummy, gpointer data )
 {
        page_clips this = data;
-       valerie_unit_remove_current_clip( this->dv, dv1394app_get_selected_unit( this->app ) );
+       mvcp_unit_remove_current_clip( this->dv, dv1394app_get_selected_unit( this->app ) );
        return TRUE;
 }
 
 static gboolean on_clean( GtkWidget *dummy, gpointer data )
 {
        page_clips this = data;
-       valerie_unit_clean( this->dv, dv1394app_get_selected_unit( this->app ) );
+       mvcp_unit_clean( this->dv, dv1394app_get_selected_unit( this->app ) );
        return TRUE;
 }
 
@@ -444,7 +444,7 @@ static void this_page_get_toolbar_info( page this, GtkIconSize size, GtkWidget *
 
 static void this_page_on_connect( page_clips this )
 {
-       this->dv = valerie_init( dv1394app_get_parser( this->app ) );
+       this->dv = mvcp_init( dv1394app_get_parser( this->app ) );
        list_clips( this, "/" );
 }
 
@@ -457,10 +457,10 @@ static void this_page_on_unit_change( page_clips this, int unit )
 static void this_page_on_disconnect( page_clips this )
 {
        list_clips( this, NULL );
-       valerie_close( this->dv );
+       mvcp_close( this->dv );
 }
 
-static void this_page_show_status( page_clips this, valerie_status status )
+static void this_page_show_status( page_clips this, mvcp_status status )
 {
        if ( status->status != unit_disconnected )
        {
@@ -488,7 +488,7 @@ page page_clips_init( dv1394app app )
        this->parent.on_connect = ( void (*)( page ) )this_page_on_connect;
        this->parent.on_unit_change = ( void (*)( page, int ) )this_page_on_unit_change;
        this->parent.on_disconnect = ( void (*)( page ) )this_page_on_disconnect;
-       this->parent.show_status = ( void (*)( page, valerie_status ) )this_page_show_status;
+       this->parent.show_status = ( void (*)( page, mvcp_status ) )this_page_show_status;
        this->parent.close = ( void (*)( page ) )this_page_close;
        this->app = app;
        this->generation = -1;