the big rework of window management. probably not complete at thsi point, but this is mostly functional

This commit is contained in:
Paul Davis 2013-05-04 22:02:05 -04:00
parent 69a3310037
commit 40944574c6
27 changed files with 506 additions and 875 deletions

View file

@ -22,9 +22,11 @@
#include <gtkmm/aboutdialog.h>
#include "ardour/session_handle.h"
class ConfigInfoDialog;
class About : public Gtk::AboutDialog
class About : public Gtk::AboutDialog, public ARDOUR::SessionHandlePtr
{
public:
About ();

View file

@ -49,7 +49,7 @@ using namespace ARDOUR;
std::vector<std::string> AddRouteDialog::channel_combo_strings;
AddRouteDialog::AddRouteDialog (Session* s)
AddRouteDialog::AddRouteDialog ()
: ArdourDialog (_("Add Track or Bus"))
, routes_adjustment (1, 1, 128, 1, 4)
, routes_spinner (routes_adjustment)
@ -57,8 +57,6 @@ AddRouteDialog::AddRouteDialog (Session* s)
, mode_label (_("Track mode:"))
, instrument_label (_("Instrument:"))
{
set_session (s);
set_name ("AddRouteDialog");
set_modal (true);
set_skip_taskbar_hint (true);
@ -496,7 +494,7 @@ AddRouteDialog::add_route_group (RouteGroup* g)
RouteGroup*
AddRouteDialog::route_group ()
{
if (route_group_combo.get_active_row_number () == 2) {
if (!_session || route_group_combo.get_active_row_number () == 2) {
return 0;
}
@ -513,7 +511,9 @@ AddRouteDialog::refill_route_groups ()
route_group_combo.append_text (_("No Group"));
_session->foreach_route_group (sigc::mem_fun (*this, &AddRouteDialog::add_route_group));
if (_session) {
_session->foreach_route_group (sigc::mem_fun (*this, &AddRouteDialog::add_route_group));
}
route_group_combo.set_active (2);
}
@ -534,7 +534,9 @@ AddRouteDialog::group_changed ()
delete g;
route_group_combo.set_active (2);
} else {
_session->add_route_group (g);
if (_session) {
_session->add_route_group (g);
}
add_route_group (g);
route_group_combo.set_active (3);
}

View file

@ -45,7 +45,7 @@ class Editor;
class AddRouteDialog : public ArdourDialog
{
public:
AddRouteDialog (ARDOUR::Session*);
AddRouteDialog ();
~AddRouteDialog ();
enum TypeWanted {

View file

@ -50,10 +50,10 @@
#ifndef GTKOSX
<separator/>
#endif
<menuitem action='ToggleSessionOptionsEditor'/>
<menuitem action='toggle-session-options-editor'/>
#ifdef GTKOSX
<menuitem action='ToggleRCOptionsEditor'/>
<menuitem action='About'/>
<menuitem action='toggle-rc-options-editor'/>
<menuitem action='toggle-about'/>
#endif
<separator/>
<menuitem action='Quit'/>
@ -231,7 +231,7 @@
<menuitem action='set-mouse-mode-object-range'/>
#ifndef GTKOSX
<separator/>
<menuitem action='ToggleRCOptionsEditor'/>
<menuitem action='toggle-rc-options-editor'/>
#endif
</menu>
@ -510,12 +510,12 @@
<separator/>
<menuitem action='ToggleInspector'/>
<menuitem action='ToggleLocations'/>
<menuitem action='ToggleKeyEditor'/>
<menuitem action='ToggleBundleManager'/>
<menuitem action='ToggleThemeManager'/>
<menuitem action='ToggleBigClock'/>
<menuitem action='toggle-inspector'/>
<menuitem action='toggle-locations'/>
<menuitem action='toggle-key-editor'/>
<menuitem action='toggle-bundle-manager'/>
<menuitem action='toggle-theme-manager'/>
<menuitem action='toggle-big-clock'/>
<menuitem action='toggle-speaker-config'/>
<separator/>
@ -531,7 +531,7 @@
</menu>
<menu name='Help' action='Help'>
#ifndef GTKOSX
<menuitem action='About'/>
<menuitem action='toggle-about'/>
#endif
<menuitem action='Chat'/>
<menuitem action='Manual'/>

View file

@ -21,18 +21,19 @@
#include "gtk2ardour-config.h"
#endif
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <cerrno>
#include <fstream>
#include <boost/locale.hpp>
#include <stdint.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>
#include <cerrno>
#include <fstream>
#include <iostream>
#include <sys/resource.h>
#include <sys/types.h>
@ -88,6 +89,7 @@ typedef uint64_t microseconds_t;
#include "ambiguous_file_dialog.h"
#include "ardour_ui.h"
#include "audio_clock.h"
#include "big_clock_window.h"
#include "bundle_manager.h"
#include "engine_dialog.h"
#include "gain_meter.h"
@ -95,6 +97,7 @@ typedef uint64_t microseconds_t;
#include "gui_object.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "keyeditor.h"
#include "location_ui.h"
#include "main_clock.h"
#include "missing_file_dialog.h"
@ -106,8 +109,11 @@ typedef uint64_t microseconds_t;
#include "processor_box.h"
#include "prompter.h"
#include "public_editor.h"
#include "rc_option_editor.h"
#include "route_time_axis.h"
#include "route_params_ui.h"
#include "session_metadata_dialog.h"
#include "session_option_editor.h"
#include "shuttle_control.h"
#include "speaker_dialog.h"
#include "splash.h"
@ -115,7 +121,6 @@ typedef uint64_t microseconds_t;
#include "theme_manager.h"
#include "time_axis_view_item.h"
#include "utils.h"
#include "window_proxy.h"
#include "video_server_dialog.h"
#include "add_video_dialog.h"
#include "transcode_video_dialog.h"
@ -168,6 +173,21 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, solo_alert_button (_("solo"))
, feedback_alert_button (_("feedback"))
, speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
, theme_manager (X_("theme-manager"), _("Theme Manager"))
, key_editor (X_("key-editor"), _("Key Bindings"))
, rc_option_editor (X_("rc-options-editor"), _("Preferences"))
, add_route_dialog (X_("add-routes"), _("Add Tracks/Busses"))
, about (X_("about"), _("About"))
, location_ui (X_("locations"), _("Locations"))
, route_params (X_("inspector"), _("Tracks and Busses"))
, 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))
, bundle_manager (X_("bundle-manager"), _("Bundle Manager"), boost::bind (&ARDOUR_UI::create_bundle_manager, this))
, big_clock_window (X_("big-clock"), _("Big Clock"), boost::bind (&ARDOUR_UI::create_big_clock_window, this))
, audio_port_matrix (X_("audio-connection-manager"), _("Audio Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::AUDIO))
, midi_port_matrix (X_("midi-connection-manager"), _("MIDI Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::MIDI))
, error_log_button (_("Errors"))
, _status_bar_visibility (X_("status-bar"))
@ -176,7 +196,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
{
Gtkmm2ext::init(localedir);
about = 0;
splash = 0;
_startup = 0;
@ -185,36 +204,20 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
}
ui_config = new UIConfiguration();
theme_manager = new ThemeManager();
key_editor = 0;
editor = 0;
mixer = 0;
editor = 0;
engine = 0;
_session_is_new = false;
big_clock_window = 0;
big_clock_height = 0;
big_clock_resize_in_progress = false;
session_selector_window = 0;
last_key_press_time = 0;
add_route_dialog = 0;
add_video_dialog = 0;
video_server_process = 0;
route_params = 0;
bundle_manager = 0;
rc_option_editor = 0;
session_option_editor = 0;
location_ui = 0;
open_session_selector = 0;
have_configure_timeout = false;
have_disk_speed_dialog_displayed = false;
session_loaded = false;
ignore_dual_punch = false;
original_big_clock_width = -1;
original_big_clock_height = -1;
original_big_clock_font_size = 0;
roll_button.set_controllable (roll_controllable);
stop_button.set_controllable (stop_controllable);
@ -308,26 +311,53 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
TimeAxisViewItem::set_constant_heights ();
/* load up the UI manager */
ActionManager::init ();
/* The following must happen after ARDOUR::init() so that Config is set up */
location_ui = new ActionWindowProxy<LocationUIWindow> (X_("locations"), Config->extra_xml (X_("UI")), X_("ToggleLocations"));
big_clock_window = new ActionWindowProxy<Gtk::Window> (X_("bigclock"), Config->extra_xml (X_("UI")), X_("ToggleBigClock"));
speaker_config_window = new ActionWindowProxy<SpeakerDialog> (X_("speakerconf"), Config->extra_xml (X_("UI")), X_("toggle-speaker-config"));
const XMLNode* ui_xml = Config->extra_xml (X_("UI"));
for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
_global_port_matrix[*i] = new ActionWindowProxy<GlobalPortMatrixWindow> (
string_compose ("GlobalPortMatrix-%1", (*i).to_string()),
Config->extra_xml (X_("UI")),
string_compose ("toggle-%1-connection-manager", (*i).to_string())
);
if (ui_xml) {
theme_manager.set_state (*ui_xml);
key_editor.set_state (*ui_xml);
rc_option_editor.set_state (*ui_xml);
session_option_editor.set_state (*ui_xml);
speaker_config_window.set_state (*ui_xml);
about.set_state (*ui_xml);
add_route_dialog.set_state (*ui_xml);
add_video_dialog.set_state (*ui_xml);
route_params.set_state (*ui_xml);
bundle_manager.set_state (*ui_xml);
location_ui.set_state (*ui_xml);
big_clock_window.set_state (*ui_xml);
audio_port_matrix.set_state (*ui_xml);
midi_port_matrix.set_state (*ui_xml);
}
setup_clock ();
SpeakerDialog* s = new SpeakerDialog ();
s->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/toggle-speaker-config")));
speaker_config_window->set (s);
WindowManager::instance().register_window (&theme_manager);
WindowManager::instance().register_window (&key_editor);
WindowManager::instance().register_window (&rc_option_editor);
WindowManager::instance().register_window (&session_option_editor);
WindowManager::instance().register_window (&speaker_config_window);
WindowManager::instance().register_window (&about);
WindowManager::instance().register_window (&add_route_dialog);
WindowManager::instance().register_window (&add_video_dialog);
WindowManager::instance().register_window (&route_params);
WindowManager::instance().register_window (&bundle_manager);
WindowManager::instance().register_window (&location_ui);
WindowManager::instance().register_window (&big_clock_window);
WindowManager::instance().register_window (&audio_port_matrix);
WindowManager::instance().register_window (&midi_port_matrix);
/* We need to instantiate the theme manager because it loads our
theme files. This should really change so that its window
and its functionality are separate
*/
(void) theme_manager.get (true);
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
@ -337,6 +367,14 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
}
GlobalPortMatrixWindow*
ARDOUR_UI::create_global_port_matrix (ARDOUR::DataType type)
{
if (!_session) {
return 0;
}
return new GlobalPortMatrixWindow (_session, type);
}
int
ARDOUR_UI::create_engine ()
@ -378,10 +416,6 @@ ARDOUR_UI::post_engine ()
ARDOUR::init_post_engine ();
/* load up the UI manager */
ActionManager::init ();
_tooltips.enable();
if (setup_windows ()) {
@ -467,10 +501,7 @@ ARDOUR_UI::~ARDOUR_UI ()
delete keyboard;
delete editor;
delete mixer;
delete add_route_dialog;
if (add_video_dialog) {
delete add_video_dialog;
}
stop_video_server();
}
@ -715,14 +746,7 @@ ARDOUR_UI::startup ()
goto_editor_window ();
/* Add the window proxies here; their addition may cause windows to be opened, and we want them
to be opened on top of the editor window that goto_editor_window() just opened.
*/
add_window_proxy (location_ui);
add_window_proxy (big_clock_window);
for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
add_window_proxy (_global_port_matrix[*i]);
}
WindowManager::instance().show_visible ();
/* We have to do this here since goto_editor_window() ends up calling show_all() on the
* editor window, and we may want stuff to be hidden.
@ -877,6 +901,8 @@ If you still wish to quit, please use the\n\n\
*/
save_ardour_state ();
close_all_dialogs ();
loading_message (string_compose (_("Please wait while %1 cleans up..."), PROGRAM_NAME));
if (_session) {
@ -887,7 +913,6 @@ If you still wish to quit, please use the\n\n\
_session = 0;
}
close_all_dialogs ();
engine->stop (true);
quit ();
}
@ -2304,11 +2329,7 @@ ARDOUR_UI::save_state (const string & name, bool switch_to_it)
{
XMLNode* node = new XMLNode (X_("UI"));
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
if (!(*i)->rc_configured()) {
node->add_child_nocopy (*((*i)->get_state ()));
}
}
WindowManager::instance().add_state (*node);
node->add_child_nocopy (gui_object_state->get_state());
@ -2943,18 +2964,6 @@ ARDOUR_UI::launch_chat ()
#endif
}
void
ARDOUR_UI::show_about ()
{
if (about == 0) {
about = new About;
about->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::about_signal_response));
}
about->set_transient_for(*editor);
about->show_all ();
}
void
ARDOUR_UI::launch_manual ()
{
@ -2967,21 +2976,6 @@ ARDOUR_UI::launch_reference ()
PBD::open_uri (Config->get_reference_manual_url());
}
void
ARDOUR_UI::hide_about ()
{
if (about) {
about->get_window()->set_cursor ();
about->hide ();
}
}
void
ARDOUR_UI::about_signal_response (int /*response*/)
{
hide_about();
}
void
ARDOUR_UI::loading_message (const std::string& msg)
{
@ -3242,18 +3236,15 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
return;
}
if (add_route_dialog == 0) {
add_route_dialog = new AddRouteDialog (_session);
if (float_window) {
add_route_dialog->set_transient_for (*float_window);
}
}
if (add_route_dialog->is_visible()) {
/* we're already doing this */
return;
}
if (float_window) {
add_route_dialog->set_transient_for (*float_window);
}
ResponseType r = (ResponseType) add_route_dialog->run ();
add_route_dialog->hide();
@ -3444,17 +3435,15 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
return;
}
if (add_video_dialog == 0) {
add_video_dialog = new AddVideoDialog (_session);
if (float_window) {
add_video_dialog->set_transient_for (*float_window);
}
if (float_window) {
add_video_dialog->set_transient_for (*float_window);
}
if (add_video_dialog->is_visible()) {
/* we're already doing this */
return;
}
ResponseType r = (ResponseType) add_video_dialog->run ();
add_video_dialog->hide();
if (r != RESPONSE_ACCEPT) { return; }
@ -3829,13 +3818,12 @@ ARDOUR_UI::update_transport_clocks (framepos_t pos)
secondary_clock->set (pos);
}
if (big_clock_window->get()) {
if (big_clock_window) {
big_clock->set (pos);
}
ARDOUR_UI::instance()->video_timeline->manual_seek_video_monitor(pos);
}
void
ARDOUR_UI::step_edit_status_change (bool yn)
{
@ -3856,7 +3844,7 @@ ARDOUR_UI::record_state_changed ()
{
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::record_state_changed);
if (!_session || !big_clock_window->get()) {
if (!_session || !big_clock_window) {
/* why bother - the clock isn't visible */
return;
}
@ -3995,26 +3983,6 @@ ARDOUR_UI::setup_profile ()
}
}
/** Add a window proxy to our list, so that its state will be saved.
* This call also causes the window to be created and opened if its
* state was saved as `visible'.
*/
void
ARDOUR_UI::add_window_proxy (WindowProxyBase* p)
{
_window_proxies.push_back (p);
p->maybe_show ();
}
/** Remove a window proxy from our list. Must be called if a WindowProxy
* is deleted, to prevent hanging pointers.
*/
void
ARDOUR_UI::remove_window_proxy (WindowProxyBase* p)
{
_window_proxies.remove (p);
}
int
ARDOUR_UI::missing_file (Session*s, std::string str, DataType type)
{

View file

@ -67,14 +67,15 @@
#include "video_timeline.h"
#include "ardour_dialog.h"
#include "ardour_button.h"
#include "ardour_dialog.h"
#include "ardour_window.h"
#include "editing.h"
#include "nsm.h"
#include "ui_config.h"
#include "window_proxy.h"
#include "enums.h"
#include "visibility_group.h"
#include "window_manager.h"
class About;
class AddRouteDialog;
@ -84,6 +85,7 @@ class SystemExec;
class ArdourStartup;
class ArdourKeyboard;
class AudioClock;
class BigClockWindow;
class BundleManager;
class ButtonJoiner;
class ConnectionEditor;
@ -101,7 +103,6 @@ class SpeakerDialog;
class ThemeManager;
class TimeInfoBox;
class MidiTracer;
class WindowProxyBase;
class GlobalPortMatrixWindow;
class GUIObjectState;
@ -165,14 +166,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
PublicEditor& the_editor(){return *editor;}
Mixer_UI* the_mixer() { return mixer; }
void toggle_key_editor ();
void toggle_location_window ();
void toggle_theme_manager ();
void toggle_bundle_manager ();
void toggle_big_clock_window ();
void toggle_speaker_config_window ();
void new_midi_tracer_window ();
void toggle_route_params_window ();
void toggle_editing_space();
void toggle_keep_tearoffs();
@ -209,6 +203,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
MainClock* primary_clock;
MainClock* secondary_clock;
void focus_on_clock ();
AudioClock* big_clock;
TimeInfoBox* time_info_box;
@ -275,9 +270,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void set_shuttle_fract (double);
void add_window_proxy (WindowProxyBase *);
void remove_window_proxy (WindowProxyBase *);
void get_process_buffers ();
void drop_process_buffers ();
@ -358,25 +350,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void manage_window (Gtk::Window&);
AudioClock* big_clock;
ActionWindowProxy<Gtk::Window>* big_clock_window;
int original_big_clock_width;
int original_big_clock_height;
double original_big_clock_font_size;
void big_clock_size_allocate (Gtk::Allocation&);
bool idle_big_clock_text_resizer (int width, int height);
void big_clock_realized ();
bool big_clock_resize_in_progress;
int big_clock_height;
void big_clock_catch_focus ();
void big_clock_reset_aspect_ratio ();
void float_big_clock (Gtk::Window* parent);
bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor);
ActionWindowProxy<SpeakerDialog>* speaker_config_window;
void update_transport_clocks (framepos_t pos);
void record_state_changed ();
@ -596,41 +571,40 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
PublicEditor *editor;
int create_editor ();
RouteParams_UI *route_params;
int create_route_params ();
/* Dialogs that can be created via new<T> */
BundleManager *bundle_manager;
void create_bundle_manager ();
WindowManager::Proxy<SpeakerDialog> speaker_config_window;
WindowManager::Proxy<ThemeManager> theme_manager;
WindowManager::Proxy<KeyEditor> key_editor;
WindowManager::Proxy<RCOptionEditor> rc_option_editor;
WindowManager::Proxy<AddRouteDialog> add_route_dialog;
WindowManager::Proxy<About> about;
WindowManager::Proxy<LocationUIWindow> location_ui;
WindowManager::Proxy<RouteParams_UI> route_params;
ActionWindowProxy<LocationUIWindow>* location_ui;
int create_location_ui ();
void handle_locations_change (ARDOUR::Location*);
/* Windows/Dialogs that require a creator method */
ActionWindowProxy<GlobalPortMatrixWindow>* _global_port_matrix[ARDOUR::DataType::num_types];
void toggle_global_port_matrix (ARDOUR::DataType);
WindowManager::ProxyWithConstructor<SessionOptionEditor> session_option_editor;
WindowManager::ProxyWithConstructor<AddVideoDialog> add_video_dialog;
WindowManager::ProxyWithConstructor<BundleManager> bundle_manager;
WindowManager::ProxyWithConstructor<BigClockWindow> big_clock_window;
WindowManager::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
WindowManager::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
/* creator methods */
SessionOptionEditor* create_session_option_editor ();
BundleManager* create_bundle_manager ();
AddVideoDialog* create_add_video_dialog ();
BigClockWindow* create_big_clock_window();
GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
static UIConfiguration *ui_config;
ThemeManager *theme_manager;
/* Key bindings editor */
KeyEditor *key_editor;
/* RC Options window */
RCOptionEditor *rc_option_editor;
SessionOptionEditor *session_option_editor;
/* route dialog */
AddRouteDialog *add_route_dialog;
/* video dialog */
AddVideoDialog *add_video_dialog;
SystemExec *video_server_process;
void handle_locations_change (ARDOUR::Location*);
/* Keyboard Handling */
ArdourKeyboard* keyboard;
@ -644,7 +618,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
uint32_t rec_enabled_streams;
void count_recenabled_streams (ARDOUR::Route&);
About* about;
Splash* splash;
void pop_back_splash (Gtk::Window&);
@ -730,8 +703,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void queue_finish ();
void fontconfig_dialog ();
std::list<WindowProxyBase*> _window_proxies;
int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type);
int ambiguous_file (std::string file, std::string path, std::vector<std::string> hits);

