3DNow, gcc fix, many cleanups (code and docs) - Alex
authorterminatorX <>
Fri, 30 Nov 2001 23:11:37 +0000 (23:11 +0000)
committerterminatorX <>
Fri, 30 Nov 2001 23:11:37 +0000 (23:11 +0000)
13 files changed:
terminatorX/AUTHORS
terminatorX/ChangeLog
terminatorX/INSTALL
terminatorX/README
terminatorX/configure.in
terminatorX/src/main.cc
terminatorX/src/tX_dialog.cc
terminatorX/src/tX_mastergui.cc
terminatorX/src/tX_seqpar.h
terminatorX/src/tX_vtt.cc
terminatorX/src/tX_vtt.h
terminatorX/src/tX_vttgui.cc
terminatorX/src/tX_vttgui.h

index 2ba48f599252cc40552d4359375fa858f8e19187..fd240b19b009af8eb1e9e28fe905c9632db58a1f 100644 (file)
@@ -1,6 +1,6 @@
 terminatorX AUTHORS:
 
-Author:                        Alexander König <alkoit00@fht-esslingen.de>
+Author:                        Alexander König <alex@lisas.de>
 
 Contributors:
 licmak.awk:            Christian <eleet@altern.org>
@@ -8,7 +8,8 @@ tX_wavfunc.c-patch:     "Andrew C. Bul+hac?k" <acb@zikzak.net>
 MK II icon:            Michael Kahl <m.kahl@student.hu-berlin.de>
 new startup switches:  Josh Steiner <joschi@eds.org>
 misc fixes and enhancements:
-                       Adrian Reber <adrian@42.fht-esslingen.de
+                       Adrian Reber <adrian@lisas.de>
+Ogg Vorbis support:    Matthew Evans <activesx@hotmail.com>
                        
 Authors of files not written for tX but included in this distribution:
 mmx.h README.MMX:      Hank Dietz <hankd@ecn.purdue.ed> and
index 243aab7e8caa6f374f894158dd89ad22a819dbc4..3fba468b303f8fe519fb2f9ac24180fa95a60983 100644 (file)
@@ -4,15 +4,25 @@ This is not a GNU-style ChangeLog but you sort of get the idea what was
 changed.
 
 [v3.72]
+- Well, I am allowed to change my mind, aren't I? Anyway, 3DNow! enhanced
+  mixing is back. I virtually "ported" the old code to the new stereo
+  algorithm. Ensure you run configure with the --enable-3dnow switch
+  if your CPU supports 3DNow - it accelerates mixing quite a lot.
 - Applied a patch from Matthew Evans <activesx@hotmail.com> that introduces 
   support for Ogg Vorbis audiofiles. It requires ogg123 and sox to work.
   Autodetection is supported via configure (--enable-ogg123).
 - Experimental support for input devices other than the core-pointer
   under XFree86 > 4. This uses the xsetpointer executable that comes with
-  XFree86. configure should autodetect this correct, in case it doesn't
-  use --enable-xetpointer switch.
-- Adrian sent me a patch introducing two new buttons: mute and solo. It's
-  not yet finished though.
+  XFree86. configure should autodetect this correctly, in case it doesn't
+  use the --enable-xetpointer switch.
+- Adrian sent me a patch introducing two new buttons: mute and solo. As it
+  didn't fully harmonize with the sequencer I rewrote parts of it and added new
+  functionality to the turntables: They can now be switched to mix_solo or
+  mix_mute - these settings affect current mixing only - their values will
+  neither be saved nor will changes to those control be recorded in the
+  sequencer - if you want to record muting events either use the mute button
+  from the turntable's trigger menu, the keyboard short-cuts (alt/strg), or
+  your middle mouse button.
 - fixed a bug that produced corrupt wavfiles on big endian machines
 
 [v3.71]
index befc348e6daae26ef497a856dcbd3c0311d7614b..04edf5f5a69a48294f47d18c9a9041ac934f6496 100644 (file)
@@ -1,5 +1,5 @@
 terminatorX INSTALL:
-Copyright (C) 1999, 2000 by Alexander König <alkoit00@fht-esslingen.de>
+Copyright (C) 1999, 2000, 2001 by Alexander König <alex@lisas.de>
 
 Note: As of Version 3.70 you need to have LADSPA installed to compile
 terminatorX.
@@ -24,8 +24,8 @@ Step 1: Configure terminatorX.
        if use bash: > export CFLAGS="-O2"
        with tcsh:   > setenv CFLAGS "-O2"
 
-       I use CFLAGS="-O6 -mpentiumpro" btw. You'll need to have a
-       "pentium-aware" compiler to use that though (gcc/pgcc).
+       I use CFLAGS="-O3 -mathlon" btw. You'll need to have a
+       "athlon-aware" compiler to use that though (gcc > 2.95.?).
 
        All of the following configure options can be either enabled with
        --enable-option or disabled with --disable-option.
@@ -87,12 +87,23 @@ Step 1: Configure terminatorX.
                files keep this option enabled. You have to have mpg123
                installed of course.
                
+               --enable-ogg123
+               
+               With this option you can turn on/off support for Ogg Vorbis
+               soundfiles. This requires ogg123 (Version >= 1.0RC2) and
+               sox to be installed. 
+               
                Misc options:
                -------------
 
-               --enable-closedev
+               --enable-3dnow
                
-               This has no effect at the moment. Sorry. Don't disable it.
+               This will cause the binary to include 3DNow! accelerated 
+               mixing routines. The rule's simple: if your CPU does support
+               3DNow! then turn it on (it enhances performance quite a bit)
+               - if your machine doesn't, well then keep it disabled. A binary
+               created with 3DNow! acceleration will *not* run on machines
+               without 3DNow!.
                
                --enable-debug
                
@@ -100,7 +111,7 @@ Step 1: Configure terminatorX.
                your console. 
                
                Just as an example my configure line is (works with bash only):
-               > CFLAGS="-O2 -mpentiumpro" ./configure 
+               > CFLAGS="-O3 -mathlon" ./configure 
 
 Step 2: Build the binary.
 -------------------------
index 626bbca75b75d4e80bcd25a87142f9805f10ee67..f9d03c0413131ff359c6a8b685c43e6c4929a91d 100644 (file)
@@ -2,7 +2,7 @@ terminatorX V3.71 README
 ------------------------
 
 Copyright (C) 1999, 2000 Alexander König
-eMail: alkoit00@fht-esslingen.de
+eMail: alex@lisas.de
 Homepage: http://www.terminatorX.cx
 
 This is free software see the COPYING file that came with this
