#include <ardour/diskstream.h>
#include "i18n.h"
-
using namespace sigc;
using namespace Gtk;
using namespace Gtkmm2ext;
set_color (unique_random_color());
}
- _route.GoingAway.connect (slot (*this, &RouteUI::route_removed));
- _route.active_changed.connect (slot (*this, &RouteUI::route_active_changed));
+ _route.GoingAway.connect (mem_fun (*this, &RouteUI::route_removed));
+ _route.active_changed.connect (mem_fun (*this, &RouteUI::route_active_changed));
mute_button = manage (new BindableToggleButton (& _route.midi_mute_control(), m_name ));
mute_button->set_bind_button_state (2, GDK_CONTROL_MASK);
if (is_audio_track()) {
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
- get_diskstream()->record_enable_changed.connect (slot (*this, &RouteUI::route_rec_enable_changed));
+ get_diskstream()->record_enable_changed.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
- _session.RecordEnabled.connect (slot (*this, &RouteUI::session_rec_enable_changed));
- _session.RecordDisabled.connect (slot (*this, &RouteUI::session_rec_enable_changed));
+ _session.RecordEnabled.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
+ _session.RecordDisabled.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
rec_enable_button = manage (new BindableToggleButton (& at->midi_rec_enable_control(), r_name ));
rec_enable_button->set_bind_button_state (2, GDK_CONTROL_MASK);
void
RouteUI::solo_changed(void* src)
{
- Gtkmm2ext::UI::instance()->call_slot (slot (*this, &RouteUI::update_solo_display));
+ Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_solo_display));
}
void
void
RouteUI::mute_changed(void* src)
{
- Gtkmm2ext::UI::instance()->call_slot (slot (*this, &RouteUI::update_mute_display));
+ Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_mute_display));
}
void
void
RouteUI::route_rec_enable_changed (void *src)
{
- Gtkmm2ext::UI::instance()->call_slot (slot (*this, &RouteUI::update_rec_display));
+ Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_rec_display));
}
void
RouteUI::session_rec_enable_changed ()
{
- Gtkmm2ext::UI::instance()->call_slot (slot (*this, &RouteUI::update_rec_display));
+ Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &RouteUI::update_rec_display));
}
void
switch (_session.record_status ()) {
case Session::Disabled:
case Session::Enabled:
- if (rec_enable_button->get_state() != GTK_STATE_ACTIVE) {
- rec_enable_button->set_state (GTK_STATE_ACTIVE);
+ if (rec_enable_button->get_state() != Gtk::STATE_ACTIVE) {
+ rec_enable_button->set_state (Gtk::STATE_ACTIVE);
}
break;
case Session::Recording:
- if (rec_enable_button->get_state() != GTK_STATE_SELECTED) {
- rec_enable_button->set_state (GTK_STATE_SELECTED);
+ if (rec_enable_button->get_state() != Gtk::STATE_SELECTED) {
+ rec_enable_button->set_state (Gtk::STATE_SELECTED);
}
break;
}
check = new CheckMenuItem(_("Solo-safe"));
check->set_active (_route.solo_safe());
- check->toggled.connect (bind (slot (*this, &RouteUI::toggle_solo_safe), check));
- _route.solo_safe_changed.connect(bind (slot (*this, &RouteUI::solo_safe_toggle), check));
+ check->signal_toggled().connect (bind (mem_fun (*this, &RouteUI::toggle_solo_safe), check));
+ _route.solo_safe_changed.connect(bind (mem_fun (*this, &RouteUI::solo_safe_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
items.push_back (SeparatorElem());
- items.push_back (MenuElem (_("MIDI Bind"), slot (*mute_button, &BindableToggleButton::midi_learn)));
+ items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
}
check = new CheckMenuItem(_("Pre Fader"));
init_mute_menu(PRE_FADER, check);
- check->toggled.connect(bind (slot (*this, &RouteUI::toggle_mute_menu), PRE_FADER, check));
- _route.pre_fader_changed.connect(bind (slot (*this, &RouteUI::pre_fader_toggle), check));
+ check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), PRE_FADER, check));
+ _route.pre_fader_changed.connect(bind (mem_fun (*this, &RouteUI::pre_fader_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Post Fader"));
init_mute_menu(POST_FADER, check);
- check->toggled.connect(bind (slot (*this, &RouteUI::toggle_mute_menu), POST_FADER, check));
- _route.post_fader_changed.connect(bind (slot (*this, &RouteUI::post_fader_toggle), check));
+ check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), POST_FADER, check));
+ _route.post_fader_changed.connect(bind (mem_fun (*this, &RouteUI::post_fader_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Control Outs"));
init_mute_menu(CONTROL_OUTS, check);
- check->toggled.connect(bind (slot (*this, &RouteUI::toggle_mute_menu), CONTROL_OUTS, check));
- _route.control_outs_changed.connect(bind (slot (*this, &RouteUI::control_outs_toggle), check));
+ check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), CONTROL_OUTS, check));
+ _route.control_outs_changed.connect(bind (mem_fun (*this, &RouteUI::control_outs_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Main Outs"));
init_mute_menu(MAIN_OUTS, check);
- check->toggled.connect(bind (slot (*this, &RouteUI::toggle_mute_menu), MAIN_OUTS, check));
- _route.main_outs_changed.connect(bind (slot (*this, &RouteUI::main_outs_toggle), check));
+ check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), MAIN_OUTS, check));
+ _route.main_outs_changed.connect(bind (mem_fun (*this, &RouteUI::main_outs_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
items.push_back (SeparatorElem());
- items.push_back (MenuElem (_("MIDI Bind"), slot (*mute_button, &BindableToggleButton::midi_learn)));
+ items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
}
void
RouteUI::reversibly_apply_route_boolean (string name, void (Route::*func)(bool, void *), bool yn, void *arg)
{
_session.begin_reversible_command (name);
- _session.add_undo (bind (slot (_route, func), !yn, (void *) arg));
- _session.add_redo (bind (slot (_route, func), yn, (void *) arg));
+ _session.add_undo (bind (mem_fun (_route, func), !yn, (void *) arg));
+ _session.add_redo (bind (mem_fun (_route, func), yn, (void *) arg));
_session.commit_reversible_command ();
}
RouteUI::reversibly_apply_audio_track_boolean (string name, void (AudioTrack::*func)(bool, void *), bool yn, void *arg)
{
_session.begin_reversible_command (name);
- _session.add_undo (bind (slot (*audio_track(), func), !yn, (void *) arg));
- _session.add_redo (bind (slot (*audio_track(), func), yn, (void *) arg));
+ _session.add_undo (bind (mem_fun (*audio_track(), func), !yn, (void *) arg));
+ _session.add_redo (bind (mem_fun (*audio_track(), func), yn, (void *) arg));
_session.commit_reversible_command ();
}
RouteUI::choose_color()
{
bool picked;
- GdkColor color;
- gdouble current[4];
+ Gdk::Color color;
+ Gdk::Color current;
- current[0] = _color.get_red() / 65535.0;
- current[1] = _color.get_green() / 65535.0;
- current[2] = _color.get_blue() / 65535.0;
- current[3] = 1.0;
+ current.set_red ( _color.get_red() / 65535.0);
+ current.set_green (_color.get_green() / 65535.0);
+ current.set_blue (_color.get_blue() / 65535.0);
+ //current[3] = 1.0;
- color = Gtkmm2ext::UI::instance()->get_color (_("ardour: color selection"), picked, current);
+ color = Gtkmm2ext::UI::instance()->get_color (_("ardour: color selection"), picked, ¤t);
if (picked) {
set_color (color);
}
void
-RouteUI::set_color (Gdk_Color c)
+RouteUI::set_color (Gdk::Color c)
{
char buf[64];
_color = c;
ensure_xml_node ();
- snprintf (buf, sizeof (buf), "%d:%d:%d", c.red, c.green, c.blue);
+ snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue());
xml_node->add_property ("color", buf);
_route.gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
if ((prop = xml_node->property ("color")) != 0) {
int r, g, b;
sscanf (prop->value().c_str(), "%d:%d:%d", &r, &g, &b);
- _color.red = r;
- _color.green = g;
- _color.blue = b;
+ _color.set_red(r);
+ _color.set_green(g);
+ _color.set_blue(b);
return 0;
}
return 1;
string prompt;
if (is_audio_track()) {
- prompt = compose (_("Do you really want to remove track \"%1\" ?\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove track \"%1\" ?\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route.name());
} else {
- prompt = compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
}
choices.push_back (_("Yes, remove it."));
Choice prompter (prompt, choices);
- prompter.chosen.connect (Gtk::Main::quit.slot());
+ prompter.chosen.connect(sigc::ptr_fun(Gtk::Main::quit));
prompter.show_all ();
Gtk::Main::run ();
if (prompter.get_choice() == 0) {
- Main::idle.connect (bind (slot (&RouteUI::idle_remove_this_route), this));
+ Glib::signal_idle().connect (bind (sigc::ptr_fun (&RouteUI::idle_remove_this_route), this));
}
}
void
RouteUI::route_removed ()
{
- ENSURE_GUI_THREAD(slot (*this, &RouteUI::route_removed));
+ ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::route_removed));
delete this;
}
RouteUI::route_rename ()
{
ArdourPrompter name_prompter (true);
+ string result;
name_prompter.set_prompt (_("new name: "));
name_prompter.set_initial_text (_route.name());
- name_prompter.done.connect (Gtk::Main::quit.slot());
name_prompter.show_all ();
- Gtk::Main::run();
-
- if (name_prompter.status == Gtkmm2ext::Prompter::cancelled) {
- return;
- }
-
- string result;
- name_prompter.get_result (result);
+ switch (name_prompter.run ()) {
- if (result.length() == 0) {
- return;
+ case GTK_RESPONSE_ACCEPT:
+ name_prompter.get_result (result);
+ if (result.length()) {
+ strip_whitespace_edges (result);
+ _route.set_name (result, this);
+ }
+ break;
}
- strip_whitespace_edges (result);
- _route.set_name (result, this);
+ return;
+
}
void
RouteUI::name_changed (void *src)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &RouteUI::name_changed), src));
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::name_changed), src));
name_label.set_text (_route.name());
}
RouteUI::route_active_changed ()
{
if (route_active_menu_item) {
- Gtkmm2ext::UI::instance()->call_slot (bind (slot (*route_active_menu_item, &CheckMenuItem::set_active), _route.active()));
+ Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*route_active_menu_item, &CheckMenuItem::set_active), _route.active()));
}
}
void
RouteUI::pre_fader_toggle(void* src, Gtk::CheckMenuItem* check)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &RouteUI::pre_fader_toggle), src, check));
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::pre_fader_toggle), src, check));
bool yn = _route.get_mute_config(PRE_FADER);
if (check->get_active() != yn) {
void
RouteUI::post_fader_toggle(void* src, Gtk::CheckMenuItem* check)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &RouteUI::post_fader_toggle), src, check));
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::post_fader_toggle), src, check));
bool yn = _route.get_mute_config(POST_FADER);
if (check->get_active() != yn) {
void
RouteUI::control_outs_toggle(void* src, Gtk::CheckMenuItem* check)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &RouteUI::control_outs_toggle), src, check));
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::control_outs_toggle), src, check));
bool yn = _route.get_mute_config(CONTROL_OUTS);
if (check->get_active() != yn) {
void
RouteUI::main_outs_toggle(void* src, Gtk::CheckMenuItem* check)
{
- ENSURE_GUI_THREAD(bind (slot (*this, &RouteUI::main_outs_toggle), src, check));
+ ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::main_outs_toggle), src, check));
bool yn = _route.get_mute_config(MAIN_OUTS);
if (check->get_active() != yn) {
void
RouteUI::map_frozen ()
{
- ENSURE_GUI_THREAD (slot (*this, &RouteUI::map_frozen));
+ ENSURE_GUI_THREAD (mem_fun (*this, &RouteUI::map_frozen));
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);