13
0

remote control IDs follow editor/mixer view order; fix multiple display of disk over/under run errors; don't show automation editing cursor unless you actually edit it

git-svn-id: svn://localhost/ardour2/trunk@1474 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-02-19 17:30:47 +00:00
parent 60b8dce637
commit 4c6b2c7eb7
17 changed files with 186 additions and 53 deletions

View File

@ -291,8 +291,12 @@
<menuitem action='OutputAutoConnectMaster'/>
<menuitem action='OutputAutoConnectManual'/>
</menu>
<menu action='ControlSurfaces'/>
<menu action='Monitoring'>
<menu action='ControlSurfaces'>
<menuitem action='RemoteUserDefined'/>
<menuitem action='RemoteMixerDefined'/>
<menuitem action='RemoteEditorDefined'/>
</menu>
<menu action='Monitoring'>
<menuitem action='UseHardwareMonitoring'/>
<menuitem action='UseSoftwareMonitoring'/>
<menuitem action='UseExternalMonitoring'/>

View File

@ -180,8 +180,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
location_ui = 0;
open_session_selector = 0;
have_configure_timeout = false;
have_disk_overrun_displayed = false;
have_disk_underrun_displayed = false;
have_disk_speed_dialog_displayed = false;
_will_create_new_session_automatically = false;
session_loaded = false;
last_speed_displayed = -1.0f;
@ -2366,18 +2365,18 @@ ARDOUR_UI::halt_on_xrun_message ()
void
ARDOUR_UI::disk_overrun_handler ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
if (!have_disk_overrun_displayed) {
have_disk_overrun_displayed = true;
MessageDialog msg (*editor, X_("diskrate dialog"), _("\
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor, X_("diskrate dialog"), _("\
The disk system on your computer\n\
was not able to keep up with Ardour.\n\
\n\
Specifically, it failed to write data to disk\n\
quickly enough to keep up with recording.\n"));
msg.run ();
have_disk_overrun_displayed = false;
msg->signal_response().connect (bind (mem_fun (*this, &ARDOUR_UI::disk_speed_dialog_gone), msg));
msg->show_all ();
}
}
@ -2386,29 +2385,24 @@ ARDOUR_UI::disk_underrun_handler ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
if (!have_disk_underrun_displayed) {
have_disk_underrun_displayed = true;
MessageDialog msg (*editor,
(_("The disk system on your computer\n\
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor,
_("The disk system on your computer\n\
was not able to keep up with Ardour.\n\
\n\
Specifically, it failed to read data from disk\n\
quickly enough to keep up with playback.\n")));
msg.run ();
have_disk_underrun_displayed = false;
quickly enough to keep up with playback.\n"));
msg->signal_response().connect (bind (mem_fun (*this, &ARDOUR_UI::disk_speed_dialog_gone), msg));
msg->show_all ();
}
}
void
ARDOUR_UI::disk_underrun_message_gone ()
ARDOUR_UI::disk_speed_dialog_gone (int ignored_response, MessageDialog* msg)
{
have_disk_underrun_displayed = false;
}
void
ARDOUR_UI::disk_overrun_message_gone ()
{
have_disk_underrun_displayed = false;
have_disk_speed_dialog_displayed = false;
delete msg;
}
int

View File

@ -645,11 +645,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
struct timeval last_peak_grab;
struct timeval last_shuttle_request;
bool have_disk_overrun_displayed;
bool have_disk_underrun_displayed;
void disk_overrun_message_gone ();
void disk_underrun_message_gone ();
bool have_disk_speed_dialog_displayed;
void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*);
void disk_overrun_handler ();
void disk_underrun_handler ();
@ -682,6 +679,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void set_output_auto_connect (ARDOUR::AutoConnectOption);
void set_solo_model (ARDOUR::SoloModel);
void set_monitor_model (ARDOUR::MonitorModel);
void set_remote_model (ARDOUR::RemoteModel);
void toggle_StopPluginsWithTransport();
void toggle_DoNotRunPluginsWhileRecording();
@ -697,6 +695,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void mtc_port_changed ();
void map_solo_model ();
void map_monitor_model ();
void map_remote_model ();
void map_file_header_format ();
void map_file_data_format ();
void map_input_auto_connect ();

View File

@ -62,6 +62,13 @@ ARDOUR_UI::connect_to_session (Session *s)
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
}
if (!session->control_out()) {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), X_("SoloViaBus"));
if (act) {
act->set_sensitive (false);
}
}
/* allow wastebasket flush again */
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("FlushWastebasket"));

View File

@ -470,6 +470,15 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_radio_action (option_actions, output_auto_connect_group, X_("OutputAutoConnectManual"), _("Manually connect outputs"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_output_auto_connect), (AutoConnectOption) 0)));
ActionManager::session_sensitive_actions.push_back (act);
RadioAction::Group remote_group;
act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteUserDefined"), _("Remote ID assigned by User"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), UserOrdered)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteMixerDefined"), _("Remote ID follows order of Mixer"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), MixerOrdered)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteEditorDefined"), _("Remote ID follows order of Editor"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), EditorOrdered)));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::add_action_group (shuttle_actions);
ActionManager::add_action_group (option_actions);
ActionManager::add_action_group (jack_actions);

View File

@ -225,6 +225,39 @@ ARDOUR_UI::set_solo_model (SoloModel model)
}
void
ARDOUR_UI::set_remote_model (RemoteModel model)
{
const char* action = 0;
switch (model) {
case UserOrdered:
action = X_("RemoteUserDefined");
break;
case MixerOrdered:
action = X_("RemoteMixerDefined");
break;
case EditorOrdered:
action = X_("RemoteEditorDefined");
break;
default:
fatal << string_compose (_("programming error: unknown remote model in ARDOUR_UI::set_remote_model: %1"), model) << endmsg;
/*NOTREACHED*/
}
Glib::RefPtr<Action> act = ActionManager::get_action ("options", action);
if (act) {
Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
if (ract && ract->get_active() && Config->get_remote_model() != model) {
Config->set_remote_model (model);
}
}
}
void
ARDOUR_UI::set_monitor_model (MonitorModel model)
{
@ -477,6 +510,33 @@ ARDOUR_UI::map_monitor_model ()
}
}
void
ARDOUR_UI::map_remote_model ()
{
const char* on = 0;
switch (Config->get_remote_model()) {
case UserOrdered:
on = X_("RemoteUserDefined");
break;
case MixerOrdered:
on = X_("RemoteMixerDefined");
break;
case EditorOrdered:
on = X_("RemoteEditorDefined");
break;
}
Glib::RefPtr<Action> act = ActionManager::get_action ("options", on);
if (act) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
if (tact && !tact->get_active()) {
tact->set_active (true);
}
}
}
void
ARDOUR_UI::map_file_header_format ()
{
@ -814,6 +874,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "StopTransportAtEndOfSession", &Configuration::get_stop_at_session_end);
} else if (PARAM_IS ("monitoring-model")) {
map_monitor_model ();
} else if (PARAM_IS ("remote-model")) {
map_remote_model ();
} else if (PARAM_IS ("use-video-sync")) {
ActionManager::map_some_state ("Transport", "ToggleVideoSync", &Configuration::get_use_video_sync);
} else if (PARAM_IS ("quieten-at-speed")) {

View File

@ -1176,23 +1176,25 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case GainAutomationControlPointItem:
case PanAutomationControlPointItem:
case RedirectAutomationControlPointItem:
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
cp->set_visible (true);
double at_x, at_y;
at_x = cp->get_x();
at_y = cp->get_y ();
cp->item->i2w (at_x, at_y);
at_x += 20.0;
at_y += 20.0;
if (mouse_mode == MouseGain || mouse_mode == MouseObject) {
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
cp->set_visible (true);
fraction = 1.0 - (cp->get_y() / cp->line.height());
set_verbose_canvas_cursor (cp->line.get_verbose_cursor_string (fraction), at_x, at_y);
show_verbose_canvas_cursor ();
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
double at_x, at_y;
at_x = cp->get_x();
at_y = cp->get_y ();
cp->item->i2w (at_x, at_y);
at_x += 20.0;
at_y += 20.0;
fraction = 1.0 - (cp->get_y() / cp->line.height());
set_verbose_canvas_cursor (cp->line.get_verbose_cursor_string (fraction), at_x, at_y);
show_verbose_canvas_cursor ();
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
}
}
break;
@ -1210,13 +1212,15 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
case GainAutomationLineItem:
case RedirectAutomationLineItem:
case PanAutomationLineItem:
{
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line)
line->property_fill_color_rgba() = color_map[cEnteredAutomationLine];
}
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
if (mouse_mode == MouseGain || mouse_mode == MouseObject) {
{
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line)
line->property_fill_color_rgba() = color_map[cEnteredAutomationLine];
}
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
}
}
break;

View File

@ -512,11 +512,13 @@ Editor::initial_route_list_display ()
void
Editor::route_list_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
{
session->set_remote_control_ids();
redisplay_route_list ();
}
void
Editor::route_list_delete (const Gtk::TreeModel::Path& path)
{
session->set_remote_control_ids();
redisplay_route_list ();
}

View File

@ -555,12 +555,14 @@ Mixer_UI::hide_all_audiotracks ()
void
Mixer_UI::track_list_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter)
{
session->set_remote_control_ids();
redisplay_track_list ();
}
void
Mixer_UI::track_list_delete (const Gtk::TreeModel::Path& path)
{
session->set_remote_control_ids();
redisplay_track_list ();
}

View File