index 5a70d1189766cf9382b065786f86033659dfce89..e4a0cc6115be4d65995384c9514dd29ed1dbe8b7 100644 (file)
@@ -11,7 +11,7 @@ dnl AC_ARG_ENABLE(wavonly,  [  --enable-wavonly        enable the builtin wav ro
 AC_ARG_ENABLE(scheduler,[  --enable-scheduler      enable rt-scheduling (req. root-priv). [default=yes] ])
 AC_ARG_ENABLE(debug,    [  --enable-debug          enable debug output. [default=no] ])
 dnl AC_ARG_ENABLE(flash,    [  --enable-flash          enable flashes. [default=yes] ])
-dnl AC_ARG_ENABLE(3dnow,    [  --enable-3dnow          enables 3DNow! support. [default=no] ])
+AC_ARG_ENABLE(3dnow,    [  --enable-3dnow          enables 3DNow! support. [default=no] ])
 dnl AC_ARG_ENABLE(benchmark,[  --enable-benchmark      creates a non-functional test version [default=no] ])
 AC_ARG_ENABLE(wav,          [  --enable-wav            enables the builtin wav-loader [default=yes] ])
 AC_ARG_ENABLE(xsetpointer,  [  --enable-xsetpointer    enables executing of xsetpointer [default=auto] ])
@@ -146,8 +146,7 @@ if test "$enable_flash" = "no"; then
 fi 
 
 if test "$enable_3dnow" = "yes"; then
-       AC_MSG_ERROR([** 3DNOW Support is gone. **])
-dnl    AC_DEFINE(USE_3DNOW)
+       AC_DEFINE(USE_3DNOW)
 fi 
 
 if test "$enable_scheduler" != "no"; then
index 79cc278f5096205bc074cb960dea29fe9249da69..f563251b894ef8834c997b79198b20bb57a0a276 100644 (file)
 
 GTimer *my_time;
 gint idle_tag;
-/* main(): */
+
+#ifdef USE_3DNOW
+/*     Function to test if multimedia instructions are supported...
+*/
+inline int
+tx_mm_support(void)
+{
+       /* Returns 1 if MMX instructions are supported,
+          3 if Cyrix MMX and Extended MMX instructions are supported
+          5 if AMD MMX and 3DNow! instructions are supported
+          0 if hardware does not support any of these
+       */
+       register int rval = 0;
+
+       __asm__ __volatile__ (
+               /* See if CPUID instruction is supported ... */
+               /* ... Get copies of EFLAGS into eax and ecx */
+               "pushf\n\t"
+               "popl %%eax\n\t"
+               "movl %%eax, %%ecx\n\t"
+
+               /* ... Toggle the ID bit in one copy and store */
+               /*     to the EFLAGS reg */
+               "xorl $0x200000, %%eax\n\t"
+               "push %%eax\n\t"
+               "popf\n\t"
+
+               /* ... Get the (hopefully modified) EFLAGS */
+               "pushf\n\t"
+               "popl %%eax\n\t"
+
+               /* ... Compare and test result */
+               "xorl %%eax, %%ecx\n\t"
+               "testl $0x200000, %%ecx\n\t"
+               "jz NotSupported1\n\t"          /* CPUID not supported */
+
+
+               /* Get standard CPUID information, and
+                      go to a specific vendor section */
+               "movl $0, %%eax\n\t"
+               "cpuid\n\t"
+
+               /* Check for Intel */
+               "cmpl $0x756e6547, %%ebx\n\t"
+               "jne TryAMD\n\t"
+               "cmpl $0x49656e69, %%edx\n\t"
+               "jne TryAMD\n\t"
+               "cmpl $0x6c65746e, %%ecx\n"
+               "jne TryAMD\n\t"
+               "jmp Intel\n\t"
+
+               /* Check for AMD */
+               "\nTryAMD:\n\t"
+               "cmpl $0x68747541, %%ebx\n\t"
+               "jne TryCyrix\n\t"
+               "cmpl $0x69746e65, %%edx\n\t"
+               "jne TryCyrix\n\t"
+               "cmpl $0x444d4163, %%ecx\n"
+               "jne TryCyrix\n\t"
+               "jmp AMD\n\t"
+
+               /* Check for Cyrix */
+               "\nTryCyrix:\n\t"
+               "cmpl $0x69727943, %%ebx\n\t"
+               "jne NotSupported2\n\t"
+               "cmpl $0x736e4978, %%edx\n\t"
+               "jne NotSupported3\n\t"
+               "cmpl $0x64616574, %%ecx\n\t"
+               "jne NotSupported4\n\t"
+               /* Drop through to Cyrix... */
+
+
+               /* Cyrix Section */
+               /* See if extended CPUID level 80000001 is supported */
+               /* The value of CPUID/80000001 for the 6x86MX is undefined
+                  according to the Cyrix CPU Detection Guide (Preliminary
+                  Rev. 1.01 table 1), so we'll check the value of eax for
+                  CPUID/0 to see if standard CPUID level 2 is supported.
+                  According to the table, the only CPU which supports level
+                  2 is also the only one which supports extended CPUID levels.
+               */
+               "cmpl $0x2, %%eax\n\t"
+               "jne MMXtest\n\t"       /* Use standard CPUID instead */
+
+               /* Extended CPUID supported (in theory), so get extended
+                  features */
+               "movl $0x80000001, %%eax\n\t"
+               "cpuid\n\t"
+               "testl $0x00800000, %%eax\n\t"  /* Test for MMX */
+               "jz NotSupported5\n\t"          /* MMX not supported */
+               "testl $0x01000000, %%eax\n\t"  /* Test for Ext'd MMX */
+               "jnz EMMXSupported\n\t"
+               "movl $1, %0\n\n\t"             /* MMX Supported */
+               "jmp Return\n\n"
+               "EMMXSupported:\n\t"
+               "movl $3, %0\n\n\t"             /* EMMX and MMX Supported */
+               "jmp Return\n\t"
+
+
+               /* AMD Section */
+               "AMD:\n\t"
+
+               /* See if extended CPUID is supported */
+               "movl $0x80000000, %%eax\n\t"
+               "cpuid\n\t"
+               "cmpl $0x80000000, %%eax\n\t"
+               "jl MMXtest\n\t"        /* Use standard CPUID instead */
+
+               /* Extended CPUID supported, so get extended features */
+               "movl $0x80000001, %%eax\n\t"
+               "cpuid\n\t"
+               "testl $0x00800000, %%edx\n\t"  /* Test for MMX */
+               "jz NotSupported6\n\t"          /* MMX not supported */
+               "testl $0x80000000, %%edx\n\t"  /* Test for 3DNow! */
+               "jnz ThreeDNowSupported\n\t"
+               "movl $1, %0\n\n\t"             /* MMX Supported */
+               "jmp Return\n\n"
+               "ThreeDNowSupported:\n\t"
+               "movl $5, %0\n\n\t"             /* 3DNow! and MMX Supported */
+               "jmp Return\n\t"
+
+
+               /* Intel Section */
+               "Intel:\n\t"
+
+               /* Check for MMX */
+               "MMXtest:\n\t"
+               "movl $1, %%eax\n\t"
+               "cpuid\n\t"
+               "testl $0x00800000, %%edx\n\t"  /* Test for MMX */
+               "jz NotSupported7\n\t"          /* MMX Not supported */
+               "movl $1, %0\n\n\t"             /* MMX Supported */
+               "jmp Return\n\t"
+
+               /* Nothing supported */
+               "\nNotSupported1:\n\t"
+               "#movl $101, %0\n\n\t"
+               "\nNotSupported2:\n\t"
+               "#movl $102, %0\n\n\t"
+               "\nNotSupported3:\n\t"
+               "#movl $103, %0\n\n\t"
+               "\nNotSupported4:\n\t"
+               "#movl $104, %0\n\n\t"
+               "\nNotSupported5:\n\t"
+               "#movl $105, %0\n\n\t"
+               "\nNotSupported6:\n\t"
+               "#movl $106, %0\n\n\t"
+               "\nNotSupported7:\n\t"
+               "#movl $107, %0\n\n\t"
+               "movl $0, %0\n\n\t"
+
+               "Return:\n\t"
+               : "=g" (rval)
+               : /* no input */
+               : "eax", "ebx", "ecx", "edx"
+       );
+
+       /* Return */
+       return(rval);
+}
+
+#endif
 
 int idle()
 {
@@ -216,7 +377,7 @@ int main(int argc, char **argv)
        fprintf(stderr, "terminatorX comes with ABSOLUTELY NO WARRANTY - for details read the license.\n");
 
 #ifdef USE_3DNOW
-       if (mm_support()!=5)
+       if (tx_mm_support()!=5)
        {
                printf("3DNow! not detected. Giving up.\n");
                return(1);
index 07cd9f12f4990baa92d464e675cb80b56cf4ba59..7c13ce420757fb24c814461686359617b74787bb 100644 (file)
@@ -584,7 +584,7 @@ void show_about(int nag)
                
                label=gtk_label_new(
                "\nThis is "PACKAGE" Release "VERSION" - Copyright (C) 1999, 2000 by Alexander König" 
-               "\n\nSend comments, patches and scratches to: alkoit00@fht-esslingen.de\n"
+               "\n\nSend comments, patches and scratches to: alex@lisas.de\n"
                "terminatorX-homepage: http://www.terminatorX.cx\n\nThis binary has been compiled with the following flags: "
                "Sox support: "
 #ifdef USE_SOX_INPUT
@@ -598,21 +598,22 @@ void show_about(int nag)
 #else
                "OFF"
 #endif
-               " - \n3DNow!: "
-#ifdef USE_3DNOW
+               " - \nogg123 support: "
+#ifdef USE_OGG123_INPUT
                "ON"
 #else
                "OFF"
 #endif
-               
-               " - enhanced scheduling: "
-#ifdef USE_SCHEDULER
+
+               " - 3DNow!: "
+#ifdef USE_3DNOW
                "ON"
 #else
                "OFF"
 #endif
-               " - keep device open: "
-#ifdef KEEP_DEV_OPEN
+               
+               " - enhanced scheduling: "
+#ifdef USE_SCHEDULER
                "ON"
 #else
                "OFF"
index 07edbe19dd18ceb05ea3a10075bce67d753c08e2..f98f0fc5b8bcbc2197e4980be9ec8f2e07fb5c13 100644 (file)
@@ -552,16 +552,6 @@ GtkSignalFunc audio_on(GtkWidget *w, void *d)
                        return 0;
                }
 
-/*
-#ifdef USE_SCHEDULER
-               if (!(getuid()))
-               {
-                       mg_oldprio=getpriority(PRIO_PROCESS, getpid());
-                       setpriority(PRIO_PROCESS, getpid(), 20);
-//                     printf("Priority of %i set to %i\n", getpid(), getpriority(PRIO_PROCESS, getpid()));            
-               }
-#endif 
-*/
                stop_update=0;
                audioon=1;
                update_delay=globals.update_delay;
@@ -583,15 +573,6 @@ GtkSignalFunc audio_on(GtkWidget *w, void *d)
                        rec_dont_care=0;
                }
                seq_stop(NULL, NULL);
-/*             
-#ifdef USE_SCHEDULER
-               if (!getuid())
-               {
-                       setpriority(PRIO_PROCESS, getpid(), mg_oldprio);
-//                     printf("Priority of %i set to %i\n", getpid(), getpriority(PRIO_PROCESS, getpid()));            
-               }
-#endif                 
-*/
                mg_enable_critical_buttons(1);
        }
 }
@@ -684,12 +665,10 @@ void hide_clicked(GtkWidget *w, void *d)
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
        {
                mg_hide_gui=1;
-               show_all_guis(0);
        }
        else
        {
                mg_hide_gui=0;
-               show_all_guis(1);
        }
 }
 
@@ -705,7 +684,7 @@ void quit()
 }
 
 void mplcfitx()
-/* Most Proabably Least Called Function In Terminator X :) */
+/* Most Probably Least Called Function In Terminator X :) */
 {
        show_about(0);
 }
@@ -887,19 +866,6 @@ void create_mastergui(int x, int y)
        gui_set_tooltip(dummy, "Record the audio the terminatorX' audio engine renders. You will be prompted to enter a name for the target wav-file.");
        gtk_widget_show(dummy);
        
-/*     dummy=gtk_label_new("Volume:");
-       gtk_box_pack_start(GTK_BOX(control_box), dummy, WID_FIX);
-       gtk_widget_show(dummy);
-       
-       dumadj=(GtkAdjustment*) gtk_adjustment_new(globals.volume, 0, 1.5, 0.001, 0.001, 0.01);
-       volume_adj=dumadj;
-       connect_adj(dumadj, master_volume_changed, NULL);       
-       dummy=gtk_hscale_new(dumadj);
-       gtk_scale_set_digits(GTK_SCALE(dummy), 2);
-       gtk_scale_set_value_pos(GTK_SCALE(dummy), GTK_POS_LEFT);
-       gtk_box_pack_start(GTK_BOX(control_box), dummy, WID_DYN);
-       gtk_widget_show(dummy);
-*/
        dummy=gtk_label_new("Pitch:");
        gtk_box_pack_start(GTK_BOX(control_box), dummy, WID_FIX);
        gtk_widget_show(dummy);
@@ -961,7 +927,6 @@ void create_mastergui(int x, int y)
        gui_set_tooltip(dummy, "Select the start position for the sequencer in song-time.");
        gtk_box_pack_start(GTK_BOX(sequencer_box), dummy, WID_DYN);
        gtk_widget_show(dummy);
-
        
        dummy=gtk_hbox_new(FALSE,2);
        gtk_box_pack_start(GTK_BOX(left_hbox), dummy, WID_DYN);
@@ -1026,21 +991,6 @@ void create_mastergui(int x, int y)
        gtk_signal_connect(GTK_OBJECT(dummy), "clicked", GtkSignalFunc(save_tables), NULL);     
 
        add_sep();
-
-       /*
-       dummy=gtk_check_button_new_with_label("Saturate");
-       gtk_box_pack_start(GTK_BOX(right_hbox), dummy, WID_FIX);
-       gtk_widget_show(dummy);
-       connect_button(dummy, saturate_changed, NULL);
-       
-       
-       dummy=gtk_check_button_new_with_label("Hide GUI");
-       gtk_box_pack_start(GTK_BOX(right_hbox), dummy, WID_FIX);
-       gtk_widget_show(dummy);
-       connect_button(dummy, hide_clicked, NULL);
-       
-       add_sep();
-       */
        
        dummy=gtk_button_new_with_label("Options");
        gtk_box_pack_start(GTK_BOX(right_hbox), dummy, WID_FIX);
@@ -1069,20 +1019,10 @@ void create_mastergui(int x, int y)
        smaller_box=gtk_vbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(small_box), smaller_box, WID_FIX);
        gtk_widget_show(smaller_box);
-
-/*     GdkBitmap *mask;
-       GtkStyle *style;
-       GdkPixmap *pmap=NULL;
-       GtkWidget *pwid;
-       
-       style = gtk_widget_get_style( main_window );
-       pmap=gdk_pixmap_create_from_xpm_d(main_window->window, &mask, &style->bg[GTK_STATE_NORMAL], (gchar **) tx_smlog_xpm ;
-       pwid = gtk_pixmap_new( pmap, mask );*/
        
        dummy = tx_pixmap_widget(TX_ICON_LOGO);
        gtk_box_pack_start(GTK_BOX(smaller_box), dummy, WID_FIX);
        gtk_widget_show( dummy );
-       
 
        dummy=gtk_label_new("0");
        used_mem=dummy;
@@ -1161,7 +1101,7 @@ gfloat old_percent=-1;
 
 void wav_progress_update(gfloat percent)
 {
-       percent=floor(percent*10.0)/10.0; //Updateing statusbars with gtk-themes eats up hell of a lot CPU-time
+       percent=floor(percent*10.0)/10.0; //Updating statusbars with gtk-themes eats up hell of a lot CPU-time
                                          // which is why we update every 10% only.
        
        if (wav_progress)
@@ -1211,9 +1151,6 @@ void tx_note(const char *message)
        gtk_widget_grab_default(btn);
        gtk_widget_show(btn);
        gtk_widget_show(mbox);
-
-//     gtk_widget_unrealize(main_window);
-       
 }
 
 
@@ -1244,9 +1181,6 @@ void tx_l_note(const char *message)
        gtk_window_set_default_size(win, 200, 100);
        gtk_window_set_position(win, GTK_WIN_POS_CENTER_ALWAYS);        
        gtk_widget_show(mbox);
-
-//     gtk_widget_unrealize(main_window);
-       
 }
 
 void display_mastergui()
index b66035d2a8e5414200f77685f0f96e5d5a5fd702..7657df84d2573ea513f1a74a43eb7a1b2989f1c1 100644 (file)
@@ -32,6 +32,9 @@
 #define NO_MOUSE_MAPPING 0
 #define MOUSE_MAPPING_OK 1
 
+/* required for gcc>=3.0 */
+using namespace std;
+
 class tX_seqpar
 {      
        public:
index 5d93cf1e605d8079685f12bab9dcc524ff589204..cbf884ff7e7b557350e35072d0d917b500e03c19 100644 (file)
@@ -70,7 +70,6 @@ extern void gui_update_display(vtt_class *vtt);
 extern void gui_clear_master_button(vtt_class *vtt);
 extern void cleanup_vtt(vtt_class *vtt);
 extern int vg_get_current_page(vtt_class *vtt);
-extern void vg_set_current_page(vtt_class *vtt, int page);
 
 int vtt_class::vtt_amount=0;
 list <vtt_class *> vtt_class::main_list;
@@ -78,13 +77,12 @@ list <vtt_class *> vtt_class::render_list;
 int16_t* vtt_class::mix_out_buffer=NULL;
 f_prec * vtt_class::mix_buffer=NULL;
 f_prec * vtt_class::mix_buffer_end=NULL;
+int vtt_class::solo_ctr=0;
 
 int vtt_class::samples_in_mix_buffer=0;
 pthread_mutex_t vtt_class::render_lock=PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t vtt_class::main_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::saturate_fac=((f_prec) SAMPLE_MAX-SAMPLE_BORDER)*1.0/FLT_MAX;
 f_prec vtt_class::saturate_fac=0.1;
 int vtt_class::do_saturate=0;
 vtt_class * vtt_class::sync_master=NULL;
@@ -135,10 +133,7 @@ vtt_class :: vtt_class (int do_create_gui)
        ec_set_pan(0);
        ec_set_volume(1);
        
-//     pthread_mutex_lock(&main_lock);
        main_list.push_back(this);
-//     pthread_mutex_unlock(&main_lock);
-
 
        /* "connecting" the seq-parameters */
        
@@ -185,16 +180,19 @@ vtt_class :: vtt_class (int do_create_gui)
        set_master_volume(globals.volume);
        set_output_buffer_size(samples_in_mix_buffer/2);
        
-       audiofile = NULL;       
+       audiofile = NULL;
+       mix_solo=0;
+       mix_mute=0;
+       res_mute=mute;
+       res_mute_old=0;
 }
 
 vtt_class :: ~vtt_class()
 {
        vtt_fx *effect;
        stop();
-//     pthread_mutex_lock(&main_lock);
+
        main_list.remove(this);
-//     pthread_mutex_unlock(&main_lock);
        if (audiofile) delete audiofile;
        //if (buffer) free(buffer);
        if (output_buffer) tX_freemem(output_buffer, "output_buffer", "vtt Destructor");
@@ -260,8 +258,8 @@ int vtt_class :: set_output_buffer_size(int newsize)
        tX_malloc(ec_output_buffer, "ec_output_buffer", "vtt set_output_buffer_size()", sizeof(float)*newsize, (float *));
 
        if (output_buffer) tX_freemem(output_buffer, "output_buffer", "vtt set_output_buffer_size()");
-       //output_buffer = (float *) malloc (sizeof(float)*newsize);
        tX_malloc(output_buffer, "output_buffer", "vtt set_output_buffer_size()", sizeof(float)*newsize, (float *));
+
        end_of_outputbuffer = output_buffer + newsize; //size_t(sizeof(float)*(newsize));
        
        samples_in_outputbuffer=newsize;
@@ -302,7 +300,6 @@ void vtt_class :: recalc_volume()
                res_volume_left=res_volume_right=res_volume;
        }
        
-       
        if (ec_pan>0.0)
        {
                ec_volume_left=(1.0-ec_pan)*ec_res_volume;
@@ -363,9 +360,35 @@ void vtt_class :: set_controls (int x, int y)
        y_control=y;
 }
 
+#define calc_mute() res_mute=((mute) || (mix_mute && (!mix_solo)) || ((solo_ctr>0)&&(!mix_solo)))
+
 void vtt_class :: set_mute(int newstate)
 {
        mute=newstate;
+       calc_mute();
+}
+
+void vtt_class :: set_mix_mute(int newstate)
+{
+       mix_mute=newstate;
+       calc_mute();
+}
+
+void vtt_class :: set_mix_solo(int newstate)
+{
+       if (mix_solo && !newstate)
+       {
+               /* turning it off */
+               mix_solo=0;
+               solo_ctr--;
+       }
+       else if (!mix_solo && newstate)
+       {
+               /* turning it on */
+               mix_solo=1;
+               solo_ctr++;
+       }
+       calc_mute();
 }
 
 void vtt_class :: lp_set_enable (int newstate)
