Changes for the upcomming 3.73 release - Alex
authorterminatorX <>
Sat, 18 May 2002 13:42:02 +0000 (13:42 +0000)
committerterminatorX <>
Sat, 18 May 2002 13:42:02 +0000 (13:42 +0000)
38 files changed:
ChangeLog
Makefile.am
acconfig.h
configure.in
debian/Makefile.am [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/files [new file with mode: 0644]
debian/rules [new file with mode: 0644]
debian/substvars [new file with mode: 0644]
debian/terminatorx.menu [new file with mode: 0644]
gnome-support/Makefile.am
gnome-support/terminatorX.desktop [new file with mode: 0644]
gnome-support/terminatorX.keys.in [new file with mode: 0644]
src/main.cc
src/tX_audiodevice.cc
src/tX_audiofile.cc
src/tX_audiofile.h
src/tX_dial.c
src/tX_dialog.cc
src/tX_event.h
src/tX_extdial.cc
src/tX_flash.c
src/tX_mastergui.cc
src/tX_mouse.cc
src/tX_mouse.h
src/tX_seqpar.cc
src/tX_seqpar.h
src/tX_sequencer.cc
src/tX_sequencer.h
src/tX_vtt.cc
src/tX_vttfx.cc
src/tX_vttgui.cc
src/tX_widget.c
terminatorX.1.in [new file with mode: 0644]

index 3ed2326495dde6589dfb71c9240ee8aaae64de7a..db1cbee8529c972b20c0eaf28457fe47f8ba0d6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,18 @@ 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.73]
+- Fixed a compilation bug ocurring on big endian systems only.
+- Fixed the built-in wav loading routines for big endian systems (again).
+- Ported terminatorX to gtk+ Version 2. The code for gtk2 will be enabled
+  when gtk2 is detected by configure. To force terminatorX to use the good
+  old gtk 1.2.x (x>=5) run configure with the '--disable-gtk2' switch.
+- Applied a patch from Adrian that brings lots of new stuff:
+  - Debian package support  
+  - enhanced GNOME integration
+  - a manpage for terminatorX
+- Included another gcc3 fix thanks to Gregor Riepl <seto-kun@freesurf.ch>
+
 [v3.72]
 - Applied a patch from Matthew Evans <activesx@hotmail.com> that introduces 
   support for Ogg Vorbis audiofiles. It requires ogg123 > RC2 and sox to work.
index 64ae4ce176c1c67fa453a5b81d3af4200e7b57b9..8b7571b2c046470f587d7cef88db9339b2c55018 100644 (file)
@@ -1,3 +1,5 @@
 AUTOMAKE_OPTIONS = foreign 
-SUBDIRS = src gnome-support doc
+SUBDIRS = src gnome-support doc debian
 SOURCES = README.GNOME README.PERFORMANCE terminatorX.spec terminatorX.spec.in
+
+man_MANS = terminatorX.1
index 8725018b29e9c0d5d0b8754c0408396bf151ddbb..a934abb479bb1506401242cf551306010c9c37f8 100644 (file)
@@ -50,3 +50,6 @@
 
 /* Don't use movqfix */
 #undef OVERRIDE_MOVQ_AUTODETECT
+
+/* use the newer gtk+ toolkit */
+#undef USE_GTK2
index bf0005666d16b3371ee98a87e2c9953723036534..a1309cf59bf1dfb914979158b4b25dfa9bafb67e 100644 (file)
@@ -1,26 +1,26 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/tX_global.h)
-AM_INIT_AUTOMAKE(terminatorX,3.72)
+AM_INIT_AUTOMAKE(terminatorX, 3.73)
 AM_CONFIG_HEADER(config.h)
 
 dnl AC_ARG_ENABLE(closedev, [  --enable-closedev       close audio device if not in use. [default=yes] ])
