audiofile support + improved sample rate support + results of a -Wall -Werr
authorterminatorX <>
Sat, 14 Sep 2002 16:19:03 +0000 (16:19 +0000)
committerterminatorX <>
Sat, 14 Sep 2002 16:19:03 +0000 (16:19 +0000)
session - Alex

25 files changed:
acconfig.h
configure.in
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_engine.cc
src/tX_flash.c
src/tX_flash.h
src/tX_global.c
src/tX_global.h
src/tX_ladspa.cc
src/tX_loaddlg.cc
src/tX_mastergui.cc
src/tX_mouse.cc
src/tX_prelis.cc
src/tX_seqpar.cc
src/tX_seqpar.h
src/tX_vtt.cc
src/tX_vtt.h
src/tX_vttfx.cc
src/tX_vttgui.cc
src/wav_write.c

index 16ad248b0f0377db938522daea8762f31df07db0..8e95b84360c9d79ff266e9b89ad63d3c526d7348 100644 (file)
@@ -48,6 +48,9 @@
 /* Use libvorbis for ogg support */
 #undef USE_VORBIS_INPUT
 
+/* Use libaudiofile support */
+#undef USE_AUDIOFILE_INPUT
+
 /* Use ALSA*/
 #undef USE_ALSA
 
index 51068a2e5ad690a57d4d4d53abc334e69cf59d37..0defc786ca20e89734357d6c35daa50a545a0909 100644 (file)
@@ -8,7 +8,7 @@ AC_ARG_ENABLE(sox, [  --enable-sox            use sox as input converter. (defau
 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) ])
+dnl 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) ])
@@ -22,8 +22,9 @@ dnl AC_ARG_ENABLE(dial,         [  --enable-dial           use dials instead of
 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(libxml2,     [  --disable-libxml2       use libxml even if verion 2 detected (default=auto) ])
-AC_ARG_ENABLE(libmad,          [  --disable-mad           disable mad for mp3 support (default=auto) ])
-AC_ARG_ENABLE(libvorbis,       [  --disable-vorbis        disable libvorbis support (default=auto) ])
+AC_ARG_ENABLE(mad,             [  --disable-mad           disable mad for mp3 support (default=auto) ])
+AC_ARG_ENABLE(vorbis,  [  --disable-vorbis        disable libvorbis support (default=auto) ])
+AC_ARG_ENABLE(audiofile,       [  --disable-audiofile     disable audiofile support (default=auto) ])
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -33,6 +34,16 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_RANLIB
 
+OPTION_SOX="no"
+OPTION_MPG123="no"
+OPTION_MAD="no"
+OPTION_OGG123="no"
+OPTION_VORBIS="no"
+OPTION_AUDIOFILE="no"
+OPTION_WAV="no"
+OPTION_GTK_VERSION="none"
+OPTION_GNOME="no"
+
 dnl Checks for libraries.
 AC_CHECK_LIB(m, floor,, AC_MSG_ERROR([** math-lib not installed or broken **]))
 
@@ -107,6 +118,7 @@ if test "$enable_gtk2" != "no"; then
          GTK2_LIBS="$GTK_LIBS"
          gtk2="yes"
          GTK2_VERSION="`$PKG_CONFIG --modversion gtk+-2.0`"], [ gtk2="no" ]) 
+         OPTION_GTK_VERSION="Version 2 - ($GTK2_VERSION)"
 fi
 
 if test "$gtk2" = "no"; then
@@ -115,6 +127,7 @@ if test "$gtk2" = "no"; then
          GTK12_LIBS="$GTK_LIBS"
          gtk12="yes"
          GTK12_VERSION="`$GTK_CONFIG $gtk_config_args --version`"], [ gtk12="no" ])
+         OPTION_GTK_VERSION="Version 1.2 - ($GTK12_VERSION)"     
 fi
 
 if test "$gtk2" = "yes"; then
@@ -175,6 +188,7 @@ if test "$enable_sox" != "no"; then
        AC_CHECK_PROG(SOX_PROG, sox, yes)
        if test "$SOX_PROG" = "yes"; then
                AC_DEFINE(USE_SOX_INPUT)
+               OPTION_SOX="yes"
        fi
 fi
 
@@ -185,6 +199,7 @@ if test "$enable_mad" != "no"; then
                if test "$madlib" = "yes"; then
                        LIBS="$LIBS -lmad"
                        AC_DEFINE(USE_MAD_INPUT)
+                       OPTION_MAD="yes"
                fi
        fi
 fi
@@ -200,6 +215,7 @@ if test "$enable_vorbis" != "no"; then
                        if test "$vorbisfile_libs" = "yes"; then
                                LIBS="$LIBS -lvorbisfile"
                                AC_DEFINE(USE_VORBIS_INPUT)
+                               OPTION_VORBIS="yes"
                        else
                                LIBS=PREV_LIBS
                        fi
@@ -207,15 +223,41 @@ if test "$enable_vorbis" != "no"; then
        fi
 fi
 
+if test "$enable_audiofile" != "no"; then
+       AC_CHECK_PROG(af_config,audiofile-config,yes,no)
+       if test "$af_config" = "yes"; then
+               af_cflags=`audiofile-config --cflags`
+               if test "$af_cflags" != ""; then
+                       CFLAGS="$CFLAGS $af_cflags"
+               fi
+               af_libs=`audiofile-config --libs`
+               LIBS="$LIBS $af_libs"
+               AC_DEFINE(USE_AUDIOFILE_INPUT)
+               OPTION_AUDIOFILE="yes"
+       else
+               AC_CHECK_HEADERS(audiofile.h,audiofile_headers=yes,audiofile_headers=no)
+               if test "$audiofile_headers" = "yes"; then
+                       AC_CHECK_LIB(audiofile,afOpenFile,audiofile_libs=yes,audiofile_libs=no)
+                       if test "$audiofile_libs" = "yes"; then
+                               LIBS="$LIBS -laudiofile"
+                               AC_DEFINE(USE_AUDIOFILE_INPUT)
+                               OPTION_AUDIOFILE="yes"
+                       fi
+               fi
+       fi
+fi
+
 if test "$enable_mpg123" != "no"; then
        AC_CHECK_PROG(MPG123_PROG, mpg123, yes)
        if test "$MPG123_PROG" = "yes"; then
                if test "$SOX_PROG" = "yes"; then       
                        AC_DEFINE(USE_MPG123_INPUT)
