Skip to content

Commit f567b30

Browse files
Documentation Added
1 parent 95bbe96 commit f567b30

2 files changed

Lines changed: 53 additions & 20 deletions

File tree

Source/Processors/Editors/ChannelSelector.cpp

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
*/
11541168
ChannelSelectorBox::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

11601174
ChannelSelectorBox::~ChannelSelectorBox(){}
11611175

1176+
/*
1177+
convert a string to integer.
1178+
*/
11621179
int 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+
*/
11771201
std::vector<int> ChannelSelectorBox::getBoxInfo(int len){
11781202
std::string s = getText().toStdString();
11791203
std::vector<std::string> parsed;

Source/Processors/Editors/ChannelSelector.h

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,31 @@ class PLUGIN_API ChannelSelector : public Component,
140140
EditorButton* paramsButton;
141141
EditorButton* allButton;
142142
EditorButton* noneButton;
143-
EditorButton* selectButtonParam;
144-
EditorButton* deselectButtonParam;
145-
EditorButton* selectButtonRecord;
146-
EditorButton* deselectButtonRecord;
147-
EditorButton* selectButtonAudio;
148-
EditorButton* deselectButtonAudio;
143+
EditorButton* selectButtonParam; //Select Channels in parameter tab
144+
EditorButton* deselectButtonParam; //Deselect Channels in parameter tab
145+
EditorButton* selectButtonRecord; //Select Channels in record tab
146+
EditorButton* deselectButtonRecord;//Deselect Channels in record tab
147+
EditorButton* selectButtonAudio; //Select Channels in audio tab
148+
EditorButton* deselectButtonAudio; //Deselect Channels in audio tab
149149

150150
/** An array of ChannelSelectorButtons used to select the channels that
151-
will be updated when a parameter is changed. */
151+
will be updated when a parameter is changed.
152+
paramBox: TextBox where user input is taken for param tab.
153+
*/
152154
Array<ChannelSelectorButton*> parameterButtons;
153155
ChannelSelectorBox* paramBox;
154156

155157
/** An array of ChannelSelectorButtons used to select the channels that
156-
are sent to the audio monitor. */
158+
are sent to the audio monitor.
159+
audioBox: TextBox where user input is taken for audio tab
160+
*/
157161
Array<ChannelSelectorButton*> audioButtons;
158162
ChannelSelectorBox* audioBox;
159163

160164
/** An array of ChannelSelectorButtons used to select the channels that
161-
will be written to disk when the record button is pressed. */
165+
will be written to disk when the record button is pressed.
166+
recordBox: TextBox where user input is taken for record tab
167+
*/
162168
Array<ChannelSelectorButton*> recordButtons;
163169
ChannelSelectorBox* recordBox;
164170

@@ -297,12 +303,15 @@ class ChannelSelectorButton : public Button
297303
bool isActive;
298304
};
299305

306+
/*
307+
A textbox within the channelSelector to select multiple channels at a time.
308+
*/
300309
class ChannelSelectorBox :public TextEditor{
301310
public:
302311
ChannelSelectorBox();
303312
~ChannelSelectorBox();
304-
std::vector<int> getBoxInfo(int len);
305-
int convertToInteger(std::string s);
313+
std::vector<int> getBoxInfo(int len); // Extract Information from the box.
314+
int convertToInteger(std::string s); // Conversion of string to integer.
306315
};
307316

308317
#endif // __CHANNELSELECTOR_H_68124E35__

0 commit comments

Comments
 (0)