mute and send-alert buttons are now ArdourButtons

git-svn-id: svn://localhost/ardour2/branches/3.0@10397 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-11-02 16:46:49 +00:00
parent 36803567f0
commit 592bfa3616
15 changed files with 91 additions and 69 deletions

View File

@ -399,5 +399,40 @@
<Option name="rude audition text" value="979797ff"/>
<Option name="rude audition text active" value="ffffffff"/>
<Option name="rude audition text mid" value="00000000"/>
<Option name="mute button border start" value="a50303ff"/>
<Option name="mute button border end" value="684d4dff"/>
<Option name="mute button border start selected" value="00000000"/>
<Option name="mute button border end selected" value="00000000"/>
<Option name="mute button fill start" value="684d4dff"/>
<Option name="mute button fill end" value="513c3cff"/>
<Option name="mute button fill start active" value="ff1f1fff"/>
<Option name="mute button fill end active" value="e21b1bff"/>
<Option name="mute button fill start mid" value="00000000"/>
<Option name="mute button fill end mid" value="00000000"/>
<Option name="mute button led" value="00000000"/>
<Option name="mute button led active" value="00000000"/>
<Option name="mute button led mid" value="00000000"/>
<Option name="mute button text" value="979797ff"/>
<Option name="mute button text active" value="ffffffff"/>
<Option name="mute button text mid" value="00000000"/>
<Option name="send alert button border start" value="a50303ff"/>
<Option name="send alert button border end" value="684d4dff"/>
<Option name="send alert button border start selected" value="00000000"/>
<Option name="send alert button border end selected" value="00000000"/>
<Option name="send alert button fill start" value="684d4dff"/>
<Option name="send alert button fill end" value="513c3cff"/>
<Option name="send alert button fill start active" value="ff1f1fff"/>
<Option name="send alert button fill end active" value="e21b1bff"/>
<Option name="send alert button fill start mid" value="00000000"/>
<Option name="send alert button fill end mid" value="00000000"/>
<Option name="send alert button led" value="00000000"/>
<Option name="send alert button led active" value="00000000"/>
<Option name="send alert button led mid" value="00000000"/>
<Option name="send alert button text" value="979797ff"/>
<Option name="send alert button text active" value="ffffffff"/>
<Option name="send alert button text mid" value="00000000"/>
</Canvas>
</Ardour>

View File

@ -395,3 +395,5 @@ widget "*processor prefader" style:highest "processor"
widget "*processor fader" style:highest "processor"
widget "*processor postfader" style:highest "processor"
widget "*MonitorSectionLabel" style:highest "very_small_text"
widget "*mute button" style:highest "small_text"
widget "*send alert button" style:highest "small_text"

View File

@ -67,12 +67,13 @@ class ArdourButton : public CairoWidget
void set_related_action (Glib::RefPtr<Gtk::Action>);
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
protected:
void render (cairo_t *);
void on_size_request (Gtk::Requisition* req);
void on_size_allocate (Gtk::Allocation&);
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
void controllable_changed ();

View File