+                       OPTION_MPG123="yes"
                else
                        AC_CHECK_PROG(SOX_PROG, sox, yes)
                        if test "$SOX_PROG" = "yes"; then       
                                AC_DEFINE(USE_MPG123_INPUT)
+                               OPTION_MPG123="yes"
                        else
                                AC_MSG_RESULT([** mpg123 support disabled: couldn't find sox! **])
                        fi
@@ -227,6 +269,7 @@ if test "$enable_ogg123" != "no"; then
        AC_CHECK_PROG(OGG123_PROG, ogg123, yes)
        if test "$OGG123_PROG" = "yes"; then
                AC_DEFINE(USE_OGG123_INPUT)
+               OPTION_OGG123="yes"
        fi
 fi
 
@@ -298,6 +341,7 @@ fi
 if test "$enable_wav" != "no";
 then
        AC_DEFINE(USE_BUILTIN_WAV)
+       OPTION_WAV="yes"
 fi
 
 if test "$enable_flash" = "no"; then
@@ -353,6 +397,7 @@ AC_MSG_CHECKING(for GNOME)
                AC_SUBST(gnomedatadir)
                AM_CONDITIONAL(GNOMEpresent, test "$gnomepresent" = yes)
                AC_MSG_RESULT([Found GNOME - installing terminatorX.desktop.])
+               OPTION_GNOME="yes"
        else
                AC_MSG_RESULT([GNOME not found.])
        fi
@@ -427,3 +472,19 @@ 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 gnome-support/terminatorX.keys src/gui_icons/Makefile src/smallknob/Makefile doc/Makefile doc/img/Makefile terminatorX.spec terminatorX.1)
+
+echo
+echo configured terminatorX for:
+echo ---------------------------
+echo
+echo "sox support:             $OPTION_SOX"
+echo "mpg123 support:          $OPTION_MPG123"
+echo "mad support:             $OPTION_MAD"
+echo "ogg123 support:          $OPTION_OGG123"
+echo "vorbis support:          $OPTION_VORBIS"
+echo "audiofile support:       $OPTION_AUDIOFILE"
+echo "builtin-wav support:     $OPTION_WAV"
+echo "gtk+ Version:            $OPTION_GTK_VERSION"
+echo "GNOME support:           $OPTION_GNOME"
+echo
+echo You can now run \'make\' to compile terminatorX
index 11f11cf5e2508a8f0ce6c03a14a37d73b7adec65..507e20e4c122f858902e0fcc4618335b2cefd953 100644 (file)
@@ -363,8 +363,6 @@ int parse_args(int *argc, char **argv)
 
 int main(int argc, char **argv)
 {
-       FILE *gtk_rc_file;
-       
        fprintf(stderr, "%s - Copyright (C) 1999-2002 by Alexander K├Ânig\n", VERSIONSTRING);
        fprintf(stderr, "terminatorX comes with ABSOLUTELY NO WARRANTY - for details read the license.\n");
 
index a180ea651060baae85dfa5c411bedb341a7a9d70..8e6bc17ced657f52072cb9976f8077dcee492886 100644 (file)
@@ -132,8 +132,6 @@ int tX_audiodevice_oss :: open()
 
 int tX_audiodevice_oss :: close()
 {
-       void *dummy;
-
        if (!fd)
        {       
                return(1);              
index 00a60eb14dbf3c5130d7af268ec351f1187035b1..7a4072c22b5c6e9ef0773ca75c9f0fc2f3d612e6 100644 (file)
 #      include <errno.h>
 #endif
 
+#ifdef USE_AUDIOFILE_INPUT
+#      include <audiofile.h>
+#endif
+
 tx_audiofile :: tx_audiofile()
 {
        mem_type=TX_AUDIO_UNDEFINED;
@@ -100,6 +104,12 @@ tX_audio_error tx_audiofile :: load(char *p_file_name)
        ld_set_progress(0);
                
        figure_file_type();
+
+#ifdef USE_AUDIOFILE_INPUT
+       if ((load_err) && (file_type!=TX_FILE_MPG123) && (file_type!=TX_FILE_OGG123)) {
+               load_err=load_af();
+       }
+#endif
        
 #ifdef USE_BUILTIN_WAV
        if ((load_err) && (file_type==TX_FILE_WAV)) {
@@ -221,8 +231,9 @@ tX_audio_error tx_audiofile :: load_piped()
 #endif
        
 #ifdef USE_SOX_INPUT
-tX_audio_error tx_audiofile :: load_sox()
-{
+tX_audio_error tx_audiofile :: load_sox() {
+       tX_debug("tx_audiofile::load_sox()");
+
        char command[PATH_MAX*2];
 
        sprintf(command, SOX_STR, filename);
@@ -236,8 +247,9 @@ tX_audio_error tx_audiofile :: load_sox()
 #endif 
 
 #ifdef USE_MPG123_INPUT
-tX_audio_error tx_audiofile :: load_mpg123()
-{
+tX_audio_error tx_audiofile :: load_mpg123() {
+       tX_debug("tx_audiofile::load_mpg123()");
+       
        char command[PATH_MAX*2];
        
        sprintf(command, MPG123_STR, filename);
@@ -250,8 +262,9 @@ tX_audio_error tx_audiofile :: load_mpg123()
 #endif 
 
 #ifdef USE_OGG123_INPUT
-tX_audio_error tx_audiofile :: load_ogg123()
-{
+tX_audio_error tx_audiofile :: load_ogg123() {
+       tX_debug("tx_audiofile::load_ogg123()");
+       
        char command[PATH_MAX*2];
 
        sprintf(command, OGG123_STR, filename);
@@ -265,14 +278,14 @@ tX_audio_error tx_audiofile :: load_ogg123()
 
 #ifdef USE_BUILTIN_WAV
 #define min(a,b) ((a) < (b) ? (a) : (b))
-tX_audio_error tx_audiofile :: load_wav()
-{
+tX_audio_error tx_audiofile :: load_wav() {
+       tX_debug("tx_audiofile::load_wav()");
+       
        wav_sig wav_in;
        int16_t *data;
        int16_t *p;
        ssize_t allbytes=0;
        ssize_t bytes=0;
-       int i;
 
        mem_type=TX_AUDIO_LOAD;
        
@@ -365,6 +378,8 @@ tX_audio_error tx_audiofile :: load_wav()
 
 #ifdef USE_MAD_INPUT
 tX_audio_error tx_audiofile::load_mad() {
+       tX_debug("tx_audiofile::load_mad()");
+       
        struct stat stat_dat;
        int fd;
        int res;
@@ -411,6 +426,7 @@ typedef struct {
        unsigned int target_samples;
        unsigned int current_sample;
        unsigned int sample_rate;
+       unsigned int lost_sync_counter;
 } tX_mad_buffer;
 
 const unsigned char *last_current=NULL;
@@ -446,8 +462,19 @@ static enum mad_flow tX_mad_input(void *data, struct mad_stream *stream) {
 
 static enum mad_flow tX_mad_error(void *data, struct mad_stream *stream, struct mad_frame *frame) {
        tX_mad_buffer *buffer = (tX_mad_buffer *) data;
-       tX_error("Error 0x%04x loading via mad: (%s)\n", stream->error, mad_stream_errorstr(stream));
-       return MAD_FLOW_CONTINUE;
+       if (MAD_RECOVERABLE(stream->error)) {
+               if ((stream->error==MAD_ERROR_LOSTSYNC) && (buffer->lost_sync_counter<3)) {
+                       /* Ignore at least two sync errors to not annoy people
+                          about ID3 tags.
+                       */
+                       buffer->lost_sync_counter++;
+                       return MAD_FLOW_CONTINUE;
+               }
+               tX_warning("mad reported stream error (%i) '%s'.", stream->error, mad_stream_errorstr(stream));
+               return MAD_FLOW_CONTINUE;
+       }
+       tX_error("mad reported fatal stream error (%i) '%s'.", stream->error, mad_stream_errorstr(stream));
+       return MAD_FLOW_STOP;
 }
 
 /* From minimad.c of mad */
@@ -483,7 +510,7 @@ static enum mad_flow tX_mad_output(void *data, struct mad_header const *header,
 
        buffer->target_buffer=(int16_t *) realloc(buffer->target_buffer, buffer->target_samples<<1);
        if (!buffer->target_buffer) { 
-                       tX_error("Failed allocating sample memory!\n");
+                       tX_error("tX_mad_output(): Failed allocating sample memory!\n");
                        return MAD_FLOW_STOP;
        }
                
@@ -517,13 +544,12 @@ int tx_audiofile::mad_decode(unsigned char const *start, unsigned long length) {
        buffer.end = &start[length];
        buffer.last_frame = NULL;
        buffer.size = length;
-       //buffer.next_block = 0;  
-       //buffer.blocks = length/TX_MAD_BLOCKSIZE + (length%TX_MAD_BLOCKSIZE ? 1 : 0);
        buffer.target_buffer = NULL;
        buffer.target_samples = 0;
        buffer.current_sample = 0;
        buffer.first_call=true;
        buffer.sample_rate=0;
+       buffer.lost_sync_counter=0;
 
        tX_debug("tx_audiofile::mad_decode() - start %08x, length %i", buffer.start, buffer.size);
        /* configure input, output, and error functions */
@@ -578,6 +604,8 @@ size_t ogg_read(void  *ptr, size_t size, size_t nmemb, FILE *stream) {
 #define VORBIS_BUFF_SIZE 4096 /*recommended*/
 
 tX_audio_error tx_audiofile::load_vorbis() {
+       tX_debug("tx_audiofile::load_vorbis()");
+       
        /*  VORBIS Callbacks */
        ov_callbacks org_callbacks;
        /* evil casting - to make g++ shut up */
@@ -585,11 +613,10 @@ tX_audio_error tx_audiofile::load_vorbis() {
        
        /* buffer */
        char pcmout[VORBIS_BUFF_SIZE];
-       char mono[VORBIS_BUFF_SIZE];
        OggVorbis_File vf;
        bool eof=false;
        int current_section=0;
-       
+       unsigned int i;
        struct stat stat_dat;
                
        callbacks->read_func=ogg_read;
@@ -621,10 +648,11 @@ tX_audio_error tx_audiofile::load_vorbis() {
 
        unsigned int channels=vi->channels;     
        unsigned int samples_read=0;
+       unsigned int mono_samples;
        int16_t* data=NULL;
        size_t bytes=0;
        
-       while((!eof) && (!current_section)){
+       while((!eof) && (!current_section)) {
 #ifdef BIG_ENDIAN_MACHINE
 #      define ENDIANP 1
 #else
@@ -637,43 +665,120 @@ tX_audio_error tx_audiofile::load_vorbis() {
                  /* ignore stream errors */
                } else {
                        int16_t *new_data;
-                       
                        bytes+=ret;
                        new_data=(int16_t *) realloc(data, bytes/channels);
                        if (!new_data) {
                                if (data) free(data);
                                return TX_AUDIO_ERR_ALLOC;\r
                        }
-                       data=new_data;
                        
-                       int mono_samples=(ret/2)/channels;
+                       data=new_data;
+                       int16_t *src=(int16_t *) &pcmout;
                        
-                       int i=0;                        
-                       while (i<mono_samples) {
-                               int16_t *src=(int16_t *) &pcmout;                               
-                               double value=0.0;
+                       switch (channels) {
+                               case 1:
+                                       mono_samples=ret/2;
+                                       for (i=0; i<mono_samples; i++) {
+                                               data[samples_read+i]=src[i];
+                                       }
+                                       break;
+                                       
+                               case 2:
+                                       mono_samples=ret/4;
+                                       for (i=0; i<mono_samples; i++) {
+                                               double l_value, r_value;
+                                               l_value=src[i*2];
+                                               r_value=src[i*2+1];
+                                               data[samples_read+i]=(int16_t) ((l_value+r_value)/2.0);
+                                       }
+                                       break;
+                                       
+                               default:
+                                       mono_samples=(ret/2)/channels;
+                                       for (i=0; i<mono_samples; i++) {
+                                               double value=0.0;
                                
-                               for (int c=0; c<channels; c++) {
-                                       value+=(double) src[i*channels+c];
-                               }
-                               value/=(double) channels;
-                               
-                               data[samples_read+i]=(int16_t) value;
-                               i++;
+                                               for (unsigned int c=0; c<channels; c++) {
+                                                       value+=(double) src[i*channels+c];
+                                               }
+                                               value/=(double) channels;
+                                               data[samples_read+i]=(int16_t) value;
+                                       }               
                        }
                        samples_read+=mono_samples;
-                       
-                       //memcpy(&data[last_pos], pcmout, ret);
                }
-               //printf("current %i\n", current_section);
     }
        
        ov_clear(&vf);
        
        mem=(int16_t *) data;
-       //no_samples=bytes>>1;
        no_samples=samples_read;
        
+       if (no_samples==0) {
+               if (mem) free(mem);
+               mem=NULL;
+               return TX_AUDIO_ERR_VORBIS_NODATA;
+       }
+       
+       return TX_AUDIO_SUCCESS;
+}
+#endif
+
+#ifdef USE_AUDIOFILE_INPUT
+#define TX_AF_SAMPLES_PER_BLOCK 2048
+
+tX_audio_error tx_audiofile::load_af() {
+       tX_debug("tx_audiofile::load_af()");
+       
+       AFfilehandle af_file;
+       AFframecount    all_frames, frames_read=0, current_frames=1;
+       int16_t *data=NULL;
+       
+       af_file = afOpenFile(filename, "r", NULL);
+       if (af_file==AF_NULL_FILEHANDLE) {
+               return TX_AUDIO_ERR_AF_OPEN;
+       }
+       
+       all_frames=afGetFrameCount(af_file, AF_DEFAULT_TRACK);
+       sample_rate=(unsigned int) afGetRate(af_file, AF_DEFAULT_TRACK);
+       afSetVirtualChannels(af_file, AF_DEFAULT_TRACK, 1);
+       afSetVirtualSampleFormat(af_file, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 16); // 2 == 16 Bit?
+#ifdef BIG_ENDIAN_MACHINE
+       afSetVirtualByteOrder(af_file, AF_DEFAULT_TRACK, AF_BYTEORDER_BIGENDIAN);
+#else
+       afSetVirtualByteOrder(af_file, AF_DEFAULT_TRACK, AF_BYTEORDER_LITTLEENDIAN);
+#endif
+       
+       while (current_frames) {
+               int16_t *new_data;
+               
+               new_data=(int16_t*) realloc(data, (frames_read+TX_AF_SAMPLES_PER_BLOCK)*2);
+               if (!new_data) {
+                       if (data) free(data);
+                       afCloseFile(af_file);
+                       return TX_AUDIO_ERR_ALLOC;
+               }
+               data=new_data;
+               current_frames=afReadFrames(af_file,AF_DEFAULT_TRACK,(void *) &data[frames_read],TX_AF_SAMPLES_PER_BLOCK);
+               frames_read+=current_frames;
+               ld_set_progress(((double) frames_read)/((double) all_frames));
+       }
+       afCloseFile(af_file);
+       
+       if (!frames_read) {
+               if (data) free(data);
+               return TX_AUDIO_ERR_AF_NODATA;
+       }
+       
+       /* shorten to the actually read size of samples */
+       if (!realloc(data, frames_read*2)) {
+                       if (data) free(data);
+                       return TX_AUDIO_ERR_ALLOC;
+       }
+       
+       mem=data;
+       no_samples=frames_read;
+       
        return TX_AUDIO_SUCCESS;
 }
 #endif
index 83ebb31d093e831b911735f25d946144cbc5165b..637714ae040869adcf41a6b624debab5e3f18e32 100644 (file)
@@ -74,7 +74,10 @@ enum tX_audio_error {
        TX_AUDIO_ERR_MAD_DECODE,
        TX_AUDIO_ERR_MAD_MMAP,
        TX_AUDIO_ERR_MAD_MUNMAP,
-       TX_AUDIO_ERR_VORBIS_OPEN
+       TX_AUDIO_ERR_VORBIS_OPEN,
+       TX_AUDIO_ERR_VORBIS_NODATA,
+       TX_AUDIO_ERR_AF_OPEN,
+       TX_AUDIO_ERR_AF_NODATA  
 };
 
 enum tX_audio_storage_type {
@@ -105,7 +108,7 @@ class tx_audiofile
        int16_t *mem;
        size_t memsize;
        long no_samples;        
-       unsigned int sample_rate; //in HZ
+       unsigned int sample_rate; //in HZ       
 
 #ifdef USE_BUILTIN_WAV
        tX_audio_error load_wav();
@@ -116,6 +119,10 @@ class tx_audiofile
 #define NEED_PIPED 1   
 #endif
 
+#ifdef USE_AUDIOFILE_INPUT
+       tX_audio_error load_af();
+#endif
+
 #ifdef USE_MAD_INPUT
        tX_audio_error load_mad();
        int mad_decode(unsigned char const *start, unsigned long length);       
@@ -142,6 +149,7 @@ class tx_audiofile
        
        public:
        tx_audiofile();
+       unsigned int get_sample_rate() { return sample_rate; }
        
        tX_audio_error load(char *p_file_name);
        int16_t *get_buffer() { return mem; };
index 337d1ec9f616ce24eeb0244574955ed3702cf489..827c30cc2a0f29c1b7ac751256bb2ffbcbd6f2d7 100644 (file)
@@ -570,7 +570,6 @@ gtk_tx_dial_adjustment_value_changed (GtkAdjustment *adjustment,
                                    gpointer       data)
 {
   GtkTxDial *tx_dial;
-  gint image;
 
   g_return_if_fail (adjustment != NULL);
   g_return_if_fail (data != NULL);
index 0b607418255e3101d8131fe6e85c055d4656f4a0..ce7f7440afa9dc3702a48f84207f75df27f3856e 100644 (file)
@@ -89,10 +89,8 @@ GtkTooltips *opt_tips;
 
 int opt_hidden=0;
 
-void apply_options()
-{
+void apply_options() {
        char *text;
-       int i;
        
        strcpy(globals.audio_device, gtk_entry_get_text(GTK_ENTRY(audio_device)));
        globals.buff_no=(int)buff_no->value;    
@@ -540,8 +538,6 @@ void show_about(int nag)
        GtkWidget *scroll;
        GdkPixmap *pmap=NULL;
        
-       int loop;
-       
        if (about) 
        {
                gdk_window_raise(about->window);
@@ -642,7 +638,6 @@ void show_about(int nag)
                " endian machine.\n";
                
                char buffer[4096];
-               char *str;
                
                strcpy(buffer, about_prefix_umlaut);
                strcat(buffer, about_rest);
index 6379df448a1022fce047acd6a9ba8ad44f93fdce..301d52f2b79be591894d0629b84e196982b03625 100644 (file)
@@ -60,7 +60,7 @@ void tX_engine :: set_grab_request() {
 }
 
 void tX_engine :: loop() {
-       int16_t *temp;
+       int16_t *temp=NULL;
        int result;
        
        while (!thread_terminate) {
index dbbd4e2f555ee4d3a93ea7c3afac797573bac6e9..63dd8a4ac9e6e083fb8987f4eb39f36303685c40 100644 (file)
@@ -315,21 +315,12 @@ static gint gtk_tx_flash_expose (GtkWidget *widget, GdkEventExpose *event)
   return FALSE;
 } 
 
-static void
-gtk_tx_flash_update (GtkTxFlash *tx_flash)
-{
-  g_return_if_fail (tx_flash != NULL);
-  g_return_if_fail (GTK_IS_TX_FLASH (tx_flash));
-
-  gtk_widget_draw (GTK_WIDGET(tx_flash), NULL);
-}
-
 void
 gtk_tx_flash_set_level(GtkWidget *widget, f_prec new_value)
 {
   GtkTxFlash *tx_flash;
   gint i, y;
-  int new_level, end_level;
+  int new_level;
   int red=0;
 
   g_return_if_fail (widget != NULL);
index 46bcc45e10a38a6cbee67c1e36a725935a17b489..4d11613229e8cf5fe1eea5c28a2f36d70308f2a5 100644 (file)
@@ -68,7 +68,6 @@ struct _GtkTxFlashClass
 
 GtkWidget*     gtk_tx_flash_new        ();
 guint         gtk_tx_flash_get_type (void);
-static void           gtk_tx_flash_prepare (GtkWidget *widget);
 void           gtk_tx_flash_set_level (GtkWidget *widget, f_prec new_value);
 void           gtk_tx_flash_clear (GtkWidget *widget);
 
index 515a4bd6fb1be96719855d77df222e95b3e7e8a8..6215ff8ddcec907efd5a7face9c95b243051bb81 100644 (file)
@@ -171,13 +171,6 @@ void load_globals_old()
        if (!globals.true_block_size) globals.true_block_size=1<globals.buff_size;
 }
 
-void load_globals() {
-       if (load_globals_xml()!=0) {
-               fprintf(stderr, "tX: Failed loading terminatorXrc - trying to load old binary rc.\n");
-               load_globals_old();
-       }
-}
-
 #define restore_int(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); }}
 #define restore_float(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if  (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue;}}
 #define restore_string(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {strcpy(i, xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); }}
@@ -299,3 +292,10 @@ void store_globals() {
                fprintf(rc,"</terminatorXrc>\n");
        }
 }
+
+void load_globals() {
+       if (load_globals_xml()!=0) {
+               fprintf(stderr, "tX: Failed loading terminatorXrc - trying to load old binary rc.\n");
+               load_globals_old();
+       }
+}
index 5f0cce272b0e5d243e3f607f21a2532ae8369ac1..7b088421234da7c953b6ab2bb43f14c281960923 100644 (file)
@@ -59,6 +59,7 @@ extern "C" {
 #endif
        
 #define tX_error(fmt, args...); { fprintf(stderr, "* tX_error: "); fprintf(stderr, fmt , ## args); fprintf(stderr, "\n"); }
+#define tX_warning(fmt, args...); { fprintf(stderr, "+ tX_warning: "); fprintf(stderr, fmt , ## args); fprintf(stderr, "\n"); }
 
 typedef struct {
        char    audio_device[PATH_MAX];
index 7ee6ad46180590b2de03fa23652547af1697d029..7cd0754a2c398f4a283cb795961eb9dfd2d7a9f6 100644 (file)
@@ -78,7 +78,7 @@ void LADSPA_Plugin :: init ()
 void LADSPA_Plugin :: handlelib(void *lib, LADSPA_Descriptor_Function desc_func, char *filename)
 {
        long i;
-       long port;
+       unsigned long port;
        const LADSPA_Descriptor *descriptor;
        int in_audio, out_audio, in_ctrl;       
        
@@ -163,7 +163,7 @@ void LADSPA_Plugin :: scandir(char *dirname)
                        }
                        else
                        {
-                               fprintf(stderr, "tX: Error: %s is not a LADSPA plugin library.");
+                               fprintf(stderr, "tX: Error: %s is not a LADSPA plugin library.", filename);
                                dlclose(handle);
                        }
                }
@@ -184,7 +184,7 @@ void LADSPA_Plugin :: debug_display()
        
        for (plugin=plugin_list.begin(); plugin != plugin_list.end(); plugin++)
        {
-               printf("plugin: %60s | id: %5i | ports: %2i\n", (*plugin)->getName(), (*plugin)->getUniqueID(), (*plugin)->getPortCount());
+               printf("plugin: %60s | id: %5li | ports: %2li\n", (*plugin)->getName(), (*plugin)->getUniqueID(), (*plugin)->getPortCount());
        }
 }
 
@@ -193,7 +193,7 @@ LADSPA_Plugin :: LADSPA_Plugin (const LADSPA_Descriptor *ld, char *filename)
        ladspa_descriptor = ld;
        plugin_list.push_back(this);
        strcpy(file, filename);
-       sprintf (info_string, "   LADSPA-Plugin: %s   \n   Label: %s   \n   File: %s   \n   Unique ID: %i   \n   Maker: %s   \n   Copyright: %s   ", ld->Name, ld->Label, file, ld->UniqueID, ld->Maker, ld->Copyright);
+       sprintf (info_string, "   LADSPA-Plugin: %s   \n   Label: %s   \n   File: %s   \n   Unique ID: %li   \n   Maker: %s   \n   Copyright: %s   ", ld->Name, ld->Label, file, ld->UniqueID, ld->Maker, ld->Copyright);
 }
 
 LADSPA_Plugin * LADSPA_Plugin :: getPluginByIndex(int i)
index fec72291c082ecef819897ec71efb05a172c0cfb..b370c8870dda14b09811678a313b2b18dfae0b1f 100644 (file)
@@ -179,8 +179,8 @@ void ld_set_filename(char *name)
 
 void ld_set_progress(gfloat progress)
 {
-       progress=floor(progress*1000.0)/1000.0;
-       
+       progress=floor(progress*200.0)/200.0;
+       if (progress>1.0) progress=1.0;
        //printf("%f\n", progress);
        
        if (progress!=ld_old_prog)
index 7fb7aab7f554d08d761b78542132e21b5f237ab4..fba8d644530a1461f6b4108500df908ffc13a0c5 100644 (file)
@@ -235,8 +235,6 @@ void mg_update_status()
 
 GtkSignalFunc new_table(GtkWidget *, char *fn)
 {
-       int i;
-       
        turn_audio_off();
                
                if (fn) 
@@ -258,8 +256,6 @@ GtkSignalFunc drop_new_table(GtkWidget *widget, GdkDragContext *context,
 {
        char filename[PATH_MAX];
        char *fn;
-       int s;
-       void *prr;
        
        strncpy(filename, (char *) selection_data->data, (size_t) selection_data->length);
        filename[selection_data->length]=0;
@@ -386,6 +382,8 @@ GtkSignalFunc load_tables()
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(load_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_tables), NULL);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(load_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_tables), NULL); 
        gtk_signal_connect (GTK_OBJECT(load_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_load_tables), NULL);        
+       
+       return NULL;
 }
 
 GtkSignalFunc drop_set(GtkWidget *widget, GdkDragContext *context,
@@ -394,8 +392,6 @@ GtkSignalFunc drop_set(GtkWidget *widget, GdkDragContext *context,
 {
        char filename[PATH_MAX];
        char *fn;
-       int s;
-       void *prr;
        
        strncpy(filename, (char *) selection_data->data, (size_t) selection_data->length);
        filename[selection_data->length]=0;
@@ -489,6 +485,8 @@ GtkSignalFunc save_tables()
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_save_tables), NULL);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_save_tables), NULL); 
        gtk_signal_connect (GTK_OBJECT(save_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_save_tables), NULL);        
+
+       return NULL;
 }
 
 GtkSignalFunc master_volume_changed (GtkWidget *wid, void *d)
@@ -574,6 +572,8 @@ GtkSignalFunc audio_on(GtkWidget *w, void *d)
                seq_stop(NULL, NULL);
                mg_enable_critical_buttons(1);
        }
+       
+       return NULL;
 }
 
 GtkSignalFunc cancel_rec(GtkWidget *wid)
@@ -628,6 +628,8 @@ GtkSignalFunc select_rec_file()
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(rec_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_rec), NULL);
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(rec_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_rec), NULL);  
        gtk_signal_connect (GTK_OBJECT(rec_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_rec), NULL); 
+       
+       return NULL;
 }
 
 GtkSignalFunc tape_on(GtkWidget *w, void *d)
@@ -646,6 +648,8 @@ GtkSignalFunc tape_on(GtkWidget *w, void *d)
        {
                        engine->set_recording_request(false);
        }
+       
+       return NULL;
 }
 
 void grab_on(GtkWidget *w, void *d)
@@ -695,6 +699,8 @@ GtkSignalFunc seq_play(GtkWidget *w, void *)
        
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(engine_btn), 1);
        }
+       
+       return NULL;
 }
 
 GtkSignalFunc seq_stop(GtkWidget *w, void *)
@@ -748,7 +754,7 @@ void seq_update_entry(const guint32 timestamp)
                minu=sec=hun=0;
        }
        
-       sprintf(buffer, "%02li:%02li.%02li", minu, sec, hun);
+       sprintf(buffer, "%02i:%02i.%02i", minu, sec, hun);
        gtk_entry_set_text(GTK_ENTRY(seq_entry), buffer);
 }
 
@@ -797,7 +803,6 @@ void create_mastergui(int x, int y)
        GtkWidget *small_box;
        GtkWidget *smaller_box;
        
-       int i;
        static GtkTargetEntry drop_types [] = {
                { "text/uri-list", 0, 0}
        };
index 353f68f67807d74506bd8289cb922d6baed92fbd..3e4f7ac0fd398c036e9b0b892fbaeb70e33042f4 100644 (file)
@@ -35,8 +35,7 @@
 #define TX_MOUSE_SPEED_NORMAL 0.05
 #define TX_MOUSE_SPEED_WARP 250000
 
-tx_mouse :: tx_mouse()
-{
+tx_mouse :: tx_mouse() {
        mask=PointerMotionMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
        xmot=(XMotionEvent *) &xev;
        xkey=(XKeyEvent *) &xev;
@@ -53,12 +52,10 @@ tx_mouse :: tx_mouse()
 }
 
 
-int tx_mouse :: grab()
-{      
+int tx_mouse :: grab() {       
 #ifdef USE_DGA2
        XDGAMode *mode;
 #endif 
-       int i, num=0;
 
        if (grabbed) return(0);
 
index be727a24b67ee4647f4c9e6dca09dcb7679c2896..ea10e4839284fb111ec345be6e33815420f33690 100644 (file)
@@ -55,9 +55,7 @@ void prelis_stop()
        }       
 }
 
-void prelis_start(char *name)
-{
-       char buffer[PATH_MAX*2];
+void prelis_start(char *name) {
        char *ext;
        pid_t temp;
        int usempg123=0;
index f9e651a4761f90c6db98f17dc813fdc04ab5d846..6f42f29966464e2608fe0478f1a3cf1a6d823d99 100644 (file)
@@ -150,7 +150,7 @@ void tX_seqpar :: create_persistence_ids()
        }
 }
 
-tX_seqpar* tX_seqpar :: get_sp_by_persistence_id(int pid)
+tX_seqpar* tX_seqpar :: get_sp_by_persistence_id(unsigned int pid)
 {
        list <tX_seqpar *> :: iterator sp;
        
@@ -384,7 +384,7 @@ void tX_seqpar_vtt_speed :: handle_mouse_input(float adjustment)
 
 void tX_seqpar_vtt_speed :: do_exec(const float value)
 {
-       tt->speed=value;
+       tt->speed=value*tt->audiofile_pitch_correction;
 }
 
 const char * tX_seqpar_vtt_speed :: get_name()
index c53cfe685342975bffc62409117619a6ace9b6e6..f6fd67e4fea6494050b7642e27b2be5a0c51ad90 100644 (file)
@@ -84,8 +84,8 @@ class tX_seqpar
        
        static void create_persistence_ids();
        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 set_persistence_id(guint32 pid) { persistence_id=pid; }
+       static tX_seqpar *get_sp_by_persistence_id(unsigned int pid);
 
        void record_value (const float value);
        virtual void do_exec(const float value);
index ef7187dfe945086738c57a746501a1c4cb836f0e..9f2d40ee1ad51a25a4826e81eaace13b83e0e799 100644 (file)
@@ -180,6 +180,7 @@ vtt_class :: vtt_class (int do_create_gui)
        set_output_buffer_size(samples_in_mix_buffer/2);
        
        audiofile = NULL;
+       audiofile_pitch_correction=0;
        mix_solo=0;
        mix_mute=0;
        res_mute=mute;
@@ -233,9 +234,11 @@ int vtt_class :: load_file(char *fname)
        audiofile=new tx_audiofile();
        res=audiofile->load(fname);     
        
-       if (res==TX_AUDIO_SUCCESS)
-       {
+       if (res==TX_AUDIO_SUCCESS) {
                buffer=audiofile->get_buffer();
+               double file_rate=audiofile->get_sample_rate();
+               audiofile_pitch_correction=file_rate/44100.0;
+               recalc_pitch();
                samples_in_buffer=audiofile->get_no_samples();
                maxpos=audiofile->get_no_samples();
                strcpy(filename, fname);
@@ -342,6 +345,7 @@ void vtt_class :: recalc_pitch()
 {
 //     res_pitch=fabs(globals.pitch)*rel_pitch;
        res_pitch=globals.pitch*rel_pitch;
+       res_pitch*=audiofile_pitch_correction;
        speed=res_pitch;
        ec_set_length(ec_length);
 }
@@ -458,8 +462,7 @@ void vtt_class :: ec_set_pan(f_prec pan)
 void vtt_class :: ec_set_length(f_prec length)
 {
        int delay;
-       int i=0;
-       
+
        ec_length=length;
        if (res_pitch==0) 
        {
@@ -1791,7 +1794,8 @@ int vtt_class :: load_12(FILE * input)
        int32_t counter;
        int32_t type;
        long id;
-       int i,t;
+       int i;
+       unsigned int t;
        LADSPA_Plugin *plugin;
        char buffer[256];
        vtt_fx_ladspa *ladspa_effect;
@@ -1883,7 +1887,7 @@ int vtt_class :: load_12(FILE * input)
                                }
                                else
                                {
-                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%i].", id);
+                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%li].", id);
                                        tx_note(buffer);
                                        res++;
                                }
@@ -1935,7 +1939,8 @@ int vtt_class :: load_13(FILE * input)
        int32_t counter;
        int32_t type;
        long id;
-       int i,t;
+       int i;
+       unsigned int t;
        LADSPA_Plugin *plugin;
        char buffer[256];
        vtt_fx_ladspa *ladspa_effect;
@@ -2039,7 +2044,7 @@ int vtt_class :: load_13(FILE * input)
                                }
                                else
                                {
-                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%i].", id);
+                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%li].", id);
                                        tx_note(buffer);
                                        res++;
                                }
@@ -2091,7 +2096,8 @@ int vtt_class :: load_14(FILE * input)
        int32_t counter;
        int32_t type;
        long id;
-       int i,t;
+       int i;
+       unsigned int t;
        LADSPA_Plugin *plugin;
        char buffer[256];
        vtt_fx_ladspa *ladspa_effect;
@@ -2198,7 +2204,7 @@ int vtt_class :: load_14(FILE * input)
                                }
                                else
                                {
-                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%i].", id);
+                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%li].", id);
                                        tx_note(buffer);
                                        res++;
                                }
@@ -2273,9 +2279,7 @@ int  vtt_class :: save_all(FILE* output)
 int  vtt_class :: load_all_10(FILE* input, char *fname)
 {
        int res=0, restmp=0;
-       list <vtt_class *> :: iterator vtt;
-       unsigned int i, max, size;
-       int16_t *newbuffer;
+       unsigned int i, max;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
        
@@ -2324,9 +2328,7 @@ int  vtt_class :: load_all_10(FILE* input, char *fname)
 int  vtt_class :: load_all_11(FILE* input, char *fname)
 {
        int res=0, restmp=0;
-       list <vtt_class *> :: iterator vtt;
-       unsigned int i, max, size;
-       int16_t *newbuffer;
+       unsigned int i, max;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
        guint32 pid;
@@ -2381,9 +2383,7 @@ int  vtt_class :: load_all_11(FILE* input, char *fname)
 int  vtt_class :: load_all_12(FILE* input, char *fname)
 {
        int res=0, restmp=0;
-       list <vtt_class *> :: iterator vtt;
-       unsigned int i, max, size;
-       int16_t *newbuffer;
+       unsigned int i, max;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
        guint32 pid;
@@ -2437,9 +2437,7 @@ int  vtt_class :: load_all_12(FILE* input, char *fname)
 int  vtt_class :: load_all_13(FILE* input, char *fname)
 {
        int res=0, restmp=0;
-       list <vtt_class *> :: iterator vtt;
-       unsigned int i, max, size;
-       int16_t *newbuffer;
+       unsigned int i, max;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
        guint32 pid;
@@ -2493,9 +2491,7 @@ int  vtt_class :: load_all_13(FILE* input, char *fname)
 int  vtt_class :: load_all_14(FILE* input, char *fname)
 {
        int res=0, restmp=0;
-       list <vtt_class *> :: iterator vtt;
-       unsigned int i, max, size;
-       int16_t *newbuffer;
+       unsigned int i, max;
        vtt_class *newvtt;
        char ftmp[PATH_MAX];
        guint32 pid;
index 5d4a01bcceca069d4c01797d1a9a103c0d27ca8f..1713170e8527336c8f7b2a69c6d8933b2b22c6e0 100644 (file)
@@ -116,7 +116,7 @@ class vtt_class
 #endif
        
        int16_t *buffer;        // Actual audio data
-       int samples_in_buffer;  // No. of samples in audio data
+       unsigned int samples_in_buffer;  // No. of samples in audio data
        int do_scratch;
        
        f_prec *output_buffer; 
@@ -216,6 +216,7 @@ class vtt_class
        tX_seqpar_spin sp_spin;
 
        tx_audiofile *audiofile;
+       f_prec audiofile_pitch_correction;
 
        list <vtt_fx *> fx_list;
                
index af9e4ef97e3525d5b0dd11f2f3000e2f5c5274b5..e5e92ed3d97c362dd3cab65bc36d2b1423546ce6 100644 (file)
@@ -163,7 +163,6 @@ vtt_fx_ladspa :: vtt_fx_ladspa(LADSPA_Plugin *p, void *v)
 {
        int port;
        float min, max;
-       const char* last_word;
        char buffer[2048];
        char buffer2[2048];
        
@@ -316,7 +315,7 @@ void vtt_fx_ladspa :: save (FILE *output)
 void vtt_fx_ladspa :: load (FILE *input)
 {
        guint32 count;
-       int i;
+       unsigned int i;
        list <tX_seqpar_vttfx *> :: iterator sp;
        guint32 pid;
        guint8 hidden;
@@ -326,11 +325,10 @@ void vtt_fx_ladspa :: load (FILE *input)
        
        if (count!=controls.size())
        {
-               fprintf(stderr, "tX: Ouch! Plugin %i has less/more controls than saved!\n", plugin->getUniqueID());
+               fprintf(stderr, "tX: Ouch! Plugin %li has less/more controls than saved!\n", plugin->getUniqueID());
        }
        
-       for (i=0, sp=controls.begin(); i<count, sp!=controls.end(); i++, sp++)
-       {
+       for (i=0, sp=controls.begin(); (i<count) && (sp!=controls.end()); i++, sp++) {
                fread((void *) &pid, sizeof(pid), 1, input);
                (*sp)->set_persistence_id(pid);
                fread((void *) &value, sizeof(value), 1, input);
index 6cace9959f85725a7945dd2651ce32b485564240..23d7cb1c2c6af20136ef7f21cb13320d36b48b84 100644 (file)
@@ -66,7 +66,6 @@ void nicer_filename(char *dest, char *source)
 {
                char *fn;
                char temp[PATH_MAX];
-               int i;
                
                fn=strrchr(source, '/');
                if (fn) fn++;
@@ -135,7 +134,6 @@ char global_filename_buffer[PATH_MAX];
 void load_part(char *newfile, vtt_class *vtt)
 {
        int ret=0;
-       char *fn;
 
        ld_create_loaddlg(TX_LOADDLG_MODE_SINGLE, 1);
        ld_set_filename(newfile);
@@ -191,13 +189,7 @@ void load_part(char *newfile, vtt_class *vtt)
 
 void do_load_file(GtkWidget *wid, vtt_class *vtt)
 {
-       int ret;
        char newfile[PATH_MAX];
-       char buffer[1024]="Couldn't open loop file: ";
-       char fn[FILENAME_BUTTON_MAX];
-       
-       int16_t *newbuffer;
-       unsigned int newsize;
        
        prelis_stop();
 
@@ -223,8 +215,6 @@ void drop_file(GtkWidget *widget, GdkDragContext *context,
 {
        char filename[PATH_MAX];
        char *fn;
-       int s;
-       void *prr;
        
        strncpy(filename, (char *) selection_data->data, (size_t) selection_data->length);
        gtk_drag_finish(context, TRUE, FALSE, time);
@@ -290,7 +280,8 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "cursor_changed", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);            
 #else
        gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "select_row", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);
-#endif         
+#endif
+       return NULL;
 }
 
 void delete_vtt(GtkWidget *wid, vtt_class *vtt)
@@ -440,8 +431,6 @@ void mute_volume(GtkWidget *widget, vtt_class *vtt)
 
 void solo_vtt(GtkWidget *widget, vtt_class *vtt)
 {
-       list <vtt_class *> :: iterator it_vtt;
-
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) 
        {
                vtt->set_mix_solo(1);
@@ -622,7 +611,7 @@ void fx_button_pressed(GtkWidget *wid, vtt_class *vtt)
        LADSPA_Plugin *plugin;
        char buffer[1024];
        char oldfile[1024]="";
-       GtkWidget *submenu;
+       GtkWidget *submenu=NULL;
 
        fx_vtt=vtt; /* AAAAARGH - Long live ugly code */
 
@@ -641,7 +630,7 @@ void fx_button_pressed(GtkWidget *wid, vtt_class *vtt)
                        gtk_menu_append(GTK_MENU(g->ladspa_menu), item);
                        gtk_widget_show(item);
                }
-               sprintf(buffer, "%s - [%i, %s]", plugin->getName(), plugin->getUniqueID(), plugin->getLabel());
+               sprintf(buffer, "%s - [%li, %s]", plugin->getName(), plugin->getUniqueID(), plugin->getLabel());
                item=gtk_menu_item_new_with_label(buffer);
                gtk_menu_append(GTK_MENU(submenu), item);
                gtk_widget_show(item);
index 102c54dae93e034c1b0cef965b314875ef8d9243..77e010069d7c626e04374e4a7df9a5028c787672 100644 (file)
@@ -42,9 +42,9 @@
 #include "wav_file.h"
 
 #include "tX_endian.h"
+#include <string.h>
 
 void init_head(wav_sig *info){
-       int16_t tmp16;
        int32_t tmp32;
        
        strcpy(info->head, "RIFF    WAVEfmt                     data    ");