Fixing sample file dialog initialization and other things - Alex
authorterminatorX <>
Thu, 12 Jun 2003 01:44:52 +0000 (01:44 +0000)
committerterminatorX <>
Thu, 12 Jun 2003 01:44:52 +0000 (01:44 +0000)
src/tX_global.c
src/tX_global.h
src/tX_legacy_global.c
src/tX_seqpar.cc
src/tX_vtt.cc
src/tX_vttgui.cc

index 9f0c71cc3e4e3b9bad7f1ec8bff6872d33f0b3e3..1434f2784e24d964d511e1a0fef8e80a6a7021b8 100644 (file)
@@ -125,7 +125,7 @@ void set_global_defaults() {
 #endif 
 #endif         
        globals.use_stdout_cmdline=0;
 #endif 
 #endif         
        globals.use_stdout_cmdline=0;
-       globals.current_path = NULL;
+       strcpy(globals.current_path, "");
        globals.pitch=1.0;
        globals.volume=1.0;
        
        globals.pitch=1.0;
        globals.volume=1.0;
        
@@ -213,6 +213,7 @@ int load_globals_xml() {
                        restore_string("record_filename", globals.record_filename);
                        restore_string("file_editor", globals.file_editor);
                        restore_string("lrdf_path", globals.lrdf_path);
                        restore_string("record_filename", globals.record_filename);
                        restore_string("file_editor", globals.file_editor);
                        restore_string("lrdf_path", globals.lrdf_path);
+                       restore_string("last_path", globals.current_path);
                        
                        restore_int("compress_set_files", globals.compress_set_files);
                        restore_int("fullscreen_enabled", globals.fullscreen_enabled);
                        
                        restore_int("compress_set_files", globals.compress_set_files);
                        restore_int("fullscreen_enabled", globals.fullscreen_enabled);
@@ -308,6 +309,8 @@ void store_globals() {
                store_int("confirm_events", globals.confirm_events);
                store_float("vtt_inertia", globals.vtt_inertia);
 
                store_int("confirm_events", globals.confirm_events);
                store_float("vtt_inertia", globals.vtt_inertia);
 
+               store_string("last_path", globals.current_path);
+
                fprintf(rc,"</terminatorXrc>\n");
        }
 }
                fprintf(rc,"</terminatorXrc>\n");
        }
 }
index 788d261ade7cac45b81bace41891dbf3caaa3f7f..d3b9e9e8a1bef538e2d5a7dd5d1a8992ce6cfbab 100644 (file)
@@ -111,7 +111,7 @@ typedef struct {
        int true_block_size;
        int update_delay; 
        
        int true_block_size;
        int update_delay; 
        
-       char *current_path;
+       char current_path[PATH_MAX];
        
        /* new audiodevice handling 
           we have *all* variables for *all* audiodevice types -
        
        /* new audiodevice handling 
           we have *all* variables for *all* audiodevice types -
index 0ccf2051ab18cac781dd69e21438b0223a75032d..5f97b4ad6fecaec948617c5e0d692d02e4572289 100644 (file)
@@ -63,7 +63,7 @@ void load_globals_old() {
          to old values on startup....
        */
        globals.use_stdout_cmdline=0;
          to old values on startup....
        */
        globals.use_stdout_cmdline=0;
-       globals.current_path = NULL;
+       globals.current_path[0] = 0;
        globals.pitch=1.0;
        globals.volume=1.0;     
 }
        globals.pitch=1.0;
        globals.volume=1.0;     
 }
index f58840e62eede8bad27685f1c8b6d037a2a4d1e9..09ac06cd4db353dc4fb5c8b974ca44e6b2ed6c54 100644 (file)
@@ -885,6 +885,7 @@ void tX_seqpar_vttfx_float :: create_widget()
        float tmp=max_value - min_value/1000;
 
        *fx_value=min_value;
        float tmp=max_value - min_value/1000;
 
        *fx_value=min_value;