@ -50,6 +50,7 @@
#include "ardour/session_playlist.h"
#include "ardour/utils.h"
#include "ardour_button.h"
#include "ardour_ui.h"
#include "audio_time_axis.h"
#include "automation_line.h"
@ -97,7 +98,7 @@ AudioTimeAxisView::set_route (boost::shared_ptr<Route> rt)
ignore_toggle = false;
mute_button->set_active (false);
mute_button->unset_active_state ();
solo_button->set_active (false);
if (is_audio_track()) {

View File

@ -172,4 +172,8 @@ BUTTON_VARS(MonitorSectionSoloExclusiveButton, "monitor solo exclusive")
BUTTON_VARS(RudeSolo, "rude solo")
BUTTON_VARS(RudeIsolate, "rude isolate")
BUTTON_VARS(RudeAudition, "rude audition")
BUTTON_VARS(MuteButton, "mute button")
BUTTON_VARS(SoloButton, "solo button")
BUTTON_VARS(RecEnableButton, "record enable button")
BUTTON_VARS(SendButton, "send alert button")

View File

@ -115,9 +115,9 @@ EditorRoutes::EditorRoutes (Editor* e)
// Mute enable toggle
CellRendererPixbufMulti* mute_col_renderer = manage (new CellRendererPixbufMulti());
mute_col_renderer->set_pixbuf (0, ::get_icon("mute-disabled"));
mute_col_renderer->set_pixbuf (1, ::get_icon("muted-by-others"));
mute_col_renderer->set_pixbuf (2, ::get_icon("mute-enabled"));
mute_col_renderer->set_pixbuf (ActiveState(0), ::get_icon("mute-disabled"));
mute_col_renderer->set_pixbuf (Mid, ::get_icon("muted-by-others"));
mute_col_renderer->set_pixbuf (Active, ::get_icon("mute-enabled"));
mute_col_renderer->signal_changed().connect (sigc::mem_fun (*this, &EditorRoutes::on_tv_mute_enable_toggled));
TreeViewColumn* mute_state_column = manage (new TreeViewColumn("M", *mute_col_renderer));
@ -599,7 +599,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
row[_columns.is_midi] = false;
}
row[_columns.mute_state] = (*x)->route()->muted();
row[_columns.mute_state] = (*x)->route()->muted() ? Active : ActiveState (0);
row[_columns.solo_state] = RouteUI::solo_visual_state ((*x)->route());
row[_columns.solo_isolate_state] = (*x)->route()->solo_isolated();
row[_columns.solo_safe_state] = (*x)->route()->solo_safe();
@ -1384,7 +1384,7 @@ EditorRoutes::update_mute_display ()
for (i = rows.begin(); i != rows.end(); ++i) {
boost::shared_ptr<Route> route = (*i)[_columns.route];
(*i)[_columns.mute_state] = RouteUI::mute_visual_state (_session, route);
(*i)[_columns.mute_state] = RouteUI::mute_active_state (_session, route);
}
}

View File

@ -21,6 +21,7 @@
#define __ardour_gtk_editor_route_h__
#include "pbd/signals.h"
#include "gtkmm2ext/widget_state.h"
#include "editor_component.h"
class EditorRoutes : public EditorComponent, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
@ -123,7 +124,7 @@ private:
Gtk::TreeModelColumn<std::string> text;
Gtk::TreeModelColumn<bool> visible;
Gtk::TreeModelColumn<uint32_t> rec_state;
Gtk::TreeModelColumn<uint32_t> mute_state;
Gtk::TreeModelColumn<Gtkmm2ext::ActiveState> mute_state;
Gtk::TreeModelColumn<uint32_t> solo_state;
Gtk::TreeModelColumn<uint32_t> solo_isolate_state;
Gtk::TreeModelColumn<uint32_t> solo_safe_state;

View File

