From f42196315c8c65148e8c65f435b885433fb36021 Mon Sep 17 00:00:00 2001 From: tresf Date: Wed, 4 Jun 2014 08:52:12 -0400 Subject: [PATCH 1/4] SF2/VST title rename #462 w/ #774 recommendations --- plugins/sf2_player/sf2_player.cpp | 4 ++-- plugins/vestige/vestige.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 4fba5c648..2647ca1f3 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -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() ); } } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 4c907c9a2..8413f3ebd 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -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 ) @@ -310,12 +311,12 @@ void vestigeInstrument::play( sampleFrame * _buf ) -bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset ) +bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time ) { m_pluginMutex.lock(); if( m_plugin != NULL ) { - m_plugin->processMidiEvent( event, offset ); + m_plugin->processMidiEvent( event, time ); } m_pluginMutex.unlock(); From 7a03353fb6b6d3f9091ae32d3b9e1d90f093271e Mon Sep 17 00:00:00 2001 From: tresf Date: Wed, 4 Jun 2014 08:55:30 -0400 Subject: [PATCH 2/4] Export dialog append wav/ogg #764 w/ #779 recommendations --- src/core/song.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/core/song.cpp b/src/core/song.cpp index 5f3719a8a..0d8eaac44 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -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(); } } From e06759d0d8084f5527104d75adb76b8cd0722cb3 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Wed, 4 Jun 2014 08:58:06 -0400 Subject: [PATCH 3/4] Formatting fixes --- plugins/sf2_player/sf2_player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 2647ca1f3..55c199ca0 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -352,7 +352,7 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName ) delete[] sf2Ascii; - if( updateTrackName || instrumentTrack()->displayName() == displayName()) + if( updateTrackName || instrumentTrack()->displayName() == displayName() ) { instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() ); } From 922ab25217fc93aa57a3e6b0d48ac46a3fb11419 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Wed, 4 Jun 2014 09:03:19 -0400 Subject: [PATCH 4/4] Fast forward vesa's sample-accurate changes --- plugins/vestige/vestige.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 8413f3ebd..7ae8dbcdd 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -311,12 +311,12 @@ void vestigeInstrument::play( sampleFrame * _buf ) -bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time ) +bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset ) { m_pluginMutex.lock(); if( m_plugin != NULL ) { - m_plugin->processMidiEvent( event, time ); + m_plugin->processMidiEvent( event, offset ); } m_pluginMutex.unlock();