#include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/grouped_buttons.h"
#include "gtkmm2ext/gtk_ui.h"
-#include "gtkmm2ext/tearoff.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/window_title.h"
#include "gtkmm2ext/choice.h"
, track_edit_playlist_submenu (0)
, track_selection_edit_playlist_submenu (0)
, _popup_region_menu_item (0)
- , global_vpacker (key_bindings)
, _track_canvas (0)
, _track_canvas_viewport (0)
, within_track_canvas (false)
, bbt_beat_subdivision (4)
, _visible_track_count (-1)
, toolbar_selection_clock_table (2,3)
- , _mouse_mode_tearoff (0)
, automation_mode_button (_("mode"))
- , _zoom_tearoff (0)
- , _tools_tearoff (0)
, _toolbar_viewport (*manage (new Gtk::Adjustment (0, 0, 1e10)), *manage (new Gtk::Adjustment (0, 0, 1e10)))
, selection (new Selection (this))
, cut_buffer (new Selection (this))
last_event_time.tv_sec = 0;
last_event_time.tv_usec = 0;
+ global_hpacker.set_data ("ardour-bindings", &bindings);
+
selection_op_history.clear();
before.clear();
global_vpacker.pack_start (*hbox, true, true);
global_hpacker.pack_start (global_vpacker, true, true);
+ /* need to show the "contents" widget so that notebook will show if tab is switched to
+ */
+
+ global_hpacker.show ();
+
/* register actions now so that set_state() can find them and set toggles/checks etc */
register_actions ();
- /* when we start using our own keybinding system for the editor, this
- * will be uncommented
- */
- // load_bindings ();
+ load_bindings ();
setup_toolbar ();
/* Button bindings */
- button_bindings = new Bindings;
+ button_bindings = new Bindings ("editor-mouse");
XMLNode* node = button_settings();
if (node) {
for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) {
- button_bindings->load (**i);
+ button_bindings->load_operation (**i);
}
}
if (!ARDOUR::Profile->get_trx()) {
mode_box->pack_start (edit_mode_selector, false, false);
}
+
mode_box->pack_start (*mouse_mode_box, false, false);
-
- _mouse_mode_tearoff = manage (new TearOff (*mode_box));
- _mouse_mode_tearoff->set_name ("MouseModeBase");
- _mouse_mode_tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), &_mouse_mode_tearoff->tearoff_window()), false);
-
- if (Profile->get_sae() || Profile->get_mixbus() ) {
- _mouse_mode_tearoff->set_can_be_torn_off (false);
- }
-
- _mouse_mode_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window()));
- _mouse_mode_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window(), 1));
- _mouse_mode_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window()));
- _mouse_mode_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_mouse_mode_tearoff->tearoff_window(), 1));
-
+
/* Zoom */
_zoom_box.set_spacing (2);
_zoom_box.pack_start (tav_expand_button);
}
- if (!ARDOUR::Profile->get_trx()) {
- _zoom_tearoff = manage (new TearOff (_zoom_box));
-
- _zoom_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_zoom_tearoff->tearoff_window()));
- _zoom_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_zoom_tearoff->tearoff_window(), 0));
- _zoom_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_zoom_tearoff->tearoff_window()));
- _zoom_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_zoom_tearoff->tearoff_window(), 0));
- }
-
- if (Profile->get_sae() || Profile->get_mixbus() ) {
- _zoom_tearoff->set_can_be_torn_off (false);
- }
-
snap_box.set_spacing (2);
snap_box.set_border_width (2);
HBox* hbox = manage (new HBox);
hbox->set_spacing(2);
- _tools_tearoff = manage (new TearOff (*hbox));
- _tools_tearoff->set_name ("MouseModeBase");
- _tools_tearoff->tearoff_window().signal_key_press_event().connect (sigc::bind (sigc::ptr_fun (relay_key_press), &_tools_tearoff->tearoff_window()), false);
-
- if (Profile->get_sae() || Profile->get_mixbus()) {
- _tools_tearoff->set_can_be_torn_off (false);
- }
-
- _tools_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_tools_tearoff->tearoff_window()));
- _tools_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_tools_tearoff->tearoff_window(), 0));
- _tools_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
- &_tools_tearoff->tearoff_window()));
- _tools_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
- &_tools_tearoff->tearoff_window(), 0));
-
toolbar_hbox.set_spacing (2);
toolbar_hbox.set_border_width (1);
- toolbar_hbox.pack_start (*_mouse_mode_tearoff, false, false);
+ toolbar_hbox.pack_start (*mode_box, false, false);
if (!ARDOUR::Profile->get_trx()) {
- toolbar_hbox.pack_start (*_zoom_tearoff, false, false);
- toolbar_hbox.pack_start (*_tools_tearoff, false, false);
+ toolbar_hbox.pack_start (_zoom_box, false, false);
+ toolbar_hbox.pack_start (*hbox, false, false);
}
if (!ARDOUR::Profile->get_trx()) {
hbox->pack_start (snap_box, false, false);
hbox->pack_start (*nudge_box, false, false);
}
- hbox->pack_start (panic_box, false, false);
hbox->show_all ();
}
}
-void
-Editor::detach_tearoff (Box* /*b*/, Window* /*w*/)
-{
- if ((_tools_tearoff->torn_off() || !_tools_tearoff->visible()) &&
- (_mouse_mode_tearoff->torn_off() || !_mouse_mode_tearoff->visible()) &&
- (_zoom_tearoff && (_zoom_tearoff->torn_off() || !_zoom_tearoff->visible()))) {
- top_hbox.remove (toolbar_frame);
- }
-}
-
-void
-Editor::reattach_tearoff (Box* /*b*/, Window* /*w*/, int32_t /*n*/)
-{
- if (toolbar_frame.get_parent() == 0) {
- top_hbox.pack_end (toolbar_frame);
- }
-}
-
void
Editor::set_show_measures (bool yn)
{
_snapshots->redisplay ();
}
-void
-Editor::update_tearoff_visibility()
-{
- bool visible = UIConfiguration::instance().get_keep_tearoffs();
- _mouse_mode_tearoff->set_visible (visible);
- _tools_tearoff->set_visible (visible);
- if (_zoom_tearoff) {
- _zoom_tearoff->set_visible (visible);
- }
-}
-
-void
-Editor::reattach_all_tearoffs ()
-{
- if (_mouse_mode_tearoff) _mouse_mode_tearoff->put_it_back ();
- if (_tools_tearoff) _tools_tearoff->put_it_back ();
- if (_zoom_tearoff) _zoom_tearoff->put_it_back ();
-}
-
void
Editor::maximise_editing_space ()
{
return;
}
- current_toplevel()->fullscreen ();
+ Gtk::Window* toplevel = current_toplevel();
- _maximised = true;
+ if (toplevel) {
+ toplevel->fullscreen ();
+ _maximised = true;
+ }
}
void
return;
}
- current_toplevel()->unfullscreen();
+ Gtk::Window* toplevel = current_toplevel();
- _maximised = false;
+ if (toplevel) {
+ toplevel->unfullscreen();
+ _maximised = false;
+ }
}
/**
if (track_views.size() > 1) {
Timers::TimerSuspender t;
dialog = new MessageDialog (
- *current_toplevel(),
string_compose (_("Please wait while %1 loads visual data."), PROGRAM_NAME),
true
);
// win->signal_realize().connect (*this, &Editor::on_realize);
win->signal_event().connect (sigc::mem_fun (*this, &Editor::generic_event_handler));
+ win->set_data ("ardour-bindings", &bindings);
update_title ();
}