@@ -255,12 +255,9 @@ void LfpDisplayCanvas::update()
255255 // std::cout << "Updating channel names" << std::endl;
256256 for (int i = 0 ; i < nChans; i++)
257257 {
258-
259258 String chName = processor->getDataChannel (i)->getName ();
260-
261259 lfpDisplay->channelInfo [i]->setName (chName);
262260 lfpDisplay->setEnabledState (isChannelEnabled[i], i);
263-
264261 }
265262
266263 if (nChans == 0 ) lfpDisplay->setBounds (0 , 0 , getWidth (), getHeight ());
@@ -275,7 +272,8 @@ void LfpDisplayCanvas::update()
275272 {
276273 for (int i = 0 ; i < nChans; i++)
277274 {
278- // std::cout << i << std::endl;
275+ String chName = processor->getDataChannel (i)->getName ();
276+ lfpDisplay->channelInfo [i]->setName (chName);
279277 lfpDisplay->channels [i]->updateType ();
280278 lfpDisplay->channelInfo [i]->updateType ();
281279 }
@@ -3078,6 +3076,7 @@ LfpChannelDisplay::LfpChannelDisplay(LfpDisplayCanvas* c, LfpDisplay* d, LfpDisp
30783076 , options(o)
30793077 , isSelected(false )
30803078 , chan(channelNumber)
3079+ , name(" " )
30813080 , drawableChan(channelNumber)
30823081 , channelOverlap(300 )
30833082 , channelHeight(30 )
@@ -3513,6 +3512,11 @@ int LfpChannelDisplay::getChannelNumber()
35133512 return chan;
35143513}
35153514
3515+ String LfpChannelDisplay::getName ()
3516+ {
3517+ return name;
3518+ }
3519+
35163520int LfpChannelDisplay::getDrawableChannelNumber ()
35173521{
35183522 return drawableChan;
@@ -3569,7 +3573,7 @@ LfpChannelDisplayInfo::LfpChannelDisplayInfo(LfpDisplayCanvas* canvas_, LfpDispl
35693573 y = -1 .0f ;
35703574
35713575// enableButton = new UtilityButton(String(ch+1), Font("Small Text", 13, Font::plain));
3572- enableButton = new UtilityButton (" * " , Font (" Small Text" , 13 , Font::plain));
3576+ enableButton = new UtilityButton (" " , Font (" Small Text" , 13 , Font::plain));
35733577 enableButton->setRadius (5 .0f );
35743578
35753579 enableButton->setEnabledState (true );
@@ -3729,24 +3733,17 @@ void LfpChannelDisplayInfo::paint(Graphics& g)
37293733
37303734 int center = getHeight ()/2 - (isSingleChannel?(75 ):(0 ));
37313735
3732- // g.setColour(lineColour);
3733- // if (chan > 98)
3734- // g.fillRoundedRectangle(5,center-8,51,22,8.0f);
3735- // else
3736-
3737- // g.fillRoundedRectangle(5,center-8,41,22,8.0f);
3738-
37393736 // Draw the channel numbers
37403737 g.setColour (Colours::grey);
3741- const String channelString = (isChannelNumberHidden () ? (" --" ) : String ( getChannelNumber () + 1 ));
3738+ const String channelString = (isChannelNumberHidden () ? (" --" ) : getName ( ));
37423739 bool isCentered = !getEnabledButtonVisibility ();
37433740
37443741 g.drawText (channelString,
37453742 2 ,
37463743 center-4 ,
3747- isCentered ? ( getWidth ()/2 - 4 ) : ( getWidth ()/ 4 ) ,
3744+ getWidth ()/2 ,
37483745 10 ,
3749- isCentered ? Justification::centred : Justification::centredRight ,
3746+ isCentered ? Justification::centred : Justification::centredLeft ,
37503747 false );
37513748
37523749 g.setColour (lineColour);
@@ -3797,17 +3794,11 @@ void LfpChannelDisplayInfo::resized()
37973794{
37983795
37993796 int center = getHeight ()/2 - (isSingleChannel?(75 ):(0 ));
3800-
3801- // if (chan > 98)
3802- // enableButton->setBounds(8,center-5,45,16);
3803- // else
3804- // enableButton->setBounds(8,center-5,35,16);
3805-
38063797 setEnabledButtonVisibility (getHeight () >= 16 );
38073798
38083799 if (getEnabledButtonVisibility ())
38093800 {
3810- enableButton->setBounds (getWidth ()/4 + 5 , ( center) - 7 , 15 , 15 );
3801+ enableButton->setBounds (getWidth ()/2 - 10 , center - 5 , 10 , 10 );
38113802 }
38123803
38133804 setChannelNumberIsHidden (getHeight () < 16 && (getDrawableChannelNumber () + 1 ) % 10 != 0 );
0 commit comments