From fe827c00b41add1a075ef89c9afe17d774017524 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 9 Jul 2006 01:07:15 +0000 Subject: [PATCH] - don't set song modified flag when playing automation - use piano widget save/load methods git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@217 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/instrument_track.h | 2 +- src/tracks/instrument_track.cpp | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/instrument_track.h b/include/instrument_track.h index 922aa7aec..10e27db0a 100755 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -121,7 +121,7 @@ public: volume getVolume( void ) const; void FASTCALL setSurroundAreaPos( const QPoint & _p ); - void FASTCALL setBaseNote( Uint32 _new_note ); + void FASTCALL setBaseNote( Uint32 _new_note, bool _modified = TRUE ); inline tones baseTone( void ) const { diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index f42b1ba04..85fbd2194 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -815,11 +815,14 @@ void instrumentTrack::setSurroundAreaPos( const QPoint & _p ) -void instrumentTrack::setBaseNote( Uint32 _new_note ) +void instrumentTrack::setBaseNote( Uint32 _new_note, bool _modified ) { setBaseTone( (tones)( _new_note % NOTES_PER_OCTAVE ) ); setBaseOctave( (octaves)( _new_note / NOTES_PER_OCTAVE ) ); - eng()->getSongEditor()->setModified(); + if( _modified ) + { + eng()->getSongEditor()->setModified(); + } emit baseNoteChanged(); } @@ -1041,8 +1044,7 @@ void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc, m_surroundArea->saveSettings( _doc, _this, "surpos" ); m_effectChannelNumber->saveSettings( _doc, _this, "fxch" ); - _this.setAttribute( "basetone", m_baseTone ); - _this.setAttribute( "baseoct", m_baseOctave ); + m_pianoWidget->saveSettings( _doc, _this, "basenote" ); _this.setAttribute( "tab", m_tabWidget->activeTab() ); mainWindow::saveWidgetState( this, _this ); @@ -1069,11 +1071,7 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this ) m_surroundArea->loadSettings( _this, "surpos" ); m_effectChannelNumber->loadSettings( _this, "fxch" ); - m_baseTone = static_cast( _this.attribute( - "basetone" ).toInt() ); - m_baseOctave = static_cast( _this.attribute( - "baseoct" ).toInt() ); - + m_pianoWidget->loadSettings( _this, "basenote" ); int tab = _this.attribute( "tab" ).toInt(); QDomNode node = _this.firstChild();