mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
remove unusued "MIDI underlay" cruft
This commit is contained in:
parent
0b050c47e4
commit
2797ea9666
9 changed files with 5 additions and 176 deletions
|
|
@ -1651,10 +1651,6 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item_type == StreamItem && clicked_routeview) {
|
|
||||||
clicked_routeview->build_underlay_menu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* When the region menu is opened, we setup the actions so that they look right
|
/* When the region menu is opened, we setup the actions so that they look right
|
||||||
in the menu.
|
in the menu.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -197,29 +197,6 @@ MidiGhostRegion::MidiGhostRegion(MidiRegionView& rv,
|
||||||
base_rect->lower_to_bottom();
|
base_rect->lower_to_bottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rv The parent RegionView being ghosted.
|
|
||||||
* @param msv MidiStreamView that this ghost region is on.
|
|
||||||
* @param source_tv TimeAxisView that we are the ghost for.
|
|
||||||
*/
|
|
||||||
MidiGhostRegion::MidiGhostRegion(MidiRegionView& rv,
|
|
||||||
MidiStreamView& msv,
|
|
||||||
TimeAxisView& source_tv,
|
|
||||||
double initial_unit_pos)
|
|
||||||
: GhostRegion (rv,
|
|
||||||
msv.midi_underlay(),
|
|
||||||
msv.trackview(),
|
|
||||||
source_tv,
|
|
||||||
initial_unit_pos)
|
|
||||||
, _note_group (new ArdourCanvas::Container (group))
|
|
||||||
, parent_mrv (rv)
|
|
||||||
, _optimization_iterator(events.end())
|
|
||||||
{
|
|
||||||
_outline = UIConfiguration::instance().color ("ghost track midi outline");
|
|
||||||
|
|
||||||
base_rect->lower_to_bottom();
|
|
||||||
}
|
|
||||||
|
|
||||||
MidiGhostRegion::~MidiGhostRegion()
|
MidiGhostRegion::~MidiGhostRegion()
|
||||||
{
|
{
|
||||||
clear_events ();
|
clear_events ();
|
||||||
|
|
|
||||||
|
|
@ -102,13 +102,7 @@ public:
|
||||||
TimeAxisView& source_tv,
|
TimeAxisView& source_tv,
|
||||||
double initial_unit_pos);
|
double initial_unit_pos);
|
||||||
|
|
||||||
MidiGhostRegion(MidiRegionView& rv,
|
|
||||||
MidiStreamView& msv,
|
|
||||||
TimeAxisView& source_tv,
|
|
||||||
double initial_unit_pos);
|
|
||||||
|
|
||||||
~MidiGhostRegion();
|
~MidiGhostRegion();
|
||||||
|
|
||||||
MidiStreamView* midi_view();
|
MidiStreamView* midi_view();
|
||||||
|
|
||||||
void set_height();
|
void set_height();
|
||||||
|
|
|
||||||
|
|
@ -1625,11 +1625,11 @@ MidiRegionView::add_ghost (TimeAxisView& tv)
|
||||||
MidiGhostRegion* ghost;
|
MidiGhostRegion* ghost;
|
||||||
|
|
||||||
if (mtv && mtv->midi_view()) {
|
if (mtv && mtv->midi_view()) {
|
||||||
/* if ghost is inserted into midi track, use a dedicated midi ghost canvas group
|
std::cerr << "AG#1\n";
|
||||||
to allow having midi notes on top of note lines and waveforms.
|
return 0;
|
||||||
*/
|
|
||||||
ghost = new MidiGhostRegion (*this, *mtv->midi_view(), trackview, unit_position);
|
|
||||||
} else {
|
} else {
|
||||||
|
std::cerr << "AG#2\n";
|
||||||
|
PBD::stacktrace (std::cerr, 35);
|
||||||
ghost = new MidiGhostRegion (*this, tv, trackview, unit_position);
|
ghost = new MidiGhostRegion (*this, tv, trackview, unit_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,6 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
||||||
, _note_lines (0)
|
, _note_lines (0)
|
||||||
, _updates_suspended (false)
|
, _updates_suspended (false)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */
|
|
||||||
_midi_underlay = new ArdourCanvas::Container (_canvas_group);
|
|
||||||
_midi_underlay->lower_to_bottom();
|
|
||||||
|
|
||||||
/* use a dedicated group for MIDI regions (on top of the grid and lines) */
|
/* use a dedicated group for MIDI regions (on top of the grid and lines) */
|
||||||
_region_group = new ArdourCanvas::Container (_canvas_group);
|
_region_group = new ArdourCanvas::Container (_canvas_group);
|
||||||
_region_group->raise_to_top ();
|
_region_group->raise_to_top ();
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@ public:
|
||||||
void suspend_updates ();
|
void suspend_updates ();
|
||||||
void resume_updates ();
|
void resume_updates ();
|
||||||
|
|
||||||
ArdourCanvas::Container* midi_underlay () const { return _midi_underlay; }
|
|
||||||
ArdourCanvas::Container* region_canvas () const { return _region_group; }
|
ArdourCanvas::Container* region_canvas () const { return _region_group; }
|
||||||
|
|
||||||
void parameter_changed (std::string const &);
|
void parameter_changed (std::string const &);
|
||||||
|
|
@ -122,7 +121,6 @@ protected:
|
||||||
void setup_rec_box ();
|
void setup_rec_box ();
|
||||||
void update_rec_box ();
|
void update_rec_box ();
|
||||||
|
|
||||||
ArdourCanvas::Container* _midi_underlay;
|
|
||||||
ArdourCanvas::Container* _region_group;
|
ArdourCanvas::Container* _region_group;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -1400,6 +1400,7 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
||||||
_route->describe_parameter(param)));
|
_route->describe_parameter(param)));
|
||||||
|
|
||||||
if (_view) {
|
if (_view) {
|
||||||
|
std::cerr << "Adding ghosts of each MIDI region\n";
|
||||||
_view->foreach_regionview (sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost));
|
_view->foreach_regionview (sigc::mem_fun (*track.get(), &TimeAxisView::add_ghost));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1704,10 +1704,6 @@ RouteTimeAxisView::region_view_added (RegionView* rv)
|
||||||
atv->add_ghost(rv);
|
atv->add_ghost(rv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UnderlayMirrorList::iterator i = _underlay_mirrors.begin(); i != _underlay_mirrors.end(); ++i) {
|
|
||||||
(*i)->add_ghost(rv);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RouteTimeAxisView::ProcessorAutomationInfo::~ProcessorAutomationInfo ()
|
RouteTimeAxisView::ProcessorAutomationInfo::~ProcessorAutomationInfo ()
|
||||||
|
|
@ -2297,122 +2293,6 @@ RouteTimeAxisView::chan_count_changed ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
RouteTimeAxisView::build_underlay_menu(Gtk::Menu* parent_menu)
|
|
||||||
{
|
|
||||||
using namespace Menu_Helpers;
|
|
||||||
|
|
||||||
if (!_underlay_streams.empty()) {
|
|
||||||
MenuList& parent_items = parent_menu->items();
|
|
||||||
Menu* gs_menu = manage (new Menu);
|
|
||||||
gs_menu->set_name ("ArdourContextMenu");
|
|
||||||
MenuList& gs_items = gs_menu->items();
|
|
||||||
|
|
||||||
parent_items.push_back (MenuElem (_("Underlays"), *gs_menu));
|
|
||||||
|
|
||||||
for(UnderlayList::iterator it = _underlay_streams.begin(); it != _underlay_streams.end(); ++it) {
|
|
||||||
gs_items.push_back(MenuElem(string_compose(_("Remove \"%1\""), (*it)->trackview().name()),
|
|
||||||
sigc::bind(sigc::mem_fun(*this, &RouteTimeAxisView::remove_underlay), *it)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
RouteTimeAxisView::set_underlay_state()
|
|
||||||
{
|
|
||||||
if (!underlay_xml_node) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLNodeList nlist = underlay_xml_node->children();
|
|
||||||
XMLNodeConstIterator niter;
|
|
||||||
XMLNode *child_node;
|
|
||||||
|
|
||||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
|
||||||
child_node = *niter;
|
|
||||||
|
|
||||||
if (child_node->name() != "Underlay") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLProperty const * prop = child_node->property ("id");
|
|
||||||
if (prop) {
|
|
||||||
PBD::ID id (prop->value());
|
|
||||||
|
|
||||||
StripableTimeAxisView* v = _editor.get_stripable_time_axis_by_id (id);
|
|
||||||
|
|
||||||
if (v) {
|
|
||||||
add_underlay(v->view(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
RouteTimeAxisView::add_underlay (StreamView* v, bool /*update_xml*/)
|
|
||||||
{
|
|
||||||
if (!v) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RouteTimeAxisView& other = v->trackview();
|
|
||||||
|
|
||||||
if (find(_underlay_streams.begin(), _underlay_streams.end(), v) == _underlay_streams.end()) {
|
|
||||||
if (find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this) != other._underlay_mirrors.end()) {
|
|
||||||
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
|
|
||||||
abort(); /*NOTREACHED*/
|
|
||||||
}
|
|
||||||
|
|
||||||
_underlay_streams.push_back(v);
|
|
||||||
other._underlay_mirrors.push_back(this);
|
|
||||||
|
|
||||||
v->foreach_regionview(sigc::mem_fun(*this, &RouteTimeAxisView::add_ghost));
|
|
||||||
|
|
||||||
#ifdef GUI_OBJECT_STATE_FIX_REQUIRED
|
|
||||||
if (update_xml) {
|
|
||||||
if (!underlay_xml_node) {
|
|
||||||
underlay_xml_node = xml_node->add_child("Underlays");
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLNode* node = underlay_xml_node->add_child("Underlay");
|
|
||||||
XMLProperty const * prop = node->add_property("id");
|
|
||||||
prop->set_value(v->trackview().route()->id().to_s());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
RouteTimeAxisView::remove_underlay (StreamView* v)
|
|
||||||
{
|
|
||||||
if (!v) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UnderlayList::iterator it = find(_underlay_streams.begin(), _underlay_streams.end(), v);
|
|
||||||
RouteTimeAxisView& other = v->trackview();
|
|
||||||
|
|
||||||
if (it != _underlay_streams.end()) {
|
|
||||||
UnderlayMirrorList::iterator gm = find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this);
|
|
||||||
|
|
||||||
if (gm == other._underlay_mirrors.end()) {
|
|
||||||
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
|
|
||||||
abort(); /*NOTREACHED*/
|
|
||||||
}
|
|
||||||
|
|
||||||
v->foreach_regionview(sigc::mem_fun(*this, &RouteTimeAxisView::remove_ghost));
|
|
||||||
|
|
||||||
_underlay_streams.erase(it);
|
|
||||||
other._underlay_mirrors.erase(gm);
|
|
||||||
|
|
||||||
if (underlay_xml_node) {
|
|
||||||
underlay_xml_node->remove_nodes_and_delete("id", v->trackview().route()->id().to_s());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::set_button_names ()
|
RouteTimeAxisView::set_button_names ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,6 @@ public:
|
||||||
void toggle_automation_track (const Evoral::Parameter& param);
|
void toggle_automation_track (const Evoral::Parameter& param);
|
||||||
void fade_range (TimeSelection&);
|
void fade_range (TimeSelection&);
|
||||||
|
|
||||||
void add_underlay (StreamView*, bool update_xml = true);
|
|
||||||
void remove_underlay (StreamView*);
|
|
||||||
void build_underlay_menu(Gtk::Menu*);
|
|
||||||
|
|
||||||
int set_state (const XMLNode&, int version);
|
int set_state (const XMLNode&, int version);
|
||||||
|
|
||||||
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
||||||
|
|
@ -283,14 +279,6 @@ protected:
|
||||||
|
|
||||||
GainMeterBase gm;
|
GainMeterBase gm;
|
||||||
|
|
||||||
XMLNode* underlay_xml_node;
|
|
||||||
bool set_underlay_state();
|
|
||||||
|
|
||||||
typedef std::list<StreamView*> UnderlayList;
|
|
||||||
UnderlayList _underlay_streams;
|
|
||||||
typedef std::list<RouteTimeAxisView*> UnderlayMirrorList;
|
|
||||||
UnderlayMirrorList _underlay_mirrors;
|
|
||||||
|
|
||||||
bool _ignore_set_layer_display;
|
bool _ignore_set_layer_display;
|
||||||
void layer_display_menu_change (Gtk::MenuItem* item);
|
void layer_display_menu_change (Gtk::MenuItem* item);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue