Author: neoclust
Date: Tue Oct 10 16:56:26 2006
New Revision: 63322
Added:
packages/cooker/TiMidity++/current/SOURCES/TiMidity++-2.13.2-gcc4.patch
packages/cooker/TiMidity++/current/SOURCES/Timidity-fix-portaudioV19-build.diff
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-cvs-fixes.patch
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-default-config-path.patch
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-emacs.patch
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-speex-header-path.patch
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-tcl.patch
Removed:
packages/cooker/TiMidity++/current/SOURCES/TiMidity++-2.13.2-gcc4.patch.bz2
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-cvs-fixes.patch.bz2
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-default-config-path.patch.bz2
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-emacs.patch.bz2
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-speex-header-path.patch.bz2
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-tcl.patch.bz2
Modified:
packages/cooker/TiMidity++/current/SPECS/TiMidity++.spec
Log:
- Fix Build for portaudio V19
Added: packages/cooker/TiMidity++/current/SOURCES/TiMidity++-2.13.2-gcc4.patch
==============================================================================
--- (empty file)
+++ packages/cooker/TiMidity++/current/SOURCES/TiMidity++-2.13.2-gcc4.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,11 @@
+--- TiMidity++-2.13.2/interface/xaw_i.c~ 2004-09-27 01:40:14.000000000
+0200
++++ TiMidity++-2.13.2/interface/xaw_i.c 2005-08-04 19:43:06.000000000
+0200
+@@ -261,7 +261,7 @@ int amplitude = DEFAULT_AMPLIFICATION;
+ String bitmapdir = XAW_BITMAP_DIR;
+ Boolean arrangetitle,savelist;
+ static char **current_flist = NULL;
+-static int voices = 0, last_voice = 0, voices_num_width;
++int voices = 0, last_voice = 0, voices_num_width;
+ static int maxentry_on_a_menu = 0,submenu_n = 0;
+ #define OPTIONS_WINDOW 1
+ #define FLIST_WINDOW 2
Added:
packages/cooker/TiMidity++/current/SOURCES/Timidity-fix-portaudioV19-build.diff
==============================================================================
--- (empty file)
+++
packages/cooker/TiMidity++/current/SOURCES/Timidity-fix-portaudioV19-build.diff
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,420 @@
+--- timidity/portaudio_a.c.neoclust 2004-05-18 05:59:34.000000000 +0200
++++ timidity/portaudio_a.c 2006-02-04 02:10:31.000000000 +0100
+@@ -17,11 +17,13 @@
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+- portaudio_a.c by Avatar <[EMAIL PROTECTED]>
++ portaudio_a.c by skeishi <[EMAIL PROTECTED]>
+ based on esd_a.c
+
+ Functions to play sound through EsounD
+ */
++#define PORTAUDIO_V19 1
++
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+@@ -63,8 +65,9 @@
+ static int output_data(char *buf, int32 nbytes);
+ static int acntl(int request, void *arg);
+
+-static int framesPerBuffer=256;
++static int framesPerBuffer=128;
+ static int stereo=2;
++static int conv16_32 =0;
+ static int data_nbyte;
+ static int numBuffers;
+ static unsigned int framesPerInBuffer;
+@@ -72,13 +75,22 @@
+ //static int firsttime;
+ static int pa_active=0;
+ static int first=1;
++
++#if PORTAUDIO_V19
++PaDeviceIndex DeviceIndex;
++const PaDeviceInfo *DeviceInfo;
++PaStreamParameters StreamParameters;
++PaStream *stream;
++PaError err;
++#else
+ PaDeviceID DeviceID;
+ const PaDeviceInfo *DeviceInfo;
+ PortAudioStream *stream;
+ PaError err;
++#endif
+ typedef struct {
+ char buf[DATA_BLOCK_SIZE*2];
+- int32 samplesToGo;
++ uint32 samplesToGo;
+ char *bufpoint;
+ char *bufepoint;
+ } padata_t;
+@@ -93,7 +105,7 @@
+ PlayMode portaudio_asio_play_mode = {
+ (SAMPLE_RATE),
+ PE_16BIT|PE_SIGNED,
+- PF_PCM_STREAM|PF_BUFF_FRAGM_OPT/*|PF_CAN_TRACE*/,
++ PF_PCM_STREAM|PF_BUFF_FRAGM_OPT|PF_CAN_TRACE,
+ -1,
+ {32}, /* PF_BUFF_FRAGM_OPT is need for TWSYNTH */
+ "PortAudio(ASIO)", 'o',
+@@ -106,7 +118,7 @@
+ PlayMode portaudio_win_ds_play_mode = {
+ (SAMPLE_RATE),
+ PE_16BIT|PE_SIGNED,
+- PF_PCM_STREAM|PF_BUFF_FRAGM_OPT/*|PF_CAN_TRACE*/,
++ PF_PCM_STREAM|PF_BUFF_FRAGM_OPT|PF_CAN_TRACE,
+ -1,
+ {32}, /* PF_BUFF_FRAGM_OPT is need for TWSYNTH */
+ "PortAudio(DirectSound)", 'P',
+@@ -119,7 +131,7 @@
+ PlayMode portaudio_win_wmme_play_mode = {
+ (SAMPLE_RATE),
+ PE_16BIT|PE_SIGNED,
+- PF_PCM_STREAM|PF_BUFF_FRAGM_OPT/*|PF_CAN_TRACE*/,
++ PF_PCM_STREAM|PF_BUFF_FRAGM_OPT|PF_CAN_TRACE,
+ -1,
+ {32}, /* PF_BUFF_FRAGM_OPT is need for TWSYNTH */
+ "PortAudio(WMME)", 'p',
+@@ -139,7 +151,7 @@
+ PlayMode dpm = {
+ (SAMPLE_RATE),
+ PE_16BIT|PE_SIGNED,
+- PF_PCM_STREAM|PF_BUFF_FRAGM_OPT/*|PF_CAN_TRACE*/,
++ PF_PCM_STREAM|PF_BUFF_FRAGM_OPT|PF_CAN_TRACE,
+ -1,
+ {32}, /* PF_BUFF_FRAGM_OPT is need for TWSYNTH */
+ "Portaudio Driver", 'p',
+@@ -151,45 +163,90 @@
+ };
+ #endif
+
+-
++#if PORTAUDIO_V19
++int paCallback( const void *inputBuffer, void *outputBuffer,
++ unsigned long framesPerBuffer,
++ const PaStreamCallbackTimeInfo* timeInfo,
++ PaStreamCallbackFlags statusFlags,
++ void *userData )
++#else
+ int paCallback( void *inputBuffer, void *outputBuffer,
+-
+ unsigned long framesPerBuffer,
+-
+- PaTimestamp outTime, void *userData )
+-
++ PaTimestamp outTime,
++ void *userData )
++#endif
+ {
+
+ unsigned int i;
+ int finished = 0;
+
+ /* Cast data passed through stream to our structure type. */
+-
+ // pa_data_t pa_data = (pa_data_t*)userData;
+-
+ char *out = (char*)outputBuffer;
+- if(pa_data.samplesToGo < framesPerBuffer*data_nbyte*stereo ){
+- for(i=0;i<pa_data.samplesToGo;i++){
+- *out++ = *(pa_data.bufpoint)++;
+- if( pa_data.buf+bytesPerInBuffer*2 <= pa_data.bufpoint
){
+- pa_data.bufpoint=pa_data.buf;
++ unsigned long datalength = framesPerBuffer*data_nbyte*stereo;
++ char * buflimit = pa_data.buf+bytesPerInBuffer*2;
++
++ if(conv16_32){
++ if(pa_data.samplesToGo < datalength ){
++ for(i=0;i<pa_data.samplesToGo/2;i++){
++ *out++ = 0;
++ *out++ = 0;
++ *out++ = *(pa_data.bufpoint)++;
++ *out++ = *(pa_data.bufpoint)++;
++ if( buflimit <= pa_data.bufpoint ){
++ pa_data.bufpoint=pa_data.buf;
++ }
+ }
++ pa_data.samplesToGo=0;
++ for(;i<datalength/2;i++){
++ *out++ = 0;
++ *out++ = 0;
++ *out++ = 0;
++ *out++ = 0;
++ }
++ finished = 0;
++ }else{
++ for(i=0;i<datalength/2;i++){
++ *out++ = 0;
++ *out++ = 0;
++ *out++=*(pa_data.bufpoint)++;
++ *out++=*(pa_data.bufpoint)++;
++ if( buflimit <= pa_data.bufpoint ){
++ pa_data.bufpoint=pa_data.buf;
++ }
++ }
++ pa_data.samplesToGo -= datalength;
+ }
+- pa_data.samplesToGo=0;
+- for(;i<framesPerBuffer*data_nbyte*stereo;i++){
+- *out++=0;
+- }
+- finished = 0;
+ }else{
+- for(i=0;i<framesPerBuffer*data_nbyte*stereo;i++){
+- *out++=*(pa_data.bufpoint)++;
+- if( pa_data.buf+bytesPerInBuffer*2 <= pa_data.bufpoint
){
+- pa_data.bufpoint=pa_data.buf;
++ if(pa_data.samplesToGo < datalength ){
++ if(pa_data.bufpoint+datalength <= buflimit){
++ memcpy(out, pa_data.bufpoint, datalength);
++ pa_data.bufpoint += datalength;
++ }else{
++ int32 send;
++ send = buflimit-pa_data.bufpoint;
++ memcpy(out, pa_data.bufpoint, send);
++ out +=send;
++ memcpy(out, pa_data.buf, datalength -send);
++ pa_data.bufpoint = pa_data.buf+datalength -send;
++ }
++ memset(out, 0x0, datalength-pa_data.samplesToGo);
++ finished = 0;
++ }else{
++ if(pa_data.bufpoint + datalength <= buflimit){
++ memcpy(out, pa_data.bufpoint, datalength);
++ pa_data.bufpoint += datalength;
++ }else{
++ int32 send;
++ send = buflimit-pa_data.bufpoint;
++ memcpy(out, pa_data.bufpoint, send);
++ out += send;
++ memcpy(out, pa_data.buf, datalength -send);
++ pa_data.bufpoint = pa_data.buf+datalength -send;
+ }
++ pa_data.samplesToGo -= datalength;
+ }
+- pa_data.samplesToGo -= framesPerBuffer*data_nbyte*stereo;
+ }
+-
+ return finished ;
+
+ }
+@@ -234,16 +291,83 @@
+ }
+ }
+ #endif
++ /* if call twice Pa_OpenStream causes paDeviceUnavailable error */
++ if(pa_active == 1) return 0;
+ if(pa_active == 0){
+ err = Pa_Initialize();
+ if( err != paNoError ) goto error;
+ pa_active = 1;
+ }
+- if(first == 1){
+- atexit(close_output);
+- first = 0;
++
++#ifdef PORTAUDIO_V19
++ DeviceIndex = Pa_GetDefaultOutputDevice();
++ if(DeviceIndex==paNoDevice) goto error;
++ DeviceInfo = Pa_GetDeviceInfo( DeviceIndex);
++ if(DeviceInfo==NULL) goto error;
++
++ if (dpm.encoding & PE_24BIT) {
++ SampleFormat = paInt24;
++ }else if (dpm.encoding & PE_16BIT) {
++ SampleFormat = paInt16;
++ }else {
++ SampleFormat = paInt8;
+ }
+
++ stereo = (dpm.encoding & PE_MONO) ? 1 : 2;
++ data_nbyte = (dpm.encoding & PE_16BIT) ? 2 : 1;
++ data_nbyte = (dpm.encoding & PE_24BIT) ? 3 : data_nbyte;
++
++ pa_data.samplesToGo = 0;
++ pa_data.bufpoint = pa_data.buf;
++ pa_data.bufepoint = pa_data.buf;
++// firsttime = 1;
++ numBuffers = 1; //Pa_GetMinNumBuffers( framesPerBuffer, dpm.rate );
++ framesPerInBuffer = numBuffers * framesPerBuffer;
++ if (framesPerInBuffer < 4096) framesPerInBuffer = 4096;
++ bytesPerInBuffer = framesPerInBuffer * data_nbyte * stereo;
++
++ /* set StreamParameters */
++ StreamParameters.device = DeviceIndex;
++ StreamParameters.channelCount = stereo;
++ if(ctl->id_character != 'r' && ctl->id_character != 'A' &&
ctl->id_character != 'W' && ctl->id_character != 'P'){
++ StreamParameters.suggestedLatency =
DeviceInfo->defaultHighOutputLatency;
++ }else{
++ StreamParameters.suggestedLatency =
DeviceInfo->defaultLowOutputLatency;
++ }
++ StreamParameters.hostApiSpecificStreamInfo = NULL;
++
++ if( SampleFormat == paInt16){
++ StreamParameters.sampleFormat = paInt16;
++ if( paFormatIsSupported != Pa_IsFormatSupported( NULL ,
++
&StreamParameters,(double) dpm.rate )){
++ StreamParameters.sampleFormat = paInt32;
++ conv16_32 = 1;
++ } else {
++ StreamParameters.sampleFormat = paInt16;
++ conv16_32 = 0;
++ }
++ }else{
++ StreamParameters.sampleFormat = SampleFormat;
++ }
++ err = Pa_IsFormatSupported( NULL ,
++ &StreamParameters,
++ (double) dpm.rate );
++ if ( err != paNoError) goto error;
++ err = Pa_OpenStream(
++ & stream, /* passes back stream pointer */
++ NULL, /* inputStreamParameters */
++ &StreamParameters, /* outputStreamParameters */
++ (double) dpm.rate, /* sample rate */
++ paFramesPerBufferUnspecified, /* frames per buffer */
++ paFramesPerBufferUnspecified, /* PaStreamFlags */
++ paCallback, /* specify our custom callback
*/
++ &pa_data /* pass our data through to
callback */
++ );
++// Pa_Sleeep(1);
++ if ( err != paNoError) goto error;
++ return 0;
++
++#else
+ DeviceID = Pa_GetDefaultOutputDeviceID();
+ if(DeviceID==paNoDevice) goto error;
+ DeviceInfo = Pa_GetDeviceInfo( DeviceID);
+@@ -252,13 +376,21 @@
+
+ exclude_enc = PE_ULAW | PE_ALAW | PE_BYTESWAP;
+ include_enc = PE_SIGNED;
+- if (!(nativeSampleFormats & paInt16)) {exclude_enc |= PE_16BIT;}
++ if (!(nativeSampleFormats & paInt16) && !(nativeSampleFormats &
paInt32)) {exclude_enc |= PE_16BIT;}
+ if (!(nativeSampleFormats & paInt24)) {exclude_enc |= PE_24BIT;}
+ dpm.encoding = validate_encoding(dpm.encoding, include_enc, exclude_enc);
+
+- if (dpm.encoding & PE_24BIT) {SampleFormat = paInt24;}
+- else if (dpm.encoding & PE_16BIT) {SampleFormat = paInt16;}
+- else {SampleFormat = paInt8;}
++ if (dpm.encoding & PE_24BIT) {
++ SampleFormat = paInt24;
++ }else if (dpm.encoding & PE_16BIT) {
++ if(nativeSampleFormats & paInt16) SampleFormat = paInt16;
++ else{
++ SampleFormat = paInt32;
++ conv16_32 = 1;
++ }
++ }else {
++ SampleFormat = paInt8;
++ }
+
+ stereo = (dpm.encoding & PE_MONO) ? 1 : 2;
+ data_nbyte = (dpm.encoding & PE_16BIT) ? 2 : 1;
+@@ -300,6 +432,8 @@
+ if ( err != paNoError && err != paHostError) goto error;
+ return 0;
+
++#endif
++
+ error:
+ Pa_Terminate(); pa_active = 0;
+ #ifdef AU_PORTAUDIO_DLL
+@@ -316,11 +450,17 @@
+ // if(pa_data.samplesToGo > DATA_BLOCK_SIZE){
+ // Sleep( (pa_data.samplesToGo - DATA_BLOCK_SIZE)/dpm.rate/4 );
+ // }
+- for(i=0;i<nbytes;i++){
+- *(pa_data.bufepoint)++ = *buf++ ;
+- if( pa_data.buf+bytesPerInBuffer*2 <= pa_data.bufepoint ){
+- pa_data.bufepoint=pa_data.buf;
+- }
++ if (pa_data.buf+bytesPerInBuffer*2 >= pa_data.bufepoint + nbytes){
++ memcpy(pa_data.bufepoint, buf, nbytes);
++ pa_data.bufepoint += nbytes;
++ //buf += nbytes;
++ }else{
++ int32 send = pa_data.buf+bytesPerInBuffer*2 - pa_data.bufepoint;
++ memcpy(pa_data.bufepoint, buf, send);
++ buf += send;
++ memcpy(pa_data.buf, buf, nbytes - send);
++ pa_data.bufepoint = pa_data.buf + nbytes - send;
++ //buf += nbytes-send;
+ }
+ pa_data.samplesToGo += nbytes;
+
+@@ -332,12 +472,18 @@
+ firsttime=0;
+ }
+ */
++#if PORTAUDIO_V19
++ if( 0==Pa_IsStreamActive(stream)){
++#else
+ if( 0==Pa_StreamActive(stream)){
++#endif
+ err = Pa_StartStream( stream );
+
+ if( err != paNoError ) goto error;
+ }
+- while(pa_data.samplesToGo > bytesPerInBuffer){ Pa_Sleep(1);};
++
++ if(ctl->id_character != 'r' && ctl->id_character != 'A' &&
ctl->id_character != 'W' && ctl->id_character != 'P')
++ while((pa_active==1) && (pa_data.samplesToGo > bytesPerInBuffer)){
Pa_Sleep(1);};
+ // Pa_Sleep( (pa_data.samplesToGo - bytesPerInBuffer)/dpm.rate * 1000);
+ return 0;
+
+@@ -350,7 +496,11 @@
+ static void close_output(void)
+ {
+ if( pa_active==0) return;
++#if PORTAUDIO_V19
++ if(Pa_IsStreamActive(stream)){
++#else
+ if(Pa_StreamActive(stream)){
++#endif
+ Pa_Sleep( bytesPerInBuffer/dpm.rate*1000 );
+ }
+ err = Pa_StopStream( stream );
+@@ -382,26 +532,26 @@
+ case PM_REQ_GETQSIZ:
+ *(int *)arg = bytesPerInBuffer*2;
+ return 0;
+- break;
++ //break;
+ case PM_REQ_GETFILLABLE:
+ *(int *)arg = bytesPerInBuffer*2-pa_data.samplesToGo;
+ return 0;
+- break;
++ //break;
+ case PM_REQ_GETFILLED:
+ *(int *)arg = pa_data.samplesToGo;
+ return 0;
+- break;
++ //break;
+ case PM_REQ_DISCARD:
+ Pa_StopStream( stream );
+ close_output();
+ open_output();
+ return 0;
+- break;
++ //break;
+ case PM_REQ_FLUSH:
+ close_output();
+ open_output();
+ return 0;
+- break;
++ //break;
+ case PM_REQ_RATE: /* NOT WORK */
+ {
+ int i;
+@@ -418,7 +568,7 @@
+ return -1;
+ }
+ }
+- break;
++ //break;
+ }
+ return -1;
+ }
Added:
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-cvs-fixes.patch
==============================================================================
--- (empty file)
+++ packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-cvs-fixes.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,189 @@
+Index: timidity/libunimod/mlutil.c
+===================================================================
+RCS file: /cvsroot/timidity/timidity/libunimod/mlutil.c,v
+retrieving revision 1.6
+retrieving revision 1.7
+diff -u -p -r1.6 -r1.7
+--- timidity/libunimod/mlutil.c 5 Jun 2003 11:27:47 -0000 1.6
++++ timidity/libunimod/mlutil.c 17 Oct 2004 22:48:29 -0000 1.7
+@@ -321,6 +321,7 @@ ULONG getAmigaPeriod (UBYTE flags, ULONG
+ if (flags & UF_LINEAR)
+ {
+ period = lintab[period % 768] >> (period / 768);
++ if (period < 1) period = 1;
+ period = (8363L * 1712L) / period;
+ }
+
+Index: timidity/timidity/mod2midi.c
+===================================================================
+RCS file: /cvsroot/timidity/timidity/timidity/mod2midi.c,v
+retrieving revision 1.11
+retrieving revision 1.12
+diff -u -p -r1.11 -r1.12
+--- timidity/timidity/mod2midi.c 17 Oct 2004 22:48:29 -0000 1.11
++++ timidity/timidity/mod2midi.c 21 Oct 2004 02:34:03 -0000 1.12
+@@ -266,11 +267,13 @@ Voice_SetPeriod (UBYTE v, ULONG period)
+ return;
+
+ new_noteon = period2note (ModV[v].period, &bend);
+-#ifndef TRACE_SLIDE_NOTES
+- bend += (new_noteon - ModV[v].noteon) << 13;
+- new_noteon = ModV[v].noteon;
+-#endif
+- bend = WHEEL_VALUE(bend);
++ if (new_noteon >= 0) {
++ #ifndef TRACE_SLIDE_NOTES
++ bend += (new_noteon - ModV[v].noteon) << 13;
++ new_noteon = ModV[v].noteon;
++ #endif
++ bend = WHEEL_VALUE(bend);
++ }
+
+ if (ModV[v].noteon != new_noteon)
+ {
+@@ -330,13 +333,13 @@ Voice_Play (UBYTE v, SAMPLE * s, ULONG s
+ Voice_Stop (v);
+
+ new_noteon = period2note (ModV[v].period, &bend);
+- bend = WHEEL_VALUE(bend);
+ if (new_noteon < 0) {
+ ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
+ "Strange period %d",
+ ModV[v].period);
+ return;
+ }
++ bend = WHEEL_VALUE(bend);
+
+ ModV[v].noteon = new_noteon;
+ ModV[v].time = at;
+@@ -590,9 +593,13 @@ void load_module_samples (SAMPLE * s, in
+ special_patch[i]->sample = sp =
+ (Sample *)safe_malloc(sizeof(Sample));
+ memset(sp, 0, sizeof(Sample));
+- strncpy(name, s->samplename, 22);
+- name[22] = '\0';
+- code_convert(name, NULL, 23, NULL, "ASCII");
++ memset(name, 0, 23 * sizeof(char));
++ if (s->samplename != NULL)
++ {
++ strncpy(name, s->samplename, 22);
++ name[22] = '\0';
++ code_convert(name, NULL, 23, NULL, "ASCII");
++ }
+ if(name[0] == '\0')
+ special_patch[i]->name = NULL;
+ else
+Index: timidity/timidity/aRts_a.c
+===================================================================
+RCS file: /cvsroot/timidity/timidity/timidity/aRts_a.c,v
+retrieving revision 1.7
+retrieving revision 1.9
+diff -u -p -r1.7 -r1.9
+--- timidity/timidity/aRts_a.c 13 Jan 2004 14:27:48 -0000 1.7
++++ timidity/timidity/aRts_a.c 4 Dec 2004 14:32:31 -0000 1.9
+@@ -56,6 +56,7 @@
+ #include "playmidi.h"
+ #include "miditrace.h"
+
++static int arts_init_state = 0; /* 0=no init, 1=arts_init, 2=arts_free */
+ static arts_stream_t stream = 0;
+ static int server_buffer = 0;
+ static int output_count = 0;
+@@ -64,9 +65,11 @@ static int open_output(void); /* 0=succe
+ static void close_output(void);
+ static int output_data(char *buf, int32 nbytes);
+ static int acntl(int request, void *arg);
+-static int detect(void);
+
+-/* export the playback mode */
++/* export the playback mode. aRts cannot support auto-detection properly
++ * see TiMidity bug report #35 on Kagemai. Do not add any functionality
++ * that would require TiMidity to call arts_init() again after an
++ * arts_free(), it will blow up */
+
+ #define dpm arts_play_mode
+
+@@ -83,18 +86,8 @@ PlayMode dpm = {
+ close_output,
+ output_data,
+ acntl,
+- detect
+ };
+
+-static int detect(void)
+-{
+- if (arts_init() == 0) {
+- arts_free();
+- return 1; /* ok, found */
+- }
+- return 0;
+-}
+-
+ /*************************************************************************/
+ /* We currently only honor the PE_MONO bit, and the sample rate. */
+
+@@ -114,10 +107,19 @@ static int open_output(void)
+ channels = (dpm.encoding & PE_MONO) ? 1 : 2;
+
+ /* Open the audio device */
+- if((i = arts_init()) != 0)
+- {
+- ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
+- dpm.name, arts_error_text(i));
++ switch (arts_init_state) {
++ case 0:
++ if((i = arts_init()) != 0)
++ {
++ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
++ dpm.name, arts_error_text(i));
++ return -1;
++ }
++ arts_init_state = 1;
++ break;
++ case 2:
++ ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
++ "TiMidity aRts bug: open_output() after close_output() not
supported");
+ return -1;
+ }
+ stream = arts_play_stream(dpm.rate,
+@@ -187,6 +189,7 @@ static void close_output(void)
+ return;
+ arts_close_stream(stream);
+ arts_free();
++ arts_init_state = 2;
+ stream = 0;
+ }
+
+@@ -197,7 +200,6 @@ static int acntl(int request, void *arg)
+ {
+ case PM_REQ_DISCARD: /* Discard stream */
+ arts_close_stream(stream);
+- arts_free();
+ stream=NULL;
+ return 0;
+ case PM_REQ_RATE: /* Change sample rate */
+Index: timidity/interface/gtk_i.c
+===================================================================
+RCS file: /cvsroot/timidity/timidity/interface/gtk_i.c,v
+retrieving revision 1.8
+retrieving revision 1.9
+diff -u -p -r1.8 -r1.9
+--- timidity/interface/gtk_i.c 9 Sep 2004 05:23:17 -0000 1.8
++++ timidity/interface/gtk_i.c 21 Dec 2004 18:02:28 -0000 1.9
+@@ -365,6 +365,7 @@ void
+ Launch_Gtk_Process(int pipe_number)
+ {
+ int argc = 0;
++ gchar **argv = NULL;
+ GtkWidget *button, *mbar, *swin;
+ GtkWidget *table, *align, *handlebox;
+ GtkWidget *vbox, *hbox, *vbox2, *scrolled_win;
+@@ -373,7 +374,7 @@ Launch_Gtk_Process(int pipe_number)
+ /* enable locale */
+ gtk_set_locale ();
+
+- gtk_init (&argc, NULL);
++ gtk_init (&argc, &argv);
+
+ ttip = create_yellow_tooltips();
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
Added:
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-default-config-path.patch
==============================================================================
--- (empty file)
+++
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-default-config-path.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,34 @@
+--- TiMidity++-2.13.2/doc/C/timidity.cfg.5.bak 2004-04-25 17:35:50.000000000
+0800
++++ TiMidity++-2.13.2/doc/C/timidity.cfg.5 2005-02-15 19:18:26.136996488
+0800
+@@ -470,9 +470,9 @@
+ will read from the output of cat fild.mid.
+ .SH FILES
+ .TP
+-.B /etc/timidity.cfg
++.B /etc/timidity/timidity.cfg
+ .TP
+-.B /usr/local/share/timidity/timidity.cfg
++.B /usr/share/timidity/timidity.cfg
+ .SH SEE ALSO
+ timidity(1), lsmidiprog(1), mididump(1), patinfo(1), sf2text(1), wav2pat(1)
+ .SH COPYRIGHT
+--- TiMidity++-2.13.2/timidity/timidity.h.bak 2004-05-02 11:28:05.000000000
+0800
++++ TiMidity++-2.13.2/timidity/timidity.h 2005-02-15 19:16:11.322491408
+0800
+@@ -41,7 +41,8 @@
+
+ /* You could specify a complete path, e.g. "/etc/timidity.cfg", and
+ then specify the library directory in the configuration file. */
+-/* #define CONFIG_FILE "/etc/timidity.cfg" */
++#define CONFIG_FILE "/etc/timidity/timidity.cfg"
++#if 0
+ #ifndef CONFIG_FILE
+ # ifdef DEFAULT_PATH
+ # define CONFIG_FILE DEFAULT_PATH "/timidity.cfg"
+@@ -49,6 +50,7 @@
+ # define CONFIG_FILE PKGDATADIR "/timidity.cfg"
+ # endif /* DEFAULT_PATH */
+ #endif /* CONFIG_FILE */
++#endif
+
+
+ /* Filename extension, followed by command to run decompressor so that
Added: packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-emacs.patch
==============================================================================
--- (empty file)
+++ packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-emacs.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,23 @@
+--- TiMidity++-2.13.2/configure.in.emacs 2005-02-16 01:14:04.726491000
+0800
++++ TiMidity++-2.13.2/configure.in 2005-02-16 02:50:33.549456840 +0800
+@@ -1602,7 +1602,8 @@
+ [ ELFILES="$ELFILES timidity.el"
+ INTERFACE_SRCS="$INTERFACE_SRCS emacs_c.c"
+ ],
+- [ ELFILES="$ELFILES timidity.el" ])
++ [ ELFILES="$ELFILES timidity.el"
++ AM_CONDITIONAL(ENABLE_EMACS, true)])
+
+ dnl VT100
+ AM_CONDITIONAL(ENABLE_VT100, false)
+--- TiMidity++-2.13.2/interface/timidity.el.emacs 2002-01-15
18:53:20.000000000 +0800
++++ TiMidity++-2.13.2/interface/timidity.el 2005-02-16 03:22:06.513682536
+0800
+@@ -35,7 +35,7 @@
+
+ ;; Configuration parameters.
+ ; Absolute path of timidity.
+-(defvar timidity-prog-path "/usr/local/bin/timidity")
++(defvar timidity-prog-path "/usr/bin/timidity")
+
+ ; String list for timidity program options.
+ (defvar timidity-default-options nil)
Added:
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-speex-header-path.patch
==============================================================================
--- (empty file)
+++
packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-speex-header-path.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,24 @@
+--- TiMidity++-2.13.2/configure.in.bak 2004-10-03 20:39:52.000000000 +0800
++++ TiMidity++-2.13.2/configure.in 2005-02-15 19:40:48.296957160 +0800
+@@ -1230,7 +1230,7 @@
+ if test "x$au_enable_speex" = xyes; then
+ AC_CACHE_VAL(have_speex,
+ [AC_TRY_LINK([
+- #include <speex.h>
++ #include <speex/speex.h>
+ #include <ogg/ogg.h>
+ ],
+ [
+--- TiMidity++-2.13.2/timidity/speex_a.c.bak 2004-04-23 16:18:04.000000000
+0800
++++ TiMidity++-2.13.2/timidity/speex_a.c 2005-02-15 19:41:21.622890848
+0800
+@@ -33,8 +33,8 @@
+ #include <fcntl.h>
+ #endif
+
+-#include <speex.h>
+-#include <speex_header.h>
++#include <speex/speex.h>
++#include <speex/speex_header.h>
+ #include <ogg/ogg.h>
+
+ #include "timidity.h"
Added: packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-tcl.patch
==============================================================================
--- (empty file)
+++ packages/cooker/TiMidity++/current/SOURCES/timidity-2.13.2-tcl.patch
Tue Oct 10 16:56:26 2006
@@ -0,0 +1,16 @@
+--- TiMidity++-2.13.2/interface/tkmidity.ptcl.bak 2005-02-16
05:18:15.157287000 +0800
++++ TiMidity++-2.13.2/interface/tkmidity.ptcl 2005-02-16 05:39:45.403140496
+0800
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/wishx -f
++#!/usr/bin/wishx -f
+ #
+ # TiMidity++ -- MIDI to WAVE converter and player
+ # Copyright (C) 1999-2002 Masanao Izumo <[EMAIL PROTECTED]>
+--- TiMidity++-2.13.2/interface/tkpanel.tcl.bak 2002-01-15
18:53:20.000000000 +0800
++++ TiMidity++-2.13.2/interface/tkpanel.tcl 2005-02-16 05:40:19.990882360
+0800
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/wishx -f
++#!/usr/bin/wishx -f
+ #
+ # TiMidity++ -- MIDI to WAVE converter and player
+ # Copyright (C) 1999-2002 Masanao Izumo <[EMAIL PROTECTED]>
Modified: packages/cooker/TiMidity++/current/SPECS/TiMidity++.spec
==============================================================================
--- packages/cooker/TiMidity++/current/SPECS/TiMidity++.spec (original)
+++ packages/cooker/TiMidity++/current/SPECS/TiMidity++.spec Tue Oct 10
16:56:26 2006
@@ -47,6 +47,8 @@
# (Abel) CVS fixes for 2.13.2
Patch4: timidity-2.13.2-cvs-fixes.patch.bz2
Patch5: TiMidity++-2.13.2-gcc4.patch.bz2
+#(nl) CVS Fix Build against portaudio V19
+Patch6: Timidity-fix-portaudioV19-build.diff
Requires: timidity-instruments = %{patch_pkg_version}
BuildRequires: alsa-lib-devel arts-devel emacs-bin esound-devel gtk2-devel
BuildRequires: jackit-devel lesstif-devel libao-devel libflac-devel
@@ -85,6 +87,7 @@
%patch3 -p1
%patch4 -p1 -b .cvs
%patch5 -p1 -b .gcc4
+%patch6 -p0 -b .portaudioV19
autoconf