Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
f567b30e
Commit
f567b30e
authored
9 years ago
by
Priyanjit Dey
Browse files
Options
Downloads
Patches
Plain Diff
Documentation Added
parent
95bbe96d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/Processors/Editors/ChannelSelector.cpp
+33
-9
33 additions, 9 deletions
Source/Processors/Editors/ChannelSelector.cpp
Source/Processors/Editors/ChannelSelector.h
+20
-11
20 additions, 11 deletions
Source/Processors/Editors/ChannelSelector.h
with
53 additions
and
20 deletions
Source/Processors/Editors/ChannelSelector.cpp
+
33
−
9
View file @
f567b30e
...
@@ -246,15 +246,25 @@ void ChannelSelector::refreshButtonBoundaries()
...
@@ -246,15 +246,25 @@ void ChannelSelector::refreshButtonBoundaries()
int
w
=
getWidth
()
/
3
;
int
w
=
getWidth
()
/
3
;
int
h
=
15
;
int
h
=
15
;
/*
definition of textbox
*/
paramBox
->
setBounds
(
px
,
py
+
20
,
90
,
20
);
addAndMakeVisible
(
paramBox
);
paramBox
->
setBounds
(
px
,
py
+
20
,
90
,
20
);
addAndMakeVisible
(
paramBox
);
recordBox
->
setBounds
(
rx
,
ry
+
20
,
90
,
20
);
addAndMakeVisible
(
recordBox
);
recordBox
->
setBounds
(
rx
,
ry
+
20
,
90
,
20
);
addAndMakeVisible
(
recordBox
);
audioBox
->
setBounds
(
ax
,
ay
+
20
,
90
,
20
);
addAndMakeVisible
(
audioBox
);
audioBox
->
setBounds
(
ax
,
ay
+
20
,
90
,
20
);
addAndMakeVisible
(
audioBox
);
/*
audio,record and param tabs
*/
audioButton
->
setBounds
(
0
,
0
,
w
,
h
);
audioButton
->
setBounds
(
0
,
0
,
w
,
h
);
recordButton
->
setBounds
(
w
,
0
,
w
,
h
);
recordButton
->
setBounds
(
w
,
0
,
w
,
h
);
paramsButton
->
setBounds
(
w
*
2
,
0
,
w
,
h
);
paramsButton
->
setBounds
(
w
*
2
,
0
,
w
,
h
);
/*
select and deselect button under each tab
*/
selectButtonParam
->
setBounds
(
px
+
95
,
py
+
20
,
20
,
20
);
selectButtonParam
->
setBounds
(
px
+
95
,
py
+
20
,
20
,
20
);
deselectButtonParam
->
setBounds
(
px
+
117
,
py
+
20
,
20
,
20
);
deselectButtonParam
->
setBounds
(
px
+
117
,
py
+
20
,
20
,
20
);
...
@@ -660,7 +670,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -660,7 +670,7 @@ void ChannelSelector::buttonClicked(Button* button)
editor
->
channelChanged
(
-
1
);
editor
->
channelChanged
(
-
1
);
}
}
}
}
else
if
(
button
==
selectButtonParam
){
else
if
(
button
==
selectButtonParam
){
// select channels in parameter tab
selectButtonParam
->
removeListener
(
this
);
selectButtonParam
->
removeListener
(
this
);
deselectButtonParam
->
removeListener
(
this
);
deselectButtonParam
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -681,7 +691,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -681,7 +691,7 @@ void ChannelSelector::buttonClicked(Button* button)
selectButtonParam
->
addListener
(
this
);
selectButtonParam
->
addListener
(
this
);
deselectButtonParam
->
addListener
(
this
);
deselectButtonParam
->
addListener
(
this
);
}
}
else
if
(
button
==
selectButtonRecord
){
else
if
(
button
==
selectButtonRecord
){
// select channels in record tab
selectButtonRecord
->
removeListener
(
this
);
selectButtonRecord
->
removeListener
(
this
);
deselectButtonRecord
->
removeListener
(
this
);
deselectButtonRecord
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -702,7 +712,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -702,7 +712,7 @@ void ChannelSelector::buttonClicked(Button* button)
selectButtonRecord
->
addListener
(
this
);
selectButtonRecord
->
addListener
(
this
);
deselectButtonRecord
->
addListener
(
this
);
deselectButtonRecord
->
addListener
(
this
);
}
}
else
if
(
button
==
selectButtonAudio
){
else
if
(
button
==
selectButtonAudio
){
// select channels in audio tab
selectButtonAudio
->
removeListener
(
this
);
selectButtonAudio
->
removeListener
(
this
);
deselectButtonAudio
->
removeListener
(
this
);
deselectButtonAudio
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -723,7 +733,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -723,7 +733,7 @@ void ChannelSelector::buttonClicked(Button* button)
selectButtonAudio
->
addListener
(
this
);
selectButtonAudio
->
addListener
(
this
);
deselectButtonAudio
->
addListener
(
this
);
deselectButtonAudio
->
addListener
(
this
);
}
}
else
if
(
button
==
deselectButtonParam
){
else
if
(
button
==
deselectButtonParam
){
// deselect channels in param tab
selectButtonParam
->
removeListener
(
this
);
selectButtonParam
->
removeListener
(
this
);
deselectButtonParam
->
removeListener
(
this
);
deselectButtonParam
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -744,7 +754,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -744,7 +754,7 @@ void ChannelSelector::buttonClicked(Button* button)
selectButtonParam
->
addListener
(
this
);
selectButtonParam
->
addListener
(
this
);
deselectButtonParam
->
addListener
(
this
);
deselectButtonParam
->
addListener
(
this
);
}
}
else
if
(
button
==
deselectButtonRecord
){
else
if
(
button
==
deselectButtonRecord
){
// deselect channels in record tab
selectButtonRecord
->
removeListener
(
this
);
selectButtonRecord
->
removeListener
(
this
);
deselectButtonRecord
->
removeListener
(
this
);
deselectButtonRecord
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -765,7 +775,7 @@ void ChannelSelector::buttonClicked(Button* button)
...
@@ -765,7 +775,7 @@ void ChannelSelector::buttonClicked(Button* button)
selectButtonRecord
->
addListener
(
this
);
selectButtonRecord
->
addListener
(
this
);
deselectButtonRecord
->
addListener
(
this
);
deselectButtonRecord
->
addListener
(
this
);
}
}
else
if
(
button
==
deselectButtonAudio
){
else
if
(
button
==
deselectButtonAudio
){
// deselect channels in audio tab
selectButtonAudio
->
removeListener
(
this
);
selectButtonAudio
->
removeListener
(
this
);
deselectButtonAudio
->
removeListener
(
this
);
deselectButtonAudio
->
removeListener
(
this
);
std
::
vector
<
int
>
getBoxList
;
std
::
vector
<
int
>
getBoxList
;
...
@@ -1151,14 +1161,21 @@ void ChannelSelectorRegion::paint(Graphics& g)
...
@@ -1151,14 +1161,21 @@ void ChannelSelectorRegion::paint(Graphics& g)
// g.fillAll(Colours::white);
// g.fillAll(Colours::white);
}
}
/*
Constructor and Destructor of ChannelSelectorBox.
*/
ChannelSelectorBox
::
ChannelSelectorBox
(){
ChannelSelectorBox
::
ChannelSelectorBox
(){
setMultiLine
(
false
,
true
);
setMultiLine
(
false
,
true
);
// No multi lines.
setReturnKeyStartsNewLine
(
false
);
setReturnKeyStartsNewLine
(
false
);
// Return key donot start a new line.
setTabKeyUsedAsCharacter
(
false
);
setTabKeyUsedAsCharacter
(
false
);
}
}
ChannelSelectorBox
::~
ChannelSelectorBox
(){}
ChannelSelectorBox
::~
ChannelSelectorBox
(){}
/*
convert a string to integer.
*/
int
ChannelSelectorBox
::
convertToInteger
(
std
::
string
s
){
int
ChannelSelectorBox
::
convertToInteger
(
std
::
string
s
){
if
(
s
.
size
()
>
9
){
if
(
s
.
size
()
>
9
){
return
INT_MAX
;
return
INT_MAX
;
...
@@ -1174,6 +1191,13 @@ int ChannelSelectorBox::convertToInteger(std::string s){
...
@@ -1174,6 +1191,13 @@ int ChannelSelectorBox::convertToInteger(std::string s){
return
j
;
return
j
;
}
}
/*
TextBox to take input. Valid formats:
1. [ : ] -> select/deselect all channels
2. [ a : b] -> select/deselect all channels from a to b.
3. [ a : c : b] -> select/deselect all channels from a to b such that the difference between in each consecutive selected channel is c.
*/
std
::
vector
<
int
>
ChannelSelectorBox
::
getBoxInfo
(
int
len
){
std
::
vector
<
int
>
ChannelSelectorBox
::
getBoxInfo
(
int
len
){
std
::
string
s
=
getText
().
toStdString
();
std
::
string
s
=
getText
().
toStdString
();
std
::
vector
<
std
::
string
>
parsed
;
std
::
vector
<
std
::
string
>
parsed
;
...
...
This diff is collapsed.
Click to expand it.
Source/Processors/Editors/ChannelSelector.h
+
20
−
11
View file @
f567b30e
...
@@ -140,25 +140,31 @@ private:
...
@@ -140,25 +140,31 @@ private:
EditorButton
*
paramsButton
;
EditorButton
*
paramsButton
;
EditorButton
*
allButton
;
EditorButton
*
allButton
;
EditorButton
*
noneButton
;
EditorButton
*
noneButton
;
EditorButton
*
selectButtonParam
;
EditorButton
*
selectButtonParam
;
//Select Channels in parameter tab
EditorButton
*
deselectButtonParam
;
EditorButton
*
deselectButtonParam
;
//Deselect Channels in parameter tab
EditorButton
*
selectButtonRecord
;
EditorButton
*
selectButtonRecord
;
//Select Channels in record tab
EditorButton
*
deselectButtonRecord
;
EditorButton
*
deselectButtonRecord
;
//Deselect Channels in record tab
EditorButton
*
selectButtonAudio
;
EditorButton
*
selectButtonAudio
;
//Select Channels in audio tab
EditorButton
*
deselectButtonAudio
;
EditorButton
*
deselectButtonAudio
;
//Deselect Channels in audio tab
/** An array of ChannelSelectorButtons used to select the channels that
/** An array of ChannelSelectorButtons used to select the channels that
will be updated when a parameter is changed. */
will be updated when a parameter is changed.
paramBox: TextBox where user input is taken for param tab.
*/
Array
<
ChannelSelectorButton
*>
parameterButtons
;
Array
<
ChannelSelectorButton
*>
parameterButtons
;
ChannelSelectorBox
*
paramBox
;
ChannelSelectorBox
*
paramBox
;
/** An array of ChannelSelectorButtons used to select the channels that
/** An array of ChannelSelectorButtons used to select the channels that
are sent to the audio monitor. */
are sent to the audio monitor.
audioBox: TextBox where user input is taken for audio tab
*/
Array
<
ChannelSelectorButton
*>
audioButtons
;
Array
<
ChannelSelectorButton
*>
audioButtons
;
ChannelSelectorBox
*
audioBox
;
ChannelSelectorBox
*
audioBox
;
/** An array of ChannelSelectorButtons used to select the channels that
/** An array of ChannelSelectorButtons used to select the channels that
will be written to disk when the record button is pressed. */
will be written to disk when the record button is pressed.
recordBox: TextBox where user input is taken for record tab
*/
Array
<
ChannelSelectorButton
*>
recordButtons
;
Array
<
ChannelSelectorButton
*>
recordButtons
;
ChannelSelectorBox
*
recordBox
;
ChannelSelectorBox
*
recordBox
;
...
@@ -297,12 +303,15 @@ private:
...
@@ -297,12 +303,15 @@ private:
bool
isActive
;
bool
isActive
;
};
};
/*
A textbox within the channelSelector to select multiple channels at a time.
*/
class
ChannelSelectorBox
:
public
TextEditor
{
class
ChannelSelectorBox
:
public
TextEditor
{
public:
public:
ChannelSelectorBox
();
ChannelSelectorBox
();
~
ChannelSelectorBox
();
~
ChannelSelectorBox
();
std
::
vector
<
int
>
getBoxInfo
(
int
len
);
std
::
vector
<
int
>
getBoxInfo
(
int
len
);
// Extract Information from the box.
int
convertToInteger
(
std
::
string
s
);
int
convertToInteger
(
std
::
string
s
);
// Conversion of string to integer.
};
};
#endif // __CHANNELSELECTOR_H_68124E35__
#endif // __CHANNELSELECTOR_H_68124E35__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment