From aba3cab0ea6f0742f2d25c6b6a8735a849d8e3ed Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 3 Mar 2008 23:28:00 +0000 Subject: [PATCH] fixed open-file-dialog, fixed order of member-variable-initialization git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@761 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 8 ++++++++ plugins/sf2_player/sf2_player.cpp | 33 +++++++++++++++---------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16a06dac2..3ac2082b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-03-03 Tobias Doerffel + * plugins/sf2_player/sf2_player.cpp: + - fixed open-file-dialog + - fixed order of member-variable-initialization + + * src/lib/sample_buffer.cpp: + added MP3-files to file-dialog-filter as they theoretically should be + supported through SDL_sound-library + * src/core/mixer.cpp: always process all note-play-handles of monophonic instruments by the same thread serially - fixes problems with monophonic instruments diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 0fad1a111..9532ce31b 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -67,10 +67,10 @@ plugin::descriptor sf2player_plugin_descriptor = sf2Instrument::sf2Instrument( instrumentTrack * _instrument_track ) : instrument( _instrument_track, &sf2player_plugin_descriptor ), - m_bankNum( -1, -1, 999, 1, this ), - m_patchNum( -1, -1, 127, 1, this ), + m_fontId( 0 ), m_filename( "" ), - m_fontId( 0 ) + m_bankNum( -1, -1, 999, 1, this ), + m_patchNum( -1, -1, 127, 1, this ) { m_settings = new_fluid_settings(); @@ -349,26 +349,25 @@ void sf2InstrumentView::showFileDialog( void ) types << tr( "SoundFont2-Files (*.sf2)" ); ofd.setFilters( types ); - if( k->m_filename == "" ) + QString dir; + if( k->m_filename != "" ) { - ofd.setDirectory( - configManager::inst()->userSamplesDir() ); - } - else if( QFileInfo( k->m_filename ).isRelative() ) - { - QString f = configManager::inst()->userSamplesDir() - + k->m_filename; - if( QFileInfo( f ).exists() == FALSE ) + QString f = k->m_filename; + if( QFileInfo( f ).isRelative() ) { - f = configManager::inst()->factorySamplesDir() - + k->m_filename; + f = configManager::inst()->userSamplesDir() + f; + if( QFileInfo( f ).exists() == FALSE ) + { + f = configManager::inst()->factorySamplesDir() + + k->m_filename; + } } - - ofd.selectFile( f ); + ofd.setDirectory( QFileInfo( f ).absolutePath() ); + ofd.selectFile( QFileInfo( f ).fileName() ); } else { - ofd.selectFile( k->m_filename ); + ofd.setDirectory( configManager::inst()->userSamplesDir() ); } if( ofd.exec() == QDialog::Accepted && !ofd.selectedFiles().isEmpty() )