diff --git a/include/setup_dialog.h b/include/setup_dialog.h index d22fd9328..4bac5e0fe 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -109,6 +109,7 @@ private slots: void toggleOneInstrumentTrackWindow( bool _enabled ); void toggleCompactTrackButtons( bool _enabled ); void toggleSyncVSTPlugins( bool _enabled ); + void toggleAnimateAFP( bool _enabled ); private: @@ -158,6 +159,7 @@ private: bool m_oneInstrumentTrackWindow; bool m_compactTrackButtons; bool m_syncVSTPlugins; + bool m_animateAFP; typedef QMap AswMap; typedef QMap MswMap; diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 5520c7302..04fca5c37 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -522,7 +522,8 @@ AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _ m_endKnob( 0 ), m_isDragging( false ), m_reversed( false ), - m_framesPlayed( 0 ) + m_framesPlayed( 0 ), + m_animation(configManager::inst()->value("ui", "animateafp").toInt()) { setFixedSize( _w, _h ); setMouseTracking( true ); @@ -701,7 +702,7 @@ void AudioFileProcessorWaveView::paintEvent( QPaintEvent * _pe ) QColor( 255, 255, 0, 70 ) ); - if( m_framesPlayed ) + if( m_framesPlayed && m_animation) { const int played_width_px = m_framesPlayed / double( m_sampleBuffer.endFrame() - m_sampleBuffer.startFrame() ) diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index 1617e745b..cdcbbd46a 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -91,7 +91,6 @@ private: BoolModel m_reverseModel; BoolModel m_loopModel; - friend class AudioFileProcessorView; } ; @@ -235,7 +234,7 @@ private: draggingType m_draggingType; bool m_reversed; f_cnt_t m_framesPlayed; - + bool m_animation; public: AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, sampleBuffer & _buf ); diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index b8f38f9bf..29cdce5c4 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-2010 Tobias Doerffel + * Copyright (c) 2005-2013 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -119,7 +119,9 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : m_compactTrackButtons( configManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ), m_syncVSTPlugins( configManager::inst()->value( "ui", - "syncvstplugins" ).toInt() ) + "syncvstplugins" ).toInt() ), + m_animateAFP(configManager::inst()->value( "ui", + "animateafp").toInt() ) { setWindowIcon( embed::getIconPixmap( "setup_general" ) ); setWindowTitle( tr( "Setup LMMS" ) ); @@ -476,7 +478,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : tabWidget * ui_fx_tw = new tabWidget( tr( "UI effects vs. " "performance" ).toUpper(), performance ); - ui_fx_tw->setFixedHeight( 100 ); + ui_fx_tw->setFixedHeight( 120 ); ledCheckBox * disable_ch_act_ind = new ledCheckBox( tr( "Disable channel activity indicators" ), @@ -511,6 +513,15 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : this, SLOT( toggleAutoSave( bool ) ) ); + ledCheckBox * animAFP = new ledCheckBox( + tr( "Show playback cursor in AudioFileProcessor" ), + ui_fx_tw ); + animAFP->move( 10, 100 ); + animAFP->setChecked( m_animateAFP ); + connect( animAFP, SIGNAL( toggled( bool ) ), + this, SLOT( toggleAnimateAFP( bool ) ) ); + + perf_layout->addWidget( ui_fx_tw ); perf_layout->addStretch(); @@ -787,6 +798,9 @@ void setupDialog::accept() QString::number( m_compactTrackButtons ) ); configManager::inst()->setValue( "ui", "syncvstplugins", QString::number( m_syncVSTPlugins ) ); + configManager::inst()->setValue( "ui", "animateafp", + QString::number( m_animateAFP ) ); + configManager::inst()->setWorkingDir( m_workingDir ); configManager::inst()->setVSTDir( m_vstDir ); @@ -974,6 +988,11 @@ void setupDialog::toggleSyncVSTPlugins( bool _enabled ) m_syncVSTPlugins = _enabled; } +void setupDialog::toggleAnimateAFP( bool _enabled ) +{ + m_animateAFP = _enabled; +} +