Skip to content

Commit

Permalink
Merge pull request #808 from tresf/stable-1.1
Browse files Browse the repository at this point in the history
SF2/VST Title Fixes, Export Dialog Fixes
  • Loading branch information
tobydox committed Jun 5, 2014
2 parents ab493ea + 922ab25 commit dba1e75
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugins/sf2_player/sf2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
}

Expand Down
7 changes: 4 additions & 3 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
26 changes: 21 additions & 5 deletions src/core/song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit dba1e75

Please sign in to comment.