+       //myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value+tmp/10, max_value-tmp/10, tmp, tmp, tmp));
        myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value, max_value, tmp, tmp, tmp));
        mydial=new tX_extdial(label_name, myadj);
        gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_float :: gtk_callback, this);
        myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value, max_value, tmp, tmp, tmp));
        mydial=new tX_extdial(label_name, myadj);
        gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_float :: gtk_callback, this);
index b2fea64ce95d7198cc3db5a2d830d00002a0c23b..cfd788ea15781a16c82cc7b4e3e40e0bd16e9498 100644 (file)
@@ -215,6 +215,8 @@ vtt_class :: ~vtt_class()
        if (output_buffer) tX_freemem(output_buffer, "output_buffer", "vtt Destructor");
        vtt_amount--;
        
        if (output_buffer) tX_freemem(output_buffer, "output_buffer", "vtt Destructor");
        vtt_amount--;
        
+       if (mix_solo) solo_ctr--;
+       
        while (fx_list.size())
        { 
                effect=(*fx_list.begin());
        while (fx_list.size())
        { 
                effect=(*fx_list.begin());
@@ -1521,6 +1523,10 @@ int vtt_class :: load(xmlDocPtr doc, xmlNodePtr node) {
 
        recalc_volume();
 
 
        recalc_volume();
 
+       if (mix_solo) {
+               solo_ctr++;
+       }
+       
        if (xpar_id>=0) {
                set_x_input_parameter(tX_seqpar :: get_sp_by_persistence_id(xpar_id));
        }
        if (xpar_id>=0) {
                set_x_input_parameter(tX_seqpar :: get_sp_by_persistence_id(xpar_id));
        }
index 2318006d96428cff76839889799525cdaec6ae5f..9c7e9a8e2d976e254bf89ea21bd5d2c58436ae24 100644 (file)
@@ -223,13 +223,7 @@ void do_load_file(GtkWidget *wid, vtt_class *vtt)
        
        load_part(newfile, vtt);
        
        
        load_part(newfile, vtt);
        
-       if (!globals.current_path)
-       {
-               free(globals.current_path);
-               globals.current_path = NULL;
-       }
-
-       globals.current_path = strdup(newfile);
+       strcpy(globals.current_path, newfile);
 
        vtt->gui.file_dialog=NULL;
        
 
        vtt->gui.file_dialog=NULL;
        
@@ -281,19 +275,16 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        sprintf(buffer, "Select Audio File for %s", vtt->name);
        vtt->gui.fs=gtk_file_selection_new(buffer);
        
        sprintf(buffer, "Select Audio File for %s", vtt->name);
        vtt->gui.fs=gtk_file_selection_new(buffer);
        
-       if (strlen(vtt->filename) > 0)
-       {
+       if (vtt->audiofile) {
                gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs), vtt->filename);        
                gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs), vtt->filename);        
+       } else if (strlen(globals.current_path)>0 ) {
+               gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs),globals.current_path);
        }
        
        gtk_widget_show(GTK_WIDGET(vtt->gui.fs));
        
        vtt->gui.file_dialog=vtt->gui.fs->window;
        
        }
        
        gtk_widget_show(GTK_WIDGET(vtt->gui.fs));
        
        vtt->gui.file_dialog=vtt->gui.fs->window;
        
-       if (globals.current_path)
-               {
-                       gtk_file_selection_set_filename(GTK_FILE_SELECTION(vtt->gui.fs),globals.current_path);
-               }
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_file), vtt);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_file), vtt);    
        gtk_signal_connect (GTK_OBJECT(vtt->gui.fs), "delete-event", GTK_SIGNAL_FUNC(quit_load_file), vtt);     
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_file), vtt);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_file), vtt);    
        gtk_signal_connect (GTK_OBJECT(vtt->gui.fs), "delete-event", GTK_SIGNAL_FUNC(quit_load_file), vtt);