, _was_dirty (false)
, _mixer_on_top (false)
, _initial_verbose_plugin_scan (false)
+ , _shared_popup_menu (0)
, secondary_clock_spacer (0)
, auto_input_button (ArdourButton::led_default_elements)
, time_info_box (0)
delete rc_option_editor; rc_option_editor = 0; // failed to wrap object warning
delete nsm; nsm = 0;
delete gui_object_state; gui_object_state = 0;
+ delete _shared_popup_menu ; _shared_popup_menu = 0;
delete main_window_visibility;
FastMeter::flush_pattern_cache ();
ArdourFader::flush_pattern_cache ();
{
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = shared_popup_menu ();
MenuList& items = m->items ();
RadioMenuItem::Group group;
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Monitor"), "monitor-mono");
_monitor->set_mono (tact->get_active());
}
+
+Gtk::Menu*
+ARDOUR_UI::shared_popup_menu ()
+{
+ ENSURE_GUI_THREAD (*this, &ARDOUR_UI::shared_popup_menu, ignored);
+
+ assert (!_shared_popup_menu || !_shared_popup_menu->is_visible());
+ delete _shared_popup_menu;
+ _shared_popup_menu = new Gtk::Menu;
+ return _shared_popup_menu;
+}
PublicEditor& the_editor() { return *editor;}
Mixer_UI* the_mixer() { return mixer; }
+ Gtk::Menu* shared_popup_menu ();
+
void new_midi_tracer_window ();
void toggle_editing_space();
void toggle_mixer_space();
bool _mixer_on_top;
bool _initial_verbose_plugin_scan;
+ Gtk::Menu* _shared_popup_menu;
+
void hide_tabbable (ArdourWidgets::Tabbable*);
void detach_tabbable (ArdourWidgets::Tabbable*);
void attach_tabbable (ArdourWidgets::Tabbable*);
void transport_rec_enable_blink (bool onoff);
- Gtk::Menu* session_popup_menu;
-
/* menu bar and associated stuff */
Gtk::MenuBar* menu_bar;
#include "widgets/ardour_button.h"
#include "widgets/ardour_knob.h"
+
+#include "ardour_ui.h"
#include "automation_controller.h"
#include "gui_thread.h"
#include "note_select_dialog.h"
const ARDOUR::ParameterDescriptor& desc = _controllable->desc();
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
- Gtk::Menu* menu = manage(new Menu());
+ Gtk::Menu* menu = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = menu->items();
items.push_back(MenuElem(_("Select Note..."),
sigc::mem_fun(*this, &AutomationController::run_note_select_dialog)));
menu->popup(1, ev->time);
return true;
} else if (desc.unit == ARDOUR::ParameterDescriptor::HZ) {
- Gtk::Menu* menu = manage(new Menu());
+ Gtk::Menu* menu = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = menu->items();
items.push_back(MenuElem(_("Halve"),
sigc::bind(sigc::mem_fun(*this, &AutomationController::set_ratio),
#include <gtkmm/menu.h>
#include <gtkmm/menuitem.h>
+#include "ardour_ui.h"
#include "time_axis_view.h"
#include "streamview.h"
#include "editor_summary.h"
if (ev->button == 3) { // right-click: show the reset menu action
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Gtk::Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
items.push_back(MenuElem(_("Reset Summary to Extents"),
sigc::mem_fun(*this, &EditorSummary::reset_to_extents)));
#include "widgets/tooltips.h"
#include "gui_thread.h"
+#include "ardour_ui.h"
#include "ardour_window.h"
#include "ui_config.h"
#include "utils.h"
{
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
RadioMenuItem::Group group;
{
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
RadioMenuItem::Group group;
#include "widgets/tooltips.h"
+#include "ardour_ui.h"
#include "ardour_window.h"
#include "enums_convert.h"
#include "mixer_strip.h"
{
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
RadioMenuItem::Group group;
{
using namespace Gtk::Menu_Helpers;
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
if (_selection.axes.empty()) {
Gtk::TreeModel::Path tpath = recent_session_model->get_path(iter);
const bool is_child = tpath.up () && tpath.up ();
- Gtk::Menu* m = manage (new Menu);
+ Gtk::Menu* m = ARDOUR_UI::instance()->shared_popup_menu ();
MenuList& items = m->items ();
items.push_back (MenuElem (s, sigc::bind (sigc::hide_return (sigc::ptr_fun (&PBD::open_folder)), s)));
if (!is_child) {
return false;
}
+ /* memory leak: Gtk::Menu* */
menu()->popup (1, ev->time);
return true;
}
boost::function<boost::optional<bool> ()> = 0
);
- Gtk::Menu* menu ();
Gtk::Widget* list_view ();
bool button_press_event (GdkEventButton *);
void update ();
void update_list_view ();
bool should_actually_be_visible (Member const &) const;
+ Gtk::Menu* menu ();
+
std::vector<Member> _members;
std::string _xml_property_name;
ModelColumns _model_columns;