mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
use WindowManager/WMProxy to correctly manage the audio/MIDI setup window
This commit is contained in:
parent
20f28c82ec
commit
f1aa5839c0
3 changed files with 6 additions and 37 deletions
|
|
@ -191,6 +191,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
, about (X_("about"), _("About"))
|
, about (X_("about"), _("About"))
|
||||||
, location_ui (X_("locations"), _("Locations"))
|
, location_ui (X_("locations"), _("Locations"))
|
||||||
, route_params (X_("inspector"), _("Tracks and Busses"))
|
, route_params (X_("inspector"), _("Tracks and Busses"))
|
||||||
|
, audio_midi_setup (X_("audio-midi-setup"), _("Audio/MIDI Setup"))
|
||||||
, session_option_editor (X_("session-options-editor"), _("Properties"), boost::bind (&ARDOUR_UI::create_session_option_editor, this))
|
, session_option_editor (X_("session-options-editor"), _("Properties"), boost::bind (&ARDOUR_UI::create_session_option_editor, this))
|
||||||
, add_video_dialog (X_("add-video"), _("Add Tracks/Busses"), boost::bind (&ARDOUR_UI::create_add_video_dialog, this))
|
, add_video_dialog (X_("add-video"), _("Add Tracks/Busses"), boost::bind (&ARDOUR_UI::create_add_video_dialog, this))
|
||||||
, bundle_manager (X_("bundle-manager"), _("Bundle Manager"), boost::bind (&ARDOUR_UI::create_bundle_manager, this))
|
, bundle_manager (X_("bundle-manager"), _("Bundle Manager"), boost::bind (&ARDOUR_UI::create_bundle_manager, this))
|
||||||
|
|
@ -202,7 +203,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
|
|
||||||
, _status_bar_visibility (X_("status-bar"))
|
, _status_bar_visibility (X_("status-bar"))
|
||||||
, _feedback_exists (false)
|
, _feedback_exists (false)
|
||||||
, _audio_midi_setup (0)
|
|
||||||
{
|
{
|
||||||
Gtkmm2ext::init(localedir);
|
Gtkmm2ext::init(localedir);
|
||||||
|
|
||||||
|
|
@ -213,7 +213,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_config = new UIConfiguration();
|
ui_config = new UIConfiguration();
|
||||||
_audio_midi_setup = new EngineControl;
|
|
||||||
|
|
||||||
editor = 0;
|
editor = 0;
|
||||||
mixer = 0;
|
mixer = 0;
|
||||||
|
|
@ -348,6 +347,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
WM::Manager::instance().register_window (&add_route_dialog);
|
WM::Manager::instance().register_window (&add_route_dialog);
|
||||||
WM::Manager::instance().register_window (&add_video_dialog);
|
WM::Manager::instance().register_window (&add_video_dialog);
|
||||||
WM::Manager::instance().register_window (&route_params);
|
WM::Manager::instance().register_window (&route_params);
|
||||||
|
WM::Manager::instance().register_window (&audio_midi_setup);
|
||||||
WM::Manager::instance().register_window (&bundle_manager);
|
WM::Manager::instance().register_window (&bundle_manager);
|
||||||
WM::Manager::instance().register_window (&location_ui);
|
WM::Manager::instance().register_window (&location_ui);
|
||||||
WM::Manager::instance().register_window (&big_clock_window);
|
WM::Manager::instance().register_window (&big_clock_window);
|
||||||
|
|
@ -4077,41 +4077,12 @@ ARDOUR_UI::reset_route_peak_display (Route* route)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ARDOUR_UI::toggle_audio_midi_setup ()
|
|
||||||
{
|
|
||||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-audio-midi-setup"));
|
|
||||||
if (!act) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
||||||
|
|
||||||
if (tact->get_active()) {
|
|
||||||
launch_audio_midi_setup ();
|
|
||||||
} else {
|
|
||||||
_audio_midi_setup->hide ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ARDOUR_UI::launch_audio_midi_setup ()
|
|
||||||
{
|
|
||||||
if (!_audio_midi_setup) {
|
|
||||||
_audio_midi_setup = new EngineControl ();
|
|
||||||
}
|
|
||||||
|
|
||||||
_audio_midi_setup->present ();
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
|
ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
|
||||||
{
|
{
|
||||||
launch_audio_midi_setup ();
|
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
|
||||||
|
|
||||||
_audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
|
switch (audio_midi_setup->run()) {
|
||||||
|
|
||||||
switch (_audio_midi_setup->run()) {
|
|
||||||
case Gtk::RESPONSE_OK:
|
case Gtk::RESPONSE_OK:
|
||||||
return 0;
|
return 0;
|
||||||
case Gtk::RESPONSE_APPLY:
|
case Gtk::RESPONSE_APPLY:
|
||||||
|
|
|
||||||
|
|
@ -603,6 +603,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
WM::Proxy<About> about;
|
WM::Proxy<About> about;
|
||||||
WM::Proxy<LocationUIWindow> location_ui;
|
WM::Proxy<LocationUIWindow> location_ui;
|
||||||
WM::Proxy<RouteParams_UI> route_params;
|
WM::Proxy<RouteParams_UI> route_params;
|
||||||
|
WM::Proxy<EngineControl> audio_midi_setup;
|
||||||
|
|
||||||
/* Windows/Dialogs that require a creator method */
|
/* Windows/Dialogs that require a creator method */
|
||||||
|
|
||||||
|
|
@ -747,8 +748,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
std::string _announce_string;
|
std::string _announce_string;
|
||||||
void check_announcements ();
|
void check_announcements ();
|
||||||
|
|
||||||
EngineControl* _audio_midi_setup;
|
|
||||||
void launch_audio_midi_setup ();
|
|
||||||
int do_audio_midi_setup (uint32_t);
|
int do_audio_midi_setup (uint32_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,6 @@ ARDOUR_UI::install_actions ()
|
||||||
ActionManager::register_toggle_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window));
|
ActionManager::register_toggle_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window));
|
||||||
ActionManager::register_action (common_actions, X_("toggle-editor-mixer"), _("Toggle Editor+Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer));
|
ActionManager::register_action (common_actions, X_("toggle-editor-mixer"), _("Toggle Editor+Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer));
|
||||||
ActionManager::register_toggle_action (common_actions, X_("toggle-meterbridge"), S_("Window|Meterbridge"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_meterbridge));
|
ActionManager::register_toggle_action (common_actions, X_("toggle-meterbridge"), S_("Window|Meterbridge"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_meterbridge));
|
||||||
ActionManager::register_toggle_action (common_actions, X_("toggle-audio-midi-setup"), S_("Window|Audio/MIDI Setup"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_audio_midi_setup));
|
|
||||||
|
|
||||||
act = ActionManager::register_action (common_actions, X_("NewMIDITracer"), _("MIDI Tracer"), sigc::mem_fun(*this, &ARDOUR_UI::new_midi_tracer_window));
|
act = ActionManager::register_action (common_actions, X_("NewMIDITracer"), _("MIDI Tracer"), sigc::mem_fun(*this, &ARDOUR_UI::new_midi_tracer_window));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
|
|
@ -560,7 +559,7 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
window_node->add_child_nocopy (*tearoff_node);
|
window_node->add_child_nocopy (*tearoff_node);
|
||||||
|
|
||||||
Config->add_extra_xml (*window_node);
|
Config->add_extra_xml (*window_node);
|
||||||
Config->add_extra_xml (_audio_midi_setup->get_state());
|
Config->add_extra_xml (audio_midi_setup->get_state());
|
||||||
|
|
||||||
Config->save_state();
|
Config->save_state();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue