Make MIDI channel selector button colours more distinct (#3772).
git-svn-id: svn://localhost/ardour2/branches/3.0@9524 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
29dd7bbac7
commit
7390303728
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#@color arm #F33
|
#@color arm #F33
|
||||||
#@color solo #A8F730
|
#@color solo #A8F730
|
||||||
|
#@color midi_channel_selector #A8F730
|
||||||
#@color isolate #B9ECF2
|
#@color isolate #B9ECF2
|
||||||
#@color mute #FFFA87
|
#@color mute #FFFA87
|
||||||
#@color mono #DEC
|
#@color mono #DEC
|
||||||
|
@ -712,6 +713,14 @@ style "transport_rec_button_alternate"
|
||||||
bg[ACTIVE] = @@COLPREFIX@_arm
|
bg[ACTIVE] = @@COLPREFIX@_arm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
style "midi_channel_selector_button"
|
||||||
|
{
|
||||||
|
bg[NORMAL] = @@COLPREFIX@_bg
|
||||||
|
bg[ACTIVE] = @@COLPREFIX@_midi_channel_selector
|
||||||
|
fg[NORMAL] = @@COLPREFIX@_fg
|
||||||
|
fg[ACTIVE] = @@COLPREFIX@_darkest
|
||||||
|
}
|
||||||
|
|
||||||
style "shuttle_control" = "very_small_text"
|
style "shuttle_control" = "very_small_text"
|
||||||
{
|
{
|
||||||
fg[NORMAL] = @@COLPREFIX@_control_text2
|
fg[NORMAL] = @@COLPREFIX@_control_text2
|
||||||
|
@ -1831,6 +1840,7 @@ widget "*SoloSafeLED" style:highest "solo_safe_led"
|
||||||
widget "*SoloLEDLabel" style:highest "very_small_text"
|
widget "*SoloLEDLabel" style:highest "very_small_text"
|
||||||
widget "*ContrastingPopup" style:highest "contrasting_popup"
|
widget "*ContrastingPopup" style:highest "contrasting_popup"
|
||||||
widget "*ContrastingPopup*" style:highest "contrasting_popup"
|
widget "*ContrastingPopup*" style:highest "contrasting_popup"
|
||||||
|
widget "*MidiChannelSelectorButton" style:highest "midi_channel_selector_button"
|
||||||
|
|
||||||
widget "*RouteNameEditorEntry" style:highest "text_cell_entry"
|
widget "*RouteNameEditorEntry" style:highest "text_cell_entry"
|
||||||
widget "*RegionNameEditorEntry" style:highest "text_cell_entry"
|
widget "*RegionNameEditorEntry" style:highest "text_cell_entry"
|
||||||
|
|
|
@ -52,11 +52,11 @@ MidiChannelSelector::MidiChannelSelector(int n_rows, int n_columns, int start_ro
|
||||||
sigc::mem_fun(this, &MidiChannelSelector::button_toggled),
|
sigc::mem_fun(this, &MidiChannelSelector::button_toggled),
|
||||||
&_buttons[row][column],
|
&_buttons[row][column],
|
||||||
channel_nr - 1));
|
channel_nr - 1));
|
||||||
|
_buttons[row][column].set_widget_name (X_("MidiChannelSelectorButton"));
|
||||||
|
|
||||||
_buttons[row][column].signal_button_release_event().connect(
|
_buttons[row][column].signal_button_release_event().connect(
|
||||||
sigc::mem_fun(this, &MidiChannelSelector::was_clicked), false);
|
sigc::mem_fun(this, &MidiChannelSelector::was_clicked), false);
|
||||||
|
|
||||||
|
|
||||||
int table_row = start_row + row;
|
int table_row = start_row + row;
|
||||||
int table_column = start_column + column;
|
int table_column = start_column + column;
|
||||||
attach(_buttons[row][column], table_column, table_column + 1, table_row, table_row + 1);
|
attach(_buttons[row][column], table_column, table_column + 1, table_row, table_row + 1);
|
||||||
|
@ -95,8 +95,10 @@ MidiChannelSelector::set_default_channel_color()
|
||||||
{
|
{
|
||||||
for (int row = 0; row < 4; ++row) {
|
for (int row = 0; row < 4; ++row) {
|
||||||
for (int column = 0; column < 4; ++column) {
|
for (int column = 0; column < 4; ++column) {
|
||||||
_buttons[row][column].unset_bg(STATE_NORMAL);
|
_buttons[row][column].unset_fg (STATE_NORMAL);
|
||||||
_buttons[row][column].unset_bg(STATE_ACTIVE);
|
_buttons[row][column].unset_fg (STATE_ACTIVE);
|
||||||
|
_buttons[row][column].unset_bg (STATE_NORMAL);
|
||||||
|
_buttons[row][column].unset_bg (STATE_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
#include "sigc++/trackable.h"
|
#include "sigc++/trackable.h"
|
||||||
#include "gtkmm/table.h"
|
#include "gtkmm/table.h"
|
||||||
#include "gtkmm/button.h"
|
#include "gtkmm/button.h"
|
||||||
#include "gtkmm/togglebutton.h"
|
|
||||||
#include "gtkmm/label.h"
|
#include "gtkmm/label.h"
|
||||||
|
#include "gtkmm2ext/stateful_button.h"
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
|
virtual void button_toggled(Gtk::ToggleButton* button, uint8_t button_nr) = 0;
|
||||||
Gtk::Label _button_labels[4][4];
|
Gtk::Label _button_labels[4][4];
|
||||||
Gtk::ToggleButton _buttons[4][4];
|
Gtkmm2ext::StatefulToggleButton _buttons[4][4];
|
||||||
int _recursion_counter;
|
int _recursion_counter;
|
||||||
bool was_clicked (GdkEventButton*);
|
bool was_clicked (GdkEventButton*);
|
||||||
};
|
};
|
||||||
|
|
|
@ -226,6 +226,8 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session* sess,
|
||||||
_percussion_mode_item->set_active (_note_mode == Percussive);
|
_percussion_mode_item->set_active (_note_mode == Percussive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_color_mode (_color_mode, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -759,17 +761,17 @@ MidiTimeAxisView::build_color_mode_menu()
|
||||||
|
|
||||||
RadioMenuItem::Group mode_group;
|
RadioMenuItem::Group mode_group;
|
||||||
items.push_back (RadioMenuElem (mode_group, _("Meter Colors"),
|
items.push_back (RadioMenuElem (mode_group, _("Meter Colors"),
|
||||||
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), MeterColors)));
|
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), MeterColors, false)));
|
||||||
_meter_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
_meter_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
||||||
_meter_color_mode_item->set_active(_color_mode == MeterColors);
|
_meter_color_mode_item->set_active(_color_mode == MeterColors);
|
||||||
|
|
||||||
items.push_back (RadioMenuElem (mode_group, _("Channel Colors"),
|
items.push_back (RadioMenuElem (mode_group, _("Channel Colors"),
|
||||||
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), ChannelColors)));
|
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), ChannelColors, false)));
|
||||||
_channel_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
_channel_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
||||||
_channel_color_mode_item->set_active(_color_mode == ChannelColors);
|
_channel_color_mode_item->set_active(_color_mode == ChannelColors);
|
||||||
|
|
||||||
items.push_back (RadioMenuElem (mode_group, _("Track Color"),
|
items.push_back (RadioMenuElem (mode_group, _("Track Color"),
|
||||||
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), TrackColor)));
|
sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_color_mode), TrackColor, false)));
|
||||||
_channel_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
_channel_color_mode_item = dynamic_cast<RadioMenuItem*>(&items.back());
|
||||||
_channel_color_mode_item->set_active(_color_mode == TrackColor);
|
_channel_color_mode_item->set_active(_color_mode == TrackColor);
|
||||||
|
|
||||||
|
@ -788,19 +790,21 @@ MidiTimeAxisView::set_note_mode(NoteMode mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiTimeAxisView::set_color_mode(ColorMode mode)
|
MidiTimeAxisView::set_color_mode (ColorMode mode, bool force)
|
||||||
{
|
{
|
||||||
if (_color_mode != mode) {
|
if (_color_mode == mode && !force) {
|
||||||
if (mode == ChannelColors) {
|
return;
|
||||||
_channel_selector.set_channel_colors(CanvasNoteEvent::midi_channel_colors);
|
|
||||||
} else {
|
|
||||||
_channel_selector.set_default_channel_color();
|
|
||||||
}
|
|
||||||
|
|
||||||
_color_mode = mode;
|
|
||||||
xml_node->add_property ("color-mode", enum_2_string(_color_mode));
|
|
||||||
_view->redisplay_track();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode == ChannelColors) {
|
||||||
|
_channel_selector.set_channel_colors(CanvasNoteEvent::midi_channel_colors);
|
||||||
|
} else {
|
||||||
|
_channel_selector.set_default_channel_color();
|
||||||
|
}
|
||||||
|
|
||||||
|
_color_mode = mode;
|
||||||
|
xml_node->add_property ("color-mode", enum_2_string(_color_mode));
|
||||||
|
_view->redisplay_track();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -117,7 +117,7 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
||||||
Gtk::Menu* build_color_mode_menu();
|
Gtk::Menu* build_color_mode_menu();
|
||||||
|
|
||||||
void set_note_mode (ARDOUR::NoteMode mode);
|
void set_note_mode (ARDOUR::NoteMode mode);
|
||||||
void set_color_mode(ARDOUR::ColorMode mode);
|
void set_color_mode (ARDOUR::ColorMode, bool force = false);
|
||||||
void set_note_range(MidiStreamView::VisibleNoteRange range);
|
void set_note_range(MidiStreamView::VisibleNoteRange range);
|
||||||
|
|
||||||
void route_active_changed ();
|
void route_active_changed ();
|
||||||
|
|
|
@ -35,6 +35,7 @@ class StateButton
|
||||||
void set_visual_state (int);
|
void set_visual_state (int);
|
||||||
int get_visual_state () { return visual_state; }
|
int get_visual_state () { return visual_state; }
|
||||||
void set_self_managed (bool yn) { _self_managed = yn; }
|
void set_self_managed (bool yn) { _self_managed = yn; }
|
||||||
|
virtual void set_widget_name (const std::string& name) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int visual_state;
|
int visual_state;
|
||||||
|
@ -45,7 +46,6 @@ class StateButton
|
||||||
bool is_toggle;
|
bool is_toggle;
|
||||||
|
|
||||||
virtual std::string get_widget_name() const = 0;
|
virtual std::string get_widget_name() const = 0;
|
||||||
virtual void set_widget_name (const std::string& name) = 0;
|
|
||||||
virtual Gtk::Widget* get_child_widget () = 0;
|
virtual Gtk::Widget* get_child_widget () = 0;
|
||||||
|
|
||||||
void avoid_prelight_on_style_changed (const Glib::RefPtr<Gtk::Style>& style, GtkWidget* widget);
|
void avoid_prelight_on_style_changed (const Glib::RefPtr<Gtk::Style>& style, GtkWidget* widget);
|
||||||
|
@ -59,6 +59,7 @@ class StatefulToggleButton : public StateButton, public Gtk::ToggleButton
|
||||||
StatefulToggleButton();
|
StatefulToggleButton();
|
||||||
explicit StatefulToggleButton(const std::string &label);
|
explicit StatefulToggleButton(const std::string &label);
|
||||||
~StatefulToggleButton() {}
|
~StatefulToggleButton() {}
|
||||||
|
void set_widget_name (const std::string& name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_realize ();
|
void on_realize ();
|
||||||
|
@ -68,7 +69,6 @@ class StatefulToggleButton : public StateButton, public Gtk::ToggleButton
|
||||||
|
|
||||||
Gtk::Widget* get_child_widget ();
|
Gtk::Widget* get_child_widget ();
|
||||||
std::string get_widget_name() const { return get_name(); }
|
std::string get_widget_name() const { return get_name(); }
|
||||||
void set_widget_name (const std::string& name);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class StatefulButton : public StateButton, public Gtk::Button
|
class StatefulButton : public StateButton, public Gtk::Button
|
||||||
|
@ -77,6 +77,7 @@ class StatefulButton : public StateButton, public Gtk::Button
|
||||||
StatefulButton();
|
StatefulButton();
|
||||||
explicit StatefulButton(const std::string &label);
|
explicit StatefulButton(const std::string &label);
|
||||||
virtual ~StatefulButton() {}
|
virtual ~StatefulButton() {}
|
||||||
|
void set_widget_name (const std::string& name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_realize ();
|
void on_realize ();
|
||||||
|
@ -85,7 +86,6 @@ class StatefulButton : public StateButton, public Gtk::Button
|
||||||
|
|
||||||
Gtk::Widget* get_child_widget ();
|
Gtk::Widget* get_child_widget ();
|
||||||
std::string get_widget_name() const { return get_name(); }
|
std::string get_widget_name() const { return get_name(); }
|
||||||
void set_widget_name (const std::string& name);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user