-AC_ARG_ENABLE(sox, [  --enable-sox            use sox as input converter. [default=yes] ])
-AC_ARG_ENABLE(mpg123, [  --enable-mpg123         use mpg123 as input converter. [default=yes] ])
-AC_ARG_ENABLE(ogg123, [  --enable-ogg123         use ogg123 as input converter. [default=yes] ])
-dnl AC_ARG_ENABLE(wavonly,  [  --enable-wavonly        enable the builtin wav routines. (no sox/mpg123) ])
-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] ])
-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] ])
-dnl AC_ARG_ENABLE(alsa,         [  --enable-alsa           use ALSA for sound output [default=auto] ])
-AC_ARG_ENABLE(oss,          [  --enable-oss            use OSS for sound output [default=auto] ])
-AC_ARG_ENABLE(movqfix,     [  --disable-movqfix       don't use movq fix for gcc >= 2.96 [default=on] ])
-dnl AC_ARG_ENABLE(dial,         [  --enable-dial           use dials instead of scales for effects [default=yes] ])
-dnl AC_ARG_ENABLE(bigdial,      [  --enable-bigdial        use BIG dials [default=yes] ])
-dnl AC_ARG_ENABLE(dga2,     [  --enable-dga2           use DGA2 instead of DGA1. (experimental) [default=no] ])
+AC_ARG_ENABLE(sox, [  --enable-sox            use sox as input converter. (default=auto) ])
+AC_ARG_ENABLE(mpg123, [  --enable-mpg123         use mpg123 as input converter. (default=auto) ])
+AC_ARG_ENABLE(ogg123, [  --enable-ogg123         use ogg123 as input converter. (default=auto) ])
+dnl AC_ARG_ENABLE(wavonly,  [  --enable-wavonly        enable the builtin wav routines. ])
+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(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) ])
+dnl AC_ARG_ENABLE(alsa,         [  --enable-alsa           use ALSA for sound output (default=auto) ])
+AC_ARG_ENABLE(oss,          [  --enable-oss            use OSS for sound output (default=auto) ])
+dnl AC_ARG_ENABLE(movqfix,         [  --disable-movqfix       don't use movq fix for gcc >= 2.96 [default=on] ])
+AC_ARG_ENABLE(gtk2,        [  --disable-gtk2          use gtk+ 1.2 even if verion 2 detected (default=auto) ])
+dnl AC_ARG_ENABLE(dial,         [  --enable-dial           use dials instead of scales for effects (default=yes) ])
+dnl AC_ARG_ENABLE(bigdial,      [  --enable-bigdial        use BIG dials (default=yes) ])
+dnl AC_ARG_ENABLE(dga2,     [  --enable-dga2           use DGA2 instead of DGA1. (experimental) (default=no) ])
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -33,8 +33,36 @@ AC_PROG_RANLIB
 dnl Checks for libraries.
 AC_CHECK_LIB(m, floor,, AC_MSG_ERROR([** math-lib not installed or broken **]))
 AC_CHECK_LIB(pthread, pthread_mutex_lock,, AC_MSG_ERROR([** POSIX threads not installed or broken **]))
-AM_PATH_GTK(1.2.5, , AC_MSG_ERROR([** GTK 1.2.5 not installed or broken **]))
-dnl AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR([** GLIB 1.2.0 not installed or broken **]))
+
+gtk2="no"
+gtk12="no"
+
+if test "$enable_gtk2" != "no"; then
+       AM_PATH_GTK_2_0(, [
+         GTK2_CFLAGS="$GTK_CFLAGS"
+         GTK2_LIBS="$GTK_LIBS"
+         gtk2="yes"
+         GTK2_VERSION="`$PKG_CONFIG --modversion gtk+-2.0`"], [ gtk2="no" ]) 
+fi
+
+if test "$gtk2" = "no"; then
+       AM_PATH_GTK([1.2.5], [
+         GTK12_CFLAGS="$GTK_CFLAGS"
+         GTK12_LIBS="$GTK_LIBS"
+         gtk12="yes"
+         GTK12_VERSION="`$GTK_CONFIG $gtk_config_args --version`"], [ gtk12="no" ])
+fi
+
+if test "$gtk2" = "yes"; then
+       AC_MSG_RESULT([using gtk+ version 2 as widget toolkit.])
+       AC_DEFINE(USE_GTK2)
+else
+       if test "$gtk12" = "yes"; then
+               AC_MSG_RESULT([using gtk+ version 1.2 (outdated) as widget toolkit.])
+       else
+               AC_MSG_ERROR([** couldn't find gtk+ > Version 1.2.5 **])
+       fi
+fi
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -194,6 +222,24 @@ if test "$enable_dga2" = yes; then
        AC_DEFINE(USE_DGA2)
 fi
 
+AC_MSG_CHECKING(for GNOME)
+AC_MSG_RESULT([in progress])
+AC_CHECK_PROG(gnomepresent, gnome-name-service, yes, no)
+    if test "$gnomepresent" = yes; then
+   AC_CHECK_PROG(gnomeconfig, gnome-config, yes)
+        if test "$gnomeconfig" = yes; then
+       gnomedatadir=`gnome-config --datadir`
+   else
+       gnomedatadir=${datadir}
+        fi
+   AC_SUBST(gnomedatadir)
+   AM_CONDITIONAL(GNOMEpresent, test "$gnomepresent" = yes)
+   AC_MSG_RESULT([You have GNOME. I'll install terminatorX.desktop])
+    else
+   AC_MSG_RESULT([You don't have GNOME.])
+    fi
+
+
 dnl Now Check for Xlibs - I do this here as other tests fail if these run earlier
 AC_PATH_XTRA
 
@@ -203,6 +249,7 @@ AC_SUBST(X_EXTRA_LIBS)
 AC_SUBST(X_LIBS)
 AC_SUBST(x_libraries)
 
+GTK_LIBS="$GTK_LIBS $X_LIBS"
 AC_CHECK_LIB(X11, XOpenDisplay,, AC_MSG_ERROR([** X11-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
 AC_CHECK_LIB(Xext, XShmQueryExtension,, AC_MSG_ERROR([** Xext-libs not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
 AC_CHECK_LIB(Xi, XOpenDevice,, AC_MSG_ERROR([** XInput not installed or broken **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
@@ -210,4 +257,4 @@ AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,, AC_MSG_ERROR([** DGA not installe
 if test "$enable_dga2" = yes; then
        AC_CHECK_LIB(Xxf86dga, XDGASelectInput,, AC_MSG_ERROR([** DGA2 not installed. Try using dga1 instead. **]), $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
 fi
-AC_OUTPUT(Makefile src/Makefile gnome-support/Makefile src/gui_icons/Makefile src/smallknob/Makefile doc/Makefile doc/img/Makefile terminatorX.spec)
+AC_OUTPUT(Makefile src/Makefile gnome-support/Makefile gnome-support/terminatorX.keys src/gui_icons/Makefile src/smallknob/Makefile doc/Makefile doc/img/Makefile debian/Makefile terminatorX.spec terminatorX.1)
diff --git a/debian/Makefile.am b/debian/Makefile.am
new file mode 100644 (file)
index 0000000..7c6eefd
--- /dev/null
@@ -0,0 +1,16 @@
+SOURCES =      changelog \
+               control \
+               copyright \
+               dirs \
+               docs \
+               files \
+               rules \
+               substvars \
+               terminatorx.menu
+
+
+clean-local:
+       rm -rf tmp
+
+CLEANFILES = postinst.debhelper postrm.debhelper
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..be67720
--- /dev/null
@@ -0,0 +1,7 @@
+terminatorx (3.72-1) unstable; urgency=low
+
+  * Initial Release.
+  * menu entry created
+
+ -- Adrian Reber <adrian@lisas.de>  Thu, 16 May 2002 20:06:56 +0200
+
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..aa2a96e
--- /dev/null
@@ -0,0 +1,16 @@
+Source: terminatorx
+Section: sound
+Priority: optional
+Maintainer: Adrian Reber <adrian@lisas.de>
+Build-Depends: autoconf, automake, debhelper (>> 3.0.0), libgtk1.2-dev, libglib1.2-dev, xlibs-dev, libc6-dev, libstdc++2.10-dev, ladspa-sdk, sox, mpg321
+Standards-Version: 3.2.1
+
+Package: terminatorx
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Realtime Audio Synthesizer
+ terminatorX is a realtime audio synthesizer that allows you to "scratch" on
+ digitally sampled audio data (*.wav, *.au, *.mp3, etc.) the way hiphop-DJs
+ scratch on vinyl records. It features multiple turntables, realtime effects
+ (buit-in as well as LADSPA plugin effects), a sequencer and an easy-to-use
+ gtk+ GUI.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..93eb09e
--- /dev/null
@@ -0,0 +1,13 @@
+This package was debianized by Adrian Reber <adrian@lisas.de> on
+Mon, 13 May 2002 21:06:26 +0200.
+
+It was downloaded from http://terminatorX.cx/
+
+Upstream Author(s): Alexander K├Ânig <alex@lisas.de>
+
+Copyright:
+
+GPL2
+On Debian Systems, you can find the full text of the GPL under
+/usr/share/common-licenses/GPL-2
+
diff --git a/debian/dirs b/debian/dirs
new file mode 100644 (file)
index 0000000..e772481
--- /dev/null
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..8e695ec
--- /dev/null
@@ -0,0 +1 @@
+doc
diff --git a/debian/files b/debian/files
new file mode 100644 (file)
index 0000000..df74097
--- /dev/null
@@ -0,0 +1 @@
+terminatorx_3.72-1_sparc.deb sound optional
diff --git a/debian/rules b/debian/rules
new file mode 100644 (file)
index 0000000..e7b35f2
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/make -f
+# Made with the aid of debmake, by Christoph Lameter,
+# based on the sample debian/rules file for GNU hello by Ian Jackson.
+
+package=terminatorx
+
+build:
+       $(checkdir)
+       ./configure --prefix=/usr
+       $(MAKE)
+       touch build
+
+clean:
+       $(checkdir)
+       -rm -f build
+       -$(MAKE) distclean
+       -rm -f `find . -name "*~"`
+       -rm -rf debian/tmp debian/files* core debian/substvars
+
+binary-indep: checkroot build
+       $(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+
+binary-arch: checkroot build
+       $(checkdir)
+       -rm -rf debian/tmp
+       install -d debian/tmp
+       cd debian/tmp && install -d `cat ../dirs`
+       $(MAKE) install prefix=`pwd`/debian/tmp/usr
+# Must have debmake installed for this to work. Otherwise please copy
+# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
+       debstd ChangeLog AUTHORS NEWS README README.GNOME README.PERFORMANCE TODO \
+       THANKS
+       #do some cleanup for the documentation
+       find debian/tmp -name "Makefile*" -exec rm -f {} \;
+
+       dh_installmenu
+
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+
+
+       dh_md5sums
+
+       dh_gencontrol
+       #chown -R root.root debian/tmp
+       #chmod -R go=rX debian/tmp
+       #dpkg --build debian/tmp ..
+       dh_builddeb
+
+define checkdir
+       test -f debian/rules
+endef
+
+binary: binary-indep binary-arch
+
+checkroot:
+       $(checkdir)
+       test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
diff --git a/debian/substvars b/debian/substvars
new file mode 100644 (file)
index 0000000..ce09a73
--- /dev/null
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.2.4-4), libglib1.2 (>= 1.2.0), libgtk1.2 (>= 1.2.10-4), libstdc++2.10-glibc2.2 (>= 1:2.95.4-0.010810), xlibs (>> 4.1.0)
diff --git a/debian/terminatorx.menu b/debian/terminatorx.menu
new file mode 100644 (file)
index 0000000..40eff9a
--- /dev/null
@@ -0,0 +1,2 @@
+?package(terminatorx):needs=X11 icon="/usr/share/pixmaps/terminatorX-app.xpm" section="Apps/Sound" \
+  title="terminatorX" command="/usr/bin/terminatorX"
index 3fd55d12479ac0b408307586dbd40c58ff20653b..9ae0a945a7d0c22e16b4b2dee69d759de95a297a 100644 (file)
@@ -1,8 +1,22 @@
 SOURCES=terminatorX-app.xpm\
        terminatorX-mime.xpm\
-       terminatorX.keys\
        terminatorX.mime\
        tx-gnome-install\
        tx-gnome-uninstall\
+       terminatorX.desktop\
        README.GNOME
+
+if GNOMEpresent
+gnomedir=@gnomedatadir@
+gnomeappdir=$(gnomedir)/gnome/apps/Multimedia
+gnomeapp_DATA=terminatorX.desktop
+
+mimetypedir=$(gnomedir)/mime-info
+mimetype_DATA=terminatorX.keys terminatorX.mime
+
+pixmapdir=$(gnomedir)/pixmap
+pixmap_DATA=terminatorX-app.xpm terminatorX-mime.xpm
+
+endif
+
        
diff --git a/gnome-support/terminatorX.desktop b/gnome-support/terminatorX.desktop
new file mode 100644 (file)
index 0000000..268f2c3
--- /dev/null
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=terminatorX
+Type=Application
+Comment=sophisticated scratching and audio tool
+Exec=terminatorX
+Icon=terminatorX-app.xpm
+
diff --git a/gnome-support/terminatorX.keys.in b/gnome-support/terminatorX.keys.in
new file mode 100644 (file)
index 0000000..7083533
--- /dev/null
@@ -0,0 +1,5 @@
+application/x-terminatorX:
+       open=terminatorX %f
+       view=terminatorX %f
+       edit=terminatorX %f
+       icon-filename=@prefix@/share/pixmaps/terminatorX-mime.xpm
index 86979fa0d2cc71760f7f2876a33756c57c644ce0..ad42ee21a12199820216635ab61256dc7c37b9d2 100644 (file)
@@ -385,16 +385,16 @@ int main(int argc, char **argv)
        else
         printf("3DNow! accelerations available.\n");   
 #endif
-       gtk_set_locale ();
+//     gtk_set_locale ();
         gtk_init (&argc, &argv);
        
-       gtk_rc_file=fopen(TX_GTKRC, "r");
+/*     gtk_rc_file=fopen(TX_GTKRC, "r");
        if (gtk_rc_file)
        {
                fprintf (stderr, "Using terminatorX gtkrc.\n");
                fclose(gtk_rc_file);
                gtk_rc_parse(TX_GTKRC);
-       }
+       } */
 
        parse_args(&argc, argv); 
 
index 022eb4a6fe70c14aeb90962b7a735e9f43b1df1b..378ddc06653c88f34e2088c12cd0707f697bec5f 100644 (file)
@@ -160,7 +160,7 @@ tX_audiodevice_oss :: tX_audiodevice_oss()
 void tX_audiodevice_oss :: play(int16_t *buffer)
 {
 #ifdef BIG_ENDIAN_MACHINE
-       swapbuffer (buffer, samples);
+       swapbuffer (buffer, samples_per_buffer);
 #endif
        write(fd, buffer, blocksize);   
 }
@@ -187,7 +187,7 @@ tX_audiodevice_alsa :: tX_audiodevice_alsa()
 void tX_audiodevice_alsa :: play(int16_t *buffer)
 {
 #ifdef BIG_ENDIAN_MACHINE
-       swapbuffer (buffer, samples);
+       swapbuffer (buffer, samples_per_buffer);
 #endif
        /***/
 }
index 1dc11e24755c93850fb6e56e664f477289821d48..12e91596a665a16bd737eb2c9fd4fca47640ddc0 100644 (file)
@@ -348,7 +348,7 @@ int tx_audiofile :: load_wav()
                bytes = fread(p, 1, min(1024, wav_in.len-allbytes), wav_in.handle);
 
 #ifdef BIG_ENDIAN_MACHINE
-//             if (!wav_in.has_host_order) swapbuffer(p, bytes/sizeof(int16_t));
+               swapbuffer(p, bytes/sizeof(int16_t));
 #endif         
                if (bytes<=0)
                {
index cb259d890443c9b6c2eba2ce1da282f577fbcd6a..8af7903dc968683bc61f988f593d4641531c402d 100644 (file)
@@ -71,7 +71,7 @@ but mpg321 doesn't support -m yet.
 #define TX_FILE_MPG123 2
 #define TX_FILE_OGG123 3
 
-#include <linux/limits.h>
+#include <limits.h>
 #include "tX_types.h"
 #include <stdio.h>
 
index 9fb39f5a6d2b806e132c84ea6fab19eed8203a77..2df5d892e959a119ba25e82d44a570e9930365b7 100644 (file)
@@ -87,8 +87,9 @@ gtk_tx_dial_get_type ()
        sizeof (GtkTxDialClass),
        (GtkClassInitFunc) gtk_tx_dial_class_init,
        (GtkObjectInitFunc) gtk_tx_dial_init,
-       (GtkArgSetFunc) NULL,
-       (GtkArgGetFunc) NULL,
+       /* reserved */ NULL,
+       /* reserved */ NULL,
+       /* reserved */ NULL
       };
 
       tx_dial_type = gtk_type_unique (gtk_widget_get_type (), &tx_dial_info);
index 2249ac8c4c59468e41435af5708e495dcd583290..5e006a32483029be21544374b0dc1bf4e959eee6 100644 (file)
@@ -102,7 +102,11 @@ void apply_options()
                
        globals.sense_cycles=(int) sense_cycles->value;
        globals.xinput_enable=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(xinput_enable));
+#ifdef         USE_GTK2
+       text=(char *) gtk_button_get_label(GTK_BUTTON(xinput_device));
+#else  
        gtk_label_get(GTK_LABEL(GTK_BUTTON(xinput_device)->child), &text);
+#endif 
        strcpy(globals.xinput_device, text);    
        
        globals.mouse_speed=mouse_speed->value;
@@ -206,7 +210,11 @@ void  use_stdout_changed(GtkWidget *widget)
 }
 void select_input(GtkWidget *w, char *dev)
 {
+#ifdef         USE_GTK2
+       gtk_button_set_label(GTK_BUTTON(xinput_device), dev);
+#else          
        gtk_label_set(GTK_LABEL(GTK_BUTTON(xinput_device)->child), dev);
+#endif 
 }
 
 void create_options()
@@ -656,25 +664,40 @@ void show_about(int nag)
                add_about_wid(label);
 
                hbox=gtk_hbox_new(FALSE, 5);            
+
+#ifdef USE_GTK2
+               GtkTextIter iter;
+               GtkTextBuffer *tbuffer;
+
+               text=gtk_text_view_new();
+               tbuffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
+               gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_NONE);
+               gtk_text_view_set_editable(GTK_TEXT_VIEW(text), false);
+               gtk_text_buffer_get_iter_at_offset (tbuffer, &iter, 0);
+               
+               scroll=gtk_scrolled_window_new (NULL, NULL);
+        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+               gtk_container_add (GTK_CONTAINER (scroll), text);
+               gtk_widget_show(text);          
+
+               gtk_text_buffer_insert (tbuffer, &iter, license, -1);
                
+               gtk_box_pack_start(GTK_BOX(hbox), scroll, WID_DYN);
+               gtk_widget_show(scroll);                
+#else
                text=gtk_text_new(NULL,NULL);
                scroll=gtk_vscrollbar_new(GTK_TEXT(text)->vadj);
                gtk_text_set_editable(GTK_TEXT(text),0);
                gtk_text_set_word_wrap( GTK_TEXT(text), 0);
-
-/*
-               if (!GPL_font)
-               {
-                       GPL_font=gdk_font_load ("-misc-fixed-medium-r-*-*-*-120-*-*-*-*-*-*");
-               }               
-               gtk_text_insert(GTK_TEXT(text), GPL_font, NULL, NULL, license, strlen(license));*/
-                               gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, license, strlen(license));
+               gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, license, strlen(license));
 
                gtk_box_pack_start(GTK_BOX(hbox), text, WID_DYN);
                gtk_widget_show(text);
                
                gtk_box_pack_start(GTK_BOX(hbox), scroll, WID_FIX);
                gtk_widget_show(scroll);
+#endif         
+
                
                add_about_wid(hbox);
 
index be62fecf1ec5cdf3b30cf3b07bfe7da0d0fd1146..bd5ff02a88e65abfa6f78f454e450631adb44ee1 100644 (file)
 #include "tX_seqpar.h"
 #include "tX_vtt.h"
 #include <stdio.h>
+#include <glib.h>
 #include "tX_types.h"
 
 class tX_event
 {
        private:
        float                   value;
-       u_int32_t               timestamp;
+       guint32                 timestamp;
        tX_seqpar               *sp;
        
        public:
-       tX_event(u_int32_t time, float val, tX_seqpar *sp_in)
+       tX_event(guint32 time, float val, tX_seqpar *sp_in)
                {
                        timestamp=time;
                        value=val;
@@ -47,7 +48,7 @@ class tX_event
        void store(FILE *output);
 
        tX_seqpar *get_sp() { return sp; }
-       u_int32_t get_timestamp() { return timestamp; }
+       guint32 get_timestamp() { return timestamp; }
        float get_value() { return value; }
        void set_value(float val) { value=val; }
 
index ef2b8ae223a694cf71799708048779b55530f5bc..7e6ae539c588e2fee8cb1d1d67911c3efed22f22 100644 (file)
@@ -10,7 +10,7 @@ GtkSignalFunc tX_extdial :: f_entry(GtkWidget *w, tX_extdial *ed)
        strcpy(ed->sval, gtk_entry_get_text(GTK_ENTRY(ed->entry)));
        ed->s2f();
        gtk_adjustment_set_value(ed->adj, ed->fval);
-
+       return NULL;
 }
 
 GtkSignalFunc tX_extdial :: f_adjustment(GtkWidget *w, tX_extdial *ed)
@@ -18,6 +18,7 @@ GtkSignalFunc tX_extdial :: f_adjustment(GtkWidget *w, tX_extdial *ed)
        ed->fval=ed->adj->value;
        ed->f2s();
        gtk_entry_set_text(GTK_ENTRY(ed->entry), ed->sval);
+       return NULL;    
 }
 
 tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a)
index a3945433523fab6b5cde3297eda5a3a9aa21bd24..dbbd4e2f555ee4d3a93ea7c3afac797573bac6e9 100644 (file)
@@ -80,8 +80,9 @@ gtk_tx_flash_get_type ()
        sizeof (GtkTxFlashClass),
        (GtkClassInitFunc) gtk_tx_flash_class_init,
        (GtkObjectInitFunc) gtk_tx_flash_init,
-       (GtkArgSetFunc) NULL,
-       (GtkArgGetFunc) NULL,
+       /* reserved */ NULL,
+       /* reserved */ NULL,
+       /* reserved */ NULL
       };
 
       tx_flash_type = gtk_type_unique (gtk_widget_get_type (), &tx_flash_info);
index 58e4a22c1bc813a4dd57fe92afc72ca48263feb1..15c81800e08917294ce3d8e1066b0a66661c1cc6 100644 (file)
@@ -250,6 +250,7 @@ GtkSignalFunc new_table(GtkWidget *, char *fn)
                
                if (fn) ld_destroy();           
        mg_update_status();
+       return NULL;
 }
 
 GtkSignalFunc drop_new_table(GtkWidget *widget, GdkDragContext *context,
@@ -490,16 +491,19 @@ GtkSignalFunc save_tables()
 GtkSignalFunc master_volume_changed (GtkWidget *wid, void *d)
 {
        sp_master_volume.receive_gui_value((float) 2.0-GTK_ADJUSTMENT(wid)->value);
+       return NULL;    
 }
 
 GtkSignalFunc master_pitch_changed(GtkWidget *wid, void *d)
 {
        sp_master_pitch.receive_gui_value((float) GTK_ADJUSTMENT(wid)->value);  
+       return NULL;    
 }
 
 GtkSignalFunc saturate_changed(GtkWidget *w, void *d)
 {
        vtt_class::enable_saturate (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
+       return NULL;    
 }
 
 void mg_enable_critical_buttons(int enable)
@@ -727,11 +731,11 @@ GtkSignalFunc seq_rec(GtkWidget *w, void *)
        sequencer.trig_rec();
 }
 
-void seq_update_entry(const u_int32_t timestamp)
+void seq_update_entry(const guint32 timestamp)
 {
        char buffer[20];
-       u_int32_t samples;
-       u_int32_t minu,sec,hun; 
+       guint32 samples;
+       guint32 minu,sec,hun;   
        
        samples=timestamp*globals.true_block_size;
        
@@ -770,7 +774,7 @@ void seq_slider_released(GtkWidget *wid, void *d)
 }
 void sequencer_move(GtkWidget *wid, void *d)
 {
-       u_int32_t pos;
+       guint32 pos;
        
        if (seq_adj_care)
        {
index 51e121f7cb9c9f2cd813817caa2e1a41b4d2bec1..ed785e765837a3905c2468373b4452c4b643d354 100644 (file)
@@ -29,6 +29,7 @@
 #include "tX_engine.h"
 #include "tX_vtt.h"
 #include <sys/wait.h>
+#include <X11/extensions/xf86dga.h>
 
 #define TX_MOUSE_SPEED_NORMAL 0.05
 #define TX_MOUSE_SPEED_WARP 250000
index 408aee2d168499e92072d3a9a74cf59fa435dcd2..f6000ea305ecb011ee3852e4f5759c8fed839c27 100644 (file)
@@ -32,7 +32,6 @@
 #include <unistd.h>
 #include <X11/Xlib.h>
 #include <X11/extensions/XInput.h>
-#include <X11/extensions/xf86dga.h>
 #include <X11/keysym.h>
 #include <glib.h>
 #include <gdk/gdk.h>
index 2222091a20c8ad7d1195558996d434634fe466fd..f9e651a4761f90c6db98f17dc813fdc04ab5d846 100644 (file)
@@ -227,6 +227,7 @@ const char * tX_seqpar :: get_name()
 float tX_seqpar :: get_value()
 {
        printf("Ooops. tX_seqpar::get_value() called. Trouble.");
+       return 0.0;     
 }
 
 void tX_seqpar :: do_exec(const float value)
@@ -860,6 +861,7 @@ void tX_seqpar_vttfx_float :: do_update_graphics()
 GtkSignalFunc tX_seqpar_vttfx_float :: gtk_callback(GtkWidget* w, tX_seqpar_vttfx_float *sp)
 {
        sp->receive_gui_value(sp->myadj->value);        
+       return NULL;    
 }
 
 #define WID_DYN TRUE, TRUE, 0
@@ -902,6 +904,7 @@ void tX_seqpar_vttfx_int :: do_update_graphics()
 GtkSignalFunc tX_seqpar_vttfx_int :: gtk_callback(GtkWidget* w, tX_seqpar_vttfx_int *sp)
 {
        sp->receive_gui_value(sp->myadj->value);        
+       return NULL;
 }
 
 void tX_seqpar_vttfx_bool :: create_widget()
@@ -925,6 +928,7 @@ void tX_seqpar_vttfx_bool :: do_exec(const float value)
 GtkSignalFunc tX_seqpar_vttfx_bool :: gtk_callback(GtkWidget* w, tX_seqpar_vttfx_bool *sp)
 {
        sp->receive_gui_value(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sp->widget)));     
+       return NULL;
 }
 
 void tX_seqpar_vttfx_bool :: do_update_graphics()
index 7657df84d2573ea513f1a74a43eb7a1b2989f1c1..c53cfe685342975bffc62409117619a6ace9b6e6 100644 (file)
@@ -49,8 +49,8 @@ class tX_seqpar
        
        float fwd_value;
        
-       u_int32_t persistence_id;
-       u_int32_t touch_timestamp;              
+       guint32 persistence_id;
+       guint32 touch_timestamp;                
        void *last_event_recorded;
 
        void default_constructor();
@@ -80,11 +80,11 @@ class tX_seqpar
        static void untouch_all();
        
        int is_gui_active() { return gui_active; }
-       u_int32_t get_touch_timestamp() { return touch_timestamp; }
+       guint32 get_touch_timestamp() { return touch_timestamp; }
        
        static void create_persistence_ids();
-       u_int32_t get_persistence_id() { return persistence_id; }
-       unsigned int set_persistence_id(u_int32_t pid) { persistence_id=pid; }
+       guint32 get_persistence_id() { return persistence_id; }
+       unsigned int set_persistence_id(guint32 pid) { persistence_id=pid; }
        static tX_seqpar *get_sp_by_persistence_id(int pid);
 
        void record_value (const float value);
index 2bfbd5a91ae1219862ff826d3fabdde4869208a8..3c0f3d7582e0211fd10fd9e7e181b9db179c64a4 100644 (file)
@@ -43,7 +43,7 @@ tX_sequencer :: ~tX_sequencer()
 {
 }
 
-void tX_sequencer :: set_timestamp(u_int32_t timestamp)
+void tX_sequencer :: set_timestamp(guint32 timestamp)
 {
        current_timestamp=0;
        start_timestamp=0;
@@ -232,7 +232,7 @@ void tX_sequencer :: delete_all_events_for_sp(tX_seqpar *sp)
 
 void tX_sequencer :: save(FILE *out)
 {
-       u_int32_t event_count;
+       guint32 event_count;
        list <tX_event *> :: iterator song_event;
        
        event_count=song_list.size();
@@ -247,8 +247,8 @@ void tX_sequencer :: save(FILE *out)
 
 void tX_sequencer :: load(FILE *in)
 {
-       u_int32_t event_count=0;
-       u_int32_t i;
+       guint32 event_count=0;
+       guint32 i;
        tX_event *new_event=NULL;
        
        clear();
@@ -281,15 +281,15 @@ void tX_sequencer :: clear()
 }
 
 
-u_int32_t tX_sequencer :: set_start_timestamp(float pos)
+guint32 tX_sequencer :: set_start_timestamp(float pos)
 {
-       u_int32_t timestamp;
+       guint32 timestamp;
        
        if (pos>99.999) pos=99.999;
        
        pos/=100;
        
-       timestamp = (u_int32_t) (((float) max_timestamp) * pos);
+       timestamp = (guint32) (((float) max_timestamp) * pos);
        
        start_timestamp=timestamp;
        
index 41fc9fd3074e23dcae2880c30cfcdd641fcdc4c9..c04a2909329ea0488aee1534bb1fbc4f68a0b0a0 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <list>
 #include <pthread.h>
+#include <glib.h>
 
 #include "tX_event.h"
 #include "tX_seqpar.h"
@@ -40,11 +41,11 @@ class tX_sequencer
        list <tX_event *> record_list;
        pthread_mutex_t record_lock;
        
-       u_int32_t current_timestamp;
-       u_int32_t start_timestamp;
-       u_int32_t max_timestamp;
-       u_int32_t record_start_timestamp;               
-       u_int32_t record_stop_timestamp;                
+       guint32 current_timestamp;
+       guint32 start_timestamp;
+       guint32 max_timestamp;
+       guint32 record_start_timestamp;         
+       guint32 record_stop_timestamp;          
 
        list <tX_event *> :: iterator next_event;
        
@@ -55,10 +56,10 @@ class tX_sequencer
        tX_sequencer();
        ~tX_sequencer();
        
-       void set_timestamp(u_int32_t timestamp);
+       void set_timestamp(guint32 timestamp);
        int is_recording() { return (mode == TX_SEQMODE_PLAYREC); }
        
-       u_int32_t get_timestamp() { return current_timestamp; }
+       guint32 get_timestamp() { return current_timestamp; }
        float get_timestamp_as_float(){ return ((float) (((float) current_timestamp)/((float) max_timestamp))*100.0); }
 
        void step();
@@ -81,7 +82,7 @@ class tX_sequencer
        void load(FILE *);
        void clear();
        
-       u_int32_t set_start_timestamp(float pos);
+       guint32 set_start_timestamp(float pos);
        void forward_to_start_timestamp(int dont_fake);
 };
 
index 5f5dcead68a950bbd12ab9c97efd594bc9e12e2a..cd1fcfdf5a330222836d70ab3d3206c78ecebd96 100644 (file)
@@ -33,6 +33,8 @@
 #include <math.h>
 #include "tX_mastergui.h"
 #include "tX_sequencer.h"
+#include <glib.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -1584,9 +1586,9 @@ int  vtt_class :: save(FILE * output)
        list <vtt_fx *> :: iterator effect;
 
        int res=0;
-       u_int32_t pid;
+       guint32 pid;
        int32_t counter;
-       u_int8_t hidden;
+       guint8 hidden;
        
        store(name);
        store(filename);
@@ -1743,7 +1745,7 @@ int vtt_class :: load_10(FILE * input)
 int vtt_class :: load_11(FILE * input)
 {
        int res=0;
-       u_int32_t pid;
+       guint32 pid;
        int32_t gui_page;
        
        atload(name);
@@ -1816,7 +1818,7 @@ int vtt_class :: load_11(FILE * input)
 int vtt_class :: load_12(FILE * input)
 {
        int res=0;
-       u_int32_t pid;
+       guint32 pid;
        int32_t counter;
        int32_t type;
        long id;
@@ -1824,7 +1826,7 @@ int vtt_class :: load_12(FILE * input)
        LADSPA_Plugin *plugin;
        char buffer[256];
        vtt_fx_ladspa *ladspa_effect;
-       u_int8_t hidden;
+       guint8 hidden;
        
        atload(buffer);
        this->set_name(buffer);
@@ -1960,7 +1962,7 @@ int vtt_class :: load_12(FILE * input)
 int vtt_class :: load_13(FILE * input)
 {
        int res=0;
-       u_int32_t pid;
+       guint32 pid;
        int32_t counter;
        int32_t type;
        long id;
@@ -1968,7 +1970,7 @@ int vtt_class :: load_13(FILE * input)
        LADSPA_Plugin *plugin;
        char buffer[256];
        vtt_fx_ladspa *ladspa_effect;
-       u_int8_t hidden;
+       guint8 hidden;
        
        atload(buffer);
        this->set_name(buffer);
@@ -2118,7 +2120,7 @@ int  vtt_class :: save_all(FILE* output)
 {
        int res=0;
        list <vtt_class *> :: iterator vtt;
-       u_int32_t pid;
+       guint32 pid;
        
        tX_seqpar :: create_persistence_ids();
        
@@ -2200,7 +2202,7 @@ int  vtt_class :: load_all_11(FILE* input, char *fname)
        int16_t *newbuffer;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
-       u_int32_t pid;
+       guint32 pid;
        
        while (main_list.size())
        {
@@ -2257,7 +2259,7 @@ int  vtt_class :: load_all_12(FILE* input, char *fname)
        int16_t *newbuffer;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
-       u_int32_t pid;
+       guint32 pid;
        
        while (main_list.size())
        {
@@ -2313,7 +2315,7 @@ int  vtt_class :: load_all_13(FILE* input, char *fname)
        int16_t *newbuffer;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
-       u_int32_t pid;
+       guint32 pid;
        
        while (main_list.size())
        {
index 762c29b6e94513f21e3f4fdca4a28821cb864648..af9e4ef97e3525d5b0dd11f2f3000e2f5c5274b5 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "tX_vttfx.h"
 #include <stdio.h>
+#include <glib.h>
 #include "tX_vtt.h"
 #define myvtt ((vtt_class *) vtt)
 
@@ -75,7 +76,7 @@ void vtt_fx_lp :: run() { myvtt->render_lp(); }
 int vtt_fx_lp :: isEnabled() { return myvtt->lp_enable; }
 void vtt_fx_lp :: save (FILE *output)
 { 
-       u_int32_t type=TX_FX_BUILTINCUTOFF;
+       guint32 type=TX_FX_BUILTINCUTOFF;
        fwrite((void *) &type, sizeof(type), 1, output);
 }
 
@@ -92,7 +93,7 @@ void vtt_fx_ec :: run() { myvtt->render_ec(); }
 int vtt_fx_ec :: isEnabled() { return myvtt->ec_enable; }
 void vtt_fx_ec :: save (FILE *output)
 { 
-       u_int32_t type=TX_FX_BUILTINECHO;
+       guint32 type=TX_FX_BUILTINECHO;
        fwrite((void *) &type, sizeof(type), 1, output);
 }
 
@@ -287,10 +288,10 @@ void vtt_fx_ladspa :: save (FILE *output)
 {
        long ID=plugin->getUniqueID();
        list <tX_seqpar_vttfx *> :: iterator sp;
-       u_int32_t pid;
-       u_int32_t type=TX_FX_LADSPA;
-       u_int32_t count;
-       u_int8_t hidden;
+       guint32 pid;
+       guint32 type=TX_FX_LADSPA;
+       guint32 count;
+       guint8 hidden;
        float value;
        
        fwrite((void *) &type, sizeof(type), 1, output);
@@ -314,11 +315,11 @@ void vtt_fx_ladspa :: save (FILE *output)
 
 void vtt_fx_ladspa :: load (FILE *input)
 {
-       u_int32_t count;
+       guint32 count;
        int i;
        list <tX_seqpar_vttfx *> :: iterator sp;
-       u_int32_t pid;
-       u_int8_t hidden;
+       guint32 pid;
+       guint8 hidden;
        float value;
        
        fread((void *) &count, sizeof(count), 1, input);
index d3add5623fd5ade5db92fb576edd5b32a36e430a..0485289e7689e2d52fce8b073c10d18cded50be5 100644 (file)
@@ -89,7 +89,7 @@ void nicer_filename(char *dest, char *source)
 
 void name_changed(GtkWidget *wid, vtt_class *vtt)
 {
-       vtt->set_name(gtk_entry_get_text(GTK_ENTRY(wid)));
+       vtt->set_name((char *) gtk_entry_get_text(GTK_ENTRY(wid)));
 }
 
 void volume_changed(GtkWidget *wid, vtt_class *vtt)
@@ -113,7 +113,7 @@ GtkSignalFunc trigger_prelis(GtkWidget *w)
        
        fs=GTK_FILE_SELECTION(gtk_widget_get_toplevel(w));
        
-       prelis_start(gtk_file_selection_get_filename(GTK_FILE_SELECTION(fs)));
+       prelis_start((char *) gtk_file_selection_get_filename(GTK_FILE_SELECTION(fs)));
        return(0);
 }
 
@@ -183,7 +183,11 @@ void load_part(char *newfile, vtt_class *vtt)
        else
        {
                nicer_filename(global_filename_buffer, newfile);
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.file), global_filename_buffer);
+#else           
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
+#endif
        }       
 }
 
@@ -442,11 +446,19 @@ void vg_display_xcontrol(vtt_class *vtt)
                        buffer[36] = '.';
                        buffer[37] = 0;                 
                }
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.x_control), buffer);
+#else           
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.x_control)->child), buffer);                
+#endif  
        }
        else
        {
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.x_control), "Nothing");
+#else           
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.x_control)->child), "Nothing");
+#endif         
        }
 }
 
@@ -464,11 +476,19 @@ void vg_display_ycontrol(vtt_class *vtt)
                        buffer[26] = '.';
                        buffer[27] = 0;                 
                }
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.y_control), buffer);
+#else           
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.y_control)->child), buffer);                
+#endif  
        }
        else
        {
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.y_control), "Nothing");
+#else           
                gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.y_control)->child), "Nothing");
