From 523e5d048b5c28bf15f2a11412cbb8ca986f7af1 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 15 Jan 2015 15:32:55 -0500 Subject: [PATCH 01/43] Bump version for stable-1.1 patch release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1933f6a1e6d..749d7cb3590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "1") -SET(VERSION_PATCH "0") +SET(VERSION_PATCH "1") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) From d8e552de80f4a7d2834843b808369315cb5b4b40 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Thu, 15 Jan 2015 22:15:04 +0100 Subject: [PATCH 02/43] Fix calcSlope1 was not declared errors --- plugins/monstro/Monstro.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index dc516195905..d93af440749 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -784,7 +784,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * } else if( m_env_phase[i] < 2.0f ) // attack phase { - env[i][f] = calcSlope1( fraction( m_env_phase[i] ) ); + env[i][f] = calcSlope( i, fraction( m_env_phase[i] ) ); m_env_phase[i] = qMin( 2.0f, m_env_phase[i] + m_env_att[i] ); } else if( m_env_phase[i] < 3.0f ) // hold phase @@ -794,7 +794,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * } else if( m_env_phase[i] < 4.0f ) // decay phase { - const sample_t s = calcSlope1( 1.0f - fraction( m_env_phase[i] ) ); + const sample_t s = calcSlope( i, 1.0f - fraction( m_env_phase[i] ) ); if( s <= m_env_sus[i] ) { env[i][f] = m_env_sus[i]; @@ -808,7 +808,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * } else if( m_env_phase[i] < 5.0f ) // release phase { - env[i][f] = calcSlope1( 1.0f - fraction( m_env_phase[i] ) ); + env[i][f] = calcSlope( i, 1.0f - fraction( m_env_phase[i] ) ); m_env_phase[i] += m_env_rel[i]; } else env[i][f] = 0.0f; From 1ba3088554edf3e2e830ef84992e64a7e85e55ea Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 19 Jan 2015 14:04:57 +0000 Subject: [PATCH 03/43] Proposed fix for 1649 for stable-1.1 --- plugins/stk/mallets/mallets.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index c22ea0f238c..c820032006e 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -81,15 +81,6 @@ malletsInstrument::malletsInstrument( InstrumentTrack * _instrument_track ): !QFileInfo( configManager::inst()->stkDir() + QDir::separator() + "sinewave.raw" ).exists() ) { - // try to inform user about missing Stk-installation - if( m_filesMissing && engine::hasGUI() ) - { - QMessageBox::information( 0, tr( "Missing files" ), - tr( "Your Stk-installation seems to be " - "incomplete. Please make sure " - "the full Stk-package is installed!" ), - QMessageBox::Ok ); - } // ModalBar m_presetsModel.addItem( tr( "Marimba" ) ); @@ -334,6 +325,16 @@ malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument, m_spreadKnob->setLabel( tr( "Spread" ) ); m_spreadKnob->move( 190, 140 ); m_spreadKnob->setHintText( tr( "Spread:" ) + " ", "" ); + + // try to inform user about missing Stk-installation + if( _instrument->m_filesMissing && engine::hasGUI() ) + { + QMessageBox::information( 0, tr( "Missing files" ), + tr( "Your Stk-installation seems to be " + "incomplete. Please make sure " + "the full Stk-package is installed!" ), + QMessageBox::Ok ); + } } From ffe7e8b8fae63e25f23a538d6ad7ccff0b30f387 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 22 Jan 2015 22:24:23 +0100 Subject: [PATCH 04/43] Travis: updated name of PPA with MinGW-X packages for Precise --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4dd7576f82d..cfd45e66590 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: - TARGET_OS=win32 - TARGET_OS=win64 before_install: - - if [ $TARGET_OS != linux ]; then sudo add-apt-repository ppa:tobydox/mingw -y; fi + - if [ $TARGET_OS != linux ]; then sudo add-apt-repository ppa:tobydox/mingw-x-precise -y; fi - sudo apt-get update -qq install: - if [ $TARGET_OS != linux ]; then sudo apt-get install -y nsis cloog-isl libmpc2 mingw32; fi From d64e93b41a502814968d540c232230fc0be87b9b Mon Sep 17 00:00:00 2001 From: Fastigium Date: Sat, 7 Feb 2015 15:21:01 +0100 Subject: [PATCH 05/43] RT-safe fix for race condition causing #1662 --- src/core/FxMixer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 7f78afc9f35..b99acc35654 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -98,8 +98,8 @@ inline void FxChannel::processed() void FxChannel::incrementDeps() { - m_dependenciesMet.ref(); - if( m_dependenciesMet >= m_receives.size() && ! m_queued ) + int i = m_dependenciesMet.fetchAndAddOrdered( 1 ) + 1; + if( i >= m_receives.size() && ! m_queued ) { m_queued = true; MixerWorkerThread::addJob( this ); From 9e3f344c704449e82e475efb1f9f55e970ef8a90 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 10 Feb 2015 10:19:05 -0500 Subject: [PATCH 06/43] Bump version for stable-1.1 patch release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 749d7cb3590..95dcbe859b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "1") -SET(VERSION_PATCH "1") +SET(VERSION_PATCH "2") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) From 9312c920139070c6d666f2706ba2468dca24eb2e Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 31 Jan 2015 12:43:14 +0000 Subject: [PATCH 07/43] Save and load the mute flag for automation patterns --- src/core/AutomationPattern.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 67894080f6f..5de57b4398a 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -391,6 +391,7 @@ void AutomationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this ) _this.setAttribute( "name", name() ); _this.setAttribute( "prog", QString::number( progressionType() ) ); _this.setAttribute( "tens", QString::number( getTension() ) ); + _this.setAttribute( "mute", QString::number( isMuted() ) ); for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); ++it ) @@ -425,6 +426,7 @@ void AutomationPattern::loadSettings( const QDomElement & _this ) setProgressionType( static_cast( _this.attribute( "prog" ).toInt() ) ); setTension( _this.attribute( "tens" ) ); + setMuted(_this.attribute( "mute", QString::number( false ) ).toInt() ); for( QDomNode node = _this.firstChild(); !node.isNull(); node = node.nextSibling() ) From 3cc2091620a6c7119d7bc815743f5d1e44c0a448 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 15 Feb 2015 20:02:46 +0100 Subject: [PATCH 08/43] Fixed path to FLTK DLL mingw-x-fltk >= 1.3.3 has the FLTK DLL inside the bin directory like all the other library packages as well. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95dcbe859b5..6403157377c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,7 +484,7 @@ IF(LMMS_BUILD_WIN32) "${MINGW_PREFIX}/bin/libvorbisfile-3.dll" "${MINGW_PREFIX}/bin/libjpeg-9.dll" "${MINGW_PREFIX}/bin/libogg-0.dll" - "${MINGW_PREFIX}/lib/libfltk.dll" + "${MINGW_PREFIX}/bin/libfltk.dll" "${MINGW_PREFIX}/bin/libfluidsynth.dll" "${MINGW_PREFIX}/bin/libfftw3f-3.dll" "${MINGW_PREFIX}/bin/libFLAC-8.dll" From 8e9d902fa0541ba45b0860f98da52bde520bc19a Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Mon, 26 Jan 2015 22:00:23 -0200 Subject: [PATCH 09/43] Refactor moving track views up and down --- include/TrackContainerView.h | 5 ++- src/gui/TrackContainerView.cpp | 67 ++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 42e56128fc4..c6e555651aa 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -103,8 +103,9 @@ class TrackContainerView : public QWidget, public ModelView, return m_tc; } - void moveTrackViewUp( TrackView * _tv ); - void moveTrackViewDown( TrackView * _tv ); + void moveTrackView( TrackView * trackView, int indexTo ); + void moveTrackViewUp( TrackView * trackView ); + void moveTrackViewDown( TrackView * trackView ); // -- for usage by trackView only --------------- TrackView * addTrackView( TrackView * _tv ); diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 4513e9edfd8..5c908856dde 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -156,45 +156,48 @@ void TrackContainerView::removeTrackView( TrackView * _tv ) -void TrackContainerView::moveTrackViewUp( TrackView * _tv ) +void TrackContainerView::moveTrackView( TrackView * trackView, int indexTo ) { - for( int i = 1; i < m_trackViews.size(); ++i ) - { - TrackView * t = m_trackViews[i]; - if( t == _tv ) - { - BBTrack::swapBBTracks( t->getTrack(), - m_trackViews[i - 1]->getTrack() ); - m_scrollLayout->removeWidget( t ); - m_scrollLayout->insertWidget( i - 1, t ); - qSwap( m_tc->m_tracks[i-1], m_tc->m_tracks[i] ); - m_trackViews.swap( i - 1, i ); - realignTracks(); - break; - } - } + // Can't move out of bounds + if ( indexTo >= m_trackViews.size() || indexTo < 0 ) { return; } + + // Does not need to move to itself + int indexFrom = m_trackViews.indexOf( trackView ); + if ( indexFrom == indexTo ) { return; } + + BBTrack::swapBBTracks( trackView->getTrack(), + m_trackViews[indexTo]->getTrack() ); + + m_scrollLayout->removeWidget( trackView ); + m_scrollLayout->insertWidget( indexTo, trackView ); + + Track * track = m_tc->m_tracks[indexFrom]; + + m_tc->m_tracks.remove( indexFrom ); + m_tc->m_tracks.insert( indexTo, track ); + m_trackViews.move( indexFrom, indexTo ); + + realignTracks(); } -void TrackContainerView::moveTrackViewDown( TrackView * _tv ) +void TrackContainerView::moveTrackViewUp( TrackView * trackView ) { - for( int i = 0; i < m_trackViews.size()-1; ++i ) - { - TrackView * t = m_trackViews[i]; - if( t == _tv ) - { - BBTrack::swapBBTracks( t->getTrack(), - m_trackViews[i + 1]->getTrack() ); - m_scrollLayout->removeWidget( t ); - m_scrollLayout->insertWidget( i + 1, t ); - qSwap( m_tc->m_tracks[i], m_tc->m_tracks[i+1] ); - m_trackViews.swap( i, i + 1 ); - realignTracks(); - break; - } - } + int index = m_trackViews.indexOf( trackView ); + + moveTrackView( trackView, index - 1 ); +} + + + + +void TrackContainerView::moveTrackViewDown( TrackView * trackView ) +{ + int index = m_trackViews.indexOf( trackView ); + + moveTrackView( trackView, index + 1 ); } From 33893e51c4f9e403057538687e7641a84073c17c Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Tue, 27 Jan 2015 16:05:18 -0200 Subject: [PATCH 10/43] Move cloned tracks under the original --- include/Track.h | 2 +- include/TrackContainerView.h | 12 ++++++------ src/core/Track.cpp | 13 +++++++++---- src/gui/TrackContainerView.cpp | 11 +++++++++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/Track.h b/include/Track.h index 1bebffbf17a..73db6017a99 100644 --- a/include/Track.h +++ b/include/Track.h @@ -441,7 +441,7 @@ class EXPORT Track : public Model, public JournallingObject static Track * create( TrackTypes tt, TrackContainer * tc ); static Track * create( const QDomElement & element, TrackContainer * tc ); - void clone(); + Track * clone(); // pure virtual functions diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index c6e555651aa..b340325bd15 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -103,6 +103,11 @@ class TrackContainerView : public QWidget, public ModelView, return m_tc; } + const QList & trackViews() const + { + return( m_trackViews ); + } + void moveTrackView( TrackView * trackView, int indexTo ); void moveTrackViewUp( TrackView * trackView ); void moveTrackViewDown( TrackView * trackView ); @@ -122,7 +127,7 @@ class TrackContainerView : public QWidget, public ModelView, public slots: void realignTracks(); - void createTrackView( Track * _t ); + TrackView * createTrackView( Track * _t ); void deleteTrackView( TrackView * _tv ); virtual void dropEvent( QDropEvent * _de ); @@ -142,11 +147,6 @@ public slots: protected: static const int DEFAULT_PIXELS_PER_TACT = 16; - const QList & trackViews() const - { - return( m_trackViews ); - } - virtual void mousePressEvent( QMouseEvent * _me ); virtual void mouseMoveEvent( QMouseEvent * _me ); virtual void mouseReleaseEvent( QMouseEvent * _me ); diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 4f5440af0c1..e80e5eb24d1 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -1688,13 +1688,18 @@ void TrackOperationsWidget::paintEvent( QPaintEvent * pe ) - /*! \brief Clone this track * */ void TrackOperationsWidget::cloneTrack() { - m_trackView->getTrack()->clone(); + TrackContainerView *tcView = m_trackView->trackContainerView(); + + Track *newTrack = m_trackView->getTrack()->clone(); + TrackView *newTrackView = tcView->createTrackView( newTrack ); + + int index = tcView->trackViews().indexOf( m_trackView ); + tcView->moveTrackView( newTrackView, index + 1 ); } @@ -1904,12 +1909,12 @@ Track * Track::create( const QDomElement & element, TrackContainer * tc ) /*! \brief Clone a track from this track * */ -void Track::clone() +Track * Track::clone() { QDomDocument doc; QDomElement parent = doc.createElement( "clone" ); saveState( doc, parent ); - create( parent.firstChild().toElement(), m_trackContainer ); + return create( parent.firstChild().toElement(), m_trackContainer ); } diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 5c908856dde..2c823c264b0 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -222,11 +222,18 @@ void TrackContainerView::realignTracks() -void TrackContainerView::createTrackView( Track * _t ) +TrackView * TrackContainerView::createTrackView( Track * _t ) { //m_tc->addJournalCheckPoint(); - _t->createView( this ); + // Avoid duplicating track views + for( trackViewList::iterator it = m_trackViews.begin(); + it != m_trackViews.end(); ++it ) + { + if ( ( *it )->getTrack() == _t ) { return ( *it ); } + } + + return _t->createView( this ); } From d14f4511b2235906ad66c375ed9d4ad34db0283c Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Sat, 7 Mar 2015 21:47:14 -0500 Subject: [PATCH 11/43] Remove compiler optimizations for mingw, bump version Fixes #1757 --- CMakeLists.txt | 2 +- plugins/vst_base/CMakeLists.txt | 2 +- plugins/vst_base/Win64/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6403157377c..63af96cd90b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig) SET(VERSION_MAJOR "1") SET(VERSION_MINOR "1") -SET(VERSION_PATCH "2") +SET(VERSION_PATCH "3") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) diff --git a/plugins/vst_base/CMakeLists.txt b/plugins/vst_base/CMakeLists.txt index 9706667ae55..373604c53b6 100644 --- a/plugins/vst_base/CMakeLists.txt +++ b/plugins/vst_base/CMakeLists.txt @@ -6,7 +6,7 @@ IF(LMMS_BUILD_WIN32) ADD_DEFINITIONS(-DPTW32_STATIC_LIB) ADD_EXECUTABLE(RemoteVstPlugin "${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp") TARGET_LINK_LIBRARIES(RemoteVstPlugin -lQtCore4 -lpthread -lgdi32 -lws2_32) - SET_TARGET_PROPERTIES(RemoteVstPlugin PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -O3") + SET_TARGET_PROPERTIES(RemoteVstPlugin PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -O0") ADD_CUSTOM_COMMAND(TARGET RemoteVstPlugin POST_BUILD COMMAND "${STRIP}" "${CMAKE_CURRENT_BINARY_DIR}/RemoteVstPlugin.exe") INSTALL(TARGETS RemoteVstPlugin RUNTIME DESTINATION "${PLUGIN_DIR}") diff --git a/plugins/vst_base/Win64/CMakeLists.txt b/plugins/vst_base/Win64/CMakeLists.txt index b16d502927e..814c86667f5 100644 --- a/plugins/vst_base/Win64/CMakeLists.txt +++ b/plugins/vst_base/Win64/CMakeLists.txt @@ -5,7 +5,7 @@ ADD_EXECUTABLE(RemoteVstPlugin32 "${CMAKE_CURRENT_SOURCE_DIR}/../RemoteVstPlugin TARGET_LINK_LIBRARIES(RemoteVstPlugin32 -lQtCore4 -lpthread -lgdi32 -lws2_32) ADD_CUSTOM_COMMAND(TARGET RemoteVstPlugin32 POST_BUILD COMMAND "${STRIP}" "\"${CMAKE_CURRENT_BINARY_DIR}/RemoteVstPlugin32.exe\"") -SET_TARGET_PROPERTIES(RemoteVstPlugin32 PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -O3") +SET_TARGET_PROPERTIES(RemoteVstPlugin32 PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -O0") INSTALL(TARGETS RemoteVstPlugin32 RUNTIME DESTINATION "${PLUGIN_DIR}/32") INSTALL(FILES "${MINGW_PREFIX32}/bin/QtCore4.dll" "${MINGW_PREFIX32}/bin/zlib1.dll" "${MINGW_PREFIX32}/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32/bin/libwinpthread-1.dll" From 898781484dad574c10c9355b7098462020e36f29 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Thu, 19 Mar 2015 21:03:40 +0200 Subject: [PATCH 12/43] SFXR: Avoid NaNs by making envelope length minimum 1 sample (this time in the stable-1.1 branch) --- plugins/sfxr/sfxr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index 7c2f35bdbbe..4ac7a9e88a3 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -133,10 +133,18 @@ void SfxrSynth::resetSample( bool restart ) env_vol=0.0f; env_stage=0; env_time=0; + env_length[0]=(int)(s->m_attModel.value()*s->m_attModel.value()*100000.0f); env_length[1]=(int)(s->m_holdModel.value()*s->m_holdModel.value()*100000.0f); env_length[2]=(int)(s->m_decModel.value()*s->m_decModel.value()*100000.0f); + // These will be used as divisors later, let's avoid division by 0 + for(int i = 0; i < 3; ++i) + { + env_length[i] = (env_length[i] == 0) ? 1 : env_length[i]; + } + + fphase=pow(s->m_phaserOffsetModel.value(), 2.0f)*1020.0f; if(s->m_phaserOffsetModel.value()<0.0f) fphase=-fphase; fdphase=pow(s->m_phaserSweepModel.value(), 2.0f)*1.0f; From 0462be7afc6e0028ff94b753706d1a0c568c72cc Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Sat, 21 Mar 2015 12:05:06 +0200 Subject: [PATCH 13/43] SFXR: Removed conditional, moved ensuring env_length!=0 to initial calculation --- plugins/sfxr/sfxr.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index 4ac7a9e88a3..1d15c1c8874 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -134,16 +134,9 @@ void SfxrSynth::resetSample( bool restart ) env_stage=0; env_time=0; - env_length[0]=(int)(s->m_attModel.value()*s->m_attModel.value()*100000.0f); - env_length[1]=(int)(s->m_holdModel.value()*s->m_holdModel.value()*100000.0f); - env_length[2]=(int)(s->m_decModel.value()*s->m_decModel.value()*100000.0f); - - // These will be used as divisors later, let's avoid division by 0 - for(int i = 0; i < 3; ++i) - { - env_length[i] = (env_length[i] == 0) ? 1 : env_length[i]; - } - + env_length[0]=(int)(s->m_attModel.value()*s->m_attModel.value()*99999.0f)+1; + env_length[1]=(int)(s->m_holdModel.value()*s->m_holdModel.value()*99999.0f)+1; + env_length[2]=(int)(s->m_decModel.value()*s->m_decModel.value()*99999.0f)+1; fphase=pow(s->m_phaserOffsetModel.value(), 2.0f)*1020.0f; if(s->m_phaserOffsetModel.value()<0.0f) fphase=-fphase; From 66086820cecd6a032e2e35d34923a8fb5aa82872 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 17 Apr 2015 20:59:46 +0200 Subject: [PATCH 14/43] Implement NATIVE_HOST_OPCODE_HOST_IDLE in carla plugin --- plugins/carlabase/carla.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/carlabase/carla.cpp b/plugins/carlabase/carla.cpp index db14178a218..f7ec0bb3f86 100644 --- a/plugins/carlabase/carla.cpp +++ b/plugins/carlabase/carla.cpp @@ -263,6 +263,9 @@ intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opco case NATIVE_HOST_OPCODE_UI_UNAVAILABLE: handleUiClosed(); break; + case NATIVE_HOST_OPCODE_HOST_IDLE: + qApp->processEvents(); + break; } return ret; From 44c42d9d38bc11fafeda8e7d4094da8169328e85 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Thu, 2 Apr 2015 05:14:27 +0000 Subject: [PATCH 15/43] Provide status messages on splash screen when loading (#1696) --- include/Engine.h | 21 +++++++++++++++- include/GuiApplication.h | 11 ++++++++- include/MainWindow.h | 1 + src/core/Engine.cpp | 8 +++++++ src/gui/GuiApplication.cpp | 49 ++++++++++++++++++++++++++++++++++++-- src/gui/MainWindow.cpp | 3 +++ 6 files changed, 89 insertions(+), 4 deletions(-) diff --git a/include/Engine.h b/include/Engine.h index ad7abe3994c..659c1ee1a74 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -27,6 +27,9 @@ #define ENGINE_H #include +#include +#include + #include "export.h" @@ -39,8 +42,9 @@ class Song; class Ladspa2LMMS; -class EXPORT Engine +class EXPORT Engine : public QObject { + Q_OBJECT public: static void init(); static void destroy(); @@ -94,6 +98,18 @@ class EXPORT Engine return s_pluginFileHandling; } + static inline Engine * inst() + { + if( s_instanceOfMe == NULL ) + { + s_instanceOfMe = new Engine(); + } + return s_instanceOfMe; + } + +signals: + void initProgress(const QString &msg); + private: // small helper function which sets the pointer to NULL before actually deleting @@ -120,6 +136,9 @@ class EXPORT Engine static QMap s_pluginFileHandling; + // even though most methods are static, an instance is needed for Qt slots/signals + static Engine * s_instanceOfMe; + static void initPluginFileHandling(); friend class GuiApplication; diff --git a/include/GuiApplication.h b/include/GuiApplication.h index c35994e8162..40fb4578d96 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -25,8 +25,12 @@ #ifndef GUIAPPLICATION_H #define GUIAPPLICATION_H +#include + #include "export.h" +class QLabel; + class AutomationEditorWindow; class BBEditor; class ControllerRackView; @@ -36,8 +40,9 @@ class PianoRollWindow; class ProjectNotes; class SongEditorWindow; -class EXPORT GuiApplication +class EXPORT GuiApplication : public QObject { + Q_OBJECT; public: explicit GuiApplication(); ~GuiApplication(); @@ -53,6 +58,9 @@ class EXPORT GuiApplication AutomationEditorWindow* automationEditor() { return m_automationEditor; } ControllerRackView* getControllerRackView() { return m_controllerRackView; } +public slots: + void displayInitProgress(const QString &msg); + private: static GuiApplication* s_instance; @@ -64,6 +72,7 @@ class EXPORT GuiApplication PianoRollWindow* m_pianoRoll; ProjectNotes* m_projectNotes; ControllerRackView* m_controllerRackView; + QLabel* m_loadingProgressLabel; }; #define gui GuiApplication::instance() diff --git a/include/MainWindow.h b/include/MainWindow.h index 5e1f294aea6..f842cef0058 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -190,6 +190,7 @@ private slots: signals: void periodicUpdate(); + void initProgress(const QString &msg); } ; diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index 5730e977eb0..8e5d85139ed 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -52,11 +52,16 @@ QMap Engine::s_pluginFileHandling; void Engine::init() { + Engine *engine = inst(); + + emit engine->initProgress(tr("Generating wavetables")); // generate (load from file) bandlimited wavetables BandLimitedWave::generateWaves(); + emit engine->initProgress(tr("Locating plugins")); initPluginFileHandling(); + emit engine->initProgress(tr("Initializing data structures")); s_projectJournal = new ProjectJournal; s_mixer = new Mixer; s_song = new Song; @@ -67,11 +72,13 @@ void Engine::init() s_projectJournal->setJournalling( true ); + emit engine->initProgress(tr("Opening audio and midi devices")); s_mixer->initDevices(); PresetPreviewPlayHandle::init(); s_dummyTC = new DummyTrackContainer; + emit engine->initProgress(tr("Launching mixer threads")); s_mixer->startProcessing(); } @@ -142,3 +149,4 @@ void Engine::initPluginFileHandling() } +Engine * Engine::s_instanceOfMe = NULL; diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 78cf609efb6..64edcb364ad 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -49,6 +49,7 @@ GuiApplication* GuiApplication::instance() return s_instance; } + GuiApplication::GuiApplication() { // Init style and palette @@ -64,27 +65,60 @@ GuiApplication::GuiApplication() // Show splash screen QSplashScreen splashScreen( embed::getIconPixmap( "splash" ) ); splashScreen.show(); - splashScreen.showMessage( MainWindow::tr( "Version %1" ).arg( LMMS_VERSION ), - Qt::AlignRight | Qt::AlignBottom, Qt::white ); + + QHBoxLayout layout; + layout.setAlignment(Qt::AlignBottom); + splashScreen.setLayout(&layout); + + // Create a left-aligned label for loading progress + // & a right-aligned label for version info + QLabel loadingProgressLabel; + m_loadingProgressLabel = &loadingProgressLabel; + QLabel versionLabel(MainWindow::tr( "Version %1" ).arg( LMMS_VERSION )); + + loadingProgressLabel.setAlignment(Qt::AlignLeft); + versionLabel.setAlignment(Qt::AlignRight); + + layout.addWidget(&loadingProgressLabel); + layout.addWidget(&versionLabel); + + // may have long gaps between future frames, so force update now + splashScreen.update(); qApp->processEvents(); + connect(Engine::inst(), SIGNAL(initProgress(const QString&)), + this, SLOT(displayInitProgress(const QString&))); + // Init central engine which handles all components of LMMS Engine::init(); s_instance = this; + displayInitProgress(tr("Preparing UI")); + m_mainWindow = new MainWindow; + connect(m_mainWindow, SIGNAL(initProgress(const QString&)), + this, SLOT(displayInitProgress(const QString&))); + displayInitProgress(tr("Preparing song editor")); m_songEditor = new SongEditorWindow(Engine::getSong()); + displayInitProgress(tr("Preparing mixer")); m_fxMixerView = new FxMixerView; + displayInitProgress(tr("Preparing controller rack")); m_controllerRackView = new ControllerRackView; + displayInitProgress(tr("Preparing project notes")); m_projectNotes = new ProjectNotes; + displayInitProgress(tr("Preparing beat/baseline editor")); m_bbEditor = new BBEditor(Engine::getBBTrackContainer()); + displayInitProgress(tr("Preparing piano roll")); m_pianoRoll = new PianoRollWindow(); + displayInitProgress(tr("Preparing automation editor")); m_automationEditor = new AutomationEditorWindow; m_mainWindow->finalize(); splashScreen.finish(m_mainWindow); + + m_loadingProgressLabel = nullptr; } GuiApplication::~GuiApplication() @@ -92,3 +126,14 @@ GuiApplication::~GuiApplication() InstrumentTrackView::cleanupWindowCache(); s_instance = nullptr; } + + +void GuiApplication::displayInitProgress(const QString &msg) +{ + Q_ASSERT(m_loadingProgressLabel != nullptr); + + m_loadingProgressLabel->setText(msg); + // must force a UI update and process events, as there may be long gaps between processEvents() calls during init + m_loadingProgressLabel->repaint(); + qApp->processEvents(); +} \ No newline at end of file diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 78df3798bd7..6dc28dffe8a 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -96,7 +96,9 @@ MainWindow::MainWindow() : ConfigManager* confMgr = ConfigManager::inst(); + emit initProgress(tr("Preparing plugin browser")); sideBar->appendTab( new PluginBrowser( splitter ) ); + emit initProgress(tr("Preparing file browsers")); sideBar->appendTab( new FileBrowser( confMgr->userProjectsDir() + "*" + confMgr->factoryProjectsDir(), @@ -150,6 +152,7 @@ MainWindow::MainWindow() : m_workspace = new QMdiArea( splitter ); // Load background + emit initProgress(tr("Loading background artwork")); QString bgArtwork = ConfigManager::inst()->backgroundArtwork(); QImage bgImage; if( !bgArtwork.isEmpty() ) From 589cd4fb596c8589e78c674a5f984f070bc59062 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 5 Apr 2015 13:42:09 +0100 Subject: [PATCH 16/43] Model::isValueChanged correctly returns if sample exactness is used. The introduction of sample exactness introduced a bug, if The value was changed using sample exactness Model::isValueChanged was incorectly returning false. This bug has shown its self in the BassBooster plugin. --- include/AutomatableModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 57c2a6f0fe3..9f53c9451a3 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -255,7 +255,7 @@ class EXPORT AutomatableModel : public Model, public JournallingObject // has to be accessed by more than one object, then this function shouldn't be used. bool isValueChanged() { - if( m_valueChanged ) + if( m_valueChanged || valueBuffer() ) { m_valueChanged = false; return true; From 4f76241e6803a61377fe32ef522378d9c5b1b7e5 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 18 Apr 2015 18:40:41 +0100 Subject: [PATCH 17/43] Delay and Flanger, removed noise from delay when automating length The original delay code, was setting it read index relative to the length of the delay. This fixes that, now when the length is changed the read index stays in the correct place in the buffer. --- plugins/Delay/DelayControls.cpp | 6 +++--- plugins/Delay/DelayEffect.cpp | 2 +- plugins/Delay/StereoDelay.cpp | 27 +++++++++------------------ plugins/Flanger/MonoDelay.cpp | 29 +++++++++-------------------- 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/plugins/Delay/DelayControls.cpp b/plugins/Delay/DelayControls.cpp index f8241b95e89..15ccdb705e1 100644 --- a/plugins/Delay/DelayControls.cpp +++ b/plugins/Delay/DelayControls.cpp @@ -32,10 +32,10 @@ DelayControls::DelayControls( DelayEffect* effect ): EffectControls( effect ), m_effect ( effect ), - m_delayTimeModel( 0.5, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Delay Samples" )) , + m_delayTimeModel( 0.5, 0.01, 5.0, 0.0001, 20000.0, this, tr( "Delay Samples" )) , m_feedbackModel(0.0f,0.0f,1.0f,0.01f,this,tr( "Feedback" ) ), - m_lfoTimeModel(2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Lfo Frequency" ) ), - m_lfoAmountModel(0.0, 0.0, 2.0, 0.0001, 2000.0, this, tr ( "Lfo Amount" ) ), + m_lfoTimeModel(2.0, 0.01, 5.0, 0.0001, 20000.0, this, tr( "Lfo Frequency" ) ), + m_lfoAmountModel(0.0, 0.0, 0.5, 0.0001, 2000.0, this, tr ( "Lfo Amount" ) ), m_outGainModel( 0.0, -60.0, 20.0, 0.01, this, tr( "Output gain" ) ) { connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) ); diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 7f41653a288..af45c2bc9b6 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -118,7 +118,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_delay->setFeedback( *feedbackPtr ); m_lfo->setFrequency( *lfoTimePtr ); sampleLength = *lengthPtr * Engine::mixer()->processingSampleRate(); - m_currentLength = linearInterpolate( sampleLength, m_currentLength, 0.9999 ); + m_currentLength = sampleLength; m_delay->setLength( m_currentLength + ( *amplitudePtr * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); diff --git a/plugins/Delay/StereoDelay.cpp b/plugins/Delay/StereoDelay.cpp index 21e637740b5..2093627a985 100644 --- a/plugins/Delay/StereoDelay.cpp +++ b/plugins/Delay/StereoDelay.cpp @@ -57,24 +57,15 @@ StereoDelay::~StereoDelay() void StereoDelay::tick( sampleFrame frame ) { - m_buffer[m_index][0] = frame[0]; - m_buffer[m_index][1] = frame[1]; - - int readIndex = m_index - ( int )m_length - 1; - if( readIndex < 0 ) - { - readIndex += m_maxLength; - } - float fract = 1.0f - fraction( m_length ); - frame[0] = linearInterpolate( m_buffer[readIndex][0] , - m_buffer[( readIndex+1) % m_maxLength][0], fract ); - frame[1] = linearInterpolate( m_buffer[readIndex][1] , - m_buffer[( readIndex+1) % m_maxLength][1], fract ); - - m_buffer[m_index][0] += frame[0] * m_feedback; - m_buffer[m_index][1] += frame[1] * m_feedback; - - m_index = ( m_index + 1) % (int) m_maxLength; + m_index = ( int )m_length > 0 + ? ( m_index + 1 ) % ( int ) m_length + : m_index; + float lOut = m_buffer[ m_index ][ 0 ]; + float rOut = m_buffer[ m_index ] [1 ]; + m_buffer[ m_index ][ 0 ] = frame[ 0 ] + ( lOut * m_feedback ); + m_buffer[ m_index ][ 1 ] = frame[ 1 ] + ( rOut * m_feedback ); + frame[ 0 ] = lOut; + frame[ 1 ] = rOut; } diff --git a/plugins/Flanger/MonoDelay.cpp b/plugins/Flanger/MonoDelay.cpp index 9afc3ee1710..05b17d6e65b 100644 --- a/plugins/Flanger/MonoDelay.cpp +++ b/plugins/Flanger/MonoDelay.cpp @@ -25,6 +25,7 @@ #include "MonoDelay.h" #include "interpolation.h" #include "lmms_math.h" +#include "string.h" MonoDelay::MonoDelay( int maxTime , int sampleRate ) { @@ -51,27 +52,14 @@ MonoDelay::~MonoDelay() - void MonoDelay::tick( sample_t* sample ) { - m_buffer[m_index] = *sample; - int readIndex = m_index - ( int )m_length - 1; - if(readIndex < 0) - { - readIndex += m_maxLength; - } - float fract = 1.0f - fraction( m_length ); - if(readIndex != m_maxLength-1 ) - { - *sample = linearInterpolate(m_buffer[readIndex] , - m_buffer[readIndex+1], fract ); - } else - { - *sample = linearInterpolate(m_buffer[readIndex] , - m_buffer[0], fract ); - } - m_buffer[m_index] += *sample * m_feedback; - m_index = ( m_index +1 ) % m_maxLength; + m_index = ( int )m_length > 0 + ? ( m_index + 1 ) % ( int ) m_length + : m_index; + float out = m_buffer[ m_index ]; + m_buffer[ m_index ] = *sample + ( out * m_feedback ); + *sample = out; } @@ -85,5 +73,6 @@ void MonoDelay::setSampleRate( int sampleRate ) } - m_buffer = new sample_t[( int )( sampleRate * m_maxTime )]; + m_buffer = new sample_t[( int )( sampleRate * m_maxTime ) ]; + memset( m_buffer, 0, sizeof(float) * ( int )( sampleRate * m_maxTime ) ); } From 68edb91fc6ecde68a7aa8e00b0e0538c260e2cda Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 18 Apr 2015 18:53:11 +0100 Subject: [PATCH 18/43] Delay and Flanger updated formatting error --- plugins/Flanger/MonoDelay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Flanger/MonoDelay.cpp b/plugins/Flanger/MonoDelay.cpp index 05b17d6e65b..9342d49c530 100644 --- a/plugins/Flanger/MonoDelay.cpp +++ b/plugins/Flanger/MonoDelay.cpp @@ -55,7 +55,7 @@ MonoDelay::~MonoDelay() void MonoDelay::tick( sample_t* sample ) { m_index = ( int )m_length > 0 - ? ( m_index + 1 ) % ( int ) m_length + ? ( m_index + 1 ) % ( int )m_length : m_index; float out = m_buffer[ m_index ]; m_buffer[ m_index ] = *sample + ( out * m_feedback ); From a27bf57d486fbd731e7b222a769284456ebac99c Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Thu, 2 Apr 2015 21:29:45 +0000 Subject: [PATCH 19/43] Fix typo in initialization progress message --- src/gui/GuiApplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 64edcb364ad..4a9b35f73d4 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -108,7 +108,7 @@ GuiApplication::GuiApplication() m_controllerRackView = new ControllerRackView; displayInitProgress(tr("Preparing project notes")); m_projectNotes = new ProjectNotes; - displayInitProgress(tr("Preparing beat/baseline editor")); + displayInitProgress(tr("Preparing beat/bassline editor")); m_bbEditor = new BBEditor(Engine::getBBTrackContainer()); displayInitProgress(tr("Preparing piano roll")); m_pianoRoll = new PianoRollWindow(); @@ -136,4 +136,4 @@ void GuiApplication::displayInitProgress(const QString &msg) // must force a UI update and process events, as there may be long gaps between processEvents() calls during init m_loadingProgressLabel->repaint(); qApp->processEvents(); -} \ No newline at end of file +} From d146e6fb4a6c779ca90fc17f9dd8d7eaf5dc9162 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Sat, 18 Apr 2015 22:22:35 +0000 Subject: [PATCH 20/43] Add keyboard shortcut to create a new FX channel --- src/gui/FxMixerView.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 5e99ca32de0..89120456d07 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -510,6 +510,9 @@ void FxMixerView::keyPressEvent(QKeyEvent * e) setCurrentFxLine( m_currentFxLine->channelIndex()+1 ); } break; + case Qt::Key_Insert: + addNewChannel(); + break; } } From 19d641f6b421866da902a15a655afbc8c5db35c5 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 19 Apr 2015 17:11:03 +0200 Subject: [PATCH 21/43] Might fix 1981 ("Midi Import crash in master branch") This commit adds checks for conditions that are asserted during calls to get_atom_value. It might fix a crash that is described in 1981. Unfortunately no files have been attached to that issue. However, I was able to crash LMMS using a local file and this crash is gone with this fix. So hopefully this change also fixes the crashes described in 1981. --- plugins/MidiImport/MidiImport.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 25c204368cf..f5f2c507ee7 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -374,19 +374,22 @@ bool MidiImport::readSMF( TrackContainer* tc ) if( evt->chan == -1 ) { bool handled = false; - if( evt->is_update() ) + if( evt->is_update() ) { QString attr = evt->get_attribute(); - if( attr == "tracknames" ) { + if( attr == "tracknames" && evt->get_update_type() == 'a' ) { trackName = evt->get_atom_value(); handled = true; } } - if(!handled) { + if( !handled ) { printf("MISSING GLOBAL THINGY\n"); - printf(" %d %d %f %s %s\n", (int) evt->chan, - evt->get_type_code(), evt->time, - evt->get_attribute(), evt->get_atom_value() ); + if ( evt->is_update() && evt->get_update_type() == 'a' ) + { + printf(" %d %d %f %s %s\n", (int) evt->chan, + evt->get_type_code(), evt->time, + evt->get_attribute(), evt->get_atom_value() ); + } // Global stuff } } From 70b063ba050d751243b1f183e695c1770482bfc4 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 19 Apr 2015 22:02:13 +0200 Subject: [PATCH 22/43] Show native plugin info in the effect selection dialog The effect selection dialog now also shows the information for the native plugins. This included name, description, author as well as the plugin icon. Also removed the group box with the title "Plugin description" because it should be rather obvious to the user that further information about the plugin is shown. This removes some clutter from the dialog. --- src/gui/EffectSelectDialog.cpp | 73 ++++++++++++++++++++++------- src/gui/Forms/EffectSelectDialog.ui | 49 ++++++------------- 2 files changed, 71 insertions(+), 51 deletions(-) diff --git a/src/gui/EffectSelectDialog.cpp b/src/gui/EffectSelectDialog.cpp index 9cfa9ee0847..9249116846a 100644 --- a/src/gui/EffectSelectDialog.cpp +++ b/src/gui/EffectSelectDialog.cpp @@ -29,6 +29,8 @@ #include "gui_templates.h" #include "embed.h" +#include + EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : QDialog( _parent ), @@ -173,25 +175,64 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, { m_currentSelection = m_effectKeys[m_model.mapToSource( _idx ).row()]; } - if( m_currentSelection.desc && m_currentSelection.desc->subPluginFeatures ) + if( m_currentSelection.desc ) { m_descriptionWidget = new QWidget; - QVBoxLayout * l = new QVBoxLayout( m_descriptionWidget ); - l->setMargin( 4 ); - l->setSpacing( 0 ); - - ui->scrollArea->setWidget( m_descriptionWidget ); - m_currentSelection.desc->subPluginFeatures-> - fillDescriptionWidget( m_descriptionWidget, &m_currentSelection ); - foreach( QWidget * w, m_descriptionWidget->findChildren() ) - { - if( w->parent() == m_descriptionWidget ) - { - l->addWidget( w ); - } - } - l->setSizeConstraint( QLayout::SetFixedSize ); + QHBoxLayout *hbox = new QHBoxLayout( m_descriptionWidget ); + + Plugin::Descriptor const & descriptor = *( m_currentSelection.desc ); + + if ( descriptor.logo ) + { + QLabel *logoLabel = new QLabel( m_descriptionWidget ); + logoLabel->setPixmap( descriptor.logo->pixmap() ); + logoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + + hbox->addWidget( logoLabel ); + hbox->setAlignment( logoLabel, Qt::AlignTop); + } + + QWidget *textualInfoWidget = new QWidget( m_descriptionWidget ); + + hbox->addWidget(textualInfoWidget); + + QVBoxLayout * textWidgetLayout = new QVBoxLayout( textualInfoWidget); + textWidgetLayout->setMargin( 4 ); + textWidgetLayout->setSpacing( 0 ); + + std::string stdName(descriptor.name); + if ( stdName != "ladspaeffect" ) + { + QLabel *label = new QLabel(m_descriptionWidget); + QString labelText = "

