Merge pull request #808 from tresf/stable-1.1
SF2/VST Title Fixes, Export Dialog Fixes
This commit is contained in:
@@ -352,9 +352,9 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName )
|
||||
|
||||
delete[] sf2Ascii;
|
||||
|
||||
if( updateTrackName )
|
||||
if( updateTrackName || instrumentTrack()->displayName() == displayName() )
|
||||
{
|
||||
instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() );
|
||||
instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,9 +237,10 @@ void vestigeInstrument::loadFile( const QString & _file )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
const bool set_ch_name = ( m_plugin != NULL &&
|
||||
instrumentTrack()->name() == m_plugin->name() ) ||
|
||||
instrumentTrack()->name() ==
|
||||
InstrumentTrack::tr( "Default preset" );
|
||||
instrumentTrack()->name() == m_plugin->name() ) ||
|
||||
instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) ||
|
||||
instrumentTrack()->name() == displayName();
|
||||
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
if ( m_plugin != NULL )
|
||||
|
||||
@@ -1195,12 +1195,28 @@ void song::exportProject(bool multiExport)
|
||||
efd.setAcceptMode( FileDialog::AcceptSave );
|
||||
|
||||
|
||||
if( efd.exec() == QDialog::Accepted &&
|
||||
!efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() )
|
||||
if( efd.exec() == QDialog::Accepted && !efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() )
|
||||
{
|
||||
const QString export_file_name = efd.selectedFiles()[0];
|
||||
exportProjectDialog epd( export_file_name,
|
||||
engine::mainWindow(), multiExport );
|
||||
QString suffix = "";
|
||||
if ( !multiExport )
|
||||
{
|
||||
int stx = efd.selectedNameFilter().indexOf( "(*." );
|
||||
int etx = efd.selectedNameFilter().indexOf( ")" );
|
||||
|
||||
if ( stx > 0 && etx > stx )
|
||||
{
|
||||
// Get first extension from selected dropdown.
|
||||
// i.e. ".wav" from "WAV-File (*.wav), Dummy-File (*.dum)"
|
||||
suffix = efd.selectedNameFilter().mid( stx + 2, etx - stx - 2 ).split( " " )[0].trimmed();
|
||||
if ( efd.selectedFiles()[0].endsWith( suffix ) )
|
||||
{
|
||||
suffix = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QString export_file_name = efd.selectedFiles()[0] + suffix;
|
||||
exportProjectDialog epd( export_file_name, engine::mainWindow(), multiExport );
|
||||
epd.exec();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user