diff --git a/ChangeLog b/ChangeLog index a15bf69bc..34377a10c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,7 +16,7 @@ - use controller in value() if set * src/tracks/pattern.cpp: - Change brightness of note volume-lines according to volume + Fixed length of notes according to PaulWay * src/core/mixer.cpp: trigger controller's frame counter diff --git a/include/automatable_model.h b/include/automatable_model.h index 0d418f929..c9de3d564 100644 --- a/include/automatable_model.h +++ b/include/automatable_model.h @@ -104,52 +104,38 @@ public: return( static_cast( _v ) ); } - inline virtual T value( void ) const - { - return value( 0 ); - } + inline virtual T value( void ) const + { + return value( 0 ); + } inline virtual T value( int _frameOffset ) const { - T val; - if( m_controller != NULL ) - { - val = minValue() + - ( maxValue() - minValue() ) * - castValue( m_controller->currentValue( _frameOffset ) ); - - // New framebuffer, emit signal for all the signal based users - if( _frameOffset == 0 && val != m_value ) - { - // Sort of a hack, but this really is our intention - // - // Any model that wants sample-exactness must operate without relying - // on the dataChanged signal. This is primarily for updating the GUI - - //autoModel * that = const_cast( this ); - //emit that->dataChanged(); - } - } - else - { - val = m_value; - } + if( m_controller != NULL ) + { + return minValue() + + ( maxValue() - minValue() ) * + castValue( m_controller->currentValue( _frameOffset ) ); + } - return val; + return m_value; } - inline controller * getController( void ) const - { - return m_controller; - } - inline void setController( controller * _c ) - { - m_controller = _c; + inline controller * getController( void ) const + { + return m_controller; + } + + + inline void setController( controller * _c ) + { + m_controller = _c; QObject::connect( m_controller, SIGNAL( valueChanged() ), this, SIGNAL( dataChanged() ) ); - } + } + inline virtual T initValue( void ) const { @@ -244,7 +230,7 @@ protected: private: - controller * m_controller; + controller * m_controller; T m_value; T m_initValue; T m_minValue; @@ -299,12 +285,12 @@ public slots: -template +template class automatableModelView : public modelView { public: typedef automatableModel autoModel; - typedef automatableModelView autoModelView; + typedef automatableModelView autoModelView; automatableModelView( ::model * _model ) : modelView( _model ) @@ -341,15 +327,14 @@ public: #define generateModelPrimitive(type,type2) \ typedef automatableModel type##Model; \ - typedef automatableModelView type##ModelView; \ + typedef automatableModelView type##ModelView; \ // some model-primitives generateModelPrimitive(float,float); generateModelPrimitive(int,int); -template -class boolModel : public automatableModel +class boolModel : public automatableModel { public: boolModel( const bool _val = FALSE, @@ -362,7 +347,7 @@ public: } ; -typedef automatableModelView boolModelView; +typedef automatableModelView boolModelView; #endif diff --git a/include/automatable_model_templates.h b/include/automatable_model_templates.h index 3eef5a7dd..8742de78f 100644 --- a/include/automatable_model_templates.h +++ b/include/automatable_model_templates.h @@ -45,7 +45,7 @@ automatableModel::automatableModel( ::model * _parent, bool _default_constructed ) : model( _parent, _default_constructed ), - m_controller( NULL ), + m_controller( NULL ), m_value( _val ), m_initValue( _val ), m_minValue( _min ), diff --git a/include/controller.h b/include/controller.h index cb0098df4..382582465 100644 --- a/include/controller.h +++ b/include/controller.h @@ -77,12 +77,12 @@ protected: static unsigned int s_frames; /* - QString publicName(); slots: void trigger(); */ + signals: // The value changed while the mixer isn't running (i.e: MIDI CC) void valueChanged( void ); diff --git a/include/knob.h b/include/knob.h index b8afd4be0..af51263ab 100644 --- a/include/knob.h +++ b/include/knob.h @@ -5,7 +5,7 @@ * Josef Wilgen * * Copyright (c) 2004-2007 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ enum knobTypes -class knob : public QWidget, public floatModelView +class knob : public QWidget, public floatModelView { Q_OBJECT public: @@ -73,8 +73,6 @@ public slots: signals: -// void valueChanged( float value ); -// void valueChanged( void ); void sliderPressed( void ); void sliderReleased( void ); void sliderMoved( float value ); diff --git a/src/core/mv_base.cpp b/src/core/mv_base.cpp index 6b09509b6..10026acb9 100644 --- a/src/core/mv_base.cpp +++ b/src/core/mv_base.cpp @@ -70,14 +70,11 @@ void modelView::doConnections( void ) { if( m_model != NULL ) { - // Why queued connections? this causes a terrible stair effect when - // the GUI can't keep up. If anything should suffer, it should be - // GUI response. QWidget * w = dynamic_cast( this ); QObject::connect( m_model, SIGNAL( dataChanged() ), - w, SLOT( update() ) /*, Qt::QueuedConnection */ ); + w, SLOT( update() ), Qt::QueuedConnection ); QObject::connect( m_model, SIGNAL( propertiesChanged() ), - w, SLOT( update() ) /*, Qt::QueuedConnection */ ); + w, SLOT( update() ), Qt::QueuedConnection ); } } diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index 8e3db1255..dcf5d113d 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -577,12 +577,12 @@ void knob::connectToMidiDevice( void ) void knob::connectToController( void ) { - // TODO[pg]: Display a dialog with list of controllers currently in the song - // in addition to any system MIDI controllers + // TODO[pg]: Display a dialog with list of controllers currently in the song + // in addition to any system MIDI controllers - controller * c = new controller(); + controller * c = new controller(); - model()->setController( c ); + model()->setController( c ); }