View file

@ -82,8 +82,6 @@ ARDOUR_UI::setup_windows ()
we_have_dependents ();
theme_manager->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleThemeManager")));
#ifdef TOP_MENUBAR
HBox* status_bar_packer = manage (new HBox);
EventBox* status_bar_event_box = manage (new EventBox);

View file

@ -85,118 +85,6 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
s->restore_history ("");
}
static bool
_hide_splash (gpointer arg)
{
((ARDOUR_UI*)arg)->hide_splash();
return false;
}
void
ARDOUR_UI::goto_editor_window ()
{
if (splash && splash->is_visible()) {
// in 2 seconds, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000);
}
editor->show_window ();
editor->present ();
flush_pending ();
}
void
ARDOUR_UI::goto_mixer_window ()
{
if (!editor) {
return;
}
Glib::RefPtr<Gdk::Window> win = editor->get_window ();
Glib::RefPtr<Gdk::Screen> screen;
if (win) {
screen = win->get_screen();
} else {
screen = Gdk::Screen::get_default();
}
if (screen && screen->get_height() < 700) {
Gtk::MessageDialog msg (_("This screen is not tall enough to display the mixer window"));
msg.run ();
return;
}
mixer->show_window ();
mixer->present ();
flush_pending ();
}
void
ARDOUR_UI::toggle_mixer_window ()
{
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
if (!act) {
return;
}
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active()) {
goto_mixer_window ();
} else {
mixer->hide ();
}
}
void
ARDOUR_UI::toggle_editor_mixer ()
{
if (editor && mixer) {
if (editor->get_screen() != mixer->get_screen()) {
// different screens, so don't do anything
return;
}
/* See if they are obscuring each other */
gint ex, ey, ew, eh;
gint mx, my, mw, mh;
editor->get_position (ex, ey);
editor->get_size (ew, eh);
mixer->get_position (mx, my);
mixer->get_size (mw, mh);
GdkRectangle e;
GdkRectangle m;
GdkRectangle r;
e.x = ex;
e.y = ey;
e.width = ew;
e.height = eh;
m.x = mx;
m.y = my;
m.width = mw;
m.height = mh;
if (!gdk_rectangle_intersect (&e, &m, &r)) {
/* they do not intersect so do not toggle */
return;
}
}
if (mixer && mixer->fully_visible()) {
goto_editor_window ();
} else {
goto_mixer_window ();
}
}
/** The main editor window has been closed */
gint
ARDOUR_UI::exit_on_main_window_close (GdkEventAny * /*ev*/)