@ -59,6 +59,7 @@
#include "add_midi_cc_track_dialog.h"
#include "ardour_ui.h"
#include "ardour_button.h"
#include "automation_line.h"
#include "automation_time_axis.h"
#include "canvas-note-event.h"
@ -135,7 +136,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
ignore_toggle = false;
mute_button->set_active (false);
mute_button->unset_active_state ();
solo_button->set_active (false);
if (is_midi_track()) {

View File

@ -187,7 +187,7 @@ MixerStrip::init ()
hide_button.set_events (hide_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
mute_button->set_name ("MixerMuteButton");
// mute_button->set_name ("MixerMuteButton");
solo_button->set_name ("MixerSoloButton");
monitor_input_button->set_diameter (3);
@ -587,7 +587,7 @@ MixerStrip::set_width_enum (Width w, void* owner)
switch (w) {
case Wide:
if (show_sends_button) {
((Gtk::Label*)show_sends_button->get_child())->set_text (_("Sends"));
show_sends_button->set_text (_("Sends"));
}
((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
@ -611,7 +611,7 @@ MixerStrip::set_width_enum (Width w, void* owner)
case Narrow:
if (show_sends_button) {
((Gtk::Label*)show_sends_button->get_child())->set_text (_("Snd"));
show_sends_button->set_text (_("Snd"));
}
((Gtk::Label*)gpm.gain_automation_style_button.get_child())->set_text (
@ -1673,8 +1673,7 @@ MixerStrip::switch_io (boost::shared_ptr<Route> target)
since we're not the target.
*/
send_blink_connection.disconnect ();
show_sends_button->set_active (false);
show_sends_button->set_state (STATE_NORMAL);
show_sends_button->unset_active_state ();
}
if (!target) {
@ -1766,7 +1765,7 @@ void
MixerStrip::revert_to_default_display ()
{
if (show_sends_button) {
show_sends_button->set_active (false);
show_sends_button->unset_active_state ();
}
drop_send ();
@ -1788,7 +1787,7 @@ MixerStrip::set_button_names ()
switch (_width) {
case Wide:
rec_enable_button_label.set_text (_("Rec"));
mute_button_label.set_text (_("Mute"));
mute_button->set_text (_("Mute"));
monitor_input_button->set_text (_("In"));
monitor_disk_button->set_text (_("Disk"));
@ -1820,7 +1819,7 @@ MixerStrip::set_button_names ()
default:
rec_enable_button_label.set_text (_("R"));
mute_button_label.set_text (_("M"));
mute_button->set_text (_("M"));
monitor_input_button->set_text (_("I"));
monitor_disk_button->set_text (_("D"));
if (_route && _route->solo_safe()) {

View File

@ -495,14 +495,6 @@ MonitorSection::populate_buttons ()
channel_table.show_all ();
}
void
MonitorSection::set_button_names ()
{
rec_enable_button_label.set_text ("rec");
mute_button_label.set_text ("rec");
solo_button_label.set_text ("rec");
}
void
MonitorSection::toggle_exclusive_solo ()
{

View File

@ -79,7 +79,6 @@ class MonitorSection : public RouteUI
VolumeController* solo_cut_control;
void populate_buttons ();
void set_button_names ();
void map_state ();
boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
@ -99,6 +98,7 @@ class MonitorSection : public RouteUI
void cut_all ();
void mono ();
void toggle_exclusive_solo ();
void set_button_names () {}
void toggle_mute_overrides_solo ();
void dim_level_changed ();
void solo_boost_changed ();

View File

@ -62,6 +62,7 @@
#include "evoral/Parameter.hpp"
#include "ardour_ui.h"
#include "ardour_button.h"
#include "debug.h"
#include "global_signals.h"
#include "route_time_axis.h"
@ -2373,7 +2374,7 @@ RouteTimeAxisView::set_button_names ()
solo_button_label.set_text (_("s"));
}
}
mute_button_label.set_text (_("m"));
mute_button->set_text (_("m"));
}
Gtk::CheckMenuItem*

View File

@ -112,30 +112,27 @@ RouteUI::init ()
setup_invert_buttons ();
mute_button = manage (new BindableToggleButton ());
mute_button = manage (new ArdourButton);
// mute_button->set_self_managed (true);
mute_button->set_name ("MuteButton");
mute_button->add (mute_button_label);
mute_button_label.show ();
mute_button->set_name ("mute button");
UI::instance()->set_tip (mute_button, _("Mute this track"), "");
solo_button = manage (new BindableToggleButton ());
solo_button = manage (new BindableToggleButton);
// solo_button->set_self_managed (true);
solo_button->set_name ("SoloButton");
solo_button->set_name ("solo button");
solo_button->add (solo_button_label);
solo_button_label.show ();
UI::instance()->set_tip (solo_button, _("Mute other (non-soloed) tracks"), "");
solo_button->set_no_show_all (true);
rec_enable_button = manage (new BindableToggleButton ());
rec_enable_button->set_name ("RecordEnableButton");
// rec_enable_button->set_self_managed (true);
rec_enable_button = manage (new BindableToggleButton);
rec_enable_button->set_name ("record enable button");
rec_enable_button->add (rec_enable_button_label);
rec_enable_button_label.show ();
UI::instance()->set_tip (rec_enable_button, _("Enable recording on this track"), "");
show_sends_button = manage (new BindableToggleButton (""));
show_sends_button->set_name ("SendAlert");
show_sends_button = manage (new ArdourButton);
show_sends_button->set_name ("send alert button");
// show_sends_button->set_self_managed (true);
UI::instance()->set_tip (show_sends_button, _("make mixer strips show sends to this bus"), "");
@ -898,11 +895,11 @@ RouteUI::show_sends_press(GdkEventButton* ev)
/* change button state */
show_sends_button->set_active (!show_sends_button->get_active());
show_sends_button->set_active_state (Active);
/* start blinking */
if (show_sends_button->get_active()) {
if (show_sends_button->active_state()) {
/* show sends to this bus */
MixerStrip::SwitchIO (_route);
send_blink_connection = ARDOUR_UI::instance()->Blink.connect (sigc::mem_fun(*this, &RouteUI::send_blink));
@ -1097,11 +1094,11 @@ RouteUI::mute_changed(void* /*src*/)
update_mute_display ();
}
int
RouteUI::mute_visual_state (Session* s, boost::shared_ptr<Route> r)
ActiveState
RouteUI::mute_active_state (Session* s, boost::shared_ptr<Route> r)
{
if (r->is_master() || r->is_monitor()) {
return 0;
return ActiveState(0);
}
@ -1109,26 +1106,26 @@ RouteUI::mute_visual_state (Session* s, boost::shared_ptr<Route> r)
if (r->muted ()) {
/* full mute */
return 2;
return Active;
} else if (s->soloing() && !r->soloed() && !r->solo_isolated()) {
return 1;
return Mid;
} else {
/* no mute at all */
return 0;
return ActiveState(0);
}
} else {
if (r->muted()) {
/* full mute */
return 2;
return Active;
} else {
/* no mute at all */
return 0;
return ActiveState(0);
}
}
return 0;
return ActiveState(0);
}
void
@ -1138,20 +1135,7 @@ RouteUI::update_mute_display ()
return;
}
bool model = _route->muted();
bool view = mute_button->get_active();
/* first make sure the button's "depressed" visual
is correct.
*/
if (model != view) {
++_i_am_the_modifier;
mute_button->set_active (model);
--_i_am_the_modifier;
}
mute_button->set_visual_state (mute_visual_state (_session, _route));
mute_button->set_active_state (mute_active_state (_session, _route));
}
void

View File

@ -25,6 +25,8 @@
#include "pbd/xml++.h"
#include "pbd/signals.h"
#include "gtkmm2ext/widget_state.h"
#include "ardour/ardour.h"
#include "ardour/mute_master.h"
#include "ardour/session_event.h"
@ -90,10 +92,10 @@ class RouteUI : public virtual AxisView
bool multiple_solo_change;
Gtk::HBox _invert_button_box;
BindableToggleButton* mute_button;
ArdourButton* mute_button;
BindableToggleButton* solo_button;
BindableToggleButton* rec_enable_button; /* audio tracks */
BindableToggleButton* show_sends_button; /* busses */
ArdourButton* show_sends_button; /* busses */
ArdourButton* monitor_input_button;
ArdourButton* monitor_disk_button;
@ -103,7 +105,6 @@ class RouteUI : public virtual AxisView
ArdourButton* solo_isolated_led;
Gtk::Label solo_button_label;
Gtk::Label mute_button_label;
Gtk::Label rec_enable_button_label;
Gtk::Label monitor_input_button_label;
Gtk::Label monitor_disk_button_label;
@ -222,7 +223,7 @@ class RouteUI : public virtual AxisView
static int solo_visual_state_with_isolate (boost::shared_ptr<ARDOUR::Route>);
static int solo_isolate_visual_state (boost::shared_ptr<ARDOUR::Route>);
static int solo_safe_visual_state (boost::shared_ptr<ARDOUR::Route>);
static int mute_visual_state (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
static Gtkmm2ext::ActiveState mute_active_state (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
protected:
PBD::ScopedConnectionList route_connections;

View File

@ -292,7 +292,7 @@ UIConfiguration::color_by_name (const std::string& name)
return i->second->get();
}
// cerr << string_compose (_("Color %1 not found"), name) << endl;
cerr << string_compose (_("Color %1 not found"), name) << endl;
return RGBA_TO_UINT (random()%256,random()%256,random()%256,0xff);
}