MidiViewBackground now has a virtual method to access instrument info
This commit is contained in:
@@ -92,6 +92,17 @@ MidiStreamView::~MidiStreamView ()
|
||||
undisplay_track ();
|
||||
}
|
||||
|
||||
InstrumentInfo*
|
||||
MidiStreamView::instrument_info() const
|
||||
{
|
||||
std::shared_ptr<Route> r = _trackview.route();
|
||||
if (!r) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &r->instrument_info();
|
||||
}
|
||||
|
||||
void
|
||||
MidiStreamView::parameter_changed (string const & param)
|
||||
{
|
||||
|
||||
@@ -89,6 +89,8 @@ public:
|
||||
void record_layer_check (std::shared_ptr<ARDOUR::Region>, samplepos_t);
|
||||
void set_note_highlight (bool);
|
||||
|
||||
ARDOUR::InstrumentInfo* instrument_info() const;
|
||||
|
||||
protected:
|
||||
void setup_rec_box ();
|
||||
void update_rec_box ();
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
|
||||
#include "view_background.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class InstrumentInfo;
|
||||
}
|
||||
|
||||
namespace ArdourCanvas {
|
||||
class Item;
|
||||
class LineSet;
|
||||
@@ -117,6 +121,8 @@ class MidiViewBackground : public virtual ViewBackground
|
||||
virtual void set_size (double w, double h) {}
|
||||
PBD::Signal<void()> HeightChanged;
|
||||
|
||||
virtual ARDOUR::InstrumentInfo* instrument_info() const = 0;
|
||||
|
||||
protected:
|
||||
bool _range_dirty;
|
||||
double _range_sum_cache;
|
||||
|
||||
@@ -490,6 +490,8 @@ Pianoroll::set_visible_channel (int n)
|
||||
view->set_visible_channel (n);
|
||||
view->swap_automation_channel (n);
|
||||
}
|
||||
|
||||
prh->instrument_info_change ();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3021,3 +3023,13 @@ Pianoroll::shift_midi (timepos_t const & t, bool model)
|
||||
|
||||
view->shift_midi (t, model);
|
||||
}
|
||||
|
||||
InstrumentInfo*
|
||||
Pianoroll::instrument_info () const
|
||||
{
|
||||
if (!view || !view->midi_track()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &view->midi_track()->instrument_info ();
|
||||
}
|
||||
|
||||
@@ -147,6 +147,8 @@ class Pianoroll : public CueEditor
|
||||
void shift_midi (Temporal::timepos_t const &, bool model);
|
||||
void make_a_region();
|
||||
|
||||
ARDOUR::InstrumentInfo* instrument_info() const;
|
||||
|
||||
protected:
|
||||
void load_bindings ();
|
||||
void register_actions ();
|
||||
|
||||
@@ -66,6 +66,12 @@ PianorollMidiBackground::width() const
|
||||
return _width;
|
||||
}
|
||||
|
||||
ARDOUR::InstrumentInfo*
|
||||
PianorollMidiBackground::instrument_info () const
|
||||
{
|
||||
return pianoroll.instrument_info ();
|
||||
}
|
||||
|
||||
uint8_t
|
||||
PianorollMidiBackground::get_preferred_midi_channel () const
|
||||
{
|
||||
|
||||
@@ -50,6 +50,8 @@ class PianorollMidiBackground : public MidiViewBackground
|
||||
void set_size (double w, double h);
|
||||
void set_view (MidiView*);
|
||||
|
||||
ARDOUR::InstrumentInfo* instrument_info() const;
|
||||
|
||||
protected:
|
||||
MidiView* view;
|
||||
Pianoroll& pianoroll;
|
||||
|
||||
Reference in New Issue
Block a user