@ -107,6 +107,8 @@ RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, co
update_rec_display ();
}
_route->RemoteControlIDChanged.connect (mem_fun(*this, &RouteUI::refresh_remote_control_menu));
/* map the current state */
map_frozen ();
@ -478,6 +480,14 @@ RouteUI::build_remote_control_menu ()
void
RouteUI::refresh_remote_control_menu ()
{
ENSURE_GUI_THREAD (mem_fun (*this, &RouteUI::refresh_remote_control_menu));
// only refresh the menu if it has been instantiated
if (remote_control_menu == 0) {
return;
}
using namespace Menu_Helpers;
RadioMenuItem::Group rc_group;

View File

@ -24,6 +24,7 @@ CONFIG_VARIABLE (bool, midi_control, "midi-control", false)
CONFIG_VARIABLE (uint32_t, feedback_interval_ms, "feedback-interval-ms", 100)
CONFIG_VARIABLE (bool, use_tranzport, "use-tranzport", false)
CONFIG_VARIABLE (std::string, mackie_emulation, "mackie-emulation", "mcu")
CONFIG_VARIABLE (RemoteModel, remote_model, "remote-model", MixerOrdered)
/* disk operations */

View File

@ -476,6 +476,8 @@ class Session : public PBD::StatefulDestructible
void resort_routes ();
void resort_routes_using (boost::shared_ptr<RouteList>);
void set_remote_control_ids();
AudioEngine &engine() { return _engine; };
int32_t max_level;

View File

@ -267,6 +267,12 @@ namespace ARDOUR {
ExternalMonitoring,
};
enum RemoteModel {
UserOrdered,
MixerOrdered,
EditorOrdered,
};
enum CrossfadeModel {
FullCrossfade,
ShortCrossfade
@ -349,6 +355,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::HeaderFormat& sf);
std::istream& operator>>(std::istream& o, ARDOUR::AutoConnectOption& sf);
std::istream& operator>>(std::istream& o, ARDOUR::EditMode& sf);
std::istream& operator>>(std::istream& o, ARDOUR::MonitorModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SoloModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);

View File

@ -31,6 +31,7 @@ setup_enum_writer ()
RegionPoint _RegionPoint;
Placement _Placement;
MonitorModel _MonitorModel;
RemoteModel _RemoteModel;
CrossfadeModel _CrossfadeModel;
LayerModel _LayerModel;
SoloModel _SoloModel;
@ -142,6 +143,11 @@ setup_enum_writer ()
REGISTER_ENUM (ExternalMonitoring);
REGISTER (_MonitorModel);
REGISTER_ENUM (UserOrdered);
REGISTER_ENUM (MixerOrdered);
REGISTER_ENUM (EditorOrdered);
REGISTER (_RemoteModel);
REGISTER_ENUM (FullCrossfade);
REGISTER_ENUM (ShortCrossfade);
REGISTER (_CrossfadeModel);

View File

@ -614,6 +614,7 @@ std::istream& operator>>(std::istream& o, HeaderFormat& var) { return int_to_typ
std::istream& operator>>(std::istream& o, SampleFormat& var) { return int_to_type<SampleFormat> (o, var); }
std::istream& operator>>(std::istream& o, AutoConnectOption& var) { return int_to_type<AutoConnectOption> (o, var); }
std::istream& operator>>(std::istream& o, MonitorModel& var) { return int_to_type<MonitorModel> (o, var); }
std::istream& operator>>(std::istream& o, RemoteModel& var) { return int_to_type<RemoteModel> (o, var); }
std::istream& operator>>(std::istream& o, EditMode& var) { return int_to_type<EditMode> (o, var); }
std::istream& operator>>(std::istream& o, SoloModel& var) { return int_to_type<SoloModel> (o, var); }
std::istream& operator>>(std::istream& o, LayerModel& var) { return int_to_type<LayerModel> (o, var); }

View File

@ -1770,6 +1770,27 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
return ret;
}
void
Session::set_remote_control_ids ()
{
RemoteModel m = Config->get_remote_model();
shared_ptr<RouteList> r = routes.reader ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if ( MixerOrdered == m) {
long order = (*i)->order_key(N_("signal"));
(*i)->set_remote_control_id( order+1 );
} else if ( EditorOrdered == m) {
long order = (*i)->order_key(N_("editor"));
(*i)->set_remote_control_id( order+1 );
} else if ( UserOrdered == m) {
//do nothing ... only changes to remote id's are initiated by user
}
}
}
Session::RouteList
Session::new_audio_route (int input_channels, int output_channels, uint32_t how_many)
{

View File

@ -3167,6 +3167,8 @@ Session::config_changed (const char* parameter_name)
} else if (PARAM_IS ("slave-source")) {
set_slave_source (Config->get_slave_source());
} else if (PARAM_IS ("remote-model")) {
set_remote_control_ids ();
}
set_dirty ();