Rename main channel controls
authorAlexander Koenig <alex@lisas.de>
Sat, 13 Feb 2021 22:10:44 +0000 (23:10 +0100)
committerAlexander Koenig <alex@lisas.de>
Sat, 13 Feb 2021 22:10:44 +0000 (23:10 +0100)
src/tX_legacy_vtt.cc
src/tX_maingui.cc
src/tX_maingui.h
src/tX_midiin.cc
src/tX_seqpar.cc
src/tX_seqpar.h
src/tX_vtt.cc
src/tX_vtt.h
src/tX_vttgui.cc

index 80c4ee6855fc4ea1b4589b92d9ad0a3caee9ecd0..3795ee6355c70daeb99c10baaa49fe2a1f8731bb 100644 (file)
@@ -619,11 +619,11 @@ int  vtt_class :: load_all_10(FILE* input, char *fname)
        }
                
        atload(max);
-       atload(master_volume);
-       set_master_volume(master_volume);
-       globals.volume=master_volume;
+       atload(main_volume);
+       set_main_volume(main_volume);
+       globals.volume=main_volume;
        atload(globals.pitch);  
-       set_master_pitch(globals.pitch);
+       set_main_pitch(globals.pitch);
 
        ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
        ld_set_setname(fname);
@@ -669,15 +669,15 @@ int  vtt_class :: load_all_11(FILE* input, char *fname)
        }
                
        atload(max);
-       atload(master_volume);
-       set_master_volume(master_volume);
-       globals.volume=master_volume;
+       atload(main_volume);
+       set_main_volume(main_volume);
+       globals.volume=main_volume;
        atload(globals.pitch);  
-       set_master_pitch(globals.pitch);
+       set_main_pitch(globals.pitch);
        atload(pid);
-       sp_master_volume.set_persistence_id(pid);
+       sp_main_volume.set_persistence_id(pid);
        atload(pid);
-       sp_master_pitch.set_persistence_id(pid);
+       sp_main_pitch.set_persistence_id(pid);
 
        ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
        ld_set_setname(fname);
@@ -724,15 +724,15 @@ int  vtt_class :: load_all_12(FILE* input, char *fname)
        }
                
        atload(max);
-       atload(master_volume);
-       set_master_volume(master_volume);
-       globals.volume=master_volume;
+       atload(main_volume);
+       set_main_volume(main_volume);
+       globals.volume=main_volume;
        atload(globals.pitch);  
-       set_master_pitch(globals.pitch);
+       set_main_pitch(globals.pitch);
        atload(pid);
-       sp_master_volume.set_persistence_id(pid);
+       sp_main_volume.set_persistence_id(pid);
        atload(pid);
-       sp_master_pitch.set_persistence_id(pid);
+       sp_main_pitch.set_persistence_id(pid);
 
        ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
        ld_set_setname(fname);
@@ -778,15 +778,15 @@ int  vtt_class :: load_all_13(FILE* input, char *fname)
        }
                
        atload(max);
-       atload(master_volume);
-       set_master_volume(master_volume);
-       globals.volume=master_volume;
+       atload(main_volume);
+       set_main_volume(main_volume);
+       globals.volume=main_volume;
        atload(globals.pitch);  
-       set_master_pitch(globals.pitch);
+       set_main_pitch(globals.pitch);
        atload(pid);
-       sp_master_volume.set_persistence_id(pid);
+       sp_main_volume.set_persistence_id(pid);
        atload(pid);
-       sp_master_pitch.set_persistence_id(pid);
+       sp_main_pitch.set_persistence_id(pid);
 
        ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
        ld_set_setname(fname);
@@ -832,15 +832,15 @@ int  vtt_class :: load_all_14(FILE* input, char *fname)
        }
                
        atload(max);
-       atload(master_volume);
-       set_master_volume(master_volume);
-       globals.volume=master_volume;
+       atload(main_volume);
+       set_main_volume(main_volume);
+       globals.volume=main_volume;
        atload(globals.pitch);  
-       set_master_pitch(globals.pitch);
+       set_main_pitch(globals.pitch);
        atload(pid);
