Sf2Player: preserve custom track name when loading settings
Commit a184bc039e introduced a regression
which causes a custom track name not being preserved when loading
setings.
Closes #534.
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sf2_player.h - a soundfont2 player using fluidSynth
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail/dot/com>
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user