2020-02-22 22:42:31 +00:00
|
|
|
#include "part_menu.h"
|
|
|
|
#include "../menu/menu.h"
|
|
|
|
#include "../menu/menu_items.h"
|
|
|
|
#include <u8g2.h>
|
|
|
|
|
2020-02-23 00:34:26 +00:00
|
|
|
static const char* kVoiceDetailStrings[] = {"S", "M", "L", "XL"};
|
|
|
|
|
2020-02-22 22:42:31 +00:00
|
|
|
PartMenu::PartMenu()
|
2020-02-23 00:03:05 +00:00
|
|
|
: item_voice_count("voice count", 1, 1, 4, 1)
|
2020-02-23 00:34:26 +00:00
|
|
|
, item_voice_detail("voice detail", 0, kVoiceDetailStrings, 4)
|
2020-02-23 00:15:49 +00:00
|
|
|
, item_midi_filter_enabled("MIDI filter", 1, "on", "off")
|
2020-02-23 00:34:26 +00:00
|
|
|
, item_midi_channel("MIDI channel", 0, 0, 16, 1)
|
2020-02-22 23:58:21 +00:00
|
|
|
, item_midi_lowest_note("MIDI lowest", 0)
|
|
|
|
, item_midi_highest_note("MIDI highest", 127)
|
2020-02-22 22:42:31 +00:00
|
|
|
{
|
2020-02-22 23:15:01 +00:00
|
|
|
this->menu.add_item(&this->item_voice_count);
|
|
|
|
this->menu.add_item(&this->item_voice_detail);
|
|
|
|
this->menu.add_item(&this->item_midi_filter_enabled);
|
|
|
|
this->menu.add_item(&this->item_midi_channel);
|
|
|
|
this->menu.add_item(&this->item_midi_lowest_note);
|
|
|
|
this->menu.add_item(&this->item_midi_highest_note);
|
2020-02-22 22:42:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void PartMenu::up()
|
|
|
|
{
|
|
|
|
menu.up();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartMenu::down()
|
|
|
|
{
|
|
|
|
menu.down();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PartMenu::back()
|
|
|
|
{
|
|
|
|
if (menu.back())
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PartMenu::enter()
|
|
|
|
{
|
|
|
|
menu.enter();
|
2020-02-23 00:15:49 +00:00
|
|
|
|
2020-02-22 22:42:31 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartMenu::render(u8g2_t* u8g2, int x, int y, int width, int height)
|
|
|
|
{
|
|
|
|
menu.render(u8g2, x, y, width, height);
|
|
|
|
}
|