View file

@ -29,7 +29,9 @@
#include "actions.h"
#include "add_route_dialog.h"
#include "add_video_dialog.h"
#include "ardour_ui.h"
#include "big_clock_window.h"
#include "bundle_manager.h"
#include "global_port_matrix.h"
#include "gui_object.h"
@ -45,6 +47,7 @@
#include "shuttle_control.h"
#include "session_option_editor.h"
#include "speaker_dialog.h"
#include "splash.h"
#include "sfdb_ui.h"
#include "theme_manager.h"
#include "time_info_box.h"
@ -62,14 +65,20 @@ ARDOUR_UI::set_session (Session *s)
{
SessionHandlePtr::set_session (s);
for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
GlobalPortMatrixWindow* w;
if ((w = _global_port_matrix[*i]->get()) != 0) {
w->set_session (s);
}
if (audio_port_matrix) {
audio_port_matrix->set_session (s);
}
if (midi_port_matrix) {
midi_port_matrix->set_session (s);
}
if (!_session) {
/* Session option editor cannot exist across change-of-session */
session_option_editor.drop_window ();
/* Ditto for AddVideoDialog */
add_video_dialog.drop_window ();
return;
}
@ -86,37 +95,12 @@ ARDOUR_UI::set_session (Session *s)
}
AutomationWatch::instance().set_session (s);
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);
}
if (add_route_dialog) {
add_route_dialog->set_session (s);
}
if (session_option_editor) {
session_option_editor->set_session (s);
}
WindowManager::instance().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);
@ -267,35 +251,116 @@ ARDOUR_UI::unload_session (bool hide_stuff)
return 0;
}
void
ARDOUR_UI::toggle_big_clock_window ()
static bool
_hide_splash (gpointer arg)
{
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleBigClock"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
((ARDOUR_UI*)arg)->hide_splash();
return false;
}
if (tact->get_active()) {
big_clock_window->get()->show_all ();
big_clock_window->get()->present ();
} else {
big_clock_window->get()->hide ();
}
void
ARDOUR_UI::goto_editor_window ()
{
if (splash && splash->is_visible()) {
// in 2 seconds, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000);
}
editor->show_window ();
editor->present ();
flush_pending ();
}
void
ARDOUR_UI::goto_mixer_window ()
{
if (!editor) {
return;
}
Glib::RefPtr<Gdk::Window> win = editor->get_window ();
Glib::RefPtr<Gdk::Screen> screen;
if (win) {
screen = win->get_screen();
} else {
screen = Gdk::Screen::get_default();
}
if (screen && screen->get_height() < 700) {
Gtk::MessageDialog msg (_("This screen is not tall enough to display the mixer window"));
msg.run ();
return;
}
mixer->show_window ();
mixer->present ();
flush_pending ();
}
void
ARDOUR_UI::toggle_mixer_window ()
{
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
if (!act) {
return;
}
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active()) {
goto_mixer_window ();
} else {
mixer->hide ();
}
}
void
ARDOUR_UI::toggle_speaker_config_window ()
ARDOUR_UI::toggle_editor_mixer ()
{
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-speaker-config"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (editor && mixer) {
if (tact->get_active()) {
speaker_config_window->get()->show_all ();
speaker_config_window->get()->present ();
} else {
speaker_config_window->get()->hide ();
if (editor->get_screen() != mixer->get_screen()) {
// different screens, so don't do anything
return;
}
/* See if they are obscuring each other */
gint ex, ey, ew, eh;
gint mx, my, mw, mh;
editor->get_position (ex, ey);
editor->get_size (ew, eh);
mixer->get_position (mx, my);
mixer->get_size (mw, mh);
GdkRectangle e;
GdkRectangle m;
GdkRectangle r;
e.x = ex;
e.y = ey;
e.width = ew;
e.height = eh;
m.x = mx;
m.y = my;
m.width = mw;
m.height = mh;
if (!gdk_rectangle_intersect (&e, &m, &r)) {
/* they do not intersect so do not toggle */
return;
}
}
if (mixer && mixer->fully_visible()) {
goto_editor_window ();
} else {
goto_mixer_window ();
}
}
@ -324,173 +389,28 @@ ARDOUR_UI::new_midi_tracer_window ()
}
}
void
ARDOUR_UI::toggle_rc_options_window ()
{
if (rc_option_editor == 0) {
rc_option_editor = new RCOptionEditor;
rc_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleRCOptionsEditor")));
rc_option_editor->set_session (_session);
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleRCOptionsEditor"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
rc_option_editor->show_all ();
rc_option_editor->present ();
} else {
rc_option_editor->hide ();
}
}
}
void
ARDOUR_UI::toggle_session_options_window ()
{
if (session_option_editor == 0) {
session_option_editor = new SessionOptionEditor (_session);
session_option_editor->signal_unmap().connect(sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSessionOptionsEditor")));
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSessionOptionsEditor"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active()) {
session_option_editor->show_all ();
session_option_editor->present ();
} else {
session_option_editor->hide ();
}
}
}
int
ARDOUR_UI::create_location_ui ()
{
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_("<Actions>/Common/ToggleLocations")));
}
return 0;
}
void
ARDOUR_UI::toggle_location_window ()
{
if (create_location_ui()) {
return;
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleLocations"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
location_ui->get()->show_all ();
location_ui->get()->present ();
} else {
location_ui->get()->hide ();
}
}
}
void
ARDOUR_UI::toggle_key_editor ()
{
if (key_editor == 0) {
key_editor = new KeyEditor;
key_editor->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleKeyEditor")));
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleKeyEditor"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
key_editor->show_all ();
key_editor->present ();
} else {
key_editor->hide ();
}
}
}
void
ARDOUR_UI::toggle_theme_manager ()
{
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleThemeManager"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
theme_manager->show_all ();
theme_manager->present ();
} else {
theme_manager->hide ();
}
}
}
void
BundleManager*
ARDOUR_UI::create_bundle_manager ()
{
if (bundle_manager == 0) {
bundle_manager = new BundleManager (_session);
bundle_manager->signal_unmap().connect (sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleBundleManager")));
}
return new BundleManager (_session);
}
void
ARDOUR_UI::toggle_bundle_manager ()
AddVideoDialog*
ARDOUR_UI::create_add_video_dialog ()
{
create_bundle_manager ();
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleBundleManager"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active()) {
bundle_manager->show_all ();
bundle_manager->present ();
} else {
bundle_manager->hide ();
}
}
return new AddVideoDialog (_session);
}
int
ARDOUR_UI::create_route_params ()
SessionOptionEditor*
ARDOUR_UI::create_session_option_editor ()
{
if (route_params == 0) {
route_params = new RouteParams_UI ();
route_params->set_session (_session);
route_params->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleInspector")));
}
return 0;
return new SessionOptionEditor (_session);
}
void
ARDOUR_UI::toggle_route_params_window ()
BigClockWindow*
ARDOUR_UI::create_big_clock_window ()
{
if (create_route_params ()) {
return;
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleInspector"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
if (tact->get_active()) {
route_params->show_all ();
route_params->present ();
} else {
route_params->hide ();
}
}
return new BigClockWindow (*big_clock);
}
void
@ -512,14 +432,18 @@ ARDOUR_UI::main_window_state_event_handler (GdkEventWindowState* ev, bool window
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
(ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
float_big_clock (editor);
if (big_clock_window) {
big_clock_window->set_transient_for (*editor);
}
}
} else {
if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
(ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
float_big_clock (mixer);
if (big_clock_window) {
big_clock_window->set_transient_for (*mixer);
}
}
}