" + tr("Name") + ": " + QString::fromUtf8(descriptor.displayName) + "

"; + labelText += "

" + tr("Description") + ": " + QString::fromUtf8(descriptor.description) + "

"; + labelText += "

" + tr("Author") + ": " + QString::fromUtf8(descriptor.author) + "

"; + + label->setText(labelText); + textWidgetLayout->addWidget(label); + } + + if ( m_currentSelection.desc->subPluginFeatures ) + { + QWidget *subWidget = new QWidget(textualInfoWidget); + QVBoxLayout * subLayout = new QVBoxLayout( subWidget ); + subLayout->setMargin( 4 ); + subLayout->setSpacing( 0 ); + m_currentSelection.desc->subPluginFeatures-> + fillDescriptionWidget( subWidget, &m_currentSelection ); + foreach( QWidget * w, subWidget->findChildren() ) + { + if( w->parent() == subWidget ) + { + subLayout->addWidget( w ); + } + } + + textWidgetLayout->addWidget(subWidget); + } + + ui->scrollArea->setWidget( m_descriptionWidget ); m_descriptionWidget->show(); } } diff --git a/src/gui/Forms/EffectSelectDialog.ui b/src/gui/Forms/EffectSelectDialog.ui index a58cd6c8c61..a19233ac8c3 100644 --- a/src/gui/Forms/EffectSelectDialog.ui +++ b/src/gui/Forms/EffectSelectDialog.ui @@ -7,7 +7,7 @@ 0 0 585 - 547 + 550 @@ -40,41 +40,20 @@ - - - - 0 - 200 - - - - - 16777215 - 210 - - - - Plugin description + + + QFrame::NoFrame - - - - - QFrame::NoFrame - - - - - 0 - 0 - 497 - 109 - - - - - - + + + + 0 + 0 + 497 + 109 + + + From 75dd6fa3e76b02412895fbef32ed0a4dd4ff9f79 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 20 Apr 2015 03:06:41 +0000 Subject: [PATCH 23/43] Change new mixer channel shortcut to shift+insert --- src/gui/FxMixerView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 89120456d07..2a8271048d6 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -511,7 +511,10 @@ void FxMixerView::keyPressEvent(QKeyEvent * e) } break; case Qt::Key_Insert: - addNewChannel(); + if ( e->modifiers() & Qt::ShiftModifier ) + { + addNewChannel(); + } break; } } From 92d8950fd36e783fb1d49adebbf6c012d41e7b88 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 20 Apr 2015 03:17:11 +0000 Subject: [PATCH 24/43] Remove unused m_instrumentTrack variable --- include/InstrumentPlayHandle.h | 1 - src/core/InstrumentPlayHandle.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index c8bcf67a076..ffbfbce735a 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -84,7 +84,6 @@ class EXPORT InstrumentPlayHandle : public PlayHandle private: Instrument* m_instrument; - InstrumentTrack * m_instrumentTrack; } ; diff --git a/src/core/InstrumentPlayHandle.cpp b/src/core/InstrumentPlayHandle.cpp index 11a4fb5b8f9..e44cf4e0020 100644 --- a/src/core/InstrumentPlayHandle.cpp +++ b/src/core/InstrumentPlayHandle.cpp @@ -28,8 +28,7 @@ InstrumentPlayHandle::InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ) : PlayHandle( TypeInstrumentPlayHandle ), - m_instrument( instrument ), - m_instrumentTrack( instrumentTrack ) + m_instrument( instrument ) { setAudioPort( instrumentTrack->audioPort() ); } From f12fa52a69ee8445b8ded0e1316f25ff6508bf14 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 20 Apr 2015 03:37:55 +0000 Subject: [PATCH 25/43] remove unused vars: TRACK_OP_BTN_(WIDTH|HEIGHT) --- src/core/Track.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 4f5440af0c1..35fea51088e 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -78,11 +78,6 @@ */ const int RESIZE_GRIP_WIDTH = 4; -/*! The size of the track buttons in pixels - */ -const int TRACK_OP_BTN_WIDTH = 20; -const int TRACK_OP_BTN_HEIGHT = 14; - /*! A pointer for that text bubble used when moving segments, etc. * From 954a61f0fc91860f01a1f69c6c6983186c5a0cb5 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 20 Apr 2015 03:44:38 +0000 Subject: [PATCH 26/43] Remove unused var CF_LFO_GRAPH_X and outdated commented-out code --- src/gui/LfoControllerDialog.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index b7c3eced790..f13928969f5 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -50,7 +50,6 @@ const int CD_KNOB_X_SPACING = 32; const int CD_LFO_SHAPES_X = 6; const int CD_LFO_SHAPES_Y = 36; -const int CD_LFO_GRAPH_X = 6; const int CD_LFO_GRAPH_Y = CD_ENV_KNOBS_LBL_Y+15; const int CD_LFO_CD_KNOB_Y = CD_LFO_GRAPH_Y-2; const int CD_LFO_BASE_CD_KNOB_X = CD_LFO_SHAPES_X + 64; @@ -243,7 +242,6 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent LfoControllerDialog::~LfoControllerDialog() { m_userWaveBtn->disconnect( this ); - //delete m_subWindow; } @@ -287,13 +285,6 @@ void LfoControllerDialog::contextMenuEvent( QContextMenuEvent * ) } -/* -void lfoControllerDialog::paintEvent( QPaintEvent * _pe ) -{ - QWidget::paintEvent( _pe ); -} -*/ - void LfoControllerDialog::modelChanged() { From 2d909462b63a9c16d6c56d8589965ab9a40173fa Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Mon, 20 Apr 2015 19:52:44 +0200 Subject: [PATCH 27/43] Improved debugging output for unhandled MIDI data Print as much debug info as possible for unhandled data. --- plugins/MidiImport/MidiImport.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index f5f2c507ee7..a81b0e70510 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -383,14 +383,19 @@ bool MidiImport::readSMF( TrackContainer* tc ) } } if( !handled ) { - printf("MISSING GLOBAL THINGY\n"); - if ( evt->is_update() && evt->get_update_type() == 'a' ) + // Write debug output + printf("MISSING GLOBAL HANDLER\n"); + printf(" Chn: %d, Type Code: %d, Time: %f", (int) evt->chan, + evt->get_type_code(), evt->time ); + if ( evt->is_update() ) { - printf(" %d %d %f %s %s\n", (int) evt->chan, - evt->get_type_code(), evt->time, - evt->get_attribute(), evt->get_atom_value() ); + printf( ", Update Type: %s", evt->get_attribute() ); + if ( evt->get_update_type() == 'a' ) + { + printf( ", Atom: %s", evt->get_atom_value() ); + } } - // Global stuff + printf( "\n" ); } } else if( evt->is_note() && evt->chan < 256 ) From 85b6a924606f464be3a7341849ae9128b3e19a6d Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Tue, 21 Apr 2015 19:09:56 +0000 Subject: [PATCH 28/43] Display the 'muted' attribute as "mute" to match the wording of "solo" --- data/locale/ca.ts | 2 +- data/locale/cs.ts | 2 +- data/locale/de.ts | 2 +- data/locale/en.ts | 2 +- data/locale/es.ts | 2 +- data/locale/fa.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/it.ts | 2 +- data/locale/ja.ts | 2 +- data/locale/ko.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ru.ts | 2 +- data/locale/sv.ts | 2 +- data/locale/zh.ts | 2 +- src/core/Track.cpp | 4 ++-- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index edc3681082a..f4416cea029 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -5936,7 +5936,7 @@ Latència: %2 ms Track - Muted + Mute diff --git a/data/locale/cs.ts b/data/locale/cs.ts index b0381f89737..3a93b4c60c8 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -5938,7 +5938,7 @@ Zpoždění %2 ms Track - Muted + Mute Ztlumený diff --git a/data/locale/de.ts b/data/locale/de.ts index 090e2bc7983..1017d27fc22 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -5974,7 +5974,7 @@ Latenz: %2 ms Track - Muted + Mute Stumm diff --git a/data/locale/en.ts b/data/locale/en.ts index 0c4bae00bca..85fcfe6069a 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -5927,7 +5927,7 @@ Latency: %2 ms Track - Muted + Mute diff --git a/data/locale/es.ts b/data/locale/es.ts index 3ba7312a360..8414cdef24c 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -5927,7 +5927,7 @@ Latency: %2 ms Track - Muted + Mute diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 50d1e790a02..9be626ff718 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -5927,7 +5927,7 @@ Latency: %2 ms Track - Muted + Mute diff --git a/data/locale/fr.ts b/data/locale/fr.ts index 6a3b0d36e9e..6ef9d95769f 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -5947,7 +5947,7 @@ Veuillez vérifier que vous avez les droits en lecture pour ce fichier et le ré Track - Muted + Mute Coupée diff --git a/data/locale/gl.ts b/data/locale/gl.ts index 98c13048538..cb22c7e33df 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -5946,7 +5946,7 @@ Latencia: %2 ms Track - Muted + Mute Silenciado diff --git a/data/locale/it.ts b/data/locale/it.ts index 99bc63bf4b9..645cf0665be 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -5971,7 +5971,7 @@ Assicurati di avere almeno i permessi di lettura del file e prova di nuovo. Track - Muted + Mute Muto diff --git a/data/locale/ja.ts b/data/locale/ja.ts index 2aa1b1e50dc..b931a765afe 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -5950,7 +5950,7 @@ Latency: %2 ms Track - Muted + Mute ミュート diff --git a/data/locale/ko.ts b/data/locale/ko.ts index aea6c561142..5fcd9204f06 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -5932,7 +5932,7 @@ Latency: %2 ms Track - Muted + Mute 무음 diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 2b4416f46b4..5683e3fc65c 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -5929,7 +5929,7 @@ Vertraging: %2 ms Track - Muted + Mute diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 60a86b97c83..9d7e6f99035 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -5952,7 +5952,7 @@ Upewnij się, że masz przynajmniej uprawnienia odczytu tego pliku a następnie Track - Muted + Mute Wyciszone diff --git a/data/locale/pt.ts b/data/locale/pt.ts index b797a15d567..46941c9060d 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -5950,7 +5950,7 @@ Latência: %2 ms Track - Muted + Mute Mudo diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 8d8fe034be6..6ef6e8b04f0 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -6003,7 +6003,7 @@ Latency: %2 ms Track - Muted + Mute Тихо diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 632307fa60d..f0df3f184d0 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -5928,7 +5928,7 @@ Latency: %2 ms Track - Muted + Mute diff --git a/data/locale/zh.ts b/data/locale/zh.ts index 3649e8831e6..57afb96d7f7 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -5942,7 +5942,7 @@ Latency: %2 ms Track - Muted + Mute 静音 diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 06aa15963bf..456cb7cd9cd 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -103,7 +103,7 @@ TrackContentObject::TrackContentObject( Track * track ) : m_name( QString::null ), m_startPosition(), m_length(), - m_mutedModel( false, this, tr( "Muted" ) ), + m_mutedModel( false, this, tr( "Mute" ) ), m_selectViewOnCreate( false ) { if( getTrack() ) @@ -1810,7 +1810,7 @@ Track::Track( TrackTypes type, TrackContainer * tc ) : m_trackContainer( tc ), /*!< The track container object */ m_type( type ), /*!< The track type */ m_name(), /*!< The track's name */ - m_mutedModel( false, this, tr( "Muted" ) ), + m_mutedModel( false, this, tr( "Mute" ) ), /*!< For controlling track muting */ m_soloModel( false, this, tr( "Solo" ) ), /*!< For controlling track soloing */ From 13f7065b46fb03797b71e9c9285303d203cb1304 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 21 Apr 2015 14:55:13 -0400 Subject: [PATCH 29/43] Load all file names with utf chars Fixes #1995 --- src/core/main.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 5313811d140..bf5d8d2efbc 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -217,12 +217,10 @@ int main( int argc, char * * argv ) else if( argc > i+1 && ( QString( argv[i] ) == "--upgrade" || QString( argv[i] ) == "-u" ) ) { - QString inFile( argv[i + 1] ); - DataFile dataFile( inFile ); + DataFile dataFile( QString::fromLocal8Bit( argv[i + 1] ) ); if (argc > i+2) { - const QString outFile = argv[i + 2]; - dataFile.writeFile( outFile ); + dataFile.writeFile( QString::fromLocal8Bit( argv[i + 2] ) ); } else { @@ -246,7 +244,7 @@ int main( int argc, char * * argv ) else if( argc > i && ( QString( argv[i] ) == "--dump" || QString( argv[i] ) == "-d" ) ) { - QFile f( argv[i + 1] ); + QFile f( QString::fromLocal8Bit( argv[i + 1] ) ); f.open( QIODevice::ReadOnly ); QString d = qUncompress( f.readAll() ); printf( "%s\n", d.toUtf8().constData() ); @@ -255,14 +253,14 @@ int main( int argc, char * * argv ) else if( argc > i && ( QString( argv[i] ) == "--render" || QString( argv[i] ) == "-r" ) ) { - file_to_load = QString( argv[i + 1] ); + file_to_load = QString::fromLocal8Bit( argv[i + 1] ); render_out = baseName( file_to_load ) + "."; ++i; } else if( argc > i && ( QString( argv[i] ) == "--output" || QString( argv[i] ) == "-o" ) ) { - render_out = baseName( QString( argv[i + 1] ) ) + "."; + render_out = baseName( QString::fromLocal8Bit( argv[i + 1] ) ) + "."; ++i; } else if( argc > i && @@ -386,7 +384,7 @@ int main( int argc, char * * argv ) else if( argc > i && ( QString( argv[i] ) == "--import" ) ) { - file_to_import = argv[i+1]; + file_to_import = QString::fromLocal8Bit( argv[i+1] ); ++i; // exit after import? (only for debugging) if( argc > i && QString( argv[i+1] ) == "-e" ) @@ -396,7 +394,7 @@ int main( int argc, char * * argv ) } else if( argc > i && ( QString( argv[i] ) == "--profile" || QString( argv[i] ) == "-p" ) ) { - profilerOutputFile = argv[i+1]; + profilerOutputFile = QString::fromLocal8Bit( argv[i+1] ); ++i; } else @@ -407,7 +405,7 @@ int main( int argc, char * * argv ) "Try \"%s --help\" for more information.\n\n", argv[i], argv[0] ); return( EXIT_FAILURE ); } - file_to_load = argv[i]; + file_to_load = QString::fromLocal8Bit( argv[i] ); } } From b19a9dc9033da2bb664cdc27b7d93c54929c7d1b Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 21 Apr 2015 18:09:50 -0400 Subject: [PATCH 30/43] Remove Win32 SHGetKnownFolderPath; fix windows builds Due to an upstream bug, mingw has issues building with shlobj.h. This work-around fixes #1952 by falling back to a `getenv()` approach. --- src/core/ConfigManager.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 2dcbc76cb99..f7bc5245460 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -252,31 +252,6 @@ void ConfigManager::setValue( const QString & _class, -#ifdef LMMS_BUILD_WIN32 -#include -#include - -// taken from qt-win-opensource-src-4.2.2/src/corelib/io/qsettings.cpp -static QString windowsConfigPath( int _type ) -{ - QString result; - - QLibrary library( "shell32" ); - typedef BOOL( WINAPI* GetSpecialFolderPath )( HWND, char *, int, BOOL ); - GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath) - library.resolve( "SHGetSpecialFolderPathA" ); - if( SHGetSpecialFolderPath ) - { - char path[MAX_PATH]; - SHGetSpecialFolderPath( 0, path, _type, false ); - result = QString::fromLocal8Bit( path ); - } - return result; -} -#endif - - - void ConfigManager::loadConfigFile() { // read the XML file and create DOM tree @@ -381,8 +356,8 @@ void ConfigManager::loadConfigFile() !QDir( m_vstDir ).exists() ) { #ifdef LMMS_BUILD_WIN32 - m_vstDir = windowsConfigPath( CSIDL_PROGRAM_FILES ) + - QDir::separator() + "VstPlugins"; + QString programFiles = getenv("ProgramFiles"); + m_vstDir = programFiles + QDir::separator() + "VstPlugins"; #else m_vstDir = m_workingDir + "plugins/vst" + QDir::separator(); #endif From 48291a871e25b0c39cc924224f9432e6b57c1935 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 21 Apr 2015 19:31:34 -0400 Subject: [PATCH 31/43] Minor formatting fixes ConfigManager dialog. - Changed format to match that of surrounding code - Removed unecessary QDir() usage - Re-introduce `fromLocal8Bit` --- src/core/ConfigManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index f7bc5245460..fd9dcc31ffc 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -356,10 +356,10 @@ void ConfigManager::loadConfigFile() !QDir( m_vstDir ).exists() ) { #ifdef LMMS_BUILD_WIN32 - QString programFiles = getenv("ProgramFiles"); - m_vstDir = programFiles + QDir::separator() + "VstPlugins"; + QString programFiles = QString::fromLocal8Bit( getenv( "ProgramFiles" ) ); + m_vstDir = programFiles + QDir::separator() + "VstPlugins" + QDir::separator(); #else - m_vstDir = m_workingDir + "plugins/vst" + QDir::separator(); + m_vstDir = m_workingDir + "plugins/vst/"; #endif } From 960c05bb32250b6443e775969f4214d880ea62d1 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Sat, 25 Apr 2015 03:18:38 +0000 Subject: [PATCH 32/43] Fix plurality of 'recently opened project' --- data/locale/ca.ts | 2 +- data/locale/cs.ts | 2 +- data/locale/de.ts | 2 +- data/locale/en.ts | 2 +- data/locale/es.ts | 2 +- data/locale/fa.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/it.ts | 2 +- data/locale/ja.ts | 2 +- data/locale/ko.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ru.ts | 2 +- data/locale/sv.ts | 2 +- data/locale/zh.ts | 2 +- src/gui/MainWindow.cpp | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index f4416cea029..bfd41347def 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -3435,7 +3435,7 @@ Per favor, comprova que tens permís d'escriptura per a aquest fitxer i tor Obre projecte existent - Recently opened project + Recently opened projects Projecte obert recentment diff --git a/data/locale/cs.ts b/data/locale/cs.ts index 3a93b4c60c8..f08c7b394f2 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -3435,7 +3435,7 @@ Ujistěte se prosím, že máte k souboru právo zápisu a zkuste to znovu.Otevřít existující projekt - Recently opened project + Recently opened projects Naposledy otevřené projekty diff --git a/data/locale/de.ts b/data/locale/de.ts index 1017d27fc22..f75a18bca86 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -3456,7 +3456,7 @@ Bitte überprüfen Sie Ihre Rechte und versuchen es erneut. Existierendes Projekt öffnen - Recently opened project + Recently opened projects Zuletzt geöffnete Projekte diff --git a/data/locale/en.ts b/data/locale/en.ts index 85fcfe6069a..2512f04c6e4 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. - Recently opened project + Recently opened projects diff --git a/data/locale/es.ts b/data/locale/es.ts index 8414cdef24c..f4fca86c3e7 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. Abrir proyecto existente - Recently opened project + Recently opened projects diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 9be626ff718..028f7563116 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. باز کردن پروژه ی موجود - Recently opened project + Recently opened projects diff --git a/data/locale/fr.ts b/data/locale/fr.ts index 6ef9d95769f..7051a47a804 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -3448,7 +3448,7 @@ Veuillez vérifier que vous avez les droits d'accès en écriture pour ce f Ouvrir un projet existant - Recently opened project + Recently opened projects Projets ouverts récemment diff --git a/data/locale/gl.ts b/data/locale/gl.ts index cb22c7e33df..16d0345fda7 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -3448,7 +3448,7 @@ Please make sure you have write-access to the file and try again. Abrir un projecto existente - Recently opened project + Recently opened projects Proxecto aberto recentemente diff --git a/data/locale/it.ts b/data/locale/it.ts index 645cf0665be..76ed7b44611 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -3456,7 +3456,7 @@ Assicurati di avere i permessi in scrittura per il file e riprova. Apri un progetto esistente - Recently opened project + Recently opened projects Progetti aperti di recente diff --git a/data/locale/ja.ts b/data/locale/ja.ts index b931a765afe..dfd218cb1ee 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -3450,7 +3450,7 @@ Please make sure you have write-access to the file and try again. 既存プロジェクトを開く - Recently opened project + Recently opened projects 最近開いたプロジェクト diff --git a/data/locale/ko.ts b/data/locale/ko.ts index 5fcd9204f06..af28adb0418 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. 기존 프로젝트 열기 - Recently opened project + Recently opened projects 최근 열린 프로젝트 diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 5683e3fc65c..25d761d009f 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. Open bestaand project - Recently opened project + Recently opened projects diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 9d7e6f99035..afec439e7a1 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -3453,7 +3453,7 @@ Upewnij się, że masz prawo zapisu do tego pliku i spróbuj ponownie.Otwórz istniejący projekt - Recently opened project + Recently opened projects Ostatnio otwierane projekty diff --git a/data/locale/pt.ts b/data/locale/pt.ts index 46941c9060d..b26c7881325 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -3489,7 +3489,7 @@ Double click to pick a file. Mostrar/esconder Editor de Automação - Recently opened project + Recently opened projects Projetos usados recentemente diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 6ef6e8b04f0..22bb33375db 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -3477,7 +3477,7 @@ Please make sure you have write-access to the file and try again. Открыть существующий проект - Recently opened project + Recently opened projects Недавние проекты diff --git a/data/locale/sv.ts b/data/locale/sv.ts index f0df3f184d0..6d0d7e3eed1 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -3433,7 +3433,7 @@ Please make sure you have write-access to the file and try again. Öppna existerande projekt - Recently opened project + Recently opened projects diff --git a/data/locale/zh.ts b/data/locale/zh.ts index 57afb96d7f7..edb1afd957c 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -3443,7 +3443,7 @@ Please make sure you have write-access to the file and try again. 打开已有工程 - Recently opened project + Recently opened projects 最近打开的工程 diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 0c62bf6b4bd..961e51d94f2 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -385,7 +385,7 @@ void MainWindow::finalize() ToolButton * project_open_recent = new ToolButton( embed::getIconPixmap( "project_open_recent" ), - tr( "Recently opened project" ), + tr( "Recently opened projects" ), this, SLOT( emptySlot() ), m_toolBar ); project_open_recent->setMenu( m_recentlyOpenedProjectsMenu ); project_open_recent->setPopupMode( ToolButton::InstantPopup ); From 035f48fb1d47b197078541e10aa0b245479e0d5c Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Sat, 25 Apr 2015 22:15:12 +0000 Subject: [PATCH 33/43] Grey out edit->undo/redo actions if there's nothing left to undo/redo --- include/MainWindow.h | 3 +++ include/ProjectJournal.h | 3 +++ src/core/ProjectJournal.cpp | 9 +++++++++ src/gui/MainWindow.cpp | 13 +++++++++++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/include/MainWindow.h b/include/MainWindow.h index 5e1f294aea6..2c32ad1179c 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -121,6 +121,7 @@ public slots: void updatePlayPauseIcons(); + void updateUndoRedoButtons(); void undo(); void redo(); @@ -167,6 +168,8 @@ public slots: } m_keyMods; QMenu * m_toolsMenu; + QAction * m_undoAction; + QAction * m_redoAction; QList m_tools; QBasicTimer m_updateTimer; diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 5cb7920f683..28beaa82ff7 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -45,6 +45,9 @@ class ProjectJournal void undo(); void redo(); + bool canUndo() const; + bool canRedo() const; + void addJournalCheckPoint( JournallingObject *jo ); bool isJournalling() const diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 77c5c461f9d..4e5c9229b42 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -97,6 +97,15 @@ void ProjectJournal::redo() } } +bool ProjectJournal::canUndo() const +{ + return !m_undoCheckPoints.isEmpty(); +} + +bool ProjectJournal::canRedo() const +{ + return !m_redoCheckPoints.isEmpty(); +} diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 0c62bf6b4bd..ade250ae7aa 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -288,11 +288,11 @@ void MainWindow::finalize() QMenu * edit_menu = new QMenu( this ); menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) ); - edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), + m_undoAction = edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), tr( "Undo" ), this, SLOT( undo() ), Qt::CTRL + Qt::Key_Z ); - edit_menu->addAction( embed::getIconPixmap( "edit_redo" ), + m_redoAction = edit_menu->addAction( embed::getIconPixmap( "edit_redo" ), tr( "Redo" ), this, SLOT( redo() ), Qt::CTRL + Qt::Key_Y ); @@ -300,6 +300,7 @@ void MainWindow::finalize() edit_menu->addAction( embed::getIconPixmap( "setup_general" ), tr( "Settings" ), this, SLOT( showSettingsDialog() ) ); + connect( edit_menu, SIGNAL(aboutToShow()), this, SLOT(updateUndoRedoButtons()) ); m_viewMenu = new QMenu( this ); menuBar()->addMenu( m_viewMenu )->setText( tr( "&View" ) ); @@ -1182,6 +1183,14 @@ void MainWindow::updatePlayPauseIcons() } +void MainWindow::updateUndoRedoButtons() +{ + // when the edit menu is shown, grey out the undo/redo buttons if there's nothing to undo/redo + // else, un-grey them + m_undoAction->setEnabled(Engine::projectJournal()->canUndo()); + m_redoAction->setEnabled(Engine::projectJournal()->canRedo()); +} + void MainWindow::undo() From fd8123488a88545c542dfdfd532cdb7579b38e86 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Sun, 26 Apr 2015 03:58:12 +0000 Subject: [PATCH 34/43] fix behavior of shift+dragging note ends (issue #1905) --- src/gui/editors/PianoRoll.cpp | 183 +++++++++++++++++++++++----------- 1 file changed, 126 insertions(+), 57 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 3c31b789511..8d02ddcf14d 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2434,7 +2434,7 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl ) { if( m_moveBoundaryLeft + off_ticks < 0 ) { - off_ticks += 0 - (off_ticks + m_moveBoundaryLeft); + off_ticks -= (off_ticks + m_moveBoundaryLeft); } if( m_moveBoundaryTop + off_key > NumKeys ) { @@ -2442,92 +2442,161 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl ) } if( m_moveBoundaryBottom + off_key < 0 ) { - off_key += 0 - (m_moveBoundaryBottom + off_key); + off_key -= (m_moveBoundaryBottom + off_key); } } - int shift_offset = 0; - int shift_ref_pos = -1; // get note-vector of current pattern const NoteVector & notes = m_pattern->notes(); - // will be our iterator in the following loop - NoteVector::ConstIterator it = notes.begin(); - - int sNotes = selectionCount(); - while( it != notes.end() ) + if (m_action == ActionMoveNote) + { + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) + { + Note *note = *it; + if( note->selected() ) + { + if( ! ( shift && ! m_startedWithShift ) ) + { + // moving note + int pos_ticks = note->oldPos().getTicks() + off_ticks; + int key_num = note->oldKey() + off_key; + + // ticks can't be negative + pos_ticks = qMax(0, pos_ticks); + // upper/lower bound checks on key_num + key_num = qMax(0, key_num); + key_num = qMin(key_num, NumKeys); + + note->setPos( MidiTime( pos_ticks ) ); + note->setKey( key_num ); + } + else if( shift && ! m_startedWithShift ) + { + // quick resize, toggled by holding shift after starting a note move, but not before + int ticks_new = note->oldLength().getTicks() + off_ticks; + if( ticks_new <= 0 ) + { + ticks_new = 1; + } + note->setLength( MidiTime( ticks_new ) ); + m_lenOfNewNotes = note->length(); + } + } + } + } + else if (m_action == ActionResizeNote) { - Note *note = *it; - const int pos = note->pos().getTicks(); - // When resizing notes: + // If shift is not pressed, resize the selected notes but do not rearrange them // If shift is pressed we resize and rearrange only the selected notes // If shift + ctrl then we also rearrange all posterior notes (sticky) // If shift is pressed but only one note is selected, apply sticky - if( m_action == ActionResizeNote && shift && - ( note->selected() || ctrl || sNotes == 1 ) ) + + if (shift) { - int shifted_pos = note->oldPos().getTicks() + shift_offset; - if( shifted_pos && pos == shift_ref_pos ) + // Algorithm: + // Relative to the starting point of the left-most selected note, + // all selected note start-points and *endpoints* (not length) should be scaled by a calculated factor. + // This factor is such that the endpoint of the note whose handle is being dragged should lie under the cursor. + // first, determine the start-point of the left-most selected note: + int stretchStartTick = -1; + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { - shifted_pos -= off_ticks; + Note *note = *it; + if (note->selected() && (stretchStartTick < 0 || note->oldPos().getTicks() < stretchStartTick)) + { + stretchStartTick = note->oldPos().getTicks(); + } } - note->setPos( MidiTime( shifted_pos ) ); - } - - if( note->selected() ) - { - if( m_action == ActionMoveNote && ! ( shift && ! m_startedWithShift ) ) + // determine the ending tick of the right-most selected note + Note *posteriorNote = nullptr; + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { - // moving note - int pos_ticks = note->oldPos().getTicks() + off_ticks; - int key_num = note->oldKey() + off_key; - - // ticks can't be negative - pos_ticks = qMax(0, pos_ticks); - // upper/lower bound checks on key_num - key_num = qMax(0, key_num); - key_num = qMin(key_num, NumKeys); - - note->setPos( MidiTime( pos_ticks ) ); - note->setKey( key_num ); + Note *note = *it; + if (note->selected() && (posteriorNote == nullptr || + note->oldPos().getTicks() + note->oldLength().getTicks() > + posteriorNote->oldPos().getTicks() + posteriorNote->oldLength().getTicks())) + { + posteriorNote = note; + } } - else if( m_action == ActionResizeNote ) + int posteriorEndTick = posteriorNote->pos().getTicks() + posteriorNote->length().getTicks(); + // end-point of the note whose handle is being dragged: + int stretchEndTick = m_currentNote->oldPos().getTicks() + m_currentNote->oldLength().getTicks(); + // Calculate factor by which to scale the start-point and end-point of all selected notes + float scaleFactor = (float)(stretchEndTick - stretchStartTick + off_ticks) / qMax(1, stretchEndTick - stretchStartTick); + scaleFactor = qMax(0.0f, scaleFactor); + + // process all selected notes & determine how much the endpoint of the right-most note was shifted + int posteriorDeltaThisFrame = 0; + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { - // resizing note - int ticks_new = note->oldLength().getTicks() + off_ticks; - if( ticks_new <= 0 ) + Note *note = *it; + if(note->selected()) { - ticks_new = 1; + // scale relative start and end positions by scaleFactor + int newStart = stretchStartTick + scaleFactor * + (note->oldPos().getTicks() - stretchStartTick); + int newEnd = stretchStartTick + scaleFactor * + (note->oldPos().getTicks()+note->oldLength().getTicks() - stretchStartTick); + // if not holding alt, quantize the offsets + if(!alt) + { + // quantize start time + int oldStart = note->oldPos().getTicks(); + int startDiff = newStart - oldStart; + startDiff = floor(startDiff / quantization()) * quantization(); + newStart = oldStart + startDiff; + // quantize end time + int oldEnd = oldStart + note->oldLength().getTicks(); + int endDiff = newEnd - oldEnd; + endDiff = floor(endDiff / quantization()) * quantization(); + newEnd = oldEnd + endDiff; + } + int newLength = qMax(1, newEnd-newStart); + if (note == posteriorNote) + { + posteriorDeltaThisFrame = (newStart+newLength) - + (note->pos().getTicks() + note->length().getTicks()); + } + note->setLength( MidiTime(newLength) ); + note->setPos( MidiTime(newStart) ); + + m_lenOfNewNotes = note->length(); } - else if( shift ) + } + if (ctrl || selectionCount() == 1) + { + // if holding ctrl or only one note is selected, reposition posterior notes + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { - // when holding shift: update the offset used to shift - // the following notes - if( pos > shift_ref_pos ) + Note *note = *it; + if (!note->selected() && note->pos().getTicks() >= posteriorEndTick) { - shift_offset += off_ticks; - shift_ref_pos = pos; + int newStart = note->pos().getTicks() + posteriorDeltaThisFrame; + note->setPos( MidiTime(newStart) ); } } - note->setLength( MidiTime( ticks_new ) ); - - m_lenOfNewNotes = note->length(); } - else if( m_action == ActionMoveNote && ( shift && ! m_startedWithShift ) ) + } + else + { + // shift is not pressed; stretch length of selected notes but not their position + for (NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { - // quick resize, toggled by holding shift after starting a note move, but not before - int ticks_new = note->oldLength().getTicks() + off_ticks; - if( ticks_new <= 0 ) + Note *note = *it; + if (note->selected()) { - ticks_new = 1; + int newLength = note->oldLength() + off_ticks; + newLength = qMax(1, newLength); + note->setLength( MidiTime(newLength) ); + + m_lenOfNewNotes = note->length(); } - note->setLength( MidiTime( ticks_new ) ); - m_lenOfNewNotes = note->length(); } } - ++it; } m_pattern->dataChanged(); From 61c29ada2afc6d26a32cadb72c6b1d30d75142cd Mon Sep 17 00:00:00 2001 From: Vesa Date: Sun, 26 Apr 2015 17:07:27 +0300 Subject: [PATCH 35/43] fix merge oops --- plugins/stk/mallets/mallets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index f3befe8da91..2818feffd77 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -337,7 +337,7 @@ malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument, m_spreadKnob->setHintText( tr( "Spread:" ), "" ); // try to inform user about missing Stk-installation - if( _instrument->m_filesMissing && engine::hasGUI() ) + if( _instrument->m_filesMissing && Engine::hasGUI() ) { QMessageBox::information( 0, tr( "Missing files" ), tr( "Your Stk-installation seems to be " From d9c2be73fa808cdd51697f12691624fd57e02449 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 27 Apr 2015 06:24:47 +0000 Subject: [PATCH 36/43] Remove unused function Song::playTrack --- include/Song.h | 1 - src/core/Song.cpp | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/include/Song.h b/include/Song.h index 6b7bb243981..79341601181 100644 --- a/include/Song.h +++ b/include/Song.h @@ -256,7 +256,6 @@ public slots: void playSong(); void record(); void playAndRecord(); - void playTrack( Track * trackToPlay ); void playBB(); void playPattern( const Pattern * patternToPlay, bool loop = true ); void togglePause(); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 9e808252da0..e058efa221b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -479,28 +479,6 @@ void Song::playAndRecord() -void Song::playTrack( Track * trackToPlay ) -{ - if( isStopped() == false ) - { - stop(); - } - m_trackToPlay = trackToPlay; - - m_playMode = Mode_PlayTrack; - m_playing = true; - m_paused = false; - - m_vstSyncController.setPlaybackState( true ); - - savePos(); - - emit playbackStateChanged(); -} - - - - void Song::playBB() { if( isStopped() == false ) From 57cdfe1b6642c08baa2ca7fe3742cd1aeb9fd7b2 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 27 Apr 2015 06:33:22 +0000 Subject: [PATCH 37/43] Remove unused Mode_PlayTrack and m_trackToPlay --- include/Song.h | 2 -- src/core/Song.cpp | 5 ----- 2 files changed, 7 deletions(-) diff --git a/include/Song.h b/include/Song.h index 79341601181..3f52cbbb13e 100644 --- a/include/Song.h +++ b/include/Song.h @@ -57,7 +57,6 @@ class EXPORT Song : public TrackContainer { Mode_None, Mode_PlaySong, - Mode_PlayTrack, Mode_PlayBB, Mode_PlayPattern, Mode_PlayAutomationPattern, @@ -352,7 +351,6 @@ private slots: PlayPos m_playPos[Mode_Count]; tact_t m_length; - Track * m_trackToPlay; const Pattern* m_patternToPlay; bool m_loopPattern; diff --git a/src/core/Song.cpp b/src/core/Song.cpp index e058efa221b..b336aec8279 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -94,7 +94,6 @@ Song::Song() : m_errors( new QList() ), m_playMode( Mode_None ), m_length( 0 ), - m_trackToPlay( NULL ), m_patternToPlay( NULL ), m_loopPattern( false ), m_elapsedMilliSeconds( 0 ), @@ -221,10 +220,6 @@ void Song::processNextBuffer() } break; - case Mode_PlayTrack: - trackList.push_back( m_trackToPlay ); - break; - case Mode_PlayBB: if( Engine::getBBTrackContainer()->numOfBBs() > 0 ) { From dc674491755799b787c63e0424ed4327dbc6c1d4 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Mon, 27 Apr 2015 13:02:07 +0300 Subject: [PATCH 38/43] Move the denormal protection routine to one place instead of 3 --- include/Mixer.h | 8 +------- src/core/Mixer.cpp | 10 +--------- src/core/MixerWorkerThread.cpp | 18 +++--------------- src/core/main.cpp | 18 ++---------------- 4 files changed, 7 insertions(+), 47 deletions(-) diff --git a/include/Mixer.h b/include/Mixer.h index f8f9cf313cb..03a81597560 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -25,13 +25,7 @@ #ifndef MIXER_H #define MIXER_H -// denormals stripping -#ifdef __SSE__ -#include -#endif -#ifdef __SSE3__ -#include -#endif +#include "denormals.h" #include "lmmsconfig.h" diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 845abbf93f4..686e2c5c7c0 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -930,15 +930,7 @@ void Mixer::fifoWriter::finish() void Mixer::fifoWriter::run() { -// set denormal protection for this thread -#ifdef __SSE3__ -/* DAZ flag */ - _MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON ); -#endif -#ifdef __SSE__ -/* FTZ flag */ - _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); -#endif + disable_denormals(); #if 0 #ifdef LMMS_BUILD_LINUX diff --git a/src/core/MixerWorkerThread.cpp b/src/core/MixerWorkerThread.cpp index ef011f55f64..45554708c68 100644 --- a/src/core/MixerWorkerThread.cpp +++ b/src/core/MixerWorkerThread.cpp @@ -29,12 +29,7 @@ #include "ThreadableJob.h" #include "Mixer.h" -#ifdef __SSE__ -#include -#endif -#ifdef __SSE3__ -#include -#endif +#include "denormals.h" MixerWorkerThread::JobQueue MixerWorkerThread::globalJobQueue; QWaitCondition * MixerWorkerThread::queueReadyWaitCond = NULL; @@ -159,15 +154,8 @@ void MixerWorkerThread::startAndWaitForJobs() void MixerWorkerThread::run() { -// set denormal protection for this thread -#ifdef __SSE3__ -/* DAZ flag */ - _MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON ); -#endif -#ifdef __SSE__ -/* FTZ flag */ - _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); -#endif + disable_denormals(); + QMutex m; while( m_quit == false ) { diff --git a/src/core/main.cpp b/src/core/main.cpp index bf5d8d2efbc..bba357b010a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -27,13 +27,7 @@ #include "lmmsversion.h" #include "versioninfo.h" -// denormals stripping -#ifdef __SSE__ -#include -#endif -#ifdef __SSE3__ -#include -#endif +#include "denormals.h" #include #include @@ -103,15 +97,7 @@ int main( int argc, char * * argv ) // intialize RNG srand( getpid() + time( 0 ) ); - // set denormal protection for this thread - #ifdef __SSE3__ - /* DAZ flag */ - _MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON ); - #endif - #ifdef __SSE__ - /* FTZ flag */ - _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); - #endif + disable_denormals(); bool core_only = false; bool fullscreen = true; From cb897509154e5bfb9abff4b4be68e6a04494c99d Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Mon, 27 Apr 2015 13:04:26 +0300 Subject: [PATCH 39/43] ...and add the new denormals.h file too. --- include/denormals.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/denormals.h diff --git a/include/denormals.h b/include/denormals.h new file mode 100644 index 00000000000..f89325ac1c9 --- /dev/null +++ b/include/denormals.h @@ -0,0 +1,32 @@ +// Denormals stripping. +// These snippets should be common enough to be considered public domain. + +#ifndef DENORMALS_H +#define DENORMALS_H + + +#ifdef __SSE__ +#include +#endif +#ifdef __SSE3__ +#include +#endif + + +// Set denormal protection for this thread. +// To be on the safe side, don't set the DAZ flag for SSE2 builds, +// even if most SSE2 CPUs can handle it. +void inline disable_denormals() { +#ifdef __SSE3__ + /* DAZ flag */ + _MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON ); +#endif + +#ifdef __SSE__ + /* FTZ flag */ + _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); +#endif +} + +#endif + From 9b6aaf058e8546fad8573e515657f8d53b8e9a1f Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Tue, 28 Apr 2015 04:11:00 +0000 Subject: [PATCH 40/43] Use OS-default shortcuts where applicable, but ensure both ctrl+y and ctrl+shift+z activate redo --- src/gui/MainWindow.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 3152a2b2d4a..b837a3fa2a6 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -234,12 +235,12 @@ void MainWindow::finalize() project_menu->addAction( embed::getIconPixmap( "project_new" ), tr( "&New" ), this, SLOT( createNewProject() ), - Qt::CTRL + Qt::Key_N ); + QKeySequence::New ); project_menu->addAction( embed::getIconPixmap( "project_open" ), tr( "&Open..." ), this, SLOT( openProject() ), - Qt::CTRL + Qt::Key_O ); + QKeySequence::Open ); m_recentlyOpenedProjectsMenu = project_menu->addMenu( embed::getIconPixmap( "project_open_recent" ), @@ -252,7 +253,7 @@ void MainWindow::finalize() project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "&Save" ), this, SLOT( saveProject() ), - Qt::CTRL + Qt::Key_S ); + QKeySequence::Save ); project_menu->addAction( embed::getIconPixmap( "project_saveas" ), tr( "Save &As..." ), this, SLOT( saveProjectAs() ), @@ -294,11 +295,21 @@ void MainWindow::finalize() m_undoAction = edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), tr( "Undo" ), this, SLOT( undo() ), - Qt::CTRL + Qt::Key_Z ); + QKeySequence::Undo ); m_redoAction = edit_menu->addAction( embed::getIconPixmap( "edit_redo" ), tr( "Redo" ), this, SLOT( redo() ), - Qt::CTRL + Qt::Key_Y ); + QKeySequence::Redo ); + // Ensure that both (Ctrl+Y) and (Ctrl+Shift+Z) activate redo shortcut regardless of OS defaults + if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::Key_Y)) + { + new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_Y ), this, SLOT(redo()) ); + } + if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z )) + { + new QShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Z ), this, SLOT(redo()) ); + } + edit_menu->addSeparator(); edit_menu->addAction( embed::getIconPixmap( "setup_general" ), tr( "Settings" ), From 616de244cc00daa87e057687ec01f83e5a6dd3f0 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Tue, 28 Apr 2015 07:08:35 +0000 Subject: [PATCH 41/43] add ctrl+f shortcut to FileBrowser & default focus to filter widget when opened --- include/FileBrowser.h | 3 +++ src/gui/FileBrowser.cpp | 19 +++++++++++++++++++ src/gui/widgets/SideBar.cpp | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/include/FileBrowser.h b/include/FileBrowser.h index f9bc34820fb..21e8e7aef32 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -58,10 +58,13 @@ public slots: void filterItems( const QString & filter ); void reloadTree( void ); +private slots: + void giveFocusToFilter(); private: bool filterItems( QTreeWidgetItem * item, const QString & filter ); virtual void keyPressEvent( QKeyEvent * ke ); + void focusInEvent(QFocusEvent * event); void addItems( const QString & path ); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 9fffa92053b..ca08e76854c 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "FileBrowser.h" #include "BBTrackContainer.h" @@ -97,6 +98,10 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, addContentWidget( ops ); + // Whenever the FileBrowser has focus, Ctrl+F should direct focus to its filter box. + QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_F ), this, SLOT(giveFocusToFilter()) ); + filterFocusShortcut->setContext(Qt::WidgetWithChildrenShortcut); + reloadTree(); show(); } @@ -253,7 +258,21 @@ void FileBrowser::reloadTree( void ) filterItems( text ); } +void FileBrowser::giveFocusToFilter() +{ + if (!m_filterEdit->hasFocus()) + { + // give focus to filter text box and highlight its text for quick editing if not previously focused + m_filterEdit->setFocus(); + m_filterEdit->selectAll(); + } +} +void FileBrowser::focusInEvent(QFocusEvent * event) +{ + // when the FileBrowser is opened, direct focus to the filter for quick filtering + giveFocusToFilter(); +} void FileBrowser::addItems(const QString & path ) diff --git a/src/gui/widgets/SideBar.cpp b/src/gui/widgets/SideBar.cpp index 990bae7f651..bdc7254b212 100644 --- a/src/gui/widgets/SideBar.cpp +++ b/src/gui/widgets/SideBar.cpp @@ -158,6 +158,10 @@ void SideBar::toggleButton( QAbstractButton * button ) activeWidget->setVisible( button->isChecked() ); toolButton->setToolButtonStyle( button->isChecked() ? Qt::ToolButtonTextBesideIcon : Qt::ToolButtonIconOnly ); + if ( button->isChecked() ) + { + activeWidget->setFocus(); + } } } From fe3ca6aa76c700236625546d8d608459bc0c7df0 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Wed, 29 Apr 2015 01:53:34 +0000 Subject: [PATCH 42/43] Use QKeySequence::Find in place of Ctrl+F --- src/gui/FileBrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index ca08e76854c..cbcdfc81b78 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -99,7 +99,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, addContentWidget( ops ); // Whenever the FileBrowser has focus, Ctrl+F should direct focus to its filter box. - QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_F ), this, SLOT(giveFocusToFilter()) ); + QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this, SLOT(giveFocusToFilter()) ); filterFocusShortcut->setContext(Qt::WidgetWithChildrenShortcut); reloadTree(); From c8a0d51a434898b3f2588cf887a663f821f909e7 Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Wed, 29 Apr 2015 02:06:44 +0000 Subject: [PATCH 43/43] revert changes that caused FileBrowsers to steal focus when opened --- include/FileBrowser.h | 1 - src/gui/FileBrowser.cpp | 6 ------ src/gui/widgets/SideBar.cpp | 4 ---- 3 files changed, 11 deletions(-) diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 21e8e7aef32..b2d1e83bf29 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -64,7 +64,6 @@ private slots: private: bool filterItems( QTreeWidgetItem * item, const QString & filter ); virtual void keyPressEvent( QKeyEvent * ke ); - void focusInEvent(QFocusEvent * event); void addItems( const QString & path ); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index cbcdfc81b78..e213d801c4d 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -268,12 +268,6 @@ void FileBrowser::giveFocusToFilter() } } -void FileBrowser::focusInEvent(QFocusEvent * event) -{ - // when the FileBrowser is opened, direct focus to the filter for quick filtering - giveFocusToFilter(); -} - void FileBrowser::addItems(const QString & path ) { diff --git a/src/gui/widgets/SideBar.cpp b/src/gui/widgets/SideBar.cpp index bdc7254b212..990bae7f651 100644 --- a/src/gui/widgets/SideBar.cpp +++ b/src/gui/widgets/SideBar.cpp @@ -158,10 +158,6 @@ void SideBar::toggleButton( QAbstractButton * button ) activeWidget->setVisible( button->isChecked() ); toolButton->setToolButtonStyle( button->isChecked() ? Qt::ToolButtonTextBesideIcon : Qt::ToolButtonIconOnly ); - if ( button->isChecked() ) - { - activeWidget->setFocus(); - } } }