-       sp_master_volume.set_persistence_id(pid);
+       sp_main_volume.set_persistence_id(pid);
        atload(pid);
-       sp_master_pitch.set_persistence_id(pid);
+       sp_main_pitch.set_persistence_id(pid);
 
        ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
        ld_set_setname(fname);
index 91ab26994d0441df11c1e9ea6031bd1e9215e62e..bd6aeb5ee693e316ee6598b993ba0791fe445a7a 100644 (file)
@@ -17,7 +17,7 @@
  
     File: tX_maingui.cc
  
-    Description: This implements the main (aka master) gtk+ GUI of terminatorX
+    Description: This implements the main gtk+ GUI of terminatorX
                 It serves as a container for the vtt-guis.
 */    
 
@@ -97,8 +97,8 @@ GtkAdjustment *volume_adj;
 GtkAdjustment *pitch_adj;
 
 /* seq-pars */
-tX_seqpar_master_volume sp_master_volume;
-tX_seqpar_master_pitch sp_master_pitch;
+tX_seqpar_main_volume sp_main_volume;
+tX_seqpar_main_pitch sp_main_pitch;
 
 GtkWidget *engine_btn;
 
@@ -577,15 +577,15 @@ GCallback save_tables()
        return NULL;
 }
 
-GCallback master_volume_changed (GtkWidget *wid, void *d)
+GCallback main_volume_changed (GtkWidget *wid, void *d)
 {
-       sp_master_volume.receive_gui_value((float) gtk_adjustment_get_value(GTK_ADJUSTMENT(wid)));
+       sp_main_volume.receive_gui_value((float) gtk_adjustment_get_value(GTK_ADJUSTMENT(wid)));
        return NULL;    
 }
 
-GCallback master_pitch_changed(GtkWidget *wid, void *d)
+GCallback main_pitch_changed(GtkWidget *wid, void *d)
 {
-       sp_master_pitch.receive_gui_value((float) gtk_adjustment_get_value(GTK_ADJUSTMENT(wid)));       
+       sp_main_pitch.receive_gui_value((float) gtk_adjustment_get_value(GTK_ADJUSTMENT(wid))); 
        return NULL;    
 }
 
@@ -1304,7 +1304,7 @@ void create_maingui(int x, int y)
        //GtkWidget *sequencer_box;
        GtkAdjustment *dumadj;
        GtkWidget *dummy;
-       GtkWidget *master_vol_box;
+       GtkWidget *main_vol_box;
        GtkWidget *status_box;
        GtkWidget *wrapbox;
        
@@ -1470,10 +1470,10 @@ void create_maingui(int x, int y)
        gtk_box_pack_start(GTK_BOX(main_vbox), right_hbox, WID_FIX);
        gtk_widget_show(right_hbox);
 
-       /* Master */
+       /* Main */
        
        dummy=gtk_label_new(NULL);
-       gtk_label_set_markup(GTK_LABEL(dummy),"<b>Master</b>");
+       gtk_label_set_markup(GTK_LABEL(dummy),"<b>Main</b>");
        gtk_box_pack_start(GTK_BOX(right_hbox), dummy, WID_FIX);
        gtk_widget_show(dummy); 
 
@@ -1489,36 +1489,36 @@ void create_maingui(int x, int y)
 
        dumadj=(GtkAdjustment*) gtk_adjustment_new(globals.pitch, -3, 3, 0.001, 0.001, 0.01);
        pitch_adj=dumadj;
-       connect_adj(dumadj, master_pitch_changed, NULL);
+       connect_adj(dumadj, main_pitch_changed, NULL);
        
-       tX_extdial *pdial=new tX_extdial("Pitch", pitch_adj, &sp_master_pitch, true);
+       tX_extdial *pdial=new tX_extdial("Pitch", pitch_adj, &sp_main_pitch, true);
        gtk_box_pack_start(GTK_BOX(right_hbox), pdial->get_widget(), WID_FIX);
