@@ -773,40 +773,27 @@ String SelectedChannelsParameter::getValueAsString()
773773
774774String SelectedChannelsParameter::getChangeDescription ()
775775{
776- // compare previousValue to currentValue and return a string describing the change
777- Array<int > prev;
778- for (int i = 0 ; i < previousValue.getArray ()->size (); i++)
779- {
780- prev.add (previousValue[i]);
781- }
782-
783- Array<int > curr;
784- for (int i = 0 ; i < currentValue.getArray ()->size (); i++)
785- {
786- curr.add (currentValue[i]);
787- }
788-
789- // find how many values different from prev to curr
790- int diff = 0 ;
791-
792- for (int i = 0 ; i < curr.size (); i++)
793- {
794- if (! prev.contains (curr[i]))
795- diff++;
796- }
797-
798- for (int i = 0 ; i < prev.size (); i++)
799- {
800- if (! curr.contains (prev[i]))
801- diff++;
776+ // Check number of selected channels:
777+ int selectedChannelCount = currentValue.getArray ()->size ();
778+
779+ // If more than four channels, state the number selected
780+ if (selectedChannelCount > 4 )
781+ return " selected " + String (selectedChannelCount) + " channels" ;
782+ else // Get string describing selected channels
783+ {
784+ String selectedChannelsString;
785+
786+ for (int i = 0 ; i < selectedChannelCount; i++)
787+ {
788+ selectedChannelsString += String (int (currentValue[i]) + 1 );
789+
790+ if (i < selectedChannelCount - 1 )
791+ selectedChannelsString += " , " ;
792+ }
793+
794+ return selectedChannelsString;
802795 }
803-
804- if (diff == 0 ) // should never get here
805- return " No change" ;
806- else if (diff == 1 )
807- return " changed 1" ;
808- else
809- return " changed selection" ;
796+
810797}
811798
812799void SelectedChannelsParameter::toXml (XmlElement* xml)
0 commit comments