26 #include <sigc++/bind.h>
109 , _ignore_signals(false)
111 , _piano_roll_header(0)
114 , _percussion_mode_item(0)
116 , _meter_color_mode_item(0)
117 , _channel_color_mode_item(0)
118 , _track_color_mode_item(0)
119 , _channel_selector (0)
120 , _step_edit_item (0)
121 , controller_menu (0)
165 controls_ebox.set_name (
"MidiTimeAxisViewControlsBaseUnselected");
217 HSeparator* separator = manage (
new HSeparator());
218 separator->set_name(
"TrackSeparator");
219 separator->set_size_request(-1, 1);
222 VBox* v = manage (
new VBox);
223 HBox* h = manage (
new HBox);
226 v->pack_start (*separator,
false,
false);
227 v->pack_start (*h,
true,
true);
275 PatchManager& patch_manager = PatchManager::instance();
277 for (PatchManager::DeviceNamesByMaker::const_iterator m = patch_manager.devices_by_manufacturer().begin();
278 m != patch_manager.devices_by_manufacturer().end(); ++m) {
279 Menu* menu = Gtk::manage(
new Menu);
280 Menu_Helpers::MenuList& items = menu->items();
283 for (MIDI::Name::MIDINameDocument::MasterDeviceNamesList::const_iterator n = m->second.begin();
284 n != m->second.end(); ++n) {
285 Menu_Helpers::MenuElem elem = Gtk::Menu_Helpers::MenuElem(
290 items.push_back(elem);
305 *device_names->custom_device_mode_names().begin());
319 channel_selector_button->set_name (
"route button");
334 if (!patch_manager.all_models().empty()) {
350 if (!color_mode.empty()) {
360 if (!note_mode.empty()) {
372 for (list<string>::const_iterator i = gui_ids.begin(); i != gui_ids.end(); ++i) {
378 *i, route_id, has_parameter, parameter);
379 if (p && route_id ==
_route->
id () && has_parameter) {
426 for (std::list<std::string>::const_iterator i = device_modes.begin();
427 i != device_modes.end(); ++i) {
429 Gtk::Menu_Helpers::MenuElem(
434 if (!device_modes.empty()) {
438 if (device_modes.size() > 1) {
444 if (device_modes.size() > 0) {
509 using namespace Menu_Helpers;
514 Menu *range_menu = manage(
new Menu);
515 MenuList& range_items = range_menu->items();
516 range_menu->set_name (
"ArdourContextMenu");
518 range_items.push_back (
519 MenuElem (
_(
"Show Full Range"),
523 range_items.push_back (
524 MenuElem (
_(
"Fit Contents"),
528 items.push_back (MenuElem (
_(
"Note Range"), *range_menu));
530 items.push_back (MenuElem (
_(
"Channel Selector"),
538 items.push_back (SeparatorElem ());
562 using namespace Menu_Helpers;
582 if (selected_channels != 0) {
584 automation_items.push_back (SeparatorElem());
595 automation_items.back().set_sensitive (
599 automation_items.back().set_sensitive (
611 automation_items.back().set_sensitive (
614 automation_items.push_back (
615 MenuElem (
string_compose (
"<i>%1</i>",
_(
"No MIDI Channels selected"))));
616 dynamic_cast<Label*
> (automation_items.back().get_child())->set_use_markup (
true);
625 for (uint8_t chn = 0; chn < 16; chn++) {
626 if (selected_channels & (0x0001 << chn)) {
632 menu->set_active (yn);
644 using namespace Menu_Helpers;
653 for (uint8_t chn = 0; chn < 16; chn++) {
654 if (selected_channels & (0x0001 << chn)) {
665 Menu* chn_menu = manage (
new Menu);
666 MenuList& chn_items (chn_menu->items());
671 chn_items.push_back (
672 MenuElem (
_(
"Hide all channels"),
674 false, param_without_channel)));
675 chn_items.push_back (
676 MenuElem (
_(
"Show all channels"),
678 true, param_without_channel)));
680 for (uint8_t chn = 0; chn < 16; chn++) {
681 if (selected_channels & (0x0001 << chn)) {
686 chn_items.push_back (
689 fully_qualified_param)));
692 bool visible =
false;
700 Gtk::CheckMenuItem* cmi =
static_cast<Gtk::CheckMenuItem*
>(&chn_items.back());
702 cmi->set_active (visible);
708 items.push_back (MenuElem (label, *chn_menu));
714 for (uint8_t chn = 0; chn < 16; chn++) {
715 if (selected_channels & (0x0001 << chn)) {
719 CheckMenuElem (label,
721 fully_qualified_param)));
724 bool visible =
false;
732 Gtk::CheckMenuItem* cmi =
static_cast<Gtk::CheckMenuItem*
>(&items.back());
734 cmi->set_active (visible);
747 const std::string&
name)
749 using namespace Menu_Helpers;
752 for (uint8_t chn = 0; chn < 16; chn++) {
753 if (selected_channels & (0x0001 << chn)) {
756 ctl_items.push_back (
761 fully_qualified_param)));
762 dynamic_cast<Label*
> (ctl_items.back().get_child())->set_use_markup (
true);
765 fully_qualified_param);
767 bool visible =
false;
774 Gtk::CheckMenuItem* cmi =
static_cast<Gtk::CheckMenuItem*
>(&ctl_items.back());
776 cmi->set_active (visible);
788 const std::string&
name)
790 using namespace Menu_Helpers;
794 Menu* chn_menu = manage (
new Menu);
795 MenuList& chn_items (chn_menu->items());
800 chn_items.push_back (
801 MenuElem (
_(
"Hide all channels"),
803 false, param_without_channel)));
804 chn_items.push_back (
805 MenuElem (
_(
"Show all channels"),
807 true, param_without_channel)));
809 for (uint8_t chn = 0; chn < 16; chn++) {
810 if (selected_channels & (0x0001 << chn)) {
815 chn_items.push_back (
818 fully_qualified_param)));
821 fully_qualified_param);
822 bool visible =
false;
830 Gtk::CheckMenuItem* cmi =
static_cast<Gtk::CheckMenuItem*
>(&chn_items.back());
832 cmi->set_active (visible);
837 ctl_items.push_back (MenuElem (
string_compose (
"<b>%1</b>: %2", ctl, name),
839 dynamic_cast<Label*
> (ctl_items.back().get_child())->set_use_markup (
true);
852 return device_names->custom_device_mode_by_name(
864 .document_by_model(model);
866 return midnam->master_device_names(model);
875 using namespace Menu_Helpers;
897 for (uint8_t chn = 0; chn < 16; chn++) {
898 if (selected_channels & (0x0001 << chn)) {
908 if (device_names && !device_names->controls().empty()) {
910 unsigned n_items = 0;
911 unsigned n_groups = 0;
915 for (MasterDeviceNames::ControlNameLists::const_iterator l = device_names->controls().begin();
916 l != device_names->controls().end(); ++l) {
918 Menu* ctl_menu = NULL;
920 for (ControlNameList::Controls::const_iterator c = name_list->controls().begin();
921 c != name_list->controls().end();) {
922 const uint16_t ctl = c->second->number();
927 ctl_menu = manage (
new Menu);
930 MenuList& ctl_items (ctl_menu->items());
939 if (ctl_menu && (++n_items == 16 || c == name_list->controls().end())) {
943 (16 * n_groups), (16 * n_groups) + n_items - 1),
953 for (
int i = 0; i < 127; i += 16) {
954 Menu* ctl_menu = manage (
new Menu);
955 MenuList& ctl_items (ctl_menu->items());
957 for (
int ctl = i; ctl < i+16; ++ctl) {
983 using namespace Menu_Helpers;
986 MenuList& items = mode_menu->items();
987 mode_menu->set_name (
"ArdourContextMenu");
989 RadioMenuItem::Group mode_group;
991 RadioMenuElem (mode_group,
_(
"Sustained"),
998 RadioMenuElem (mode_group,
_(
"Percussive"),
1010 using namespace Menu_Helpers;
1013 MenuList& items = mode_menu->items();
1014 mode_menu->set_name (
"ArdourContextMenu");
1016 RadioMenuItem::Group mode_group;
1018 RadioMenuElem (mode_group,
_(
"Meter Colors"),
1025 RadioMenuElem (mode_group,
_(
"Channel Colors"),
1032 RadioMenuElem (mode_group,
_(
"Track Color"),
1044 if (apply_to_selection) {
1060 if (apply_to_selection) {
1087 if (apply_to_selection) {
1102 for (list<GhostRegion*>::iterator i =
ghosts.begin(); i !=
ghosts.end(); ++i) {
1103 if ((mgr = dynamic_cast<MidiGhostRegion*>(*i)) != 0) {
1114 if (apply_to_selection) {
1122 for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
1129 device_names && !device_names->controls().empty()) {
1130 const std::string device_mode =
gui_property (
X_(
"midnam-custom-device-mode"));
1132 for (uint32_t chn = 0; chn < 16; ++chn) {
1133 if ((selected_channels & (0x0001 << chn)) == 0) {
1145 chan_names->control_list_name());
1146 if (!control_names) {
1150 for (ControlNameList::Controls::const_iterator c = control_names->controls().begin();
1151 c != control_names->controls().end();
1153 const uint16_t ctl = c->second->number();
1171 if (apply_to_selection) {
1178 for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
1205 existing->second->set_marked_for_display (show);
1218 switch (param.
type()) {
1274 error <<
"MidiTimeAxisView: unknown automation child "
1275 << EventTypeMap::instance().to_symbol(param) <<
endmsg;
1291 controls_ebox.set_name (
"MidiTrackControlsBaseInactiveUnselected");
1303 controls_ebox.set_name (
"BusControlsBaseInactiveUnselected");
1401 dynamic_cast<MidiRegionView*
>(rv)->select_matching_notes (note, chn_mask,
false,
false);
1407 dynamic_cast<MidiRegionView*
>(rv)->select_matching_notes (note, chn_mask,
true,
false);
1413 dynamic_cast<MidiRegionView*
>(rv)->select_matching_notes (note, chn_mask,
true,
true);
1419 dynamic_cast<MidiRegionView*
>(rv)->toggle_matching_notes (note, chn_mask);
1426 dynamic_cast<MidiRegionView*
>(rv)->selection_as_notelist (selected,
false);
1428 std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > notes;
1431 for (sel_it = selected.
begin(); sel_it != selected.
end(); ++sel_it) {
1432 notes.insert (*sel_it);
1435 if (!notes.empty()) {
1436 selection.push_back (make_pair ((rv)->region()->
id(), notes));
1448 bool changed =
false;
1452 for (uint32_t ctl = 0; ctl < 127; ++ctl) {
1454 for (uint32_t chn = 0; chn < 16; ++chn) {
1462 if ((selected_channels & (0x0001 << chn)) == 0) {
1568 uint8_t channel = 0;
1574 for (uint16_t i = 0; i < 16; ++i) {
1575 if (chn_mask & (1<<i)) {
1581 if (chn_cnt == 16) {
1604 switch (
midi_track()->get_playback_channel_mode()) {
1620 switch (
midi_track()->get_capture_channel_mode()) {
StepEditor * _step_editor
boost::shared_ptr< ARDOUR::Playlist > playlist() const
#define MIDI_CTL_MSB_BANK
void set_route(boost::shared_ptr< ARDOUR::Route >)
int atoi(const string &s)
Force all events to a certain channel.
void custom_device_mode_changed(const std::string &mode)
std::multiset< NotePtr, EarlierNoteComparator > Notes
boost::shared_ptr< ARDOUR::MidiTrack > midi_track() const
static const uint32_t midi_channel_colors[16]
hue circle divided into 16 equal-looking parts, courtesy Thorsten Wilms
void set_channel_colors(const uint32_t new_channel_colors[16])
void extend_note_selection_region_view(RegionView *, uint8_t note, uint16_t chn_mask)
std::string get_string(const std::string &id, const std::string &prop_name, bool *empty=0)
virtual Gtk::CheckMenuItem * automation_child_menu_item(Evoral::Parameter)
PBD::Signal0< void > ChannelModeChanged
bool is_midi_track() const
bool paste(ARDOUR::framepos_t, const Selection &, PasteContext &ctx)
void begin_reversible_command(std::string cmd_name)
std::string gui_property(const std::string &property_name) const
#define MIDI_CTL_LSB_BANK
uint32_t num_selected_regionviews() const
MidiTimeAxisView(PublicEditor &, ARDOUR::Session *, ArdourCanvas::Canvas &canvas)
void capture_channel_mode_changed()
sigc::signal< void, RegionView * > RegionViewAdded
void add_note_selection(uint8_t note)
virtual void redisplay_track()=0
static const uint32_t MIDI_CONTROLS_BOX_MIN_HEIGHT
virtual bool have_idled() const =0
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
Gtk::Menu * controller_menu
static ARDOUR_UI * instance()
LIBARDOUR_API PBD::PropertyDescriptor< std::string > name
Gtk::RadioMenuItem * _meter_color_mode_item
Gtk::Menu * build_color_mode_menu()
Lists of selected things.
void set_external_instrument(const std::string &model, const std::string &mode)
void change_all_channel_tracks_visibility(bool yn, Evoral::Parameter param)
void add_command(Command *const cmd)
Gtk::VBox _midi_controls_box
void set_route(boost::shared_ptr< ARDOUR::Route >)
void append_extra_display_menu_items()
Representation of the interface of the Editor class.
std::list< std::string > custom_device_mode_names_by_model(std::string model_name)
Gtk::Label _playback_channel_status
LIBPBD_API Transmitter error
ArdourCanvas::Canvas & parent_canvas
void set_note_selection(uint8_t note)
std::ostream & endmsg(std::ostream &ostr)
uint16_t get_playback_channel_mask() const
Gtk::Menu * color_mode_menu
StreamView * view() const
void extend_note_selection(uint8_t note)
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
LIBARDOUR_API GQuark create_region
void contents_height_changed()
Gtk::Frame time_axis_frame
MidiChannelFilter & playback_filter()
void set_note_range(MidiStreamView::VisibleNoteRange range, bool apply_to_selection=false)
void note_range_changed()
virtual bool set_marked_for_display(bool)
sigc::signal< void > NoteRangeChanged
Gtk::Menu * build_note_mode_menu()
void add_multi_channel_controller_item(Gtk::Menu_Helpers::MenuList &ctl_items, int ctl, const std::string &name)
virtual void route_active_changed()
Gtk::Label _capture_channel_status
sigc::signal0< void > DragFinishing
virtual void show_existing_automation(bool apply_to_selection=false)
PBD::Signal0< void > ChannelMaskChanged
uint8_t get_channel_for_add() const
ARDOUR::NoteMode note_mode() const
void set_height(uint32_t h, TrackHeightMode m=OnlySelf)
void foreach_selected_regionview(sigc::slot< void, RegionView * > slot)
boost::shared_ptr< ARDOUR::MidiRegion > add_region(ARDOUR::framepos_t, ARDOUR::framecnt_t, bool)
std::string controls_base_selected_name
void set_default_channel_color()
void get_per_region_note_selection_region_view(RegionView *, std::list< std::pair< PBD::ID, std::set< boost::shared_ptr< Evoral::Note< Evoral::Beats > > > > > &)
void create_gain_automation_child(const Evoral::Parameter &, bool)
boost::shared_ptr< ARDOUR::Route > _route
static bool parse_state_id(std::string const &, PBD::ID &, bool &, Evoral::Parameter &)
void add_region(boost::shared_ptr< Region >, framepos_t position, float times=1, bool auto_partition=false)
void set_note_mode(NoteMode m)
void foreach_regionview(sigc::slot< void, RegionView * > slot)
uint32_t gdk_color_to_rgba(Gdk::Color const &)
boost::shared_ptr< MIDI::Name::CustomDeviceMode > get_device_mode()
ParameterMenuMap _channel_command_menu_map
#define string_2_enum(str, e)
ArdourDropdown _midnam_model_selector
void add_ghost(RegionView *)
ArdourDropdown _midnam_custom_device_mode_selector
Gtk::Fixed scroomer_placeholder
sigc::signal0< void > DoubleClicked
MidiChannelFilter & capture_filter()
virtual std::string describe_parameter(Evoral::Parameter param)
void start_step_editing()
bool string_is_affirmative(const std::string &str)
virtual void show_all_automation(bool apply_to_selection=false)
void show_all_automation(bool apply_to_selection=false)
const const_iterator & end() const
const PBD::ID & id() const
sigc::signal0< void > DragStarting
boost::shared_ptr< ARDOUR::Track > track() const
void region_view_added(RegionView *)
void add_single_channel_controller_item(Gtk::Menu_Helpers::MenuList &ctl_items, int ctl, const std::string &name)
sigc::signal< void > ContentsHeightChanged
void add_channel_command_menu_item(Gtk::Menu_Helpers::MenuList &items, const std::string &label, ARDOUR::AutomationType auto_type, uint8_t cmd)
bool paste(ARDOUR::framepos_t pos, const Selection &selection, PasteContext &ctx)
void playback_channel_mode_changed()
void get_per_region_note_selection(std::list< std::pair< PBD::ID, std::set< boost::shared_ptr< Evoral::Note< Evoral::Beats > > > > > &)
void create_automation_child(const Evoral::Parameter ¶m, bool show)
virtual Selection & get_selection() const =0
void add_automation_child(Evoral::Parameter param, boost::shared_ptr< AutomationTimeAxisView > track, bool show=true)
PianoRollHeader * _piano_roll_header
void model_changed(const std::string &model)
void ensure_pan_views(bool show=true)
NoteMode note_mode() const
boost::shared_ptr< PannerShell > panner_shell() const
static GUIObjectState & gui_object_state()
AutomationTracks _automation_tracks
Gtk::Menu * automation_action_menu
void set_note_mode(ARDOUR::NoteMode mode, bool apply_to_selection=false)
std::list< GhostRegion * > ghosts
void set_tip(Gtk::Widget &w, const gchar *tip)
void apply_note_range(uint8_t lowest, uint8_t highest, bool to_region_views)
void build_controller_menu()
ARDOUR::ColorMode _color_mode
void processors_changed(ARDOUR::RouteProcessorChange)
virtual void build_automation_action_menu(bool)
LIBPBD_API Glib::ustring basename_nosuffix(Glib::ustring)
PBD::Signal1< void, RouteProcessorChange > processors_changed
void create_mute_automation_child(const Evoral::Parameter &, bool)
void set_height(uint32_t, TrackHeightMode m=OnlySelf)
virtual bool internal_editing() const =0
Gtk::RadioMenuItem * _note_mode_item
Gtk::RadioMenuItem * _channel_color_mode_item
void toggle_note_selection(uint8_t note)
void ensure_step_editor()
void toggle_channel_selector()
static const uint32_t KEYBOARD_MIN_HEIGHT
const_iterator begin(Time t=Time(), bool force_discrete=false, const std::set< Evoral::Parameter > &f=std::set< Evoral::Parameter >(), const std::set< WeakNotePtr > *active_notes=NULL) const
boost::shared_ptr< AutomationTimeAxisView > automation_child(Evoral::Parameter param)
void set_color_mode(ARDOUR::ColorMode, bool force=false, bool redisplay=true, bool apply_to_selection=false)
void set_note_range(VisibleNoteRange r)
Gtk::CheckMenuItem * automation_child_menu_item(Evoral::Parameter)
boost::shared_ptr< MidiSource > create_midi_source_by_stealing_name(boost::shared_ptr< Track >)
void route_active_changed()
Pass through all channel information unmodified.
boost::shared_ptr< AutomationControl > automation_control(const Evoral::Parameter &id, bool create_if_missing=false)
virtual ~MidiTimeAxisView()
void start_step_editing()
void toggle_note_selection_region_view(RegionView *, uint8_t note, uint16_t chn_mask)
std::string controls_base_unselected_name
void set_gui_property(const std::string &property_name, const T &value)
std::list< std::string > all_ids() const
InstrumentInfo & instrument_info()
Gtk::RadioMenuItem * _percussion_mode_item
void commit_reversible_command()
bool paste(ARDOUR::framepos_t, const Selection &, PasteContext &ctx)
virtual void begin_reversible_selection_op(std::string cmd_name)=0
MidiChannelSelectorWindow * _channel_selector
boost::shared_ptr< MIDI::Name::MasterDeviceNames > get_device_names()
void show_existing_automation(bool apply_to_selection=false)
void apply_color(uint32_t, ColorTarget t)
bool marked_for_display() const
LIBGTKMM2EXT_API void detach_menu(Gtk::Menu &)
void add_note_selection_region_view(RegionView *rv, uint8_t note, uint16_t chn_mask)
void set_note_selection_region_view(RegionView *rv, uint8_t note, uint16_t chn_mask)
Gtk::EventBox controls_ebox
static MidiPatchManager & instance()
ARDOUR::NoteMode _note_mode
bool add(PropertyBase *prop)
ARDOUR::Session * _session
MidiStreamView * midi_view()
static Glib::RefPtr< Gtk::SizeGroup > midi_scroomer_size_group
ParameterMenuMap _controller_menu_map
void AddMenuElem(Gtk::Menu_Helpers::MenuElem e)
boost::shared_ptr< MidiPlaylist > midi_playlist()
std::string string_compose(const std::string &fmt, const T1 &o1)
void set_channel_mode(ARDOUR::ChannelMode, uint16_t)
ARDOUR::ColorMode color_mode() const
Ignore events on certain channels.
virtual void commit_reversible_selection_op()=0
void build_automation_action_menu(bool)
void foreach_midi_time_axis(Function f)
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
Gtk::HBox _channel_status_box
void snap_to(framepos_t &first, ARDOUR::RoundMode direction=ARDOUR::RoundNearest, bool for_mark=false)
MidiScroomer * _range_scroomer
void toggle_automation_track(const Evoral::Parameter ¶m)