Skip to content
Snippets Groups Projects
Commit b5eb51dc authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Fix channel selector in channel mapper not updating channel number correctly

parent aa88db0d
No related branches found
No related tags found
No related merge requests found
...@@ -129,6 +129,19 @@ void ChannelSelector::setNumChannels(int numChans) ...@@ -129,6 +129,19 @@ void ChannelSelector::setNumChannels(int numChans)
} }
} }
//Reassign numbers according to the actual channels (useful for channel mapper)
std::cout << parameterButtons.size() << " - " << recordButtons.size() << " - " <<audioButtons.size() << std::endl;
for (int n = 0; n < parameterButtons.size(); n++)
{
int num = ((GenericEditor*)getParentComponent())->getChannel(n)->num + 1;
parameterButtons[n]->setChannel(num);
if (isNotSink)
{
recordButtons[n]->setChannel(num);
audioButtons[n]->setChannel(num);
}
}
refreshButtonBoundaries(); refreshButtonBoundaries();
} }
...@@ -343,9 +356,9 @@ void ChannelSelector::activateButtons() ...@@ -343,9 +356,9 @@ void ChannelSelector::activateButtons()
void ChannelSelector::inactivateRecButtons() void ChannelSelector::inactivateRecButtons()
{ {
recActive = false; recActive = false;
for (int i = 0; i < recordButtons.size(); i++) for (int i = 0; i < recordButtons.size(); i++)
{ {
recordButtons[i]->setActive(false); recordButtons[i]->setActive(false);
recordButtons[i]->repaint(); recordButtons[i]->repaint();
...@@ -355,7 +368,7 @@ void ChannelSelector::inactivateRecButtons() ...@@ -355,7 +368,7 @@ void ChannelSelector::inactivateRecButtons()
void ChannelSelector::activateRecButtons() void ChannelSelector::activateRecButtons()
{ {
recActive = true; recActive = true;
for (int i = 0; i < recordButtons.size(); i++) for (int i = 0; i < recordButtons.size(); i++)
{ {
......
...@@ -303,6 +303,10 @@ public: ...@@ -303,6 +303,10 @@ public:
} }
//Channel* getChannel() {return ch;} //Channel* getChannel() {return ch;}
void setActive(bool t); void setActive(bool t);
void setChannel(int n)
{
num = n;
}
private: private:
void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown); void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
......
...@@ -321,6 +321,7 @@ void GenericProcessor::update() ...@@ -321,6 +321,7 @@ void GenericProcessor::update()
Channel* ch = new Channel(*sourceChan); Channel* ch = new Channel(*sourceChan);
ch->setProcessor(this); ch->setProcessor(this);
ch->bitVolts = ch->bitVolts*getDefaultBitVolts(); ch->bitVolts = ch->bitVolts*getDefaultBitVolts();
ch->num = i;
if (i < recordStatus.size()) if (i < recordStatus.size())
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment