fixed wav-write, xfree-4-input-hack and adrian's solo patch - alex
authorterminatorX <>
Tue, 26 Jun 2001 19:13:32 +0000 (19:13 +0000)
committerterminatorX <>
Tue, 26 Jun 2001 19:13:32 +0000 (19:13 +0000)
12 files changed:
ChangeLog
configure.in
gnome-support/Makefile.in
src/gui_icons/Makefile.in
src/main.cc
src/smallknob/Makefile.in
src/tX_mastergui.cc
src/tX_mouse.cc
src/tX_mouse.h
src/tX_vttgui.cc
src/tX_vttgui.h
src/wav_write.c

index 1cb6e7a34625efa60b0b2995335900e4e7f05a4d..34605354d811fc5a79944df7de9671bb9231c7a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@ All changes were done by me (Alexander K
 This is not a GNU-style ChangeLog but you sort of get the idea what was
 changed.
 
+[v3.72]
+- fixed a bug that produced corupt wavfiles on big endian machines
+- hack: made XInput work on XFree>4, proabably breaks XFree<4
+- applied Adrians solo-patch
+
 [v3.71]
 - applied a big patch from Adrian Reber (adrian@lisas.de). This patch includes:
   o compile fixes for the newer gcc releases
index 55edc8258fff54ef2099903e946902cbe091f53f..e75a96ebe0be21a7c87968bd076ab3ffd802c58e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/tX_global.h)
-AM_INIT_AUTOMAKE(terminatorX,3.71)
+AM_INIT_AUTOMAKE(terminatorX,3.72)
 AM_CONFIG_HEADER(config.h)
 
 dnl AC_ARG_ENABLE(closedev, [  --enable-closedev       close audio device if not in use. [default=yes] ])
index f7482f24a5729cc958e15907cbc36368a104d646..fb74ec961d1a7ee53d1b25e4d9e3e364695df7f6 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p1 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
index ba80d92410a0e0fd8b073630b1dd8619bd8174b2..904b34195d7d4562cbe7dd281682fe82a48db6ac 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p1 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
index 0e816068035362e0ed91dd2a708880ea6cd79b3d..79cc278f5096205bc074cb960dea29fe9249da69 100644 (file)
@@ -265,6 +265,8 @@ int main(int argc, char **argv)
        load_knob_pixs(main_window);
 #endif 
 
+//     gdk_input_init();
+
        gtk_main();
 
        store_globals();
index 51c9efbe720f13b7058b4595d16c173a552f1dbc..e17033a9173c3b8e78176145e8ddccbc5498f07e 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p1 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
index d3b0b1a7ac2411ea54ced3a46aafdc50afee49b7..07edbe19dd18ceb05ea3a10075bce67d753c08e2 100644 (file)
@@ -1127,7 +1127,7 @@ void create_mastergui(int x, int y)
        gtk_box_pack_end(GTK_BOX(smaller_box), dummy, WID_FIX);
        gtk_widget_show(dummy);
        
-       dumadj=(GtkAdjustment*) gtk_adjustment_new(2.0-globals.volume, 0, 2, 0.001, 0.001, 0.01);
+       dumadj=(GtkAdjustment*) gtk_adjustment_new(2.0-globals.volume, 0, 2, 0.01, 0.05, 0.005);
        volume_adj=dumadj;
 
        connect_adj(dumadj, master_volume_changed, NULL);       
index 6695736ec628117537bae638a373112548b50a76..df03617fae3faf53f07e04c8e15c18c511b16074 100644 (file)
@@ -49,13 +49,13 @@ tx_mouse :: tx_mouse()
        warp=TX_MOUSE_SPEED_NORMAL;
 }
 
+
 int tx_mouse :: grab()
 {      
 #ifdef USE_DGA2
        XDGAMode *mode;
 #endif 
        int i, num=0;
-       
 
        if (grabbed) return(0);
 
@@ -78,6 +78,10 @@ int tx_mouse :: grab()
        }
        XFree(mode);
 #endif 
+                               
+       XSelectInput(dpy, xwindow, mask);       
+
+       XSetInputFocus(dpy, xwindow, None, CurrentTime);
 
        if (globals.xinput_enable)
        {
@@ -88,10 +92,6 @@ int tx_mouse :: grab()
                        return(ENG_ERR_XINPUT);
                }
        }
-                               
-       XSelectInput(dpy, xwindow, mask);       
-
-       XSetInputFocus(dpy, xwindow, None, CurrentTime);
 
         if (GrabSuccess != XGrabPointer(dpy, xwindow, False, ButtonPressMask|ButtonReleaseMask|PointerMotionMask, GrabModeAsync,GrabModeAsync,None,None,CurrentTime))
        {
@@ -152,23 +152,32 @@ void tx_mouse :: ungrab()
        XUngrabKeyboard(dpy, CurrentTime);              
        XUngrabPointer (dpy, CurrentTime);
        XAutoRepeatOn(dpy);
-
-       reset_xinput(); 
        
        XCloseDisplay(dpy);
 
+       if (globals.xinput_enable)
+       {
+               reset_xinput(); 
+       }
+
        vtt_class::unfocus();
 
        grabbed=0;
 }
 
-
+void tx_mouse :: set_x_pointer(char *devname)
+{
+       char commandline[256];
+       
+       sprintf(commandline, "xsetpointer %s", devname);
+       system(commandline);
+       printf("ran: %s\n", commandline);
+}
 
 int tx_mouse :: set_xinput()
 {
        XDeviceInfo *devlist;                   
        int listmax, i;
-       int match=-1;
        
        if (globals.xinput_enable)
        {       
@@ -176,37 +185,30 @@ int tx_mouse :: set_xinput()
        
                for (i=0; i<listmax; i++)
                {
-                       if(!strcmp(globals.xinput_device,devlist[i].name))
-                       {
-                               match=i;
-                       }
-               
                        if(devlist[i].use == IsXPointer)
                        {
                                OrgXPointer=devlist[i].id;
+                               strcpy(OrgXPointerName, devlist[i].name);
                        }
                }
                
-               if (match>=0)
-               {
-                       input_device=NULL;
-                       input_device=XOpenDevice(dpy,devlist[match].id);
-/*                     if (XChangePointerDevice(dpy,input_device, 0, 1)!=Success)
-                       {
-                               match=-1;
-                       }*/
-                       XCloseDevice(dpy, input_device);
-               }
-               
                XFreeDeviceList(devlist);               
-       
-               if (match>=0) return(0); 
-               else return(1);
+               
+               set_x_pointer(globals.xinput_device);
        }
-       
        return(0);
 }
 
+
+void tx_mouse :: reset_xinput()
+{
+       if (globals.xinput_enable)
+       {
+               set_x_pointer(OrgXPointerName);
+       }
+}
+
+
 #define vtt vtt_class::focused_vtt
 
 int tx_mouse :: check_event()
@@ -328,13 +330,3 @@ int tx_mouse :: check_event()
        }
        return(0);
 }
-
-void tx_mouse :: reset_xinput()
-{
-       /*      if (globals.xinput_enable)
-       {
-               input_device=XOpenDevice(dpy, OrgXPointer);
-               XChangePointerDevice(dpy, input_device, 0, 1);
-               XCloseDevice(dpy,input_device); 
-       }*/
-}
index e8a02e7cc0bee3f8857d4b1a3e28dd99ec8e8535..c5456cb8dcdb7c9e0e6d72ffcd8bdd9336254486 100644 (file)
 #include <X11/extensions/XInput.h>
 #include <X11/extensions/xf86dga.h>
 #include <X11/keysym.h>
+#include <glib.h>
+#include <gdk/gdk.h>
 
 class tx_mouse
 {
        XID OrgXPointer;
+       char OrgXPointerName[256];
        XDevice *input_device;
        XEvent xev;
        long mask;
@@ -64,10 +67,14 @@ class tx_mouse
 
        int set_xinput();
        void reset_xinput();
+               
        int grab();
        int check_event();
        void ungrab();
        tx_mouse();
+       
+       private:
+       void set_x_pointer(char*);
 };
 
 
index 62caab2b848c08470c82d4d4b1e1cd3d64a8f057..8e4d5be0f4e3d21fc94ea5fc3287e1b97ee54934 100644 (file)
@@ -397,27 +397,38 @@ void client_setup_number(GtkWidget *wid, vtt_class *vtt)
        vtt->sp_sync_cycles.receive_gui_value(cycles);
 }
 
-/*
-void control_changed(GtkWidget *wid, vtt_class *vtt)
+void mute_volume(GtkWidget *widget, vtt_class *vtt)
 {
-       int x,y;
-       vtt_gui *g=&vtt->gui;
-       
-       if (GTK_TOGGLE_BUTTON(g->x_scratch)->active) x=CONTROL_SCRATCH;
-       else if (GTK_TOGGLE_BUTTON(g->x_volume)->active) x=CONTROL_VOLUME;
-       else if (GTK_TOGGLE_BUTTON(g->x_lp_cutoff)->active) x=CONTROL_CUTOFF;
-       else if (GTK_TOGGLE_BUTTON(g->x_ec_feedback)->active) x=CONTROL_FEEDBACK;
-       else if (GTK_TOGGLE_BUTTON(g->x_nothing)->active) x=CONTROL_NOTHING;
-
-       if (GTK_TOGGLE_BUTTON(g->y_scratch)->active) y=CONTROL_SCRATCH;
-       else if (GTK_TOGGLE_BUTTON(g->y_volume)->active) y=CONTROL_VOLUME;
-       else if (GTK_TOGGLE_BUTTON(g->y_lp_cutoff)->active) y=CONTROL_CUTOFF;
-       else if (GTK_TOGGLE_BUTTON(g->y_ec_feedback)->active) y=CONTROL_FEEDBACK;
-       else if (GTK_TOGGLE_BUTTON(g->y_nothing)->active) y=CONTROL_NOTHING;
-       
-       vtt->set_controls(x,y);
+       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);
 }
-*/
+
+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);
+              }
+       }
+
+}      
 
 void vg_display_xcontrol(vtt_class *vtt)
 {
@@ -893,6 +904,17 @@ void build_vtt_gui(vtt_class *vtt)
        gtk_box_pack_start(GTK_BOX(tempbox2), g->pand->get_widget(), WID_FIX);
        gui_set_tooltip(g->pand->get_entry(), "Specifies the position of this turntable within the stereo spectrum: -1 -> left, 0-> center, 1->right.");
 
+       g->mute=gtk_check_button_new_with_label("Mute");
+       gtk_box_pack_start(GTK_BOX(tempbox2), g->mute, WID_FIX);
+       gtk_signal_connect(GTK_OBJECT(g->mute),"clicked", (GtkSignalFunc) mute_volume, vtt);
+       gtk_widget_show(g->mute);
+
+       g->solo=gtk_check_button_new_with_label("Solo");
+       gtk_box_pack_start(GTK_BOX(tempbox2), g->solo, WID_FIX);
+       gtk_signal_connect(GTK_OBJECT(g->solo),"clicked", (GtkSignalFunc) solo_vtt, vtt);
+       gtk_widget_show(g->solo);
+       
+
        tempbox2=gtk_hbox_new(FALSE,0);
        gtk_widget_show(tempbox2);
        gtk_box_pack_start(GTK_BOX(tempbox), tempbox2, WID_FIX);
index 535f54b9fb3295f035c5849dd4b27d35206743cf..ebaa8b82a61acc30db729744c7a1b6cd7e8eaa6f 100644 (file)
@@ -74,6 +74,8 @@ typedef struct vtt_gui
        GtkAdjustment *pitch;
        GtkAdjustment *pan;
        GtkAdjustment *volume; 
+        GtkWidget *mute;
+        GtkWidget *solo;
        GtkWidget *flash;
 
        /* Widgets in Lowpass Panel */
index c124bb74cccd454a675c0b4e76b355be33f385a9..102c54dae93e034c1b0cef965b314875ef8d9243 100644 (file)
@@ -62,11 +62,14 @@ void init_head(wav_sig *info){
 #endif
        *(int32_t *)&info->head[16] = tmp32;
        
-       tmp16=1;
+/*     tmp16=1;
 #ifdef BIG_ENDIAN_MACHINE      
        swap16(&tmp16);
 #endif
        *(int16_t *)&info->head[20] = tmp16;
+*/
+       info->head[20] = 1;
+       info->head[21] = 0;
        
        info->head[22] = info->chans;
        info->head[23] = 0;