@@ -246,15 +246,25 @@ void ChannelSelector::refreshButtonBoundaries()
246246
247247 int w = getWidth () / 3 ;
248248 int h = 15 ;
249-
249+
250+
251+ /*
252+ definition of textbox
253+ */
250254 paramBox->setBounds (px, py+20 , 90 , 20 ); addAndMakeVisible (paramBox);
251255 recordBox->setBounds (rx, ry+20 , 90 , 20 ); addAndMakeVisible (recordBox);
252256 audioBox->setBounds (ax, ay+20 , 90 , 20 ); addAndMakeVisible (audioBox);
253257
258+ /*
259+ audio,record and param tabs
260+ */
254261 audioButton->setBounds (0 , 0 , w, h);
255262 recordButton->setBounds (w, 0 , w, h);
256263 paramsButton->setBounds (w * 2 , 0 , w, h);
257264
265+ /*
266+ select and deselect button under each tab
267+ */
258268 selectButtonParam->setBounds (px + 95 , py + 20 , 20 , 20 );
259269 deselectButtonParam->setBounds (px + 117 , py + 20 , 20 , 20 );
260270
@@ -660,7 +670,7 @@ void ChannelSelector::buttonClicked(Button* button)
660670 editor->channelChanged (-1 );
661671 }
662672 }
663- else if (button == selectButtonParam){
673+ else if (button == selectButtonParam){ // select channels in parameter tab
664674 selectButtonParam->removeListener (this );
665675 deselectButtonParam->removeListener (this );
666676 std::vector<int > getBoxList;
@@ -681,7 +691,7 @@ void ChannelSelector::buttonClicked(Button* button)
681691 selectButtonParam->addListener (this );
682692 deselectButtonParam->addListener (this );
683693 }
684- else if (button == selectButtonRecord){
694+ else if (button == selectButtonRecord){ // select channels in record tab
685695 selectButtonRecord->removeListener (this );
686696 deselectButtonRecord->removeListener (this );
687697 std::vector<int > getBoxList;
@@ -702,7 +712,7 @@ void ChannelSelector::buttonClicked(Button* button)
702712 selectButtonRecord->addListener (this );
703713 deselectButtonRecord->addListener (this );
704714 }
705- else if (button == selectButtonAudio){
715+ else if (button == selectButtonAudio){ // select channels in audio tab
706716 selectButtonAudio->removeListener (this );
707717 deselectButtonAudio->removeListener (this );
708718 std::vector<int > getBoxList;
@@ -723,7 +733,7 @@ void ChannelSelector::buttonClicked(Button* button)
723733 selectButtonAudio->addListener (this );
724734 deselectButtonAudio->addListener (this );
725735 }
726- else if (button == deselectButtonParam){
736+ else if (button == deselectButtonParam){ // deselect channels in param tab
727737 selectButtonParam->removeListener (this );
728738 deselectButtonParam->removeListener (this );
729739 std::vector<int > getBoxList;
@@ -744,7 +754,7 @@ void ChannelSelector::buttonClicked(Button* button)
744754 selectButtonParam->addListener (this );
745755 deselectButtonParam->addListener (this );
746756 }
747- else if (button == deselectButtonRecord){
757+ else if (button == deselectButtonRecord){ // deselect channels in record tab
748758 selectButtonRecord->removeListener (this );
749759 deselectButtonRecord->removeListener (this );
750760 std::vector<int > getBoxList;
@@ -765,7 +775,7 @@ void ChannelSelector::buttonClicked(Button* button)
765775 selectButtonRecord->addListener (this );
766776 deselectButtonRecord->addListener (this );
767777 }
768- else if (button == deselectButtonAudio){
778+ else if (button == deselectButtonAudio){ // deselect channels in audio tab
769779 selectButtonAudio->removeListener (this );
770780 deselectButtonAudio->removeListener (this );
771781 std::vector<int > getBoxList;
@@ -1151,14 +1161,21 @@ void ChannelSelectorRegion::paint(Graphics& g)
11511161 // g.fillAll(Colours::white);
11521162}
11531163
1164+
1165+ /*
1166+ Constructor and Destructor of ChannelSelectorBox.
1167+ */
11541168ChannelSelectorBox::ChannelSelectorBox (){
1155- setMultiLine (false , true );
1156- setReturnKeyStartsNewLine (false );
1169+ setMultiLine (false , true ); // No multi lines.
1170+ setReturnKeyStartsNewLine (false ); // Return key donot start a new line.
11571171 setTabKeyUsedAsCharacter (false );
11581172}
11591173
11601174ChannelSelectorBox::~ChannelSelectorBox (){}
11611175
1176+ /*
1177+ convert a string to integer.
1178+ */
11621179int ChannelSelectorBox::convertToInteger (std::string s){
11631180 if (s.size () > 9 ){
11641181 return INT_MAX;
@@ -1174,6 +1191,13 @@ int ChannelSelectorBox::convertToInteger(std::string s){
11741191 return j;
11751192}
11761193
1194+
1195+ /*
1196+ TextBox to take input. Valid formats:
1197+ 1. [ : ] -> select/deselect all channels
1198+ 2. [ a : b] -> select/deselect all channels from a to b.
1199+ 3. [ a : c : b] -> select/deselect all channels from a to b such that the difference between in each consecutive selected channel is c.
1200+ */
11771201std::vector<int > ChannelSelectorBox::getBoxInfo (int len){
11781202 std::string s = getText ().toStdString ();
11791203 std::vector<std::string> parsed;
0 commit comments