diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index 89d62193a..359ee650e 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -69,7 +69,6 @@ class arpAndChordsTabWidget : public QWidget, public journallingObject public: enum arpDirections { - OFF, UP, DOWN, UP_AND_DOWN, diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index 528e5040c..da3cfc300 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -635,7 +635,7 @@ bool flpImport::tryImport( trackContainer * _tc ) const arpAndChordsTabWidget::arpDirections mappedArpDir[] = { - arpAndChordsTabWidget::OFF, + arpAndChordsTabWidget::UP, arpAndChordsTabWidget::UP, arpAndChordsTabWidget::DOWN, arpAndChordsTabWidget::UP_AND_DOWN, @@ -645,16 +645,14 @@ bool flpImport::tryImport( trackContainer * _tc ) const Uint32 * p = (const Uint32 *) text; arpAndChordsTabWidget * actw = it->m_arpWidget; actw->m_arpDirectionBtnGrp->setValue( - mappedArpDir[p[10]] - 1 ); + mappedArpDir[p[10]] ); actw->m_arpRangeKnob->setValue( p[11] ); actw->m_arpComboBox->setValue( p[12] ); actw->m_arpTimeKnob->setValue( p[13] / 8.0f ); //// 100.0f ); actw->m_arpGateKnob->setValue( p[14] * 100.0f / 48.0f ); - actw->m_arpGroupBox->setState( - mappedArpDir[p[10]] != - arpAndChordsTabWidget::OFF ); + actw->m_arpGroupBox->setState( p[10] > 0 ); printf( "channel params: " ); dump_mem( text, text_len ); //printf( "channel params: arpdir: %d range: %d time: %d gate: %d\n", p[10], p[11], p[13], p[14] ); diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 31edfff34..1fdb36b50 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -386,7 +386,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( m_arpDirectionBtnGrp->addButton( arp_up_and_down_btn ); m_arpDirectionBtnGrp->addButton( arp_random_btn ); - m_arpDirectionBtnGrp->setInitValue( UP - 1 ); + m_arpDirectionBtnGrp->setInitValue( UP ); QLabel * mode_lbl = new QLabel( tr( "Mode:" ), m_arpGroupBox ); @@ -479,7 +479,6 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // now follows code for arpeggio if( _n->baseNote() == FALSE || - ( m_arpDirectionBtnGrp->value() + 1) == OFF || !m_arpGroupBox->isActive() || ( _n->released() && _n->releaseFramesDone() >= _n->actualReleaseFramesToDo() ) ) @@ -553,8 +552,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) continue; } - arpDirections dir = static_cast( - m_arpDirectionBtnGrp->value() + 1 ); + const int dir = m_arpDirectionBtnGrp->value(); // process according to arpeggio-direction... if( dir == UP ) { @@ -678,7 +676,7 @@ void arpAndChordsTabWidget::loadSettings( const QDomElement & _this ) m_arpGateKnob->loadSettings( _this, "arpgate" ); m_arpDirectionBtnGrp->loadSettings( _this, "arpdir" ); - // Keep compatibility with version 2.1 file format + // Keep compatibility with version 0.2.1 file format if( _this.hasAttribute( "arpsyncmode" ) ) { m_arpTimeKnob->setSyncMode( diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index 7ccadfa34..1e6086445 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -533,6 +533,12 @@ void multimediaProject::upgrade( void ) !el.attribute( "arpdisabled" ) .toInt() ); } + else if( !el.hasAttribute( "chord-enabled" ) ) + { + el.setAttribute( "chord-enabled", TRUE ); + el.setAttribute( "arp-enabled", + el.attribute( "arpdir" ).toInt() != 0 ); + } } list = elementsByTagName( "channeltrack" ); @@ -572,6 +578,26 @@ void multimediaProject::upgrade( void ) } } } + + + if( version < "0.3.0-rc2" ) + { + QDomNodeList list = elementsByTagName( "arpandchords" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement el = list.item( i ).toElement(); + if( el.attribute( "arpdir" ).toInt() > 0 ) + { + el.setAttribute( "arpdir", + el.attribute( "arpdir" ).toInt() - 1 ); + } + } + } + + if( !m_head.hasAttribute( "mastervol" ) ) + { + m_head.setAttribute( "mastervol", 100 ); + } }