From ae8ed9e1832a17ef10a75946bb7b92e3c120e382 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 7 Sep 2008 12:08:10 +0000 Subject: [PATCH] moved peridic update-timer from songEditor to mainWindow git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1567 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/song_editor.h | 12 ---------- src/gui/fx_mixer_view.cpp | 30 ++++++++++++++++++------ src/gui/song_editor.cpp | 10 -------- src/gui/widgets/visualization_widget.cpp | 9 +++---- 4 files changed, 26 insertions(+), 35 deletions(-) diff --git a/include/song_editor.h b/include/song_editor.h index 84b893b78..c94aaffd1 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -27,11 +27,8 @@ #ifndef _SONG_EDITOR_H #define _SONG_EDITOR_H -#include - #include "track_container_view.h" - class QLabel; class QScrollBar; @@ -53,10 +50,6 @@ public: virtual ~songEditor(); -signals: - void periodicUpdate( void ); - - public slots: void scrolled( int _new_pos ); @@ -86,18 +79,13 @@ private slots: private: virtual void keyPressEvent( QKeyEvent * _ke ); virtual void paintEvent( QPaintEvent * _pe ); - virtual void timerEvent( QTimerEvent * _ev ); virtual void wheelEvent( QWheelEvent * _we ); virtual bool allowRubberband( void ) const; - song * m_s; - QBasicTimer m_updateTimer; - - QScrollBar * m_leftRightScroll; QWidget * m_toolBar; diff --git a/src/gui/fx_mixer_view.cpp b/src/gui/fx_mixer_view.cpp index 7216d695f..46a9be18b 100644 --- a/src/gui/fx_mixer_view.cpp +++ b/src/gui/fx_mixer_view.cpp @@ -1,5 +1,3 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * fx_mixer_view.cpp - effect-mixer-view for LMMS * @@ -42,10 +40,11 @@ #include "main_window.h" #include "lcd_spinbox.h" #include "gui_templates.h" -#include "song_editor.h" #include "tooltip.h" #include "pixmap_button.h" + + class fxLine : public QWidget { public: @@ -108,9 +107,11 @@ private: fxMixerView::fxMixerView() : QWidget(), - modelView( NULL, this ) + modelView( NULL, this ), + serializingObjectHook() { fxMixer * m = engine::getFxMixer(); + m->setHook( this ); QPalette pal = palette(); pal.setColor( QPalette::Background, QColor( 72, 76, 88 ) ); @@ -224,8 +225,8 @@ fxMixerView::fxMixerView() : setCurrentFxLine( m_fxChannelViews[0].m_fxLine ); // timer for updating faders - connect( engine::getSongEditor(), SIGNAL( periodicUpdate() ), - this, SLOT( updateFaders() ) ); + connect( engine::getMainWindow(), SIGNAL( periodicUpdate() ), + this, SLOT( updateFaders() ) ); // add ourself to workspace @@ -254,6 +255,22 @@ fxMixerView::~fxMixerView() +void fxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this ) +{ + mainWindow::saveWidgetState( this, _this ); +} + + + + +void fxMixerView::loadSettings( const QDomElement & _this ) +{ + mainWindow::restoreWidgetState( this, _this ); +} + + + + void fxMixerView::setCurrentFxLine( fxLine * _line ) { m_currentFxLine = _line; @@ -326,4 +343,3 @@ void fxMixerView::updateFaders( void ) #include "moc_fx_mixer_view.cxx" -#endif diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 09414e06e..ff37924b2 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -358,8 +358,6 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : parentWidget()->resize( 600, 300 ); parentWidget()->move( 5, 5 ); parentWidget()->show(); - - m_updateTimer.start( 1000 / 20, this ); // 20 fps } @@ -495,14 +493,6 @@ void songEditor::paintEvent( QPaintEvent * _pe ) -void songEditor::timerEvent( QTimerEvent * ) -{ - emit periodicUpdate(); -} - - - - void songEditor::wheelEvent( QWheelEvent * _we ) { if( engine::getMainWindow()->isCtrlPressed() == TRUE ) diff --git a/src/gui/widgets/visualization_widget.cpp b/src/gui/widgets/visualization_widget.cpp index b24f11284..ddf25104c 100644 --- a/src/gui/widgets/visualization_widget.cpp +++ b/src/gui/widgets/visualization_widget.cpp @@ -25,18 +25,15 @@ */ -#include #include #include -#include #include "visualization_widget.h" +#include "main_window.h" #include "embed.h" #include "engine.h" -#include "templates.h" #include "tooltip.h" #include "song.h" -#include "song_editor.h" @@ -99,7 +96,7 @@ void visualizationWidget::setActive( bool _active ) m_active = _active; if( m_active ) { - connect( engine::getSongEditor(), + connect( engine::getMainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); connect( engine::getMixer(), @@ -108,7 +105,7 @@ void visualizationWidget::setActive( bool _active ) } else { - disconnect( engine::getSongEditor(), + disconnect( engine::getMainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); disconnect( engine::getMixer(),