#include "midi_channel_selector.h"
#include "gtkmm/separator.h"
#include "i18n.h"
+#include "rgb_macros.h"
using namespace std;
using namespace Gtk;
using namespace sigc;
using namespace ARDOUR;
-MidiChannelSelector::MidiChannelSelector(int no_rows, int no_columns, int start_row, int start_column) : Table(no_rows, no_columns, true)
- , _recursion_counter(0)
+MidiChannelSelector::MidiChannelSelector(int n_rows, int n_columns, int start_row, int start_column)
+ : Table(n_rows, n_columns, true)
+ , _recursion_counter(0)
{
- assert(no_rows >= 4);
- assert(no_rows >= start_row + 4);
- assert(no_columns >=4);
- assert(no_columns >= start_column + 4);
+ assert(n_rows >= 4);
+ assert(n_rows >= start_row + 4);
+ assert(n_columns >=4);
+ assert(n_columns >= start_column + 4);
property_column_spacing() = 0;
property_row_spacing() = 0;
{
}
+void
+MidiChannelSelector::set_channel_colors(const uint32_t new_channel_colors[16])
+{
+ for (int row = 0; row < 4; ++row) {
+ for (int column = 0; column < 4; ++column) {
+ char color_normal[8];
+ char color_active[8];
+ snprintf(color_normal, 8, "#%x", UINT_INTERPOLATE(new_channel_colors[row * 4 + column], 0x000000ff, 0.6));
+ snprintf(color_active, 8, "#%x", new_channel_colors[row * 4 + column]);
+ _buttons[row][column].modify_bg(STATE_NORMAL, Gdk::Color(color_normal));
+ _buttons[row][column].modify_bg(STATE_ACTIVE, Gdk::Color(color_active));
+ }
+ }
+}
+
+void
+MidiChannelSelector::set_default_channel_color()
+{
+ for (int row = 0; row < 4; ++row) {
+ for (int column = 0; column < 4; ++column) {
+ _buttons[row][column].unset_bg(STATE_NORMAL);
+ _buttons[row][column].unset_bg(STATE_ACTIVE);
+ }
+ }
+}
+
SingleMidiChannelSelector::SingleMidiChannelSelector(uint8_t active_channel)
: MidiChannelSelector()
{
}
void
-MidiMultipleChannelSelector::set_channel_mode(ChannelMode mode, uint8_t mask)
+MidiMultipleChannelSelector::set_channel_mode(ChannelMode mode, uint16_t mask)
{
switch (mode) {
case AllChannels:
}
}
-const uint16_t
+uint16_t
MidiMultipleChannelSelector::get_selected_channels() const
{
uint16_t selected_channels = 0;
}
void
-MidiMultipleChannelSelector::button_toggled(ToggleButton *button, uint8_t channel)
+MidiMultipleChannelSelector::button_toggled(ToggleButton */*button*/, uint8_t channel)
{
++_recursion_counter;
if (_recursion_counter == 1) {