+#endif         
        }
 }
 
@@ -1070,13 +1090,21 @@ void gui_set_name(vtt_class *vtt, char *newname)
 
 void gui_set_filename (vtt_class *vtt, char *newname)
 {
-       gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), newname);
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.file), newname);
+#else           
+        gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), newname);
+#endif  
 }
 
 void gui_update_display(vtt_class *vtt)
 {
        nicer_filename(global_filename_buffer, vtt->filename);
-       gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
+#ifdef  USE_GTK2
+        gtk_button_set_label(GTK_BUTTON(vtt->gui.file), global_filename_buffer);
+#else           
+        gtk_label_set(GTK_LABEL(GTK_BUTTON(vtt->gui.file)->child), global_filename_buffer);
+#endif  
        gtk_tx_set_data(GTK_TX(vtt->gui.display), vtt->buffer, vtt->samples_in_buffer);
 }
 
index 47bcc77c991e1d05b8a7659aec7c42b163a5fbe3..ad672f037ff68291d68f2fc4ffa081c4f26f3b3a 100644 (file)
@@ -21,7 +21,7 @@
     Description: This contains the implementation of the tx_widget.
                 This file is based on the GTK+ widget example from
                 the GTK+ 1.2 tutorial.
-*/    
+*/
 
 #define FR_SIZE 3
 #define DBL_FR_SIZE 6
 
 #ifdef __cplusplus
 extern "C" {
-#endif /* __cplusplus */
+#endif                         /* __cplusplus */
 
 #define TX_DEFAULT_SIZE_X 100
 #define TX_DEFAULT_SIZE_Y 30
 
 /* pre dec */
-static void gtk_tx_class_init (GtkTxClass *);
-static void gtk_tx_init (GtkTx *tx);
-GtkWidget* gtk_tx_new (int16_t *wavdata, int wavsamples);
-static void gtk_tx_destroy (GtkObject *object);
-void gtk_tx_set_data(GtkTx *tx, int16_t *wavdata, int wavsamples);
-static void gtk_tx_realize (GtkWidget *widget);
-static void gtk_tx_size_request (GtkWidget *widget, GtkRequisition *requisition);
-static void gtk_tx_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
-static gint gtk_tx_expose (GtkWidget *widget, GdkEventExpose *event);
-static void gtk_tx_update (GtkTx *tx);
-static void gtk_tx_prepare (GtkWidget *widget);
+    static void gtk_tx_class_init(GtkTxClass *);
+    static void gtk_tx_init(GtkTx * tx);
+    GtkWidget *gtk_tx_new(int16_t * wavdata, int wavsamples);
+    static void gtk_tx_destroy(GtkObject * object);
+    void gtk_tx_set_data(GtkTx * tx, int16_t * wavdata, int wavsamples);
+    static void gtk_tx_realize(GtkWidget * widget);
+    static void gtk_tx_size_request(GtkWidget * widget,
+                                   GtkRequisition * requisition);
+    static void gtk_tx_size_allocate(GtkWidget * widget,
+                                    GtkAllocation * allocation);
+    static gint gtk_tx_expose(GtkWidget * widget, GdkEventExpose * event);
+    static void gtk_tx_update(GtkTx * tx);
+    static void gtk_tx_prepare(GtkWidget * widget);
 
 /* Local data */
 
-static GtkWidgetClass *parent_class = NULL;
-
-guint
-gtk_tx_get_type ()
-{
-  static guint tx_type = 0;
-
-  if (!tx_type)
-    {
-      GtkTypeInfo tx_info =
-      {
-       "GtkTx",
-       sizeof (GtkTx),
-       sizeof (GtkTxClass),
-       (GtkClassInitFunc) gtk_tx_class_init,
-       (GtkObjectInitFunc) gtk_tx_init,
-       (GtkArgSetFunc) NULL,
-       (GtkArgGetFunc) NULL,
-      };
-
-      tx_type = gtk_type_unique (gtk_widget_get_type (), &tx_info);
-    }
+    static GtkWidgetClass *parent_class = NULL;
 
-  return tx_type;
-}
+     guint gtk_tx_get_type() {
+       static guint tx_type = 0;
+
+       if (!tx_type) {
+           GtkTypeInfo tx_info = {
+               "GtkTx",
+               sizeof(GtkTx),
+               sizeof(GtkTxClass),
+               (GtkClassInitFunc) gtk_tx_class_init,
+               (GtkObjectInitFunc) gtk_tx_init,
+               /* reserved */ NULL,
+               /* reserved */ NULL,
+               /* reserved */ NULL
+           };
+
+            tx_type = gtk_type_unique(gtk_widget_get_type(), &tx_info);
+       }
 
-static void
-gtk_tx_class_init (GtkTxClass *gclass)
-{
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
+       return tx_type;
+    }
+
+    static void
+     gtk_tx_class_init(GtkTxClass * gclass) {
+       GtkObjectClass *object_class;
+       GtkWidgetClass *widget_class;
 
-  object_class = (GtkObjectClass*) gclass;
-  widget_class = (GtkWidgetClass*) gclass;
+       object_class = (GtkObjectClass *) gclass;
+       widget_class = (GtkWidgetClass *) gclass;
 
-  parent_class = gtk_type_class (gtk_widget_get_type ());
+       parent_class = gtk_type_class(gtk_widget_get_type());
 
-  object_class->destroy = gtk_tx_destroy;
+       object_class->destroy = gtk_tx_destroy;
 
-  widget_class->realize = gtk_tx_realize;
-  widget_class->expose_event = gtk_tx_expose;
-  widget_class->size_request = gtk_tx_size_request;
-  widget_class->size_allocate = gtk_tx_size_allocate;
+       widget_class->realize = gtk_tx_realize;
+       widget_class->expose_event = gtk_tx_expose;
+       widget_class->size_request = gtk_tx_size_request;
+       widget_class->size_allocate = gtk_tx_size_allocate;
 //  widget_class->button_press_event = gtk_tx_button_press;
 //  widget_class->button_release_event = gtk_tx_button_release;
 //  widget_class->motion_notify_event = gtk_tx_motion_notify;
-}
+    }
 
-void gtk_tx_mk_col(GtkTx *tx, GdkColor *col, float r, float g, float b)
-{
-       float max=65535.0;
-       
-       col->red=(gint) (r*max);
-       col->green=(gint) (g*max);
-       col->blue=(gint) (b*max);
-//     printf("r: %8i, g: %8i, b: %8i\n", col->red, col->green, col->blue);
-       gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET(tx)), col, 1, 1);         
-}
+    void gtk_tx_mk_col(GtkTx * tx, GdkColor * col, float r, float g,
+                      float b) {
+       float max = 65535.0;
 
-static void
-gtk_tx_init (GtkTx *tx)
-{
+       col->red = (gint) (r * max);
+       col->green = (gint) (g * max);
+       col->blue = (gint) (b * max);
+//      printf("r: %8i, g: %8i, b: %8i\n", col->red, col->green, col->blue);
+       gdk_colormap_alloc_color(gtk_widget_get_colormap(GTK_WIDGET(tx)),
+                                col, 1, 1);
+    }
+
+    static void
+     gtk_tx_init(GtkTx * tx) {
        GdkColormap *priv;
-               
-       tx->disp_data=NULL;
-       
-       tx->data=NULL;
-       tx->samples=0;
-       
-       tx->do_showframe=0;
-       
-       priv=gdk_colormap_new(gtk_widget_get_visual(GTK_WIDGET(tx)), 6);
+
+       tx->disp_data = NULL;
+
+       tx->data = NULL;
+       tx->samples = 0;
+
+       tx->do_showframe = 0;
+
+       priv = gdk_colormap_new(gtk_widget_get_visual(GTK_WIDGET(tx)), 6);
        gtk_widget_set_colormap(GTK_WIDGET(tx), priv);
 
        gtk_tx_mk_col(tx, &tx->bg, 0, 0, 0);
 
-       gtk_tx_mk_col(tx, &tx->fg, 0, 1, 0);    
+       gtk_tx_mk_col(tx, &tx->fg, 0, 1, 0);
 
        gtk_tx_mk_col(tx, &tx->busy_fg, 1, 1, 1);
        gtk_tx_mk_col(tx, &tx->busy_bg, 1, 0.4, 0.4);
 
        gtk_tx_mk_col(tx, &tx->mute_fg, 0, 1, 1);
-       gtk_tx_mk_col(tx, &tx->mute_bg, 0, 0, 1);       
-       gtk_tx_mk_col(tx, &tx->framecol, 1,0,0);
-}
+       gtk_tx_mk_col(tx, &tx->mute_bg, 0, 0, 1);
+       gtk_tx_mk_col(tx, &tx->framecol, 1, 0, 0);
+    }
+
+    GtkWidget *gtk_tx_new(int16_t * wavdata, int wavsamples) {
+       GtkTx *tx;
 
-GtkWidget*
-gtk_tx_new (int16_t *wavdata, int wavsamples)
-{
-  GtkTx *tx;
+       tx = gtk_type_new(gtk_tx_get_type());
 
-  tx = gtk_type_new (gtk_tx_get_type ());
+       tx->data = wavdata;
+       tx->samples = wavsamples;
 
-  tx->data=wavdata;
-  tx->samples=wavsamples;
+//  gtk_tx_prepare(GTK_WIDGET(tx));     
 
-//  gtk_tx_prepare(GTK_WIDGET(tx));    
+       return GTK_WIDGET(tx);
+    }
 
-  return GTK_WIDGET (tx);
-}
+    static void
+     gtk_tx_destroy(GtkObject * object) {
+       g_return_if_fail(object != NULL);
+       g_return_if_fail(GTK_IS_TX(object));
 
-static void
-gtk_tx_destroy (GtkObject *object)
-{
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_TX (object));
+       if (GTK_OBJECT_CLASS(parent_class)->destroy)
+           (*GTK_OBJECT_CLASS(parent_class)->destroy) (object);
+    }
 
