#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/selector.h>
-#include <gtkmm2ext/stop_signal.h>
#include <gtkmm2ext/bindable_button.h>
#include <gtkmm2ext/utils.h>
controls_vbox.pack_start(_midi_controls_box, false, false);
- boost::shared_ptr<MidiDiskstream> diskstream = midi_track()->midi_diskstream();
-
// restore channel selector settings
- _channel_selector.set_channel_mode(diskstream->get_channel_mode(),
- diskstream->get_channel_mask());
+ _channel_selector.set_channel_mode(midi_track()->get_channel_mode(), midi_track()->get_channel_mask());
_channel_selector.mode_changed.connect(
- sigc::mem_fun(*midi_track()->midi_diskstream(), &MidiDiskstream::set_channel_mode));
+ sigc::mem_fun(*midi_track(), &MidiTrack::set_channel_mode));
_channel_selector.mode_changed.connect(
sigc::mem_fun(*this, &MidiTimeAxisView::set_channel_mode));
RouteTimeAxisView::set_height (h);
if (height >= MIDI_CONTROLS_BOX_MIN_HEIGHT) {
- _midi_controls_box.show();
+ _midi_controls_box.show_all ();
} else {
_midi_controls_box.hide();
}
{
using namespace Menu_Helpers;
+ /* If we have a controller menu, we need to detach it before
+ RouteTimeAxis::build_automation_action_menu destroys the
+ menu it is attached to. Otherwise GTK destroys
+ controller_menu's gobj, meaning that it can't be reattached
+ below. See bug #3134.
+ */
+
+ if (controller_menu) {
+ detach_menu (*controller_menu);
+ }
+
RouteTimeAxisView::build_automation_action_menu ();
MenuList& automation_items = automation_action_menu->items();
something about MIDI (!) would not expect to find them there.
*/
- add_channel_command_menu_item (automation_items, _("Program PropertyChange"), MidiPgmChangeAutomation, MIDI_CMD_PGM_CHANGE);
+ add_channel_command_menu_item (automation_items, _("Program Change"), MidiPgmChangeAutomation, MIDI_CMD_PGM_CHANGE);
add_channel_command_menu_item (automation_items, _("Bender"), MidiPitchBenderAutomation, MIDI_CMD_BENDER);
add_channel_command_menu_item (automation_items, _("Pressure"), MidiChannelPressureAutomation, MIDI_CMD_CHANNEL_PRESSURE);
*/
build_controller_menu ();
- detach_menu (*controller_menu);
automation_items.push_back (SeparatorElem());
automation_items.push_back (MenuElem (_("Controllers"), *controller_menu));
if (selected_channels & (0x0001 << chn)) {
Evoral::Parameter fully_qualified_param (param.type(), chn, param.id());
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ Gtk::CheckMenuItem* menu = automation_child_menu_item (fully_qualified_param);
- if (node && node->menu_item) {
- node->menu_item->set_active (yn);
+ if (menu) {
+ menu->set_active (yn);
}
}
}
sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),
fully_qualified_param)));
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ boost::shared_ptr<AutomationTimeAxisView> track = automation_child (fully_qualified_param);
bool visible = false;
- if (node) {
- if (node->track->marked_for_display()) {
+ if (track) {
+ if (track->marked_for_display()) {
visible = true;
}
}
CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&chn_items.back());
- if (node) {
- node->menu_item = cmi;
- }
-
+ _parameter_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
-
- parameter_menu_map[fully_qualified_param] = cmi;
}
}
sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),
fully_qualified_param)));
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ boost::shared_ptr<AutomationTimeAxisView> track = automation_child (fully_qualified_param);
bool visible = false;
- if (node) {
- if (node->track->marked_for_display()) {
+ if (track) {
+ if (track->marked_for_display()) {
visible = true;
}
}
CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&items.back());
- if (node) {
- node->menu_item = cmi;
- }
-
+ _parameter_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
- parameter_menu_map[fully_qualified_param] = cmi;
-
/* one channel only */
break;
}
sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),
fully_qualified_param)));
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ boost::shared_ptr<AutomationTimeAxisView> track = automation_child (fully_qualified_param);
bool visible = false;
- if (node) {
- if (node->track->marked_for_display()) {
+ if (track) {
+ if (track->marked_for_display()) {
visible = true;
}
}
CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&chn_items.back());
-
- if (node) {
- node->menu_item = cmi;
- }
-
+ _parameter_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
-
- parameter_menu_map[fully_qualified_param] = cmi;
}
}
/* add the per-channel menu to the list of controllers, with the name of the controller */
-
- ctl_items.push_back (MenuElem (midi_name (ctl), *chn_menu));
-
+ ctl_items.push_back (MenuElem (string_compose ("<b>%1</b>: %2", ctl, midi_name (ctl)), *chn_menu));
+ dynamic_cast<Label*> (ctl_items.back().get_child())->set_use_markup (true);
+
} else {
/* just one channel - create a single menu item for this ctl+channel combination*/
sigc::bind (sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),
fully_qualified_param)));
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ boost::shared_ptr<AutomationTimeAxisView> track = automation_child (fully_qualified_param);
bool visible = false;
- if (node) {
- if (node->track->marked_for_display()) {
+ if (track) {
+ if (track->marked_for_display()) {
visible = true;
}
}
CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&ctl_items.back());
- if (node) {
- node->menu_item = cmi;
- }
-
+ _parameter_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
-
- parameter_menu_map[fully_qualified_param] = cmi;
/* one channel only */
break;
}
/* add the menu for this block of controllers to the overall controller menu */
- items.push_back (MenuElem (string_compose (_("Controllers %1-%2"), i+1, i+16), *ctl_menu));
+ items.push_back (MenuElem (string_compose (_("Controllers %1-%2"), i, i+15), *ctl_menu));
}
}
_note_mode = mode;
midi_track()->set_note_mode(mode);
xml_node->add_property ("note-mode", enum_2_string(_note_mode));
- _view->redisplay_diskstream();
+ _view->redisplay_track();
}
}
_color_mode = mode;
xml_node->add_property ("color-mode", enum_2_string(_color_mode));
- _view->redisplay_diskstream();
+ _view->redisplay_track();
}
}
MidiTimeAxisView::show_all_automation ()
{
if (midi_track()) {
- const set<Evoral::Parameter> params = midi_track()->midi_diskstream()->
- midi_playlist()->contained_automation();
+ const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
create_automation_child(*i, true);
MidiTimeAxisView::show_existing_automation ()
{
if (midi_track()) {
- const set<Evoral::Parameter> params = midi_track()->midi_diskstream()->
- midi_playlist()->contained_automation();
+ const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
create_automation_child(*i, true);
const Tempo& t = _session->tempo_map().tempo_at(start);
double length = floor (m.frames_per_bar(t, _session->frame_rate()));
- const boost::shared_ptr<MidiDiskstream> diskstream =
- boost::dynamic_pointer_cast<MidiDiskstream>(view()->trackview().track()->diskstream());
-
- boost::shared_ptr<Source> src = _session->create_midi_source_for_session (*diskstream.get());
+ boost::shared_ptr<Source> src = _session->create_midi_source_for_session (view()->trackview().track()->name());
PropertyList plist;
for (uint32_t chn = 0; chn < 16; ++chn) {
Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl);
- RouteAutomationNode* node = automation_track (fully_qualified_param);
+ boost::shared_ptr<AutomationTimeAxisView> track = automation_child (fully_qualified_param);
- if (!node) {
+ if (!track) {
continue;
}
/* channel not in use. hiding it will trigger RouteTimeAxisView::automation_track_hidden()
which will cause a redraw. We don't want one per channel, so block that with no_redraw.
*/
- changed = node->track->set_visibility (false) || changed;
+ changed = track->set_visibility (false) || changed;
} else {
- changed = node->track->set_visibility (true) || changed;
+ changed = track->set_visibility (true) || changed;
}
}
}