@@ -400,8 +423,6 @@ void vtt_class :: lp_set_freq(f_prec freq)
        
        lp_a=0.9999-freq;
        lp_b=lp_reso*(1.0+(1.0/lp_a));
-       
-       //printf("a %f, b%f\n", lp_a, lp_b);
 }
 
 void vtt_class :: lp_setup(f_prec gain, f_prec reso, f_prec freq)
@@ -556,9 +577,9 @@ void vtt_class :: calc_speed()
 
        speed_last = speed_real;
 
-       if (mute != mute_old)
+       if (res_mute != res_mute_old)
        {
-               if (mute)
+               if (res_mute)
                {
                        fade_out=1; fade_in=0;
                        fade=NEED_FADE_IN;
@@ -568,11 +589,11 @@ void vtt_class :: calc_speed()
                        fade_in=1; fade_out=0;
                        fade=NEED_FADE_OUT;
                }
-               mute_old=mute;
+               res_mute_old=res_mute;
        }
        else
        {
-               if (mute) do_mute=1;
+               if (res_mute) do_mute=1;
        }       
 }
 
@@ -823,16 +844,16 @@ int vtt_class :: set_mix_buffer_size(int no_samples)
        
        if (mix_buffer) tX_freemem(mix_buffer, "mix_buffer", "vtt set_mix_buffer_size()");
        samples_in_mix_buffer=no_samples*2;
-       //mix_buffer=(float *) malloc (sizeof(float)*samples_in_mix_buffer);
+
        tX_malloc(mix_buffer, "mix_buffer", "vtt set_mix_buffer_size()", sizeof(float)*samples_in_mix_buffer, (float *));
        mix_buffer_end=mix_buffer+samples_in_mix_buffer;
+
 //     printf("mix_buffer: %12x\n", mix_buffer);
-       
 //     printf("mix_samples: %i, out_samples: %i", samples_in_mix_buffer, no_samples);
        
        if (mix_out_buffer) tX_freemem(mix_out_buffer, "mix_out_buffer", "vtt set_mix_buffer_size()");
-       //mix_out_buffer=(int16_t *) malloc (sizeof(int16_t)*samples_in_mix_buffer + 4); /* extra 4 for 3DNow! */
        tX_malloc(mix_out_buffer, "mix_out_buffer", "vtt set_mix_buffer_size()", sizeof(int16_t)*samples_in_mix_buffer + 4, (int16_t *));
+
 //     printf("mix_out_buffer: %12x\n", mix_out_buffer);
        
        for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++)
@@ -860,9 +881,47 @@ int16_t * vtt_class :: render_all_turntables()
 #ifdef USE_FLASH
        f_prec max;
        f_prec min;
-#ifdef USE_3DNOW       
+#ifdef USE_3DNOW
        mmx_t mm_max;
        mmx_t mm_min;
+       mmx_t mm_volume;
+       mmx_t mm_src1;
+       mmx_t mm_src2;
+
+#ifndef OVERRIDE_MOVQ_AUTODETECT
+#ifndef GCC_VERSION
+#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+#endif /* GCC_VERSION */
+
+#if (GCC_VERSION < 2096)
+#warning "*************************"
+#warning "* gcc < 2.96            *"
+#warning "* assuming working movq *"
+#warning "*************************"
+#undef GCC_MOVQ_BUG_WORKAROUND
+#else
+#warning "*************************"
+#warning "* gcc >= 2.96           *"
+#warning "* using movq-workaround *"
+#warning "*************************"
+#define GCC_MOVQ_BUG_WORKAROUND 1
+#endif /* GCC < 2.96 */
+#endif /* OVERRIDE MOVQ AUTODETECVT */
+       
+#ifdef GCC_MOVQ_BUG_WORKAROUND
+       /* REQUIRED DUE TO GCC BUG (2.96-3.0.2) */
+       mmx_t *mm_src1_ptr=&mm_src1;
+       mmx_t *mm_src2_ptr=&mm_src2;
+       mmx_t *mm_volume_ptr=&mm_volume;
+       mmx_t *mm_max_ptr=&mm_max;
+       mmx_t *mm_min_ptr=&mm_min;
+       
+#define MM_VAR_ACC(var) (* var ## _ptr)
+#define MM_VAR_MOVQ(var) * var ## _ptr
+#else
+#define MM_VAR_ACC(var) var
+#define MM_VAR_MOVQ(var) var
+#endif 
        int32_t *temp_int=&mm_max.d[1];
 #endif 
 #endif 
@@ -883,6 +942,7 @@ int16_t * vtt_class :: render_all_turntables()
                        max=(*vtt)->max_value;
                        min=max;
 
+#ifndef USE_3DNOW
                        for (sample=0, mix_sample=0; sample<(*vtt)->samples_in_outputbuffer; sample++)
                        {                               
                                temp=(*vtt)->output_buffer[sample];
@@ -893,13 +953,66 @@ int16_t * vtt_class :: render_all_turntables()
                                
                                if (temp>max) max=temp;
                                else if (temp<min) min=temp;
-                       }               
+                       }
+#else
+                       MM_VAR_ACC(mm_volume).s[0]=(*vtt)->res_volume_left;
+                       MM_VAR_ACC(mm_volume).s[1]=(*vtt)->res_volume_right;
+
+                       MM_VAR_ACC(mm_max).s[1]=MM_VAR_ACC(mm_max).s[0]=max;
+                       MM_VAR_ACC(mm_min).s[1]=MM_VAR_ACC(mm_min).s[0]=min;
+                       
+                       movq_m2r(MM_VAR_MOVQ(mm_max), mm1);
+                       movq_m2r(MM_VAR_MOVQ(mm_min), mm2);
+                                                       
+                       movq_m2r(MM_VAR_MOVQ(mm_volume), mm0);
+                       
+                       mix=(mmx_t*)mix_buffer;
+                       
+                       for (f_prec* src=(*vtt)->output_buffer; mix < (mmx_t*) mix_buffer_end;)
+                       {
+                               /* first sample */
+                               MM_VAR_ACC(mm_src1).s[0]=*src;
+                               MM_VAR_ACC(mm_src1).s[1]=*src;
+                                       
+                               /* sample * l/r volume */
+                               movq_m2r(MM_VAR_MOVQ(mm_src1), mm3);
+                               pfmul_r2r(mm0, mm3);
+                               movq_r2m(mm3, *mix);
+                                       
+                               /* next sample */
+                               src++, mix++;
+                               MM_VAR_ACC(mm_src2).s[0]=*src;
+                               MM_VAR_ACC(mm_src2).s[1]=*src;
+                                       
+                               /* sample * l/r volume */
+                               movq_m2r(MM_VAR_MOVQ(mm_src2), mm3);
+                               pfmul_r2r(mm0, mm3);
+                               movq_r2m(mm3, *mix);
+                                       
+                               /* calculating min/max */
+                               MM_VAR_ACC(mm_src1).s[1]=MM_VAR_ACC(mm_src2).s[0];
+                               movq_m2r(mm_src1, mm3);
+                               pfmax_r2r(mm3, mm1);
+                               pfmin_r2r(mm3, mm2);
+                               
+                               src++, mix++;
+                       }
+
+                       movq_r2m(mm1, MM_VAR_MOVQ(mm_max));
+                       movq_r2m(mm2, MM_VAR_MOVQ(mm_min));
+                       
+                       femms();
+                       
+                       if (MM_VAR_ACC(mm_max).s[0]>MM_VAR_ACC(mm_max).s[1]) max=MM_VAR_ACC(mm_max).s[0]; else max=MM_VAR_ACC(mm_max).s[1];
+                       if (MM_VAR_ACC(mm_min).s[0]<MM_VAR_ACC(mm_min).s[0]) min=MM_VAR_ACC(mm_min).s[0]; else min=MM_VAR_ACC(mm_min).s[1];
+#endif                 
                        
                        min*=-1.0;
                        if (min>max) (*vtt)->max_value=min; else (*vtt)->max_value=max;
 
                        if ((*vtt)->ec_enable)
                        {
+#ifndef USE_3DNOW                      
                                for (sample=0, mix_sample=0; sample<(*vtt)->samples_in_outputbuffer; sample++)
                                {                               
                                        temp=(*vtt)->ec_output_buffer[sample];
@@ -908,13 +1021,36 @@ int16_t * vtt_class :: render_all_turntables()
                                        mix_sample++;
                                        mix_buffer[mix_sample]+=temp*(*vtt)->ec_volume_right;
                                        mix_sample++;
-                               }               
+                               }
+#else
+                               MM_VAR_ACC(mm_volume).s[0]=(*vtt)->ec_volume_left;
+                               MM_VAR_ACC(mm_volume).s[1]=(*vtt)->ec_volume_right;
+                                               
+                               movq_m2r(MM_VAR_MOVQ(mm_volume), mm0);
+                               mix =(mmx_t*)mix_buffer;
+
+                               for (f_prec* src=(*vtt)->ec_output_buffer; mix < (mmx_t*) mix_buffer_end; src++, mix++)
+                               {
+                                       /* first sample */
+                                       MM_VAR_ACC(mm_src1).s[0]=*src;
+                                       MM_VAR_ACC(mm_src1).s[1]=*src;
+                               
+                                       /* sample * l/r volume */
+                                       movq_m2r(MM_VAR_MOVQ(mm_src1), mm3);
+                                       pfmul_r2r(mm0, mm3);
+                               
+                                       /* accumulating complete mix */
+                                       movq_m2r(*mix, mm4);
+                                       pfadd_r2r(mm4, mm3);
+                                       movq_r2m(mm3, *mix);
+                               }
+                               femms();
+#endif                         
                        }
                        
                        if (master_triggered)
                        {
                                pthread_mutex_unlock(&render_lock);
-//                             pthread_mutex_lock(&main_lock);
                                for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++)
                                {
                                        if ((*vtt)->is_sync_client)
@@ -930,7 +1066,6 @@ int16_t * vtt_class :: render_all_turntables()
                                                }
                                        }
                                }
-//                             pthread_mutex_unlock(&main_lock);
                                pthread_mutex_lock(&render_lock);
                        }
                        
@@ -941,6 +1076,7 @@ int16_t * vtt_class :: render_all_turntables()
                                max=(*vtt)->max_value;
                                min=max;
 
+#ifndef USE_3DNOW
                                for (sample=0, mix_sample=0; sample<(*vtt)->samples_in_outputbuffer; sample++)
                                {                               
                                        temp=(*vtt)->output_buffer[sample];
@@ -952,12 +1088,72 @@ int16_t * vtt_class :: render_all_turntables()
                                        if (temp>max) max=temp;
                                        else if (temp<min) min=temp;
                                }
+#else
+                               MM_VAR_ACC(mm_volume).s[0]=(*vtt)->res_volume_left;
+                               MM_VAR_ACC(mm_volume).s[1]=(*vtt)->res_volume_right;
+
+                               MM_VAR_ACC(mm_max).s[1]=MM_VAR_ACC(mm_max).s[0]=max;
+                               MM_VAR_ACC(mm_min).s[1]=MM_VAR_ACC(mm_min).s[0]=min;
+                       
+                               movq_m2r(MM_VAR_MOVQ(mm_max), mm1);
+                               movq_m2r(MM_VAR_MOVQ(mm_min), mm2);
+                                                       
+                               movq_m2r(MM_VAR_MOVQ(mm_volume), mm0);
+                               mix=(mmx_t*)mix_buffer;
+
+                               for (f_prec* src=(*vtt)->output_buffer; mix < (mmx_t*) mix_buffer_end;)
+                               {
+                                       /* first sample */
+                                       MM_VAR_ACC(mm_src1).s[0]=*src;
+                                       MM_VAR_ACC(mm_src1).s[1]=*src;
+                                       
+                                       /* sample * l/r volume */
+                                       movq_m2r(MM_VAR_MOVQ(mm_src1), mm3);
+                                       pfmul_r2r(mm0, mm3);
+                                       
+                                       /* accumulating complete mix */
+                                       movq_m2r(*mix, mm4);
+                                       pfadd_r2r(mm4, mm3);
+                                       movq_r2m(mm3, *mix);
+                                       
+                                       /* next sample */
+                                       src++, mix++;
+                                       MM_VAR_ACC(mm_src2).s[0]=*src;
+                                       MM_VAR_ACC(mm_src2).s[1]=*src;
+                                       
+                                       /* sample * l/r volume */
+                                       movq_m2r(MM_VAR_MOVQ(mm_src2), mm3);
+                                       pfmul_r2r(mm0, mm3);
+
+                                       /* accumulating complete mix */
+                                       movq_m2r(*mix, mm4);
+                                       pfadd_r2r(mm4, mm3);
+                                       movq_r2m(mm3, *mix);
+                                       
+                                       /* calculating min/max */
+                                       MM_VAR_ACC(mm_src1).s[1]=MM_VAR_ACC(mm_src2).s[0];
+                                       movq_m2r(MM_VAR_MOVQ(mm_src1), mm3);
+                                       pfmax_r2r(mm3, mm1);
+                                       pfmin_r2r(mm3, mm2);
+                                       
+                                       src++, mix++;
+                               }
+
+                               movq_r2m(mm1, MM_VAR_MOVQ(mm_max));
+                               movq_r2m(mm2, MM_VAR_MOVQ(mm_min));
+                               
+                               femms();
+       
+                               if (MM_VAR_ACC(mm_max).s[0]>MM_VAR_ACC(mm_max).s[1]) max=MM_VAR_ACC(mm_max).s[0]; else max=MM_VAR_ACC(mm_max).s[1];
+                               if (MM_VAR_ACC(mm_min).s[0]<MM_VAR_ACC(mm_min).s[0]) min=MM_VAR_ACC(mm_min).s[0]; else min=MM_VAR_ACC(mm_min).s[1];
+#endif
                                
                                min*=-1.0;
                                if (min>max) (*vtt)->max_value=min; else (*vtt)->max_value=max;
                                
                                if ((*vtt)->ec_enable)
                                {
+#ifndef USE_3DNOW
                                        for (sample=0, mix_sample=0; sample<(*vtt)->samples_in_outputbuffer; sample++)
                                        {                               
                                                temp=(*vtt)->ec_output_buffer[sample];
@@ -966,7 +1162,32 @@ int16_t * vtt_class :: render_all_turntables()
                                                mix_sample++;
                                                mix_buffer[mix_sample]+=temp*(*vtt)->ec_volume_right;
                                                mix_sample++;
-                                       }               
+                                       }
+#else
+                                       MM_VAR_ACC(mm_volume).s[0]=(*vtt)->ec_volume_left;
+                                       MM_VAR_ACC(mm_volume).s[1]=(*vtt)->ec_volume_right;
+                                               
+                                       movq_m2r(MM_VAR_MOVQ(mm_volume), mm0);
+                                       mix =(mmx_t*)mix_buffer;
+
+                                       for (f_prec* src=(*vtt)->ec_output_buffer; mix < (mmx_t*) mix_buffer_end; src++, mix++)
+                                       {
+                                               /* first sample */
+                                               MM_VAR_ACC(mm_src1).s[0]=*src;
+                                               MM_VAR_ACC(mm_src1).s[1]=*src;
+                               
+                                               /* sample * l/r volume */
+                                               movq_m2r(MM_VAR_MOVQ(mm_src1), mm3);
+                                               pfmul_r2r(mm0, mm3);
+                               
+                                               /* accumulating complete mix */
+                                               movq_m2r(*mix, mm4);
+                                               pfadd_r2r(mm4, mm3);
+                                               movq_r2m(mm3, *mix);
+                                       }
+
+                                       femms();
+#endif                                 
                                }
                        }
                        
