From 44c37775a4af86a44327b2078c4694d92ff1341a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 11 Jun 2013 13:25:18 +0200 Subject: [PATCH] Sf2Player: preserve custom track name when loading settings Commit a184bc039e8ac3064491772fd4d1d512619ac903 introduced a regression which causes a custom track name not being preserved when loading setings. Closes #534. --- plugins/sf2_player/sf2_player.cpp | 9 ++++++--- plugins/sf2_player/sf2_player.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 453ac05e6..f03153783 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -228,7 +228,7 @@ void sf2Instrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) void sf2Instrument::loadSettings( const QDomElement & _this ) { - openFile( _this.attribute( "src" ) ); + openFile( _this.attribute( "src" ), false ); m_patchNum.loadSettings( _this, "patch" ); m_bankNum.loadSettings( _this, "bank" ); @@ -329,7 +329,7 @@ void sf2Instrument::freeFont() -void sf2Instrument::openFile( const QString & _sf2File ) +void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName ) { emit fileLoading(); @@ -390,7 +390,10 @@ void sf2Instrument::openFile( const QString & _sf2File ) delete[] sf2Ascii; - instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() ); + if( updateTrackName ) + { + instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() ); + } } diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index 1c1ef2764..9c7412bc1 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -2,7 +2,7 @@ * sf2_player.h - a soundfont2 player using fluidSynth * * Copyright (c) 2008 Paul Giblock - * Copyright (c) 2009 Tobias Doerffel + * Copyright (c) 2009-2013 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -91,7 +91,7 @@ public: public slots: - void openFile( const QString & _sf2File ); + void openFile( const QString & _sf2File, bool updateTrackName = true ); void updatePatch(); void updateSampleRate();