/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002-2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/stop_signal.h>
#include <gtkmm2ext/choice.h>
-#include <gtkmm2ext/bindable_button.h>
#include <gtkmm2ext/doi.h>
+#include <gtkmm2ext/bindable_button.h>
#include <ardour/route_group.h>
#include <ardour/route.h>
#include <ardour/audio_track.h>
-#include <ardour/diskstream.h>
+#include <ardour/audio_diskstream.h>
#include "i18n.h"
using namespace sigc;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ARDOUR;
+using namespace PBD;
RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
_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);
- solo_button = manage (new BindableToggleButton (& _route.midi_solo_control(), s_name ));
- solo_button->set_bind_button_state (2, GDK_CONTROL_MASK);
-
+ mute_button = manage (new BindableToggleButton (_route.mute_control(), m_name ));
+ solo_button = manage (new BindableToggleButton (_route.solo_control(), s_name ));
+
if (is_audio_track()) {
AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
_session.RecordStateChanged.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);
+ rec_enable_button = manage (new BindableToggleButton (at->rec_enable_control(), r_name ));
- } else {
- rec_enable_button = manage (new BindableToggleButton (0, r_name ));
- }
+ rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
+
+ update_rec_display ();
+ }
mute_button->unset_flags (Gtk::CAN_FOCUS);
solo_button->unset_flags (Gtk::CAN_FOCUS);
- rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
/* map the current state */
- update_rec_display ();
map_frozen ();
}
gint
RouteUI::rec_enable_press(GdkEventButton* ev)
{
- if (!ignore_toggle && is_audio_track()) {
+ if (!ignore_toggle && is_audio_track() && rec_enable_button) {
if (ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
// do nothing on midi bind event
limit += 4; /* leave some breathing room */
- for (uint32_t i = 0; i < limit; ++i) {
+ rc_items.push_back (RadioMenuElem (rc_group, _("None")));
+ if (_route.remote_control_id() == 0) {
+ rc_active = dynamic_cast<CheckMenuItem*> (&rc_items.back());
+ rc_active->set_active ();
+ }
+
+ for (uint32_t i = 1; i < limit; ++i) {
snprintf (buf, sizeof (buf), "%u", i);
rc_items.push_back (RadioMenuElem (rc_group, buf));
rc_active = dynamic_cast<RadioMenuItem*>(&rc_items.back());
check->show_all();
items.push_back (SeparatorElem());
- items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
+ // items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
}
check->show_all();
items.push_back (SeparatorElem());
- items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
+ // items.push_back (MenuElem (_("MIDI Bind"), mem_fun (*mute_button, &BindableToggleButton::midi_learn)));
}
void
return dynamic_cast<AudioTrack*>(&_route) != 0;
}
-DiskStream*
+AudioDiskstream*
RouteUI::get_diskstream () const
{
AudioTrack *at;