From 7d395c00fa2727c62d4a1d176d0fa94f1e354906 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 26 Jan 2014 00:14:16 +0100 Subject: [PATCH] InstrumentTrack: removed option for disabling PianoView visual feedback Probably never used by anyone and just makes code unneccessarily complex. --- include/setup_dialog.h | 4 +--- src/gui/setup_dialog.cpp | 29 ++++------------------------- src/tracks/InstrumentTrack.cpp | 16 ++++------------ 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/include/setup_dialog.h b/include/setup_dialog.h index f5bd00676..866cea7d9 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -1,7 +1,7 @@ /* * setup_dialog.h - dialog for setting up LMMS * - * Copyright (c) 2005-2011 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -103,7 +103,6 @@ private slots: void openBackgroundArtwork(); void toggleDisableChActInd( bool _disabled ); - void toggleManualChPiano( bool _enabled ); void toggleSmoothScroll( bool _enabled ); void toggleAutoSave( bool _enabled ); void toggleOneInstrumentTrackWindow( bool _enabled ); @@ -155,7 +154,6 @@ private: QString m_backgroundArtwork; bool m_disableChActInd; - bool m_manualChPiano; bool m_smoothScroll; bool m_enableAutoSave; bool m_oneInstrumentTrackWindow; diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index 0b0526aee..5703d739c 100644 --- a/src/gui/setup_dialog.cpp +++ b/src/gui/setup_dialog.cpp @@ -1,7 +1,7 @@ /* * setup_dialog.cpp - dialog for setting up LMMS * - * Copyright (c) 2005-2013 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -110,8 +110,6 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : m_backgroundArtwork( configManager::inst()->backgroundArtwork() ), m_disableChActInd( configManager::inst()->value( "ui", "disablechannelactivityindicators" ).toInt() ), - m_manualChPiano( configManager::inst()->value( "ui", - "manualchannelpiano" ).toInt() ), m_smoothScroll( configManager::inst()->value( "ui", "smoothscroll" ).toInt() ), m_enableAutoSave( configManager::inst()->value( "ui", "enableautosave" ).toInt() ), m_oneInstrumentTrackWindow( configManager::inst()->value( "ui", @@ -524,17 +522,9 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : this, SLOT( toggleDisableChActInd( bool ) ) ); - ledCheckBox * manual_ch_piano = new ledCheckBox( - tr( "Only press keys on channel-piano manually" ), - ui_fx_tw ); - manual_ch_piano->move( 10, 40 ); - manual_ch_piano->setChecked( m_manualChPiano ); - connect( manual_ch_piano, SIGNAL( toggled( bool ) ), - this, SLOT( toggleManualChPiano( bool ) ) ); - ledCheckBox * smoothScroll = new ledCheckBox( tr( "Smooth scroll in Song Editor" ), ui_fx_tw ); - smoothScroll->move( 10, 60 ); + smoothScroll->move( 10, 40 ); smoothScroll->setChecked( m_smoothScroll ); connect( smoothScroll, SIGNAL( toggled( bool ) ), this, SLOT( toggleSmoothScroll( bool ) ) ); @@ -542,7 +532,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * autoSave = new ledCheckBox( tr( "Enable auto save feature" ), ui_fx_tw ); - autoSave->move( 10, 80 ); + autoSave->move( 10, 60 ); autoSave->setChecked( m_enableAutoSave ); connect( autoSave, SIGNAL( toggled( bool ) ), this, SLOT( toggleAutoSave( bool ) ) ); @@ -551,7 +541,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * animAFP = new ledCheckBox( tr( "Show playback cursor in AudioFileProcessor" ), ui_fx_tw ); - animAFP->move( 10, 100 ); + animAFP->move( 10, 80 ); animAFP->setChecked( m_animateAFP ); connect( animAFP, SIGNAL( toggled( bool ) ), this, SLOT( toggleAnimateAFP( bool ) ) ); @@ -821,8 +811,6 @@ void setupDialog::accept() configManager::inst()->setValue( "ui", "disablechannelactivityindicators", QString::number( m_disableChActInd ) ); - configManager::inst()->setValue( "ui", "manualchannelpiano", - QString::number( m_manualChPiano ) ); configManager::inst()->setValue( "ui", "smoothscroll", QString::number( m_smoothScroll ) ); configManager::inst()->setValue( "ui", "enableautosave", @@ -987,15 +975,6 @@ void setupDialog::toggleDisableChActInd( bool _disabled ) -void setupDialog::toggleManualChPiano( bool _enabled ) -{ - m_manualChPiano = _enabled; -} - - - - - void setupDialog::toggleSmoothScroll( bool _enabled ) { m_smoothScroll = _enabled; diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 8aaab7b9b..fd16fc90d 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -237,10 +237,8 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti { if( m_notes[event.key()] == NULL ) { - if( !configManager::inst()->value( "ui", "manualchannelpiano" ).toInt() ) - { - m_piano.setKeyState( event.key(), true ); - } + m_piano.setKeyState( event.key(), true ); + // create temporary note note n; n.setKey( event.key() ); @@ -365,10 +363,7 @@ void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& t switch( event.type() ) { case MidiNoteOn: - if( !configManager::inst()->value( "ui", "manualchannelpiano" ).toInt() ) - { - m_piano.setKeyState( event.key(), true ); - } + m_piano.setKeyState( event.key(), true ); if( !configManager::inst()->value( "ui", "disablechannelactivityindicators" ).toInt() ) { if( m_notes[event.key()] == NULL ) @@ -389,10 +384,7 @@ void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& t break; case MidiNoteOff: - if( !configManager::inst()->value( "ui", "manualchannelpiano" ).toInt() ) - { - m_piano.setKeyState( event.key(), false ); - } + m_piano.setKeyState( event.key(), false ); k = masterKey( event.key() ); if( k >= 0 && k < NumKeys && --m_runningMidiNotes[k] <= 0 ) {