-       gui_set_tooltip(pdial->get_entry(), "Use this dial to adjust the master pitch (affecting *all* turntables).");
+       gui_set_tooltip(pdial->get_entry(), "Use this dial to adjust the main pitch (affecting *all* turntables).");
        
        dummy=gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
        gtk_box_pack_start(GTK_BOX(right_hbox), dummy, WID_FIX);
        gtk_widget_show(dummy);
        
        /* Volume */
-       master_vol_box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
-       gtk_box_pack_start(GTK_BOX(right_hbox), master_vol_box, WID_DYN);
-       gtk_widget_show(master_vol_box);
+       main_vol_box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
+       gtk_box_pack_start(GTK_BOX(right_hbox), main_vol_box, WID_DYN);
+       gtk_widget_show(main_vol_box);
        
        dumadj=(GtkAdjustment*) gtk_adjustment_new(globals.volume, 0, 2, 0.01, 0.05, 0.000);
        volume_adj=dumadj;
 
-       connect_adj(dumadj, master_volume_changed, NULL);
+       connect_adj(dumadj, main_volume_changed, NULL);
        dummy=gtk_scale_new(GTK_ORIENTATION_VERTICAL, dumadj);
        gtk_range_set_inverted(GTK_RANGE(dummy), TRUE);
        gtk_scale_set_draw_value(GTK_SCALE(dummy), FALSE);
-       g_signal_connect(G_OBJECT(dummy), "button_press_event", (GCallback) tX_seqpar::tX_seqpar_press, &sp_master_volume);     
+       g_signal_connect(G_OBJECT(dummy), "button_press_event", (GCallback) tX_seqpar::tX_seqpar_press, &sp_main_volume);       
        
-       gtk_box_pack_end(GTK_BOX(master_vol_box), dummy, WID_FIX);
+       gtk_box_pack_end(GTK_BOX(main_vol_box), dummy, WID_FIX);
        gtk_widget_show(dummy); 
-       gui_set_tooltip(dummy, "Adjust the master volume. This parameter will effect *all* turntables in the set.");
+       gui_set_tooltip(dummy, "Adjust the main volume. This parameter will effect *all* turntables in the set.");
        
        main_flash=gtk_tx_flash_new();
-       gtk_box_pack_end(GTK_BOX(master_vol_box), main_flash, WID_DYN);
+       gtk_box_pack_end(GTK_BOX(main_vol_box), main_flash, WID_DYN);
        gtk_widget_show(main_flash);
 
        dummy=gtk_label_new("Volume");
index ff02ec6646e463a290eb4977a504b1161cf72795..ba1ab968e63333be921a9086adf6cf8a78016bb9 100644 (file)
@@ -38,8 +38,8 @@ extern GtkAdjustment *volume_adj;
 extern GtkAdjustment *pitch_adj;
 extern GtkWidget *main_flash;
 
-extern tX_seqpar_master_volume sp_master_volume;
-extern tX_seqpar_master_pitch sp_master_pitch;
+extern tX_seqpar_main_volume sp_main_volume;
+extern tX_seqpar_main_pitch sp_main_pitch;
 
 extern void create_maingui(int x, int y);
 extern void wav_progress_update(gfloat percent);
index bb164971cd2375260eee47984d60108c1b8124fe..164ebf38a55c1c3d8f3fd686da6b9f4695365b5d 100644 (file)
@@ -585,8 +585,8 @@ void tX_midiin::auto_assign_midi_mappings(GtkWidget *widget, gpointer dummy)
        } */
        
        /* Works on my hardware :) */