-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
-}
 
+    void gtk_tx_set_data(GtkTx * tx, int16_t * wavdata, int wavsamples) {
+       g_return_if_fail(tx != NULL);
+       g_return_if_fail(GTK_IS_TX(tx));
 
-void gtk_tx_set_data(GtkTx *tx, int16_t *wavdata, int wavsamples)
-{
-       g_return_if_fail (tx != NULL);
-       g_return_if_fail (GTK_IS_TX (tx));
-       
-       tx->data=wavdata;
-       tx->samples=wavsamples;
-       
-       gtk_tx_prepare(GTK_WIDGET(tx));         
+       tx->data = wavdata;
+       tx->samples = wavsamples;
+
+       gtk_tx_prepare(GTK_WIDGET(tx));
        gtk_tx_update(tx);
-}
+    }
 
-static void
-gtk_tx_realize (GtkWidget *widget)
-{
-  GtkTx *tx;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
+    static void
+     gtk_tx_realize(GtkWidget * widget) {
+       GtkTx *tx;
+       GdkWindowAttr attributes;
+       gint attributes_mask;
 
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX (widget));
+       g_return_if_fail(widget != NULL);
+       g_return_if_fail(GTK_IS_TX(widget));
 
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-  tx = GTK_TX (widget);
+       GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
+       tx = GTK_TX(widget);
 
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (widget) | 
-    GDK_EXPOSURE_MASK;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.colormap = gtk_widget_get_colormap (widget);
-  
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+       attributes.x = widget->allocation.x;
+       attributes.y = widget->allocation.y;
+       attributes.width = widget->allocation.width;
+       attributes.height = widget->allocation.height;
+       attributes.wclass = GDK_INPUT_OUTPUT;
+       attributes.window_type = GDK_WINDOW_CHILD;
+       attributes.event_mask = gtk_widget_get_events(widget) |
+           GDK_EXPOSURE_MASK;
+       attributes.visual = gtk_widget_get_visual(widget);
+       attributes.colormap = gtk_widget_get_colormap(widget);
 
-  widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
+       attributes_mask =
+           GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
-  widget->style = gtk_style_attach (widget->style, widget->window);
+       widget->window =
+           gdk_window_new(widget->parent->window, &attributes,
+                          attributes_mask);
 
-  gdk_window_set_user_data (widget->window, widget);
+       widget->style = gtk_style_attach(widget->style, widget->window);
 
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-}
+       gdk_window_set_user_data(widget->window, widget);
 
