From c6aa917e9c08ae4652d92edd66ed6cb06161a2d4 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Mon, 11 Dec 2006 03:18:16 +0000 Subject: [PATCH] enabled speex, fixed SDL_sound and ladspa segfault git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@438 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 14 ++++++++++++++ configure.in | 4 ++-- include/sample_buffer.h | 4 ++-- plugins/ladspa_effect/ladspa_effect.cpp | 6 ++++++ src/core/file_browser.cpp | 3 ++- src/core/main_window.cpp | 2 +- src/lib/sample_buffer.cpp | 20 ++++++++++---------- 7 files changed, 37 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index c88a75afb4..011ae76c1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2006-12-11 Javier Serrano Polo + + * include/sample_buffer.h: + * src/lib/sample_buffer.cpp: + - fixed SDL_sound decoding + - enabled speex samples + + * src/core/file_browser.cpp: + * src/core/main_window.cpp: + enabled speex samples + + * plugins/ladspa_effect/ladspa_effect.cpp: + fixed adding effect segfault + 2006-12-09 Tobias Doerffel * configure.in: diff --git a/configure.in b/configure.in index 9530fcf7a7..315ee31eab 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.2.1-svn20061209, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061209) +AC_INIT(lmms, 0.2.1-svn20061211, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.2.1-svn20061211) AM_CONFIG_HEADER(config.h) diff --git a/include/sample_buffer.h b/include/sample_buffer.h index 0dadfcba95..007c890672 100644 --- a/include/sample_buffer.h +++ b/include/sample_buffer.h @@ -201,8 +201,8 @@ private: #ifdef SDL_SDL_SOUND_H f_cnt_t FASTCALL decodeSampleSDL( const char * _f, int_sample_t * & _buf, - ch_cnt_t & _channels, - sample_rate_t & _sample_rate ); + ch_cnt_t _channels, + sample_rate_t _sample_rate ); #endif #ifdef HAVE_SNDFILE_H f_cnt_t FASTCALL decodeSampleSF( const char * _f, diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 7dc981c353..96e9485f84 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -107,6 +107,7 @@ ladspaEffect::ladspaEffect( effect::constructionData * _cdata ) : p->name = m_ladspa->getPortName( m_key, port ); p->proc = proc; p->port_id = port; + p->control = NULL; // Determine the port's category. if( m_ladspa->isPortAudio( m_key, port ) ) @@ -381,6 +382,11 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf, } break; case CONTROL_RATE_INPUT: + if( m_ports[proc][port]->control == + NULL ) + { + break; + } m_ports[proc][port]->value = static_cast( m_ports[proc][port]->control->getValue() / diff --git a/src/core/file_browser.cpp b/src/core/file_browser.cpp index d9cec91844..3949c65b92 100644 --- a/src/core/file_browser.cpp +++ b/src/core/file_browser.cpp @@ -938,7 +938,8 @@ void fileItem::determineFileType( void ) } else if( ext == "wav" || ext == "ogg" || ext == "mp3" || ext == "aiff" || ext == "aif" || ext == "voc" || - ext == "au" || ext == "raw" || ext == "flac" ) + ext == "au" || ext == "raw" || ext == "flac" || + ext == "spx" ) { m_type = SAMPLE_FILE; } diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index 383322e78f..029d9e1904 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -140,7 +140,7 @@ mainWindow::mainWindow( engine * _engine ) : side_bar->appendTab( new fileBrowser( configManager::inst()->factorySamplesDir() + "*" + configManager::inst()->userSamplesDir(), - "*.wav *.ogg *.au" + "*.wav *.ogg *.spx *.au" "*.voc *.aif *.aiff *.flac *.raw", tr( "My samples" ), embed::getIconPixmap( "sound_file" ), diff --git a/src/lib/sample_buffer.cpp b/src/lib/sample_buffer.cpp index a78efbd284..71b9c87061 100644 --- a/src/lib/sample_buffer.cpp +++ b/src/lib/sample_buffer.cpp @@ -390,8 +390,8 @@ m_data[frame][chnl] = buf[idx] * fac; #ifdef SDL_SDL_SOUND_H f_cnt_t sampleBuffer::decodeSampleSDL( const char * _f, int_sample_t * & _buf, - ch_cnt_t & _channels, - sample_rate_t & _samplerate ) + ch_cnt_t _channels, + sample_rate_t _samplerate ) { Sound_AudioInfo STD_AUDIO_INFO = { @@ -408,8 +408,6 @@ f_cnt_t sampleBuffer::decodeSampleSDL( const char * _f, { // let SDL_sound decode our file to requested format ( void )Sound_DecodeAll( snd_sample ); - _channels = snd_sample->actual.channels; - _samplerate = snd_sample->actual.rate; frames = snd_sample->buffer_size / ( BYTES_PER_INT_SAMPLE * _channels ); _buf = new int_sample_t[frames * _channels]; @@ -1052,11 +1050,12 @@ QString sampleBuffer::openAudioFile( void ) const // set filters #ifdef QT4 QStringList types; - types << tr( "All Audio-Files (*.wav *.ogg *.flac *.voc *.aif *.aiff " - "*.au *.raw)" ) + types << tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc *.aif " + "*.aiff *.au *.raw)" ) << tr( "Wave-Files (*.wav)" ) << tr( "OGG-Files (*.ogg)" ) << tr( "FLAC-Files (*.flac)" ) + << tr( "SPEEX-Files (*.spx)" ) //<< tr( "MP3-Files (*.mp3)" ) //<< tr( "MIDI-Files (*.mid)" ) << tr( "VOC-Files (*.voc)" ) @@ -1067,11 +1066,12 @@ QString sampleBuffer::openAudioFile( void ) const ; ofd.setFilters( types ); #else - ofd.addFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.voc *.aif " - "*.aiff *.au *.raw)" ) ); + ofd.addFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc " + "*.aif *.aiff *.au *.raw)" ) ); ofd.addFilter( tr( "Wave-Files (*.wav)" ) ); ofd.addFilter( tr( "OGG-Files (*.ogg)" ) ); ofd.addFilter( tr( "FLAC-Files (*.flac)" ) ); + ofd.addFilter( tr( "SPEEX-Files (*.spx)" ) ); //ofd.addFilter (tr("MP3-Files (*.mp3)")); //ofd.addFilter (tr("MIDI-Files (*.mid)"));^ ofd.addFilter( tr( "VOC-Files (*.voc)" ) ); @@ -1079,8 +1079,8 @@ QString sampleBuffer::openAudioFile( void ) const ofd.addFilter( tr( "AU-Files (*.au)" ) ); ofd.addFilter( tr( "RAW-Files (*.raw)" ) ); //ofd.addFilter (tr("MOD-Files (*.mod)")); - ofd.setSelectedFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.voc " - "*.aif *.aiff *.au *.raw)" ) ); + ofd.setSelectedFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx " + "*.voc *.aif *.aiff *.au *.raw)" ) ); #endif if( m_audioFile != "" ) {