Skip to content

Commit bc7ded8

Browse files
committed
Channel selector text UI
1 parent 02e59ce commit bc7ded8

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

Applications/Note/Note.cpp

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,12 @@ void Note::LayoutSelector() {
579579
}
580580

581581
void Note::ChannelSelector() {
582-
UI channelSelector("Channel Selector", Color(0x60FF00), false);
582+
Color color = Color(0x60FF00);
583+
UI channelSelector("Channel Selector", color, false);
583584

584585
int32_t offsettedChannel = notePadConfigs[activeConfig].channel + 1;
585586
UI4pxNumber numDisplay;
586-
numDisplay.SetColor(Color(0x60FF00));
587+
numDisplay.SetColor(color);
587588
numDisplay.SetDigits(2);
588589
numDisplay.SetValuePointer(&offsettedChannel);
589590
numDisplay.SetAlternativeColor(Color(0xFFFFFF));
@@ -593,13 +594,37 @@ void Note::ChannelSelector() {
593594
UISelector channelInput;
594595
channelInput.SetDimension(Dimension(8, 2));
595596
channelInput.SetName("Channel");
596-
channelInput.SetColor(Color(0x60FF00));
597+
channelInput.SetColor(color);
597598
channelInput.SetCount(16);
598599
channelInput.SetValuePointer((uint16_t*)&notePadConfigs[activeConfig].channel);
599600
channelInput.OnChange([&](uint16_t val) -> void { offsettedChannel = val + 1; });
600601

601602
channelSelector.AddUIComponent(channelInput, Point(0, 6));
602603

604+
channelSelector.SetPostRenderFunc([&]() -> void {
605+
// C
606+
MatrixOS::LED::SetColor(Point(0, 0), color);
607+
MatrixOS::LED::SetColor(Point(0, 1), color);
608+
MatrixOS::LED::SetColor(Point(0, 2), color);
609+
MatrixOS::LED::SetColor(Point(0, 3), color);
610+
MatrixOS::LED::SetColor(Point(1, 0), color);
611+
MatrixOS::LED::SetColor(Point(1, 3), color);
612+
613+
if(notePadConfigs[activeConfig].channel < 9)
614+
{
615+
//h
616+
MatrixOS::LED::SetColor(Point(2, 0), Color(0xFFFFFF));
617+
MatrixOS::LED::SetColor(Point(2, 1), Color(0xFFFFFF));
618+
MatrixOS::LED::SetColor(Point(2, 2), Color(0xFFFFFF));
619+
MatrixOS::LED::SetColor(Point(2, 3), Color(0xFFFFFF));
620+
MatrixOS::LED::SetColor(Point(3, 1), Color(0xFFFFFF));
621+
MatrixOS::LED::SetColor(Point(4, 0), Color(0xFFFFFF));
622+
MatrixOS::LED::SetColor(Point(4, 1), Color(0xFFFFFF));
623+
MatrixOS::LED::SetColor(Point(4, 2), Color(0xFFFFFF));
624+
MatrixOS::LED::SetColor(Point(4, 3), Color(0xFFFFFF));
625+
}
626+
});
627+
603628
channelSelector.Start();
604629
}
605630

0 commit comments

Comments
 (0)