From 459b13aad3abdb41e563cebc95dcde2f66dfd986 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 30 Jun 2008 21:48:21 +0000 Subject: [PATCH] fixed inlineAutomation::hasAutomation() git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1251 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 43 ++++++++++++++++++++++++++++++++++ include/automation_pattern.h | 10 ++++++++ include/inline_automation.h | 5 ++-- include/note.h | 2 +- src/core/inline_automation.cpp | 2 +- src/core/note.cpp | 10 ++------ 6 files changed, 60 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fa8725e7..20dffd583 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,48 @@ 2008-06-30 Tobias Doerffel + * src/core/engine.cpp: + clear whole project before deleting everything - fixes segfault when + quitting with controllers added + + * src/core/effect_chain.cpp: + fixed crash when an effect failed to load because its sub-plugin is + missing (closes #2005910) + + * src/core/automation_pattern.cpp: + - initialize first value in time-map + - better default-model + - change automation-pattern to NULL if opened in automation editor + during destruction + - improved default-label + - when used in track-container with fixed TCOs, update length + + * src/core/track.cpp: + * src/tracks/bb_track.cpp: + * src/tracks/instrument_track.cpp: + * src/tracks/sample_track.cpp: + save/restore name-property inside track-class + + * src/tracks/automation_track.cpp: + set a proper name per default + + * src/gui/automation_editor.cpp: + queued connections for models for not getting signaled at + destruction-time + + * include/bb_editor.h: + * src/gui/bb_editor.cpp: + made it possible to add automation-tracks to BB-editor + + * include/automation_pattern.h: + * include/inline_automation.h: + * include/note.h: + * src/core/inline_automation.cpp: + * src/core/note.cpp: + fixed inlineAutomation::hasAutomation() + + * data/themes/default/style.css: + common font-size for various push-buttons + * src/core/config_mgr.cpp: ask whether to create working-directory if it does not exist diff --git a/include/automation_pattern.h b/include/automation_pattern.h index 848363738..bffb9ce7e 100644 --- a/include/automation_pattern.h +++ b/include/automation_pattern.h @@ -63,11 +63,21 @@ public: void removeValue( const midiTime & _time ); + inline const timeMap & getTimeMap( void ) const + { + return( m_timeMap ); + } + inline timeMap & getTimeMap( void ) { return( m_timeMap ); } + inline bool hasAutomation( void ) const + { + return( m_dynamic || getTimeMap()[0] != 0 ); + } + float valueAt( const midiTime & _time ); const QString name( void ) const; diff --git a/include/inline_automation.h b/include/inline_automation.h index 1730d1803..bcb37b55e 100644 --- a/include/inline_automation.h +++ b/include/inline_automation.h @@ -45,9 +45,10 @@ public: delete m_autoPattern; } - inline bool hasAutomationPattern( void ) const + inline bool hasAutomation( void ) const { - return( m_autoPattern != NULL ); + return( m_autoPattern != NULL && + m_autoPattern->hasAutomation() ); } automationPattern * getAutomationPattern( void ) diff --git a/include/note.h b/include/note.h index 48ed1d9d1..65ce50d49 100644 --- a/include/note.h +++ b/include/note.h @@ -153,7 +153,7 @@ public: void editDetuningPattern( void ); - bool hasDetuningInfo( void ); + bool hasDetuningInfo( void ) const; protected: diff --git a/src/core/inline_automation.cpp b/src/core/inline_automation.cpp index ccfd2e1d9..936033256 100644 --- a/src/core/inline_automation.cpp +++ b/src/core/inline_automation.cpp @@ -31,7 +31,7 @@ void inlineAutomation::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { - if( hasAutomationPattern() ) + if( hasAutomation() ) { QDomElement ap = _doc.createElement( automationPattern::classNodeName() ); diff --git a/src/core/note.cpp b/src/core/note.cpp index d2253fb35..8e13e947a 100644 --- a/src/core/note.cpp +++ b/src/core/note.cpp @@ -258,15 +258,9 @@ void note::createDetuning( void ) -bool note::hasDetuningInfo( void ) +bool note::hasDetuningInfo( void ) const { - if( m_detuning->hasAutomationPattern() ) - { - const automationPattern::timeMap & map = - m_detuning->getAutomationPattern()->getTimeMap(); - return( map.size() > 1 || map[0] != 0 ); - } - return( FALSE ); + return( m_detuning && m_detuning->hasAutomation() ); }