From b9534f4271730239aa2a5c830c76f0d78e75c333 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Wed, 21 Dec 2016 01:36:51 +0100 Subject: [PATCH] m_arpDirectionModel sort element order (#3171) --- include/InstrumentFunctions.h | 2 +- src/core/DataFile.cpp | 15 +++++++++++++++ src/core/InstrumentFunctions.cpp | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index befc16e73..8e143cf90 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -165,8 +165,8 @@ public: ArpDirUp, ArpDirDown, ArpDirUpAndDown, - ArpDirRandom, ArpDirDownAndUp, + ArpDirRandom, NumArpDirections } ; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 4e7e93378..f4220c20c 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -883,6 +883,21 @@ void DataFile::upgrade_1_1_91() el.setAttribute( a, ( el.attribute( a ) == "0" ) ? "1" : "0" ); } } + + list = elementsByTagName( "arpeggiator" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement el = list.item( i ).toElement(); + // Swap elements ArpDirRandom and ArpDirDownAndUp + if( el.attribute( "arpdir" ) == "3" ) + { + el.setAttribute( "arpdir", "4" ); + } + else if( el.attribute( "arpdir" ) == "4" ) + { + el.setAttribute( "arpdir", "3" ); + } + } } diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 67d3a0e93..5e23e76d2 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -320,8 +320,8 @@ InstrumentFunctionArpeggio::InstrumentFunctionArpeggio( Model * _parent ) : m_arpDirectionModel.addItem( tr( "Up" ), new PixmapLoader( "arp_up" ) ); m_arpDirectionModel.addItem( tr( "Down" ), new PixmapLoader( "arp_down" ) ); m_arpDirectionModel.addItem( tr( "Up and down" ), new PixmapLoader( "arp_up_and_down" ) ); - m_arpDirectionModel.addItem( tr( "Random" ), new PixmapLoader( "arp_random" ) ); m_arpDirectionModel.addItem( tr( "Down and up" ), new PixmapLoader( "arp_up_and_down" ) ); + m_arpDirectionModel.addItem( tr( "Random" ), new PixmapLoader( "arp_random" ) ); m_arpDirectionModel.setInitValue( ArpDirUp ); m_arpModeModel.addItem( tr( "Free" ), new PixmapLoader( "arp_free" ) );