@@ -1083,8 +1304,6 @@ int vtt_class :: trigger()
        speed=res_pitch;
        speed_real=res_pitch;
        speed_target=res_pitch;
-/*     mute=0;
-       mute_old=0;*/
        want_stop=0;
 
        /* activating plugins */
@@ -1201,10 +1420,8 @@ void vtt_class :: set_master_volume(f_prec new_volume)
        
        if (main_list.size()>0)
        {
-//             res_master_volume=master_volume/((f_prec) main_list.size());
                vol_channel_adjust=sqrt((f_prec) main_list.size());
-               res_master_volume=master_volume/vol_channel_adjust;
-               
+               res_master_volume=master_volume/vol_channel_adjust;             
        }
                
        for (vtt=main_list.begin(); vtt!=main_list.end(); vtt++)
@@ -1352,12 +1569,8 @@ void vtt_class :: xy_input(f_prec x_value, f_prec y_value)
 {
        if (x_par) x_par->handle_mouse_input(x_value*globals.mouse_speed);
        if (y_par) y_par->handle_mouse_input(y_value*globals.mouse_speed);
-       
-/*     handle_input(x_control, x_value);
-       handle_input(y_control, y_value);*/
 }
 
-
 #define store(data); if (fwrite((void *) &data, sizeof(data), 1, output)!=1) res+=1;
 
 int  vtt_class :: save(FILE * output)
@@ -1590,7 +1803,6 @@ int vtt_class :: load_11(FILE * input)
        sp_spin.set_persistence_id(pid);
        
        atload(gui_page);
-       vg_set_current_page(this, gui_page);
        
        return(res);
 }
@@ -2233,5 +2445,3 @@ void vtt_class ::  effect_remove(vtt_fx_ladspa *effect)
        delete effect;
 }
 
-
-
index 5733d32ac900d9dd2ddbd66f6ef3589e3f10b8db..9a3d420e1ddaa8c666ba35926ae8652df8ff7891 100644 (file)
@@ -80,7 +80,6 @@ class vtt_class
        static f_prec mix_max_r;
        static int samples_in_mix_buffer;
        static pthread_mutex_t render_lock;
-       static pthread_mutex_t main_lock;
        
        static f_prec master_volume;
        static f_prec res_master_volume;
@@ -93,6 +92,7 @@ class vtt_class
        static int master_triggered;
        static int master_triggered_at;
        static vtt_class * focused_vtt;
+       static int solo_ctr;
        
        /* the gui */
        vtt_gui gui;
@@ -158,7 +158,11 @@ class vtt_class
        d_prec maxpos;
        
        int mute;
-       int mute_old;
+       int res_mute;
+       int res_mute_old;
+       
+       int mix_mute;
+       int mix_solo;
        int fade;
        
        /* input control vars */
@@ -229,9 +233,6 @@ class vtt_class
        
        /* Parameter setup methods */
        void set_name(char *);
-/*     Obsolete        
-       void set_file_data(char *, int16_t *, int);
-*/     
        int set_output_buffer_size(int);
 
        void set_volume(f_prec);
@@ -314,6 +315,9 @@ class vtt_class
        void effect_up(vtt_fx *effect);
        void effect_down(vtt_fx *effect);
        void effect_remove(vtt_fx_ladspa *effect);
+       
+       void set_mix_mute(int newstate);
+       void set_mix_solo(int newstate);
 };
 
 #endif
index 73faa1c13be44d81b890ee66fcbca0b0b6c88c1b..4bdd401109f69613c266dd665b16396579faebfc 100644 (file)
                 class implemented in tX_vtt.cc. This code is not in tX_vtt.cc
                 for mainly to keep the GUI code divided from the audio-rendering
                 code and as gtk+ callback to C++ method call wrapper.
+                
+    Changes:
+    
+    before 11-26-2001: too many changes.
+    
+    11-26-2001: applied Adrian's solo/mute patch - Alex
+    
+    11-27-2001: modified solo/mute to use the set_mix_mute/solo function
+               of the vtts. The previous approach messed up the sequencer
+               and more. Removed some old unnecessary code, too.
 */    
 
 #include <gdk/gdk.h>
@@ -173,8 +183,6 @@ void load_part(char *newfile, vtt_class *vtt)
        else
        {
                nicer_filename(global_filename_buffer, newfile);
-//             strcpy(global_filename_buffer, fn);
-               
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
        }       
 }
@@ -235,7 +243,6 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        
        if (vtt->gui.file_dialog)
        {
-               //puts("praise");
                gdk_window_raise(vtt->gui.file_dialog);
                return(0);
        }
@@ -262,7 +269,6 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "select_row", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);
 }
 
-
 void delete_vtt(GtkWidget *wid, vtt_class *vtt)
 {
        if (audioon) tx_note("Sorry, you'll have to stop playback first.");
@@ -296,7 +302,6 @@ void reload_vtt_buffer(GtkWidget *wid, vtt_class *vtt)
        
        while (gtk_events_pending()) gtk_main_iteration();
        
-//     puts(vtt->filename);
        if (vtt->samples_in_buffer > 0)
        {
                strcpy(reload_buffer, vtt->filename);
@@ -399,35 +404,28 @@ void client_setup_number(GtkWidget *wid, vtt_class *vtt)
 
 void mute_volume(GtkWidget *widget, vtt_class *vtt)
 {
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
-              vtt->set_mute(1);
-       else
-              vtt->set_mute(0);
-       //vtt->sp_volume.receive_gui_value(0);
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+       {
+               vtt->set_mix_mute(1);
+       }
+       else
+       {
+               vtt->set_mix_mute(0);
+       }
 }
 
 void solo_vtt(GtkWidget *widget, vtt_class *vtt)
 {
-       list <vtt_class *> :: iterator it_vtt;
-
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
-              
-              for (it_vtt=vtt_class::main_list.begin(); it_vtt!=vtt_class::main_list.end(); it_vtt++) {
-                      (*it_vtt)->set_mute(1);
-                      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON((*it_vtt)->gui.mute), TRUE);
-              }
-              
-              vtt->set_mute(0);
-              gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(vtt->gui.mute), FALSE);
-
-       }
-       else {
-              for (it_vtt=vtt_class::main_list.begin(); it_vtt!=vtt_class::main_list.end(); it_vtt++) {
-                      (*it_vtt)->set_mute(0);
-                      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON((*it_vtt)->gui.mute), FALSE);
-              }
-       }
+       list <vtt_class *> :: iterator it_vtt;
 
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) 
+       {
+               vtt->set_mix_solo(1);
+       }
+       else
+       {
+               vtt->set_mix_solo(0);
+       }
 }      
 
 void vg_display_xcontrol(vtt_class *vtt)
@@ -601,7 +599,6 @@ void gui_connect_signals(vtt_class *vtt)
        connect_button(file, load_file);
        
        connect_button(del, delete_vtt);
-//     connect_button(clone, clone_vtt);
        connect_button(trigger, trigger_vtt);
        connect_button(stop, stop_vtt);
        connect_button(autotrigger, autotrigger_toggled);
@@ -609,19 +606,6 @@ void gui_connect_signals(vtt_class *vtt)
        connect_button(sync_master, master_setup);
        connect_button(sync_client, client_setup);
        connect_adj(cycles, client_setup_number);
-/*     
-       connect_button(x_scratch, control_changed);
-       connect_button(x_volume, control_changed);
-       connect_button(x_lp_cutoff, control_changed);
-       connect_button(x_ec_feedback, control_changed);
-       connect_button(x_nothing, control_changed);
-
-       connect_button(y_scratch, control_changed);
-       connect_button(y_volume, control_changed);
-       connect_button(y_lp_cutoff, control_changed);
-       connect_button(y_ec_feedback, control_changed);
-       connect_button(y_nothing, control_changed);
-*/     
        connect_button(fx_button, fx_button_pressed);
        
        connect_button(lp_enable, lp_enabled);
@@ -908,15 +892,17 @@ void build_vtt_gui(vtt_class *vtt)
        tempbox3=gtk_hbox_new(FALSE,2);
        gtk_widget_show(tempbox3);
 
-       g->mute=gtk_check_button_new_with_label("m");
+       g->mute=gtk_check_button_new_with_label("M");
        gtk_box_pack_start(GTK_BOX(tempbox3), g->mute, WID_FIX);
        gtk_signal_connect(GTK_OBJECT(g->mute),"clicked", (GtkSignalFunc) mute_volume, vtt);
        gtk_widget_show(g->mute);
+       gui_set_tooltip(g->mute, "Mute this turntable's mixer output.");
 
-       g->solo=gtk_check_button_new_with_label("s");
+       g->solo=gtk_check_button_new_with_label("S");
        gtk_box_pack_start(GTK_BOX(tempbox3), g->solo, WID_FIX);
        gtk_signal_connect(GTK_OBJECT(g->solo),"clicked", (GtkSignalFunc) solo_vtt, vtt);
        gtk_widget_show(g->solo);
+       gui_set_tooltip(g->mute, "Allow only this and other solo-switched turntabels' signal to be routed to the mixer.");
 
        gtk_box_pack_start(GTK_BOX(tempbox2), tempbox3, WID_FIX);
 
@@ -938,8 +924,6 @@ void build_vtt_gui(vtt_class *vtt)
 
        g->file_dialog=NULL;
 
-//     gtk_notebook_set_page(GTK_NOTEBOOK(vtt->gui.notebook), g->current_gui);
-       
        gui_connect_signals(vtt);
 }
 
@@ -959,7 +943,6 @@ void fx_down(GtkWidget *wid, vtt_fx *effect)
        vtt->effect_down(effect);
 }
 
-
 void fx_kill(GtkWidget *wid, vtt_fx_ladspa *effect)
 {
        vtt_class *vtt;
@@ -1120,20 +1103,6 @@ void delete_gui(vtt_class *vtt)
        gtk_widget_destroy(vtt->gui.audio_box);
 }
 
-/*
-void recreate_gui(vtt_class *vtt, GtkWidget *ctrl, GtkWidget *audio)
-{
-       build_vtt_gui(vtt);
-//     gtk_notebook_set_page(GTK_NOTEBOOK(vtt->gui.notebook), g->current_gui);
-       gtk_box_pack_start(GTK_BOX(daddy), vtt->gui.frame, TRUE, TRUE, 0);
-       gtk_widget_show(vtt->gui.frame);
-}
-
-void delete_gui(vtt_class *vtt)
-{
-       gtk_widget_destroy(vtt->gui.frame);
-}*/
-
 void update_all_vtts()
 {
        list <vtt_class *> :: iterator vtt;
@@ -1186,32 +1155,6 @@ void gui_show_frame(vtt_class *vtt, int show)
        gtk_tx_show_frame(GTK_TX(vtt->gui.display), show);
 }
 
-void show_all_guis(int show)
-{
-       list <vtt_class *> :: iterator vtt;
-/*     
-       for (vtt=vtt_class::main_list.begin(); vtt!=vtt_class::main_list.end(); vtt++)
-       {
-               if (show)
-               {
-                       gtk_widget_show((*vtt)->gui.notebook);
-               }
-               else
-               {
-                       gtk_widget_hide((*vtt)->gui.notebook);          
-               }
-       }
-       */
-}
-/*
-void vg_update_sync(void *p)
-{
-       vtt_class *vtt=(vtt_class*) p;
-       
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(vtt->gui.sync_client), vtt->is_sync_client);
-//     gtk_adjustment_set_value(vtt->gui.cycles
-}
-*/
 #define vgui (*vtt)->gui
 #define v (*vtt)
 
@@ -1226,16 +1169,6 @@ void vg_enable_critical_buttons(int enable)
 }
 
 
-int vg_get_current_page(vtt_class *vtt)
-{
-       return (0);
-}
-
-void vg_set_current_page(vtt_class *vtt, int page)
-{
-       vtt->gui.current_gui=page;
-}
-
 void vg_init_all_non_seqpars()
 {
        list <vtt_class *> :: iterator vtt;
index ebaa8b82a61acc30db729744c7a1b6cd7e8eaa6f..20e1cda8723c6cacdcce99a9fe52fefa8948c4ea 100644 (file)
@@ -117,7 +117,6 @@ typedef struct vtt_gui
 
 extern void cleanup_all_vtts();
 extern void update_all_vtts();
-extern void show_all_guis(int);
 /*extern void vg_update_sync(void *);*/
 extern void vg_enable_critical_buttons(int enable);
 extern void vg_init_all_non_seqpars();