-static void 
-gtk_tx_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
+       gtk_style_set_background(widget->style, widget->window,
+                                GTK_STATE_NORMAL);
+    }
+
+    static void
+     gtk_tx_size_request(GtkWidget * widget, GtkRequisition * requisition) {
        requisition->width = TX_DEFAULT_SIZE_X;
        requisition->height = TX_DEFAULT_SIZE_Y;
-}
+    }
 
-static void
-gtk_tx_prepare (GtkWidget *widget)
-{
+    static void
+     gtk_tx_prepare(GtkWidget * widget) {
        int x, sample;
        f_prec temp;
        int16_t *ptr;
        int16_t value;
-               
+
        GtkTx *tx;
 
-       g_return_if_fail (widget != NULL);
-       g_return_if_fail (GTK_IS_TX (widget));
-       
-       tx=GTK_TX(widget);
-       
-       tx->spp=tx->samples/(widget->allocation.width-DBL_FR_SIZE);
-       tx->yc=widget->allocation.height/2;
-       
-       if (tx->disp_data) free (tx->disp_data);
-       
-       if (tx->data)
-       {
-
-       tx->disp_data =(int16_t*) malloc((widget->allocation.width-DBL_FR_SIZE) * sizeof(int16_t));
+       g_return_if_fail(widget != NULL);
+       g_return_if_fail(GTK_IS_TX(widget));
+
+       tx = GTK_TX(widget);
+
+       tx->spp = tx->samples / (widget->allocation.width - DBL_FR_SIZE);
+       tx->yc = widget->allocation.height / 2;
 
        if (tx->disp_data)
-       for (x=0, ptr=tx->disp_data; x< widget->allocation.width-DBL_FR_SIZE; ptr++,x++)
-       {
-               value=tx->data[x*tx->spp];
-               for (sample=x*tx->spp; sample<(x+1)*tx->spp; sample++)
-               {
-                       value=(value+tx->data[sample])/2;
+           free(tx->disp_data);
+
+       if (tx->data) {
+
+           tx->disp_data =
+               (int16_t *) malloc((widget->allocation.width - DBL_FR_SIZE)
+                                  * sizeof(int16_t));
+
+           if (tx->disp_data)
+               for (x = 0, ptr = tx->disp_data;
+                    x < widget->allocation.width - DBL_FR_SIZE;
+                    ptr++, x++) {
+                   value = tx->data[x * tx->spp];
+                   for (sample = x * tx->spp; sample < (x + 1) * tx->spp;
+                        sample++) {
+                       value = (value + tx->data[sample]) / 2;
+                   }
+                   temp = ((f_prec) value) / 32767.0;
+                   tx->disp_data[x] =
+                       (int) (temp * (f_prec) (tx->yc - FR_SIZE));
                }
-               temp=((f_prec) value)/32767.0;
-               tx->disp_data[x]=(int) (temp * (f_prec) (tx->yc-FR_SIZE));
-       }
-       
-       }       
-       else tx->disp_data = NULL;
-}
 
-static void
-gtk_tx_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
-{
-  GtkTx *tx;
+       } else
+           tx->disp_data = NULL;
+    }
+
+    static void
+     gtk_tx_size_allocate(GtkWidget * widget, GtkAllocation * allocation) {
+       GtkTx *tx;
 
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX (widget));
-  g_return_if_fail (allocation != NULL);
+       g_return_if_fail(widget != NULL);
+       g_return_if_fail(GTK_IS_TX(widget));
+       g_return_if_fail(allocation != NULL);
 
-  widget->allocation = *allocation;
+       widget->allocation = *allocation;
 
-  gtk_tx_prepare(widget);
+       gtk_tx_prepare(widget);
 
-  if (GTK_WIDGET_REALIZED (widget))
-    {
-      tx = GTK_TX (widget);
+       if (GTK_WIDGET_REALIZED(widget)) {
+           tx = GTK_TX(widget);
 
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width, allocation->height);
+           gdk_window_move_resize(widget->window,
+                                  allocation->x, allocation->y,
+                                  allocation->width, allocation->height);
 
+       }
     }
-}
 