-       cc_map(&sp_master_volume, 0, 28);
-       cc_map(&sp_master_volume, 0, 29);       
+       cc_map(&sp_main_volume, 0, 28);
+       cc_map(&sp_main_volume, 0, 29); 
        
        for (vtt=vtt_class::main_list.begin(); (vtt!=vtt_class::main_list.end()) && (ctr<16); vtt++, ctr++) {
                /* These are pretty standard... */
index c392e0cfc16c4b78e30b46ed2d38276690774bcf..42e7ea1ac6e21a66146ebe07a44ca77a224cad95 100644 (file)
@@ -249,7 +249,7 @@ void tX_seqpar :: materialize_forward_values()
 const char * tX_seqpar :: get_vtt_name()
 {
         if (vtt) return tt->name;
-        else return "Master Track";
+        else return "Main Track";
 }
 
 void tX_seqpar :: restore_meta(xmlNodePtr node) {
@@ -436,46 +436,46 @@ void tX_seqpar_update_active_forward :: receive_forward_value(const float value)
 
 /**** Sequencable Parameter: MASTER VOLUME ****/
 
-tX_seqpar_master_volume :: tX_seqpar_master_volume() 
+tX_seqpar_main_volume :: tX_seqpar_main_volume() 
 {
        set_mapping_parameters(2.5, 0, 0.1, 0);
 }
 
-void tX_seqpar_master_volume :: do_exec(const float value)
+void tX_seqpar_main_volume :: do_exec(const float value)
 {
-       vtt_class :: set_master_volume(value);
+       vtt_class :: set_main_volume(value);
 }
 
-void tX_seqpar_master_volume :: do_update_graphics ()
+void tX_seqpar_main_volume :: do_update_graphics ()
 {
-       gtk_adjustment_set_value(volume_adj, vtt_class::master_volume);
+       gtk_adjustment_set_value(volume_adj, vtt_class::main_volume);
 }
 
-const char * tX_seqpar_master_volume :: get_name()
+const char * tX_seqpar_main_volume :: get_name()
 {
-        return "Master Volume";
+        return "Main Volume";
 }
 
 /**** Sequencable Parameter: MASTER PITCH ****/
 
-tX_seqpar_master_pitch :: tX_seqpar_master_pitch()
+tX_seqpar_main_pitch :: tX_seqpar_main_pitch()
 {
        set_mapping_parameters(3.0, -3.0, 0.1, 0);
 }
 
-void tX_seqpar_master_pitch :: do_exec(const float value)
+void tX_seqpar_main_pitch :: do_exec(const float value)
 {
-       vtt_class :: set_master_pitch(value);
+       vtt_class :: set_main_pitch(value);
 }
 
-void tX_seqpar_master_pitch :: do_update_graphics ()
+void tX_seqpar_main_pitch :: do_update_graphics ()
 {
        gtk_adjustment_set_value(pitch_adj, globals.pitch);
 }
 
-const char * tX_seqpar_master_pitch :: get_name()
+const char * tX_seqpar_main_pitch :: get_name()
 {
-        return "Master Pitch";
+        return "Main Pitch";
 }
 
 /**** Sequencable Parameter: TURNTABLE SPEED ****/
index e13916f1efe26c10de75dd0d4f200fce5ccb518d..d014deece8f3667c5537c0378895b91e4b32b670 100644 (file)
@@ -191,20 +191,20 @@ class tX_seqpar_no_update_active_forward : public tX_seqpar_no_update
 
 /* now the classes for *real* sequenceable parameters */
 
-class tX_seqpar_master_volume : public tX_seqpar_update
+class tX_seqpar_main_volume : public tX_seqpar_update
 {
        public:
-       tX_seqpar_master_volume();
+       tX_seqpar_main_volume();
        virtual void do_exec(const float value);
        virtual void do_update_graphics();      
        private:
        virtual const char *get_name(); 
 };
 
-class tX_seqpar_master_pitch : public tX_seqpar_update_active_forward
+class tX_seqpar_main_pitch : public tX_seqpar_update_active_forward
 {
        public:
-       tX_seqpar_master_pitch();
+       tX_seqpar_main_pitch();
        virtual void do_exec(const float value);
        virtual void do_update_graphics();      
        private:
index 9bdb942c21b43eeb30fcb213975595c154693f35..a37a20a72cd23941ff3ceabc958b00579d951606 100644 (file)
@@ -75,8 +75,8 @@ int vtt_class::solo_ctr=0;
 
 unsigned int vtt_class::samples_in_mix_buffer=0;
 pthread_mutex_t vtt_class::render_lock=PTHREAD_MUTEX_INITIALIZER;
-f_prec vtt_class::master_volume=1.0;
-f_prec vtt_class::res_master_volume=1.0;
+f_prec vtt_class::main_volume=1.0;
+f_prec vtt_class::res_main_volume=1.0;
 
 vtt_class * vtt_class::sync_master=NULL;
 int vtt_class::master_triggered=0;
@@ -196,7 +196,7 @@ vtt_class :: vtt_class (int do_create_gui)
        else have_gui=0;
                
        set_pan(0);     
-       set_master_volume(globals.volume);
+       set_main_volume(globals.volume);
        set_output_buffer_size(samples_in_mix_buffer/2);
        
        audiofile = NULL;
@@ -326,7 +326,7 @@ void vtt_class :: set_volume(f_prec newvol)
 
 void vtt_class :: recalc_volume()
 {
-       res_volume=rel_volume*res_master_volume;
+       res_volume=rel_volume*res_main_volume;
        f_prec ec_res_volume=res_volume*ec_volume;
        
        if (pan>0.0) {
@@ -1104,16 +1104,16 @@ void vtt_class :: set_sync_client_ug(int slave, int cycles)
        set_sync_client(slave, cycles);
 }
 
-void vtt_class :: set_master_volume(f_prec new_volume)
+void vtt_class :: set_main_volume(f_prec new_volume)
 {
        list <vtt_class *> :: iterator vtt;
 
-       master_volume=new_volume;
+       main_volume=new_volume;
        globals.volume=new_volume;
        
        if (main_list.size()>0) {
                vol_channel_adjust=sqrt((f_prec) main_list.size());
-               res_master_volume=master_volume/vol_channel_adjust;             
+               res_main_volume=main_volume/vol_channel_adjust;         
        }
                
        for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++) {
@@ -1121,7 +1121,7 @@ void vtt_class :: set_master_volume(f_prec new_volume)
        }
 }
 
-void vtt_class :: set_master_pitch(f_prec new_pitch)
+void vtt_class :: set_main_pitch(f_prec new_pitch)
 {
        list <vtt_class *> :: iterator vtt;
        
@@ -1328,8 +1328,8 @@ int  vtt_class :: save_all(FILE* rc, gzFile rz) {
        
        strcpy(indent, "\t");
 
-       store_float_sp("master_volume", master_volume, sp_master_volume);
-       store_float_sp("master_pitch", globals.pitch, sp_master_pitch);
+       store_float_sp("main_volume", main_volume, sp_main_volume);
+       store_float_sp("main_pitch", globals.pitch, sp_main_pitch);
 
        for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++) {
                res+=(*vtt)->save(rc, rz, indent);
@@ -1501,22 +1501,22 @@ void vtt_class :: delete_all()
                delete((*main_list.begin()));
        }
        
-       /* Take care of the master events.. */
+       /* Take care of the main channel events.. */
        sequencer.delete_all_events(tX_sequencer::DELETE_ALL);
        
-       /* Now reset master settings ot the default: */
-       set_master_pitch(1.0);
-       set_master_volume(1.0);
+       /* Now reset main settings ot the default: */
+       set_main_pitch(1.0);
+       set_main_volume(1.0);
        
-       sp_master_pitch.do_exec(1.0);
-       sp_master_pitch.do_update_graphics();
+       sp_main_pitch.do_exec(1.0);
+       sp_main_pitch.do_update_graphics();
 
-       sp_master_volume.do_exec(1.0);
-       sp_master_volume.do_update_graphics();
+       sp_main_volume.do_exec(1.0);
+       sp_main_volume.do_update_graphics();
        
-       /* Remove master MIDI mappings... */
-       sp_master_pitch.bound_midi_event.type=tX_midievent::NONE;
-       sp_master_volume.bound_midi_event.type=tX_midievent::NONE;
+       /* Remove main channel MIDI mappings... */
+       sp_main_pitch.bound_midi_event.type=tX_midievent::NONE;
+       sp_main_volume.bound_midi_event.type=tX_midievent::NONE;
        
        seq_update();
 }
@@ -1572,8 +1572,12 @@ int vtt_class :: load_all(xmlDocPtr doc, char *fname) {
                if (cur->type == XML_ELEMENT_NODE) {                    
                        elementFound=0;
                
-                       restore_float_id("master_volume", master_volume, sp_master_volume, set_master_volume(master_volume));
-                       restore_float_id("master_pitch", globals.pitch, sp_master_pitch, set_master_pitch(globals.pitch));
+                       /* compatibilty for pre 4.1 set files */
+                       restore_float_id("master_volume", main_volume, sp_main_volume, set_main_volume(main_volume));
+                       restore_float_id("master_pitch", globals.pitch, sp_main_pitch, set_main_pitch(globals.pitch));
+                       /* 4.1+ uses main instead */
+                       restore_float_id("main_volume", main_volume, sp_main_volume, set_main_volume(main_volume));
+                       restore_float_id("main_pitch", globals.pitch, sp_main_pitch, set_main_pitch(globals.pitch));
                        
                        if ((!elementFound) && (xmlStrcmp(cur->name, (xmlChar *) "turntable")==0)) {
                                elementFound=1;
@@ -1603,8 +1607,8 @@ int vtt_class :: load_all(xmlDocPtr doc, char *fname) {
                }
        }
        
-       sp_master_volume.do_update_graphics();
-       sp_master_pitch.do_update_graphics();
+       sp_main_volume.do_update_graphics();
+       sp_main_pitch.do_update_graphics();
 
        while (gtk_events_pending()) gtk_main_iteration();
 
@@ -1785,7 +1789,7 @@ void vtt_class :: set_sample_rate(int samplerate) {
        set_mix_buffer_size(no_samples);        
 }
 
-void vtt_class :: adjust_to_master_pitch(int master_cycles, int cycles, bool create_event) {
+void vtt_class :: adjust_to_main_pitch(int master_cycles, int cycles, bool create_event) {
        if (!sync_master) return;
        if (this==sync_master) return;
        if (!sync_master->audiofile) return;
index 5b6a9254f320908a6caf6f7f1d8ab253c928631e..8e9b5af78cb2bb053e8f5b0fa7613a462500e21f 100644 (file)
@@ -66,8 +66,8 @@ class vtt_class
        static unsigned int samples_in_mix_buffer;
        static pthread_mutex_t render_lock;
        
-       static f_prec master_volume;
-       static f_prec res_master_volume;
+       static f_prec main_volume;
+       static f_prec res_main_volume;
        static f_prec vol_channel_adjust;
 
        static vtt_class * sync_master;
@@ -231,7 +231,7 @@ class vtt_class
        void recalc_volume();
        
        void set_pan(f_prec);
-       void adjust_to_master_pitch(int master_cycles, int cycles, bool create_event);
+       void adjust_to_main_pitch(int master_cycles, int cycles, bool create_event);
        void set_pitch(f_prec);
        void recalc_pitch();
        
@@ -275,8 +275,8 @@ class vtt_class
        static void forward_all_turntables();
        
        static int set_mix_buffer_size(int);
-       static void set_master_volume(f_prec);
-       static void set_master_pitch(f_prec);
+       static void set_main_volume(f_prec);
+       static void set_main_pitch(f_prec);
        static void focus_no(int);
        static void focus_next();
        static void unfocus();
index 4aabf516a193ca3cf09154d8fe4a1e34b86b3b8b..3e2df9f8c3a6d872057e3f78ef940e6e5cb13d3a 100644 (file)
@@ -479,7 +479,7 @@ void vg_do_pitch_adjust (GtkWidget *wid, vtt_class *vtt) {
        int cycles=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(lookup_widget(vtt->gui.adjust_dialog, "cycles")));
        bool create_event=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(vtt->gui.adjust_dialog, "create_event")));
 
-       vtt->adjust_to_master_pitch(master_cycles, cycles, create_event);
+       vtt->adjust_to_main_pitch(master_cycles, cycles, create_event);
        
        gtk_widget_destroy(vtt->gui.adjust_dialog);
 }