X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui_dialogs.cc;h=bb3887862d7f43770fc1f493625032f43dd44d91;hb=fa40fb2d98db1a854f00a911857149db5ec414c2;hp=6ae05ef0ee9efda17be808f56e9f712f2368ab06;hpb=ea23298f10e9587eba483cb54a6f7d75ca68126a;p=ardour.git diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 6ae05ef0ee..bb3887862d 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -27,19 +27,25 @@ #include "ardour/audioengine.h" #include "actions.h" +#include "add_route_dialog.h" #include "ardour_ui.h" +#include "bundle_manager.h" +#include "global_port_matrix.h" +#include "gui_object.h" +#include "gui_thread.h" +#include "keyeditor.h" #include "location_ui.h" +#include "midi_tracer.h" #include "mixer_ui.h" -#include "rc_option_editor.h" -#include "session_option_editor.h" #include "public_editor.h" +#include "rc_option_editor.h" #include "route_params_ui.h" +#include "shuttle_control.h" +#include "session_option_editor.h" +#include "speaker_dialog.h" #include "sfdb_ui.h" #include "theme_manager.h" -#include "bundle_manager.h" -#include "keyeditor.h" -#include "gui_thread.h" -#include "midi_tracer.h" +#include "time_info_box.h" #include "i18n.h" @@ -58,20 +64,53 @@ ARDOUR_UI::set_session (Session *s) return; } - if (location_ui) { - location_ui->set_session(s); + const XMLNode* node = _session->extra_xml (X_("UI")); + + if (node) { + const XMLNodeList& children = node->children(); + for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { + if ((*i)->name() == GUIObjectState::xml_node_name) { + gui_object_state->load (**i); + break; + } + } + } + + if (location_ui->get()) { + location_ui->get()->set_session(s); } + if (speaker_config_window->get()) { + speaker_config_window->get()->set_speakers (s->get_speakers()); + } + if (route_params) { route_params->set_session (s); } - primary_clock.set_session (s); - secondary_clock.set_session (s); - big_clock.set_session (s); - preroll_clock.set_session (s); - postroll_clock.set_session (s); - + if (add_route_dialog) { + add_route_dialog->set_session (s); + } + + if (session_option_editor) { + session_option_editor->set_session (s); + } + + if (shuttle_box) { + shuttle_box->set_session (s); + } + + for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) { + if (_global_port_matrix[*i]->get()) { + _global_port_matrix[*i]->get()->set_session (_session); + } + } + + primary_clock->set_session (s); + secondary_clock->set_session (s); + big_clock->set_session (s); + time_info_box->set_session (s); + /* sensitize menu bar options that are now valid */ ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true); @@ -106,7 +145,7 @@ ARDOUR_UI::set_session (Session *s) ActionManager::set_sensitive (ActionManager::playlist_selection_sensitive_actions, false); rec_button.set_sensitive (true); - shuttle_box.set_sensitive (true); + solo_alert_button.set_active (_session->soloing()); setup_session_options (); @@ -115,8 +154,10 @@ ARDOUR_UI::set_session (Session *s) Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::solo_blink)); Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::sync_blink)); Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink)); + Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::feedback_blink)); _session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context()); + _session->StepEditStatusChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::step_edit_status_change, this, _1), gui_context()); _session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context()); _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_autosave, this), gui_context()); @@ -125,6 +166,7 @@ ARDOUR_UI::set_session (Session *s) _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context()); _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context()); + _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ()); #ifdef HAVE_JACK_SESSION engine->JackSessionEvent.connect (*_session, MISSING_INVALIDATOR, ui_bind (&Session::jack_session_event, _session, _1), gui_context()); @@ -152,13 +194,19 @@ ARDOUR_UI::set_session (Session *s) second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second), 1000); point_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds), 100); point_zero_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_one_seconds), 40); + + update_format (); } int ARDOUR_UI::unload_session (bool hide_stuff) { if (_session && _session->dirty()) { - switch (ask_about_saving_session (_("close"))) { + std::vector actions; + actions.push_back (_("Don't close")); + actions.push_back (_("Just close")); + actions.push_back (_("Save and close")); + switch (ask_about_saving_session (actions)) { case -1: // cancel return 1; @@ -183,7 +231,6 @@ ARDOUR_UI::unload_session (bool hide_stuff) ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false); rec_button.set_sensitive (false); - shuttle_box.set_sensitive (false); stop_blinking (); stop_clocking (); @@ -193,6 +240,7 @@ ARDOUR_UI::unload_session (bool hide_stuff) Blink.clear (); delete _session; + _session = 0; update_buffer_load (); @@ -207,27 +255,52 @@ ARDOUR_UI::toggle_big_clock_window () RefPtr tact = RefPtr::cast_dynamic(act); if (tact->get_active()) { - big_clock_window->show_all (); - big_clock_window->present (); + big_clock_window->get()->show_all (); + big_clock_window->get()->present (); } else { - big_clock_window->hide (); + big_clock_window->get()->hide (); } } } void -ARDOUR_UI::toggle_midi_tracer_window () +ARDOUR_UI::toggle_speaker_config_window () { - RefPtr act = ActionManager::get_action (X_("Common"), X_("ToggleMIDITracer")); + RefPtr act = ActionManager::get_action (X_("Common"), X_("toggle-speaker-config")); + if (act) { + RefPtr tact = RefPtr::cast_dynamic(act); + + if (tact->get_active()) { + speaker_config_window->get()->show_all (); + speaker_config_window->get()->present (); + } else { + speaker_config_window->get()->hide (); + } + } +} + +void +ARDOUR_UI::new_midi_tracer_window () +{ + RefPtr act = ActionManager::get_action (X_("Common"), X_("NewMIDITracer")); if (!act) { return; } - RefPtr tact = RefPtr::cast_dynamic (act); - if (tact->get_active ()) { - _midi_tracer_window->show_all (); + std::list::iterator i = _midi_tracer_windows.begin (); + while (i != _midi_tracer_windows.end() && (*i)->get_visible() == true) { + ++i; + } + + if (i == _midi_tracer_windows.end()) { + /* all our MIDITracer windows are visible; make a new one */ + MidiTracer* t = new MidiTracer (); + manage_window (*t); + t->show_all (); + _midi_tracer_windows.push_back (t); } else { - _midi_tracer_window->hide (); + /* re-use the hidden one */ + (*i)->show_all (); } } @@ -277,10 +350,10 @@ ARDOUR_UI::toggle_session_options_window () int ARDOUR_UI::create_location_ui () { - if (location_ui == 0) { - location_ui = new LocationUIWindow (); - location_ui->set_session (_session); - location_ui->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("/Common/ToggleLocations"))); + if (location_ui->get() == 0) { + location_ui->set (new LocationUIWindow ()); + location_ui->get()->set_session (_session); + location_ui->get()->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("/Common/ToggleLocations"))); } return 0; } @@ -297,10 +370,10 @@ ARDOUR_UI::toggle_location_window () RefPtr tact = RefPtr::cast_dynamic(act); if (tact->get_active()) { - location_ui->show_all (); - location_ui->present (); + location_ui->get()->show_all (); + location_ui->get()->present (); } else { - location_ui->hide (); + location_ui->get()->hide (); } } }