-static gint gtk_tx_expose (GtkWidget *widget, GdkEventExpose *event)
-{
-  GtkTx *tx;
-  gint x, pos;
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  if (event->count > 0)
-    return FALSE;
-  
-  tx = GTK_TX (widget);
-
-  gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx->bg);
-  
-  gdk_draw_rectangle(widget->window, widget->style->fg_gc[widget->state], 1, 0, 0, widget->allocation.width,widget->allocation.height); 
-
-  gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx->fg);
-
-  if (tx->disp_data)
-  {
-       for (x=FR_SIZE, pos=0; x< widget->allocation.width-FR_SIZE; x++, pos++)
-       {
-               gdk_draw_line (widget->window,
-                    widget->style->fg_gc[widget->state],
-                    x,
-                    tx->yc-tx->disp_data[pos],
-                    x,
-                    tx->yc+tx->disp_data[pos]);
-       }       
-  }
-  else
-  {
-  gdk_draw_line (widget->window,
-                    widget->style->fg_gc[widget->state],
-                    FR_SIZE,
-                    tx->yc,
-                    widget->allocation.width-FR_SIZE,
-                    tx->yc);
-  }
-  
-  gtk_tx_show_frame(tx, tx->do_showframe);
-  return FALSE;
-}
+    static gint gtk_tx_expose(GtkWidget * widget, GdkEventExpose * event) {
+       GtkTx *tx;
+       gint x, pos;
+
+       g_return_val_if_fail(widget != NULL, FALSE);
+       g_return_val_if_fail(GTK_IS_TX(widget), FALSE);
+       g_return_val_if_fail(event != NULL, FALSE);
+
+       if (event->count > 0)
+           return FALSE;
+
+       tx = GTK_TX(widget);
+
+       gdk_gc_set_foreground(widget->style->fg_gc[widget->state],
+                             &tx->bg);
+
+       gdk_draw_rectangle(widget->window,
+                          widget->style->fg_gc[widget->state], 1, 0, 0,
+                          widget->allocation.width,
+                          widget->allocation.height);
+
+       gdk_gc_set_foreground(widget->style->fg_gc[widget->state],
+                             &tx->fg);
+
+       if (tx->disp_data) {
+           for (x = FR_SIZE, pos = 0;
+                x < widget->allocation.width - FR_SIZE; x++, pos++) {
+               gdk_draw_line(widget->window,
+                             widget->style->fg_gc[widget->state], x,
+                             tx->yc - tx->disp_data[pos], x,
+                             tx->yc + tx->disp_data[pos]);
+           }
+       } else {
+           gdk_draw_line(widget->window,
+                         widget->style->fg_gc[widget->state],
+                         FR_SIZE,
+                         tx->yc,
+                         widget->allocation.width - FR_SIZE, tx->yc);
+       }
 
-static void
-gtk_tx_update (GtkTx *tx)
-{
-  g_return_if_fail (tx != NULL);
-  g_return_if_fail (GTK_IS_TX (tx));
+       gtk_tx_show_frame(tx, tx->do_showframe);
+       return FALSE;
+    }
 
-  gtk_widget_draw (GTK_WIDGET(tx), NULL);
-}
+    static void
+     gtk_tx_update(GtkTx * tx) {
+       g_return_if_fail(tx != NULL);
+       g_return_if_fail(GTK_IS_TX(tx));
 
-void
-gtk_tx_prepare_pos_display(GtkTx *tx)
-{
-       tx->lastpos=-1;
-}
+       gtk_widget_draw(GTK_WIDGET(tx), NULL);
+    }
 
