From 311bc92bdece8bd969b6278a6d902db3e07e694a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 14 Aug 2010 00:18:26 +0200 Subject: [PATCH] SampleTrack: fixed non-functional solo and mute buttons The SampleTrackView did not explicitely have a SampleTrack model attached and thus trackView::modelChanged() was not called. This way SampleTrackView's mute and solo buttons were not connected to the according models of the SampleTrack model. Fix this by calling setModel() in SampleTrackView::SampleTrackView() (as done in constructors of other track types too) and overload the SampleTrackView::modelChanged() method. Closes #3043836. --- include/sample_track.h | 10 +++++++++- src/tracks/sample_track.cpp | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/sample_track.h b/include/sample_track.h index a5c2001ab..ca799c101 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -2,7 +2,7 @@ * sample_track.h - class sampleTrack, a track which provides arrangement of * samples * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -167,6 +167,14 @@ public slots: void showEffects(); +protected: + void modelChanged(); + virtual QString nodeName() const + { + return "SampleTrackView"; + } + + private: EffectRackView * m_effectRack; QWidget * m_effWindow; diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index 6f78b5bcc..db4f4c7e0 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -2,7 +2,7 @@ * sample_track.cpp - implementation of class sampleTrack, a track which * provides arrangement of samples * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -531,6 +531,8 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv ) m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize ); m_effWindow->setWindowTitle( _t->name() ); m_effWindow->hide(); + + setModel( _t ); } @@ -559,7 +561,15 @@ void sampleTrackView::showEffects() +void sampleTrackView::modelChanged() +{ + sampleTrack * st = castModel(); + m_volumeKnob->setModel( &st->m_volumeModel ); + + trackView::modelChanged(); +} + + #include "moc_sample_track.cxx" -