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.
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
/* Don't use movqfix */
#undef OVERRIDE_MOVQ_AUTODETECT
+
+/* use the newer gtk+ toolkit */
+#undef USE_GTK2
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
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
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
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)
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)
--- /dev/null
+SOURCES = changelog \
+ control \
+ copyright \
+ dirs \
+ docs \
+ files \
+ rules \
+ substvars \
+ terminatorx.menu
+
+
+clean-local:
+ rm -rf tmp
+
+CLEANFILES = postinst.debhelper postrm.debhelper
+
--- /dev/null
+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
+
--- /dev/null
+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.
--- /dev/null
+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
+
--- /dev/null
+terminatorx_3.72-1_sparc.deb sound optional
--- /dev/null
+#!/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
--- /dev/null
+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)
--- /dev/null
+?package(terminatorx):needs=X11 icon="/usr/share/pixmaps/terminatorX-app.xpm" section="Apps/Sound" \
+ title="terminatorX" command="/usr/bin/terminatorX"
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
+
--- /dev/null
+[Desktop Entry]
+Name=terminatorX
+Type=Application
+Comment=sophisticated scratching and audio tool
+Exec=terminatorX
+Icon=terminatorX-app.xpm
+
--- /dev/null
+application/x-terminatorX:
+ open=terminatorX %f
+ view=terminatorX %f
+ edit=terminatorX %f
+ icon-filename=@prefix@/share/pixmaps/terminatorX-mime.xpm
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);
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);
}
void tX_audiodevice_alsa :: play(int16_t *buffer)
{
#ifdef BIG_ENDIAN_MACHINE
- swapbuffer (buffer, samples);
+ swapbuffer (buffer, samples_per_buffer);
#endif
/***/
}
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)
{
#define TX_FILE_MPG123 2
#define TX_FILE_OGG123 3
-#include <linux/limits.h>
+#include <limits.h>
#include "tX_types.h"
#include <stdio.h>
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);
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;
}
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()
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);
#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;
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; }
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)
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)
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);
if (fn) ld_destroy();
mg_update_status();
+ return NULL;
}
GtkSignalFunc drop_new_table(GtkWidget *widget, GdkDragContext *context,
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)
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;
}
void sequencer_move(GtkWidget *wid, void *d)
{
- u_int32_t pos;
+ guint32 pos;
if (seq_adj_care)
{
#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
#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>
float tX_seqpar :: get_value()
{
printf("Ooops. tX_seqpar::get_value() called. Trouble.");
+ return 0.0;
}
void tX_seqpar :: do_exec(const float value)
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
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()
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()
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();
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);
{
}
-void tX_sequencer :: set_timestamp(u_int32_t timestamp)
+void tX_sequencer :: set_timestamp(guint32 timestamp)
{
current_timestamp=0;
start_timestamp=0;
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();
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();
}
-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;
#include <list>
#include <pthread.h>
+#include <glib.h>
#include "tX_event.h"
#include "tX_seqpar.h"
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;
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();
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);
};
#include <math.h>
#include "tX_mastergui.h"
#include "tX_sequencer.h"
+#include <glib.h>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
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);
int vtt_class :: load_11(FILE * input)
{
int res=0;
- u_int32_t pid;
+ guint32 pid;
int32_t gui_page;
atload(name);
int vtt_class :: load_12(FILE * input)
{
int res=0;
- u_int32_t pid;
+ guint32 pid;
int32_t counter;
int32_t type;
long id;
LADSPA_Plugin *plugin;
char buffer[256];
vtt_fx_ladspa *ladspa_effect;
- u_int8_t hidden;
+ guint8 hidden;
atload(buffer);
this->set_name(buffer);
int vtt_class :: load_13(FILE * input)
{
int res=0;
- u_int32_t pid;
+ guint32 pid;
int32_t counter;
int32_t type;
long id;
LADSPA_Plugin *plugin;
char buffer[256];
vtt_fx_ladspa *ladspa_effect;
- u_int8_t hidden;
+ guint8 hidden;
atload(buffer);
this->set_name(buffer);
{
int res=0;
list <vtt_class *> :: iterator vtt;
- u_int32_t pid;
+ guint32 pid;
tX_seqpar :: create_persistence_ids();
int16_t *newbuffer;
vtt_class *newvtt;
char ftmp[PATH_MAX];
- u_int32_t pid;
+ guint32 pid;
while (main_list.size())
{
int16_t *newbuffer;
vtt_class *newvtt;
char ftmp[PATH_MAX];
- u_int32_t pid;
+ guint32 pid;
while (main_list.size())
{
int16_t *newbuffer;
vtt_class *newvtt;
char ftmp[PATH_MAX];
- u_int32_t pid;
+ guint32 pid;
while (main_list.size())
{
#include "tX_vttfx.h"
#include <stdio.h>
+#include <glib.h>
#include "tX_vtt.h"
#define myvtt ((vtt_class *) vtt)
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);
}
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);
}
{
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);
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);
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)
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);
}
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
}
}
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
}
}
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
}
}
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);
}
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;
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;
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 */
--- /dev/null
+.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>.