-void
-gtk_tx_update_pos_display(GtkTx *tx, int sample, int mute)
-{
+    void
+     gtk_tx_prepare_pos_display(GtkTx * tx) {
+       tx->lastpos = -1;
+    }
+
+    void
+     gtk_tx_update_pos_display(GtkTx * tx, int sample, int mute) {
        GtkWidget *widget;
        GdkWindow *window;
        GdkGC *gc;
-//     GdkColor *fg;
-//     GdkColor *bg;
+//      GdkColor *fg;
+//      GdkColor *bg;
 
        int current_x, x, y, yc, ymax;
 
        /* Don't update if not required */
 
-       current_x=sample/tx->spp+FR_SIZE;
-       
-       if ((current_x==tx->lastpos) && (tx->lastmute==mute))return;
-       tx->lastmute=mute;
+       current_x = sample / tx->spp + FR_SIZE;
+
+       if ((current_x == tx->lastpos) && (tx->lastmute == mute))
+           return;
+       tx->lastmute = mute;
 
        /* speedup + easyness */
 
        widget = GTK_WIDGET(tx);
        window = widget->window;
-       
-       if (current_x>widget->allocation.width-FR_SIZE-2) return;
-       
+
+       if (current_x > widget->allocation.width - FR_SIZE - 2)
+           return;
+
        gc = widget->style->fg_gc[widget->state];
        yc = tx->yc;
-       ymax=widget->allocation.height-FR_SIZE-1;
-       
+       ymax = widget->allocation.height - FR_SIZE - 1;
+
        /* Clean up last pos */
-       
-       x=tx->lastpos;
-
-       if (x>=0)
-       {       
-               gdk_gc_set_foreground(gc, &tx->bg);
-               gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);  
-       
-               gdk_gc_set_foreground(gc, &tx->fg);
-               y=tx->disp_data[x-FR_SIZE];
-               gdk_draw_line(window, gc, x, yc+y, x, yc-y);            
+
+       x = tx->lastpos;
+
+       if (x >= 0) {
+           gdk_gc_set_foreground(gc, &tx->bg);
+           gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);
+
+           gdk_gc_set_foreground(gc, &tx->fg);
+           y = tx->disp_data[x - FR_SIZE];
+           gdk_draw_line(window, gc, x, yc + y, x, yc - y);
        }
        /* store current_pos */
-               
-       tx->lastpos=current_x;
+
+       tx->lastpos = current_x;
 
        /* draw current_pos */
 
-       x=current_x;
+       x = current_x;
 
-       if (mute) gdk_gc_set_foreground(gc, &tx->mute_bg);
-       else gdk_gc_set_foreground(gc, &tx->busy_bg);
-       
-       gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);  
-}
+       if (mute)
+           gdk_gc_set_foreground(gc, &tx->mute_bg);
+       else
+           gdk_gc_set_foreground(gc, &tx->busy_bg);
 
