diff --git a/ChangeLog b/ChangeLog index 8c4cb98af..c0ce0777c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-22 Danny McRae + + * plugins/audio_file_processor/audio_file_processor.h: + * plugins/audio_file_processor/audio_file_processor.cpp: + added a switch to setAudioFile to force the track name to be + used for the track if a name already exists. Fixes the problem + of having tracks being renamed to the file name when loading a + saved song. + 2006-05-20 Tobias Doerffel * data/locale/de.ts: diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 63582eae8..a5648c5e7 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -313,7 +313,7 @@ void audioFileProcessor::loadSettings( const QDomElement & _this ) { if( _this.attribute( "src" ) != "" ) { - setAudioFile( _this.attribute( "src" ) ); + setAudioFile( _this.attribute( "src" ), FALSE ); } else if( _this.attribute( "sampledata" ) != "" ) { @@ -368,12 +368,13 @@ Uint32 audioFileProcessor::getBeatLen( notePlayHandle * _n ) const -void audioFileProcessor::setAudioFile( const QString & _audio_file ) +void audioFileProcessor::setAudioFile( const QString & _audio_file, bool _rename ) { // is current channel-name equal to previous-filename?? - if( getInstrumentTrack()->name() == + if( _rename && + ( getInstrumentTrack()->name() == QFileInfo( m_sampleBuffer.audioFile() ).fileName() || - m_sampleBuffer.audioFile() == "" ) + m_sampleBuffer.audioFile() == "" ) ) { // then set it to new one getInstrumentTrack()->setName( QFileInfo( _audio_file diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index f6c7f4b76..308e4570c 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -72,7 +72,7 @@ public: public slots: - void setAudioFile( const QString & _audio_file ); + void setAudioFile( const QString & _audio_file, bool _rename = TRUE ); protected slots: