#include <gtkmm/menu.h>
-#include "pbd/convert.h"
+#include "pbd/string_convert.h"
#include "ardour/session.h"
#include "ardour/stripable.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h"
-#include "ardour_button.h"
#include "control_slave_ui.h"
#include "gui_thread.h"
#include "pbd/i18n.h"
using namespace ARDOUR;
+using namespace ArdourWidgets;
using namespace Gtk;
using std::string;
ControlSlaveUI::ControlSlaveUI (Session* s)
: SessionHandlePtr (s)
, initial_button (ArdourButton::default_elements)
+ , context_menu (0)
{
set_no_show_all (true);
pack_start (initial_button, true, true);
}
+ControlSlaveUI::~ControlSlaveUI ()
+{
+ delete context_menu;
+}
+
void
ControlSlaveUI::set_stripable (boost::shared_ptr<Stripable> s)
{
if (!any) {
pack_start (initial_button, true, true);
+ initial_button.show ();
}
show ();
if (!menuitem->get_active()) {
sl->unassign (vca);
} else {
- sl->assign (vca, false);
+ sl->assign (vca);
}
}
return true;
}
- Menu* menu = new Menu;
- MenuList& items = menu->items();
+ delete context_menu;
+ context_menu = new Menu;
+ MenuList& items = context_menu->items();
bool slaved = false;
for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
}
if (!items.empty()) {
- menu->popup (1, ev->time);
+ context_menu->popup (1, ev->time);
}
return true;
vca_button->set_name (X_("vca assign"));
vca_button->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
vca_button->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &ControlSlaveUI::specific_vca_button_release), vca->number()), false);
- vca_button->set_text (PBD::to_string (vca->number(), std::dec));
+ vca_button->set_text (PBD::to_string (vca->number()));
vca_button->set_fixed_colors (vca->presentation_info().color(), vca->presentation_info().color ());
vca->presentation_info().PropertyChanged.connect (master_connections, invalidator (*this), boost::bind (&ControlSlaveUI::master_property_changed, this, _1), gui_context());