View file

@ -52,7 +52,7 @@
#include "mixer_ui.h"
#include "startup.h"
#include "utils.h"
#include "window_proxy.h"
#include "window_manager.h"
#include "global_port_matrix.h"
#include "location_ui.h"
#include "main_clock.h"
@ -229,42 +229,14 @@ 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_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_("ToggleRCOptionsEditor"), _("Preferences"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_rc_options_window));
ActionManager::register_toggle_action (common_actions, X_("ToggleSessionOptionsEditor"), _("Properties"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_options_window));
act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Tracks and Busses"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("ToggleLocations"), _("Locations"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_location_window));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("toggle-speaker-config"), _("Speaker Configuration"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_speaker_config_window));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("toggle-audio-connection-manager"), _("Audio Connection Manager"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::toggle_global_port_matrix), ARDOUR::DataType::AUDIO));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("toggle-midi-connection-manager"), _("MIDI Connection Manager"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::toggle_global_port_matrix), ARDOUR::DataType::MIDI));
ActionManager::session_sensitive_actions.push_back (act);
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::register_action (common_actions, X_("About"), _("About"), sigc::mem_fun(*this, &ARDOUR_UI::show_about));
ActionManager::register_action (common_actions, X_("Chat"), _("Chat"), sigc::mem_fun(*this, &ARDOUR_UI::launch_chat));
/** TRANSLATORS: This is `Manual' in the sense of an instruction book that tells a user how to use Ardour */
ActionManager::register_action (common_actions, X_("Manual"), S_("Help|Manual"), mem_fun(*this, &ARDOUR_UI::launch_manual));
ActionManager::register_action (common_actions, X_("Reference"), _("Reference"), mem_fun(*this, &ARDOUR_UI::launch_reference));
ActionManager::register_toggle_action (common_actions, X_("ToggleThemeManager"), _("Theme Manager"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_theme_manager));
ActionManager::register_toggle_action (common_actions, X_("ToggleKeyEditor"), _("Key Bindings"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_key_editor));
ActionManager::register_toggle_action (common_actions, X_("ToggleBundleManager"), _("Bundle Manager"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_bundle_manager));
#if 0
act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("Add Audio Track"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal, (ARDOUR::RouteGroup *) 0, 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddAudioBus"), _("Add Audio Bus"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::session_add_audio_bus), 1, 1, (ARDOUR::RouteGroup *) 0, 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddMIDITrack"), _("Add MIDI Track"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::session_add_midi_track), (ARDOUR::RouteGroup *) 0, 1));
ActionManager::session_sensitive_actions.push_back (act);
//act = ActionManager::register_action (common_actions, X_("AddMidiBus"), _("Add Midi Bus"), sigc::mem_fun(*this, &ARDOUR_UI::session_add_midi_bus));
//ActionManager::session_sensitive_actions.push_back (act);
#endif
act = ActionManager::register_action (common_actions, X_("Save"), _("Save"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::save_state), string(""), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
@ -620,137 +592,6 @@ ARDOUR_UI::use_menubar_as_top_menubar ()
app->set_menu_bar (*menu_bar);
}
void
ARDOUR_UI::big_clock_catch_focus ()
{
PublicEditor::instance().reset_focus ();
}
void
ARDOUR_UI::setup_clock ()
{
ARDOUR_UI::Clock.connect (sigc::mem_fun (big_clock, &AudioClock::set));
big_clock->set_corner_radius (0.0);
big_clock->mode_changed.connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_reset_aspect_ratio));
big_clock_window->set (new Window (WINDOW_TOPLEVEL), false);
big_clock_window->get()->set_keep_above (true);
big_clock_window->get()->set_border_width (0);
big_clock_window->get()->add (*big_clock);
big_clock_window->get()->set_title (_("Big Clock"));
big_clock_window->get()->signal_realize().connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_realized));
big_clock_window->get()->signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), big_clock_window->get()), false);
big_clock_window->get()->signal_size_allocate().connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_size_allocate));
big_clock_window->get()->signal_unmap().connect (sigc::bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleBigClock")));
big_clock_window->get()->signal_unmap().connect (sigc::mem_fun (*this, &ARDOUR_UI::big_clock_catch_focus));
manage_window (*big_clock_window->get());
}
void
ARDOUR_UI::big_clock_reset_aspect_ratio ()
{
Gtk::Requisition req;
big_clock->size_request (req);
float aspect = req.width/(float)req.height;
Gdk::Geometry geom;
geom.min_aspect = aspect;
geom.max_aspect = aspect;
big_clock_window->get()->set_geometry_hints (*big_clock, geom, Gdk::HINT_ASPECT);
}
void
ARDOUR_UI::big_clock_realized ()
{
int x, y, w, d;
set_decoration (big_clock_window->get(), (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
big_clock_window->get()->get_window()->get_geometry (x, y, w, big_clock_height, d);
big_clock_reset_aspect_ratio ();
original_big_clock_height = big_clock_height;
original_big_clock_width = w;
Pango::FontDescription fd (big_clock->get_style()->get_font());
original_big_clock_font_size = fd.get_size ();
if (!fd.get_size_is_absolute ()) {
original_big_clock_font_size /= PANGO_SCALE;
}
big_clock_window->setup ();
}
void
ARDOUR_UI::float_big_clock (Gtk::Window* parent)
{
if (big_clock_window->get()) {
if (parent) {
big_clock_window->get()->set_transient_for (*parent);
} else {
gtk_window_set_transient_for (big_clock_window->get()->gobj(), (GtkWindow*) 0);
}
}
}
void
ARDOUR_UI::big_clock_size_allocate (Gtk::Allocation&)
{
if (!big_clock_resize_in_progress) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::idle_big_clock_text_resizer), 0, 0));
big_clock_resize_in_progress = true;
}
}
bool
ARDOUR_UI::idle_big_clock_text_resizer (int, int)
{
big_clock_resize_in_progress = false;
Glib::RefPtr<Gdk::Window> win = big_clock_window->get()->get_window();
Pango::FontDescription fd (big_clock->get_style()->get_font());
int current_size = fd.get_size ();
int x, y, w, h, d;
if (!fd.get_size_is_absolute ()) {
current_size /= PANGO_SCALE;
}
win->get_geometry (x, y, w, h, d);
double scale = min (((double) w / (double) original_big_clock_width),
((double) h / (double) original_big_clock_height));
int size = (int) lrintf (original_big_clock_font_size * scale);
if (size != current_size) {
string family = fd.get_family();
char buf[family.length()+16];
snprintf (buf, family.length()+16, "%s %d", family.c_str(), size);
try {
Pango::FontDescription fd (buf);
Glib::RefPtr<Gtk::RcStyle> rcstyle = big_clock->get_modifier_style ();
rcstyle->set_font (fd);
big_clock->modify_style (rcstyle);
}
catch (...) {
/* oh well, do nothing */
}
}
return false;
}
void
ARDOUR_UI::save_ardour_state ()
{
@ -769,11 +610,9 @@ ARDOUR_UI::save_ardour_state ()
XMLNode* window_node = new XMLNode (X_("UI"));
window_node->add_property (_status_bar_visibility.get_state_name().c_str(), _status_bar_visibility.get_state_value ());
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
if ((*i)->rc_configured()) {
window_node->add_child_nocopy (*((*i)->get_state ()));
}
}
/* Windows */
WindowManager::instance().add_state (*window_node);
/* tearoffs */
@ -815,42 +654,20 @@ ARDOUR_UI::save_ardour_state ()
if (_session) {
_session->add_instant_xml (enode);
_session->add_instant_xml (mnode);
if (location_ui->get ()) {
_session->add_instant_xml (location_ui->get()->ui().get_state ());
if (location_ui) {
_session->add_instant_xml (location_ui->ui().get_state ());
}
} else {
Config->add_instant_xml (enode);
Config->add_instant_xml (mnode);
if (location_ui->get ()) {
Config->add_instant_xml (location_ui->get()->ui().get_state ());
if (location_ui) {
Config->add_instant_xml (location_ui->ui().get_state ());
}
}
Keyboard::save_keybindings ();
}
void
ARDOUR_UI::toggle_global_port_matrix (ARDOUR::DataType t)
{
std::string const action = string_compose ("toggle-%1-connection-manager", t.to_string ());
if (_global_port_matrix[t]->get() == 0) {
_global_port_matrix[t]->set (new GlobalPortMatrixWindow (_session, t));
_global_port_matrix[t]->get()->signal_unmap().connect(sigc::bind (sigc::ptr_fun (&ActionManager::uncheck_toggleaction), string_compose (X_("<Actions>/Common/%1"), action)));
}
RefPtr<Action> act = ActionManager::get_action (X_("Common"), action.c_str());
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
if (tact->get_active()) {
_global_port_matrix[t]->get()->present ();
} else {
_global_port_matrix[t]->get()->hide ();
}
}
}
void
ARDOUR_UI::resize_text_widgets ()
{

View file

@ -23,8 +23,10 @@
is to cut down on the nasty compile times for these classes.
*/
#include "actions.h"
#include "ardour_ui.h"
#include "mixer_ui.h"
#include "i18n.h"
using namespace ARDOUR;

View file

@ -17,29 +17,37 @@
*/
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#include <algorithm>
#include <string>
#include "big_clock_window.h"
#include "ardour_ui.h"
#include "audio_clock.h"
#include "big_clock_window.h"
#include "public_editor.h"
#include "utils.h"
#include "i18n.h"
using std::min;
using std::string;
BigClockWindow::BigClockWindow (AudioClock& c)
: ArdourWindow (_("Big Clock"))
, clock (c)
, resize_in_progress (false)
, original_height (0)
, original_width (0)
, original_font_size (0)
{
ARDOUR_UI::Clock.connect (sigc::mem_fun (clock, &AudioClock::set));
clock.set_corner_radius (0.0);
clock.mode_changed.connect (sigc::mem_fun (*this, &BigClockWindow::reset_aspect_ratio));
win->set_keep_above (true);
win->set_border_width (0);
win->add (*clock);
set_keep_above (true);
set_border_width (0);
add (clock);
clock.show_all ();
}
void
@ -51,7 +59,7 @@ BigClockWindow::on_unmap ()
bool
BigClockWindow::on_key_press_event (GdkEventKey* ev)
{
return relay_key_press (ev);
return relay_key_press (ev, this);
}
void
@ -82,23 +90,12 @@ BigClockWindow::on_size_allocate (Gtk::Allocation& alloc)
{
ArdourWindow::on_size_allocate (alloc);
if (!big_clock_resize_in_progress) {
if (!resize_in_progress) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &BigClockWindow::text_resizer), 0, 0));
resize_in_progress = true;
}
}
void
BigClockWindow::float (Gtk::Window* parent)
{
if (parent) {
set_transient_for (*parent);
} else {
/* Gtkmm doesn't allow a call to this for a null parent */
gtk_window_set_transient_for (big_clock_window->gobj(), (GtkWindow*) 0);
}
}
void
BigClockWindow::reset_aspect_ratio ()
{

View file

@ -24,16 +24,11 @@
class AudioClock;
class BigClockWindow : public Gtk::Window, public ARDOUR::SessionHandlePtr, public Gtkmm2ext::VisibilityTracker
class BigClockWindow : public ArdourWindow
{
public:
BigClockWindow (AudioClock&);
AudioClock* clock() const { return _clock; }
void set_clock (AudioClock* c) { _clock = c; }
void float (Gtk::Window*);
private:
AudioClock& clock;
bool resize_in_progress;
@ -44,7 +39,7 @@ class BigClockWindow : public Gtk::Window, public ARDOUR::SessionHandlePtr, publ
void on_size_allocate (Gtk::Allocation&);
void on_realize ();
void on_unmap ();
bool on_key_press_event ();
bool on_key_press_event (GdkEventKey*);
bool text_resizer (int, int);
void reset_aspect_ratio ();

View file

@ -62,7 +62,6 @@
#include "editor_items.h"
#include "region_selection.h"
#include "canvas.h"
#include "window_proxy.h"
namespace Gnome {
namespace Canvas {

View file

@ -158,13 +158,13 @@ This mode provides many different operations on both regions and control points,
@mmode|MouseMode/set-mouse-mode-object|o|object mode
@sess|Main/Open|<@PRIMARY@>o|open an existing session
@sess|Main/Recent|<@PRIMARY@><@TERTIARY@>o|open a recent session
@wvis|Common/ToggleOptionsEditor|<@WINDOW@>o|toggle preferences dialog
@wvis|Window/toggle-session-options-editor|<@WINDOW@>o|toggle preferences dialog
@rop|Region/naturalize-region|<@SECONDARY@>o|move to original position
@trans|Editor/set-playhead|p|set playhead position
@select|Editor/select-all-before-playhead|<@PRIMARY@>p|all before playhead
@wvis|Common/ToggleRCOptionsEditor|<@PRIMARY@><@TERTIARY@>p|toggle preferences dialog
@wvis|Common/toggle-audio-connection-manager|<@WINDOW@>p|toggle global audio patchbay
@wvis|Common/toggle-midi-connection-manager|<@WINDOW@><@TERTIARY@>p|toggle global midi patchbay
@wvis|Window/toggle-rc-options-editor|<@PRIMARY@><@TERTIARY@>p|toggle preferences dialog
@wvis|Window/toggle-audio-connection-manager|<@WINDOW@>p|toggle global audio patchbay
@wvis|Window/toggle-midi-connection-manager|<@WINDOW@><@TERTIARY@>p|toggle global midi patchbay
@midi|MIDI/panic|<@PRIMARY@><@SECONDARY@>p|MIDI panic (stop all notes etc)
@select|Editor/select-all-after-playhead|<@TERTIARY@><@PRIMARY@>p|all after playhead
@ -194,10 +194,10 @@ This mode provides many different operations on both regions and control points,
@epp|Region/play-selected-regions|h|play selected region(s)
@eep|Region/trim-front|j|trim front
@eep|Region/trim-back|k|trim back
@wvis|Common/ToggleKeyEditor|<@WINDOW@>k|toggle key bindings editor
@wvis|Window/toggle-key-editor|<@WINDOW@>k|toggle key bindings editor
@trans|Transport/Loop|l|loop play (the loop range)
@select|Editor/select-all-in-loop-range|<@PRIMARY@>l|select all in loop range
@wvis|Common/ToggleLocations|<@WINDOW@>l| toggle locations dialog
@wvis|Window/toggle-locations|<@WINDOW@>l| toggle locations dialog
;; BOTTOM ROW
@ -209,12 +209,12 @@ This mode provides many different operations on both regions and control points,
@edit|Editor/editor-cut|<@PRIMARY@>x|cut
@-group|Editor/crop|c|some text
@edit|Editor/editor-copy|<@PRIMARY@>c|copy
@wvis|Common/ToggleColorManager|<@WINDOW@>c|toggle color manager
@wvis|Window/toggle-theme-manager|<@WINDOW@>c|toggle color manager
@rop|Region/set-region-sync-position|v|set region sync point
@edit|Editor/editor-paste|<@PRIMARY@>v|paste
@-group|Editor/brush-at-mouse|<@PRIMARY@>b|some text
@trans|Editor/track-record-enable-toggle|<@TERTIARY@>b|toggle track rec-enable
@wvis|Common/ToggleBigClock|<@WINDOW@>b|toggle big clock
@wvis|Window/toggle-big-clock|<@WINDOW@>b|toggle big clock
@rop|Region/normalize-region|n|normalize
@sess|Main/AddTrackBus|<@PRIMARY@><@TERTIARY@>n|add track(s) or bus(ses)
@sess|Main/New|<@PRIMARY@>n|open a new session

View file

@ -42,10 +42,10 @@ NSM_Client::command_save(char **out_msg)
}
int
NSM_Client::command_open(const char *name,
const char *display_name,
const char *client_id,
char **out_msg)
NSM_Client::command_open(const char* name,
const char* /*display_name*/,
const char* client_id,
char** /*out_msg*/)
{
int r = ERR_OK;

View file

@ -342,7 +342,7 @@ OptionEditor::OptionEditor (Configuration* c, std::string const & t)
using namespace Notebook_Helpers;
set_default_size (300, 300);
set_wmclass (X_("ardour_preferences"), PROGRAM_NAME);
// set_wmclass (X_("ardour_preferences"), PROGRAM_NAME);
set_name ("Preferences");
add_events (Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);

View file

@ -1020,6 +1020,22 @@ ProcessorBox::processor_operation (ProcessorOperation op)
}
}
ProcessorWindowProxy*
ProcessorBox::find_window_proxy (boost::shared_ptr<Processor> processor) const
{
for (list<ProcessorWindowProxy*>::const_iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
boost::shared_ptr<Processor> p = (*i)->processor().lock();
if (p && p == processor) {
return (*i);
}
}
return 0;
}
bool
ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry* child)
{
@ -1034,13 +1050,16 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry*
if (processor && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) {
if (_session->engine().connected()) {
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
if (Config->get_use_plugin_own_gui ()) {
toggle_edit_processor (processor);
edit_processor (processor);
} else {
toggle_edit_generic_processor (processor);
generic_edit_processor (processor);
}
}
ret = true;
} else if (processor && ev->button == 1 && selected) {
@ -1345,7 +1364,7 @@ ProcessorBox::redisplay_processors ()
_route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display));
for (list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin(); i != _processor_window_proxies.end(); ++i) {
for (list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
(*i)->marked = false;
}
@ -1353,15 +1372,15 @@ ProcessorBox::redisplay_processors ()
/* trim dead wood from the processor window proxy list */
list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin();
while (i != _processor_window_proxies.end()) {
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin();
while (i != _processor_window_info.end()) {
list<ProcessorWindowProxy*>::iterator j = i;
++j;
if (!(*i)->marked) {
ARDOUR_UI::instance()->remove_window_proxy (*i);
WindowManager::instance().remove (*i);
delete *i;
_processor_window_proxies.erase (i);
_processor_window_info.erase (i);
}
i = j;
@ -1381,8 +1400,8 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
return;
}
list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin ();
while (i != _processor_window_proxies.end()) {
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin ();
while (i != _processor_window_info.end()) {
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
@ -1410,10 +1429,15 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
ProcessorWindowProxy* wp = new ProcessorWindowProxy (
string_compose ("%1-%2-%3", loc, _route->id(), p->id()),
_session->extra_xml (X_("UI")),
this,
w);
const XMLNode* ui_xml = _session->extra_xml (X_("UI"));
if (ui_xml) {
wp->set_state (*ui_xml);
}
wp->marked = true;
/* if the processor already has an existing UI,
@ -1423,11 +1447,11 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
void* existing_ui = p->get_ui ();
if (existing_ui) {
wp->set (static_cast<Gtk::Window*>(existing_ui));
wp->use_window (*(reinterpret_cast<Gtk::Window*>(existing_ui)));
}
_processor_window_proxies.push_back (wp);
ARDOUR_UI::instance()->add_window_proxy (wp);
_processor_window_info.push_back (wp);
WindowManager::instance().register_window (wp);
}
void
@ -2015,8 +2039,8 @@ ProcessorBox::one_processor_can_be_edited ()
return (i != selection.end());
}
void
ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
Gtk::Window*
ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor)
{
boost::shared_ptr<Send> send;
boost::shared_ptr<InternalSend> internal_send;
@ -2028,7 +2052,7 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) {
if (boost::dynamic_pointer_cast<AudioTrack> (_route)->freeze_state() == AudioTrack::Frozen) {
return;
return 0;
}
}
@ -2041,7 +2065,7 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
} else if ((send = boost::dynamic_pointer_cast<Send> (processor)) != 0) {
if (!_session->engine().connected()) {
return;
return 0;
}
if (boost::dynamic_pointer_cast<InternalSend> (processor) == 0) {
@ -2062,11 +2086,11 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
if (boost::dynamic_pointer_cast<InternalReturn> (retrn)) {
/* no GUI for these */
return;
return 0;
}
if (!_session->engine().connected()) {
return;
return 0;
}
boost::shared_ptr<Return> retrn = boost::dynamic_pointer_cast<Return> (processor);
@ -2096,7 +2120,7 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
if (w == 0) {
plugin_ui = new PluginUIWindow (plugin_insert);
plugin_ui = new PluginUIWindow (plugin_insert, false, Config->get_use_plugin_own_gui());
plugin_ui->set_title (generate_processor_title (plugin_insert));
set_processor_ui (plugin_insert, plugin_ui);
@ -2111,7 +2135,7 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
if (!_session->engine().connected()) {
MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible"));
msg.run ();
return;
return 0;
}
PortInsertWindow *io_selector;
@ -2129,35 +2153,23 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
gidget = io_selector;
}
if (gidget) {
if (gidget->is_visible()) {
gidget->hide ();
} else {
gidget->show_all ();
gidget->present ();
}
}
return gidget;
}
/** Toggle a generic (Ardour-generated) plugin UI */
void
ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr<Processor> processor)
Gtk::Window*
ProcessorBox::get_generic_editor_window (boost::shared_ptr<Processor> processor)
{
boost::shared_ptr<PluginInsert> plugin_insert
= boost::dynamic_pointer_cast<PluginInsert>(processor);
if (!plugin_insert) {
return;
return 0;
}
PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false);
plugin_ui->set_title(generate_processor_title (plugin_insert));
PluginUIWindow* win = new PluginUIWindow (plugin_insert, true, false);
win->set_title (generate_processor_title (plugin_insert));
if (plugin_ui->is_visible()) {
plugin_ui->hide();
} else {
plugin_ui->show_all();
plugin_ui->present();
}
return win;
}
void
@ -2237,7 +2249,7 @@ ProcessorBox::rb_edit_generic ()
return;
}
_current_processor_box->for_selected_processors (&ProcessorBox::toggle_edit_generic_processor);
_current_processor_box->for_selected_processors (&ProcessorBox::generic_edit_processor);
}
void
@ -2413,7 +2425,35 @@ ProcessorBox::rb_edit ()
return;
}
_current_processor_box->for_selected_processors (&ProcessorBox::toggle_edit_processor);
_current_processor_box->for_selected_processors (&ProcessorBox::edit_processor);
}
void
ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
{
if (!processor) {
return;
}
ProcessorWindowProxy* proxy = find_window_proxy (processor);
if (proxy) {
proxy->toggle ();
}
}
void
ProcessorBox::generic_edit_processor (boost::shared_ptr<Processor> processor)
{
if (!processor) {
return;
}
ProcessorWindowProxy* proxy = find_window_proxy (processor);
if (proxy) {
proxy->toggle ();
}
}
void
@ -2479,8 +2519,8 @@ ProcessorBox::generate_processor_title (boost::shared_ptr<PluginInsert> pi)
Window *
ProcessorBox::get_processor_ui (boost::shared_ptr<Processor> p) const
{
list<ProcessorWindowProxy*>::const_iterator i = _processor_window_proxies.begin ();
while (i != _processor_window_proxies.end()) {
list<ProcessorWindowProxy*>::const_iterator i = _processor_window_info.begin ();
while (i != _processor_window_info.end()) {
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
if (t && t == p) {
return (*i)->get ();
@ -2499,14 +2539,14 @@ ProcessorBox::get_processor_ui (boost::shared_ptr<Processor> p) const
void
ProcessorBox::set_processor_ui (boost::shared_ptr<Processor> p, Gtk::Window* w)
{
list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin ();
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin ();
p->set_ui (w);
while (i != _processor_window_proxies.end()) {
while (i != _processor_window_info.end()) {
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
if (t && t == p) {
(*i)->set (w);
(*i)->use_window (*w);
return;
}
@ -2583,29 +2623,60 @@ ProcessorBox::update_gui_object_state (ProcessorEntry* entry)
entry->add_control_state (proc);
}
ProcessorWindowProxy::ProcessorWindowProxy (
string const & name,
XMLNode const * node,
ProcessorBox* box,
boost::weak_ptr<Processor> processor
)
: WindowProxy<Gtk::Window> (name, node)
ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* box, boost::weak_ptr<Processor> processor)
: WindowManager::ProxyBase (name, string())
, marked (false)
, _processor_box (box)
, _processor (processor)
, is_custom (false)
{
}
ARDOUR::SessionHandlePtr*
ProcessorWindowProxy::session_handle()
{
/* we don't care */
return 0;
}
void
ProcessorWindowProxy::show ()
Gtk::Window*
ProcessorWindowProxy::get (bool create)
{
boost::shared_ptr<Processor> p = _processor.lock ();
if (!p) {
return;
return 0;
}
if (_window && (is_custom != Config->get_use_plugin_own_gui ())) {
/* drop existing window - wrong type */
drop_window ();
}
_processor_box->toggle_edit_processor (p);
if (!_window) {
if (!create) {
return 0;
}
_window = _processor_box->get_editor_window (p);
is_custom = Config->get_use_plugin_own_gui();
if (_window) {
setup ();
}
}
return _window;
}
void
ProcessorWindowProxy::toggle ()
{
if (_window && (is_custom != Config->get_use_plugin_own_gui ())) {
/* drop existing window - wrong type */
drop_window ();
}
WindowManager::ProxyBase::toggle ();
}

View file

@ -53,8 +53,8 @@
#include "io_selector.h"
#include "send_ui.h"
#include "enums.h"
#include "window_proxy.h"
#include "ardour_button.h"
#include "window_manager.h"
class MotionController;
class PluginSelector;
@ -75,28 +75,26 @@ namespace ARDOUR {
class ProcessorBox;
/** A WindowProxy for Processor UI windows; it knows how to ask a ProcessorBox
* to create a UI window for a particular processor.
*/
class ProcessorWindowProxy : public WindowProxy<Gtk::Window>
class ProcessorWindowProxy : public WindowManager::ProxyBase
{
public:
ProcessorWindowProxy (std::string const &, XMLNode const *, ProcessorBox *, boost::weak_ptr<ARDOUR::Processor>);
public:
ProcessorWindowProxy (std::string const &, ProcessorBox *, boost::weak_ptr<ARDOUR::Processor>);
void show ();
bool rc_configured () const {
return false;
}
Gtk::Window* get (bool create = false);
boost::weak_ptr<ARDOUR::Processor> processor () const {
return _processor;
}
boost::weak_ptr<ARDOUR::Processor> processor () const {
return _processor;
}
ARDOUR::SessionHandlePtr* session_handle();
void toggle();
bool marked;
bool marked;
private:
ProcessorBox* _processor_box;
boost::weak_ptr<ARDOUR::Processor> _processor;
private:
ProcessorBox* _processor_box;
boost::weak_ptr<ARDOUR::Processor> _processor;
bool is_custom;
};
class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
@ -255,9 +253,15 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void hide_things ();
/* Everything except a WindowProxy object should use this to get the window */
Gtk::Window* get_processor_ui (boost::shared_ptr<ARDOUR::Processor>) const;
void toggle_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
void toggle_edit_generic_processor (boost::shared_ptr<ARDOUR::Processor>);
/* a WindowProxy object can use this */
Gtk::Window* get_editor_window (boost::shared_ptr<ARDOUR::Processor>);
Gtk::Window* get_generic_editor_window (boost::shared_ptr<ARDOUR::Processor>);
void edit_processor (boost::shared_ptr<ARDOUR::Processor>);
void generic_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
void update_gui_object_state (ProcessorEntry *);
@ -393,7 +397,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void route_property_changed (const PBD::PropertyChange&);
std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
std::list<ProcessorWindowProxy*> _processor_window_proxies;
std::list<ProcessorWindowProxy*> _processor_window_info;
ProcessorWindowProxy* find_window_proxy (boost::shared_ptr<ARDOUR::Processor>) const;
void set_processor_ui (boost::shared_ptr<ARDOUR::Processor>, Gtk::Window *);
void maybe_add_processor_to_ui_list (boost::weak_ptr<ARDOUR::Processor>);

View file

@ -31,6 +31,7 @@
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/rgb_macros.h"
#include "actions.h"
#include "ardour_ui.h"
#include "rgb_macros.h"
#include "shuttle_control.h"

View file

@ -129,8 +129,6 @@ ArdourStartup::ArdourStartup (bool require_new, const std::string& session_name,
set_default_icon_list (window_icons);
}
set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
#ifdef __APPLE__
setup_prerelease_page ();
#endif

View file

@ -470,8 +470,6 @@ StepEntry::StepEntry (StepEditor& seditor)
r = RefPtr<RadioAction>::cast_dynamic (act);
assert (r);
r->set_active (true);
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
}
StepEntry::~StepEntry()

View file

@ -292,7 +292,7 @@ VideoImageFrame::http_get(framepos_t fn) {
}
void
VideoImageFrame::http_get_again(framepos_t fn) {
VideoImageFrame::http_get_again(framepos_t /*fn*/) {
pthread_mutex_lock(&queue_lock);
queued_request=false;
req_video_frame_number=want_video_frame_number;

View file

@ -231,7 +231,7 @@ VideoMonitor::is_started ()
}
void
VideoMonitor::parse_output (std::string d, size_t s)
VideoMonitor::parse_output (std::string d, size_t /*s*/)
{
std::string line = d;
std::string::size_type start = 0;
@ -447,7 +447,7 @@ VideoMonitor::set_offset (ARDOUR::frameoffset_t offset)
}
void
VideoMonitor::manual_seek (framepos_t when, bool force, ARDOUR::frameoffset_t offset)
VideoMonitor::manual_seek (framepos_t when, bool /*force*/, ARDOUR::frameoffset_t offset)
{
if (!is_started()) { return; }
if (!_session) { return; }

View file

@ -51,7 +51,7 @@ WindowManager::register_window (ProxyBase* info)
{
_windows.push_back (info);
if (info->rc_configured() && !info->menu_name().empty()) {
if (!info->menu_name().empty()) {
if (!window_actions) {
window_actions = Gtk::ActionGroup::create (X_("Window"));
@ -220,26 +220,25 @@ WindowManager::ProxyBase::toggle()
}
}
bool
WindowManager::ProxyBase::configured (GdkEventConfigure* ev)
{
_visible = true;
_x_off = ev->x;
_y_off = ev->y;
_height = ev->height;
_width = ev->width;
return false;
}
XMLNode&
WindowManager::ProxyBase::get_state () const
{
XMLNode* node = new XMLNode (X_("Window"));
node->add_property (X_("name"), _name);
node->add_property (X_("visible"), _visible ? X_("yes") : X_("no"));
char buf[32];
char buf[32];
node->add_property (X_("name"), _name);
if (_window && vistracker) {
/* we have a window, so use current state */
_visible = vistracker->partially_visible ();
_window->get_position (_x_off, _y_off);
_window->get_size (_width, _height);
}
node->add_property (X_("visible"), _visible? X_("yes") : X_("no"));
snprintf (buf, sizeof (buf), "%d", _x_off);
node->add_property (X_("x-off"), buf);
snprintf (buf, sizeof (buf), "%d", _y_off);
@ -253,13 +252,12 @@ WindowManager::ProxyBase::get_state () const
}
void
WindowManager::ProxyBase::clear ()
WindowManager::ProxyBase::drop_window ()
{
if (_window) {
_window->hide ();
delete _window;
_window = 0;
configure_connection.disconnect ();
delete vistracker;
vistracker = 0;
}
@ -268,7 +266,7 @@ WindowManager::ProxyBase::clear ()
void
WindowManager::ProxyBase::use_window (Gtk::Window& win)
{
clear ();
drop_window ();
_window = &win;
setup ();
}
@ -278,8 +276,6 @@ WindowManager::ProxyBase::setup ()
{
assert (_window);
configure_connection = _window->signal_configure_event().connect (sigc::mem_fun (*this, &ProxyBase::configured), false);
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
if (_width != -1 && _height != -1) {

View file

@ -68,12 +68,11 @@ class WindowManager
void set_action (Glib::RefPtr<Gtk::Action>);
Glib::RefPtr<Gtk::Action> action() const { return _action; };
void clear ();
void drop_window ();
void use_window (Gtk::Window&);
virtual Gtk::Window* get (bool create = false) = 0;
virtual bool rc_configured() const { return true; }
virtual void toggle ();
void set_state (const XMLNode&);
@ -88,16 +87,14 @@ class WindowManager
std::string _menu_name;
Glib::RefPtr<Gtk::Action> _action;
Gtk::Window* _window;
bool _visible; ///< true if the window should be visible on startup
int _x_off; ///< x position
int _y_off; ///< y position
int _width; ///< width
int _height; ///< height
mutable bool _visible; ///< true if the window should be visible on startup
mutable int _x_off; ///< x position
mutable int _y_off; ///< y position
mutable int _width; ///< width
mutable int _height; ///< height
Gtkmm2ext::VisibilityTracker* vistracker;
sigc::connection configure_connection;
void setup ();
bool configured (GdkEventConfigure*);
};
template<typename T>

View file

@ -52,6 +52,7 @@ gtk2_ardour_sources = [
'automation_streamview.cc',
'automation_time_axis.cc',
'axis_view.cc',
'big_clock_window.cc',
'bundle_manager.cc',
'button_joiner.cc',
'canvas-flag.cc',
@ -242,7 +243,7 @@ gtk2_ardour_sources = [
'visibility_group.cc',
'volume_controller.cc',
'waveview.cc',
'window_proxy.cc',
'window_manager.cc',
# video-timeline related sources:
'video_image_frame.cc',
'add_video_dialog.cc',