-void gtk_tx_cleanup_pos_display(GtkTx *tx)
-{
+       gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);
+    }
+
+    void gtk_tx_cleanup_pos_display(GtkTx * tx) {
        GtkWidget *widget;
        GdkWindow *window;
        GdkGC *gc;
@@ -418,23 +412,21 @@ void gtk_tx_cleanup_pos_display(GtkTx *tx)
        window = widget->window;
        gc = widget->style->fg_gc[widget->state];
        yc = tx->yc;
-       ymax=widget->allocation.height-FR_SIZE-1;
-                               
-       x=tx->lastpos;
-
-       if (x>=0)
-       {       
-               gdk_gc_set_foreground(gc, &tx->bg);
-               gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);  
-       
-               gdk_gc_set_foreground(gc, &tx->fg);
-               y=tx->disp_data[x-FR_SIZE];
-               gdk_draw_line(window, gc, x, yc+y, x, yc-y);            
+       ymax = widget->allocation.height - FR_SIZE - 1;
+
+       x = tx->lastpos;
+
+       if (x >= 0) {
+           gdk_gc_set_foreground(gc, &tx->bg);
+           gdk_draw_line(window, gc, x, FR_SIZE, x, ymax);
+
+           gdk_gc_set_foreground(gc, &tx->fg);
+           y = tx->disp_data[x - FR_SIZE];
+           gdk_draw_line(window, gc, x, yc + y, x, yc - y);
        }
-}
+    }
 
-void gtk_tx_show_frame(GtkTx *tx, int show)
-{
+    void gtk_tx_show_frame(GtkTx * tx, int show) {
        GtkWidget *widget;
        GdkWindow *window;
        GdkGC *gc;
@@ -443,25 +435,23 @@ void gtk_tx_show_frame(GtkTx *tx, int show)
        widget = GTK_WIDGET(tx);
        window = widget->window;
        gc = widget->style->fg_gc[widget->state];
-       
 
-       tx->do_showframe=show;
 
-       if (show)
-       {
-               gdk_gc_set_foreground(gc, &tx->framecol);
-       }
-       else
-       {
-               gdk_gc_set_foreground(gc, &tx->bg);
+       tx->do_showframe = show;
+
+       if (show) {
+           gdk_gc_set_foreground(gc, &tx->framecol);
+       } else {
+           gdk_gc_set_foreground(gc, &tx->bg);
        }
-       
-       for (i=0; i<FR_SIZE; i++)
-       {
-               gdk_draw_rectangle(window, gc, 0, i, i, widget->allocation.width-(2*i+1), widget->allocation.height-(2*i+1));
+
+       for (i = 0; i < FR_SIZE; i++) {
+           gdk_draw_rectangle(window, gc, 0, i, i,
+                              widget->allocation.width - (2 * i + 1),
+                              widget->allocation.height - (2 * i + 1));
        }
-}
+    }
 
 #ifdef __cplusplus
 }
-#endif /* __cplusplus */
+#endif                         /* __cplusplus */
diff --git a/terminatorX.1.in b/terminatorX.1.in
new file mode 100644 (file)
index 0000000..1668ede
--- /dev/null
@@ -0,0 +1,34 @@
+.TH terminatorX "1" "May 2002" "terminatorX @VERSION@" "User Commands"
+.SH NAME
+terminatorX \- Realtime Audio Synthesizer
+.SH SYNOPSIS
+.B terminatorX
+[\fIoptions\fR]
+.SH DESCRIPTION
+terminatorX is a realtime audio synthesizer that allows you to "scratch" on
+digitally sampled audio data (*.wav, *.au, *.mp3, etc.) the way hiphop-DJs
+scratch on vinyl records. It features multiple turntables, realtime effects
+(buit-in as well as LADSPA plugin effects), a sequencer and an easy-to-use
+gtk+ GUI.
+.SS "Options:"
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display help info
+.TP
+\fB\-f\fR, \fB\-\-file\fR
+Load saved terminatorX set file
+.TP
+\fB\-r\fR, \fB\-\-rc-file [file]\fR
+Load alternate rc file
+.TP
+\fB\-d\fR, \fB\-\-dont-save\fR
+Do not save settings at exit
+.TP
+\fB\-s\fR, \fB\-\-std-out\fR
+Use stdout for sound output
+.TP
+\fB\-\-device=[output device]\fR
+Use alternate device for sound output
+.SH AUTHOR
+This manual page was created by Adrian Reber <adrian@lisas.de>. The software itself was created by
+Alexander Koenig <alex@lisas.de>.