26 #include "canvas/line_set.h"
27 #include "canvas/rectangle.h"
61 , note_range_adjustment(0.0
f, 0.0
f, 0.0
f)
63 , _range_sum_cache(-1.0)
69 , _updates_suspended (false)
122 region_view->
init (
false);
137 if ((*i)->region() == r) {
141 (*i)->set_valid (
true);
150 if (region_view == 0) {
185 error <<
_(
"attempt to display MIDI region with no source") <<
endmsg;
191 source->load_model(lm);
194 if (!source->model()) {
195 error <<
_(
"attempt to display MIDI region with no model") <<
endmsg;
200 source->model()->lowest_note(),
201 source->model()->highest_note());
226 mr->
model()->lowest_note(),
227 mr->
model()->highest_note());
253 list<RegionView*>::iterator i;
270 (*i)->set_valid(
false);
271 (*i)->enable_display(
false);
347 double h = y - prev_y;
348 double mid = y + (h/2.0);
378 int const max_note_height = 20;
380 int const pixels_per_note = floor (
child_height () / range);
383 if (pixels_per_note > max_note_height) {
385 int const available_note_range = floor (
child_height() / max_note_height);
386 int additional_notes = available_note_range - range;
389 for (
int i = 0; i < additional_notes; i++){
397 else if (_lowest_note > 0){
411 if (to_region_views) {
490 (RegionFactory::create (sources, plist,
false)));
537 list<pair<boost::shared_ptr<Region>,
RegionView*> >::iterator tmp;
542 (*iter).first->drop_references ();
552 for (vector<RecBoxInfo>::iterator iter=
rec_rects.begin(); iter !=
rec_rects.end(); ++iter) {
584 highest = (int) floor(sum);
628 }
else if (n > 127) {
676 list<RegionView*>::const_iterator prev =
region_views.begin ();
679 if ((*i)->region()->position() > pos) {
693 return mrv ? mrv->
paste(pos, selection, ctx) :
false;
PBD::ScopedConnectionList rec_data_ready_connections
framepos_t get_capture_start_frame(uint32_t n=0) const
bool transport_rolling() const
void display_track(boost::shared_ptr< ARDOUR::Track > tr)
std::list< std::pair< boost::shared_ptr< ARDOUR::Region >, RegionView * > > rec_regions
virtual void update_contents_height()
boost::shared_ptr< ARDOUR::MidiTrack > midi_track() const
PBD::Signal0< void > DropReferences
PublicEditor & editor() const
void setup_new_rec_layer_time(boost::shared_ptr< ARDOUR::Region >)
void note_range_adjustment_changed()
bool is_midi_track() const
LIBARDOUR_API PBD::PropertyDescriptor< layer_t > layer
sigc::signal< void, RegionView * > RegionViewAdded
virtual bool canvas_stream_view_event(GdkEvent *event, ArdourCanvas::Item *, RouteTimeAxisView *)=0
void update_contents_height()
double _samples_per_pixel
bool update_data_note_range(uint8_t min, uint8_t max)
uint8_t _data_note_max
in data
ArdourCanvas::Container * _canvas_group
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
LIBARDOUR_API PBD::PropertyDescriptor< std::string > name
Lists of selected things.
void display_track(boost::shared_ptr< ARDOUR::Track >)
framecnt_t get_captured_frames(uint32_t n=0) const
framepos_t current_capture_end() const
LIBPBD_API Transmitter error
std::ostream & endmsg(std::ostream &ostr)
RegionView * add_region_view_internal(boost::shared_ptr< ARDOUR::Region >, bool wait_for_waves, bool recording=false)
bool operator()(RegionView *a, RegionView *b)
RecordState record_status() const
virtual void remove_region_view(boost::weak_ptr< ARDOUR::Region >)
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
std::vector< RecBoxInfo > rec_rects
LIBARDOUR_API GQuark insert_file
sigc::signal< void > NoteRangeChanged
uint8_t lowest_note() const
bool operation_in_progress(GQuark) const
uint8_t contents_note_range() const
uint8_t _data_note_min
in data
RegionView * create_region_view(boost::shared_ptr< ARDOUR::Region >, bool, bool)
void set_position(framepos_t)
boost::shared_ptr< ARDOUR::Region > region() const
void update_contents_metrics(boost::shared_ptr< ARDOUR::Region > r)
uint8_t _lowest_note
currently visible
const boost::shared_ptr< ARDOUR::MidiRegion > midi_region() const
virtual void update_rec_box()
virtual void init(bool wait_for_data)
void display_model(boost::shared_ptr< ARDOUR::MidiModel > model)
framepos_t transport_frame() const
ARDOUR::Session * session() const
ArdourCanvas::Rectangle * rectangle
boost::shared_ptr< ARDOUR::Track > track() const
void extend_active_notes()
boost::shared_ptr< Playlist > playlist()
void update_note_range(uint8_t note_num)
bool paste(ARDOUR::framepos_t pos, const Selection &selection, PasteContext &ctx)
bool record_enabled() const
void foreach_region(boost::function< void(boost::shared_ptr< Region >)>)
RouteTimeAxisView & _trackview
void create_rec_box(framepos_t frame_pos, double width)
RegionViewList region_views
MidiStreamView(MidiTimeAxisView &)
framepos_t position() const
void apply_note_range(uint8_t lowest, uint8_t highest, bool to_region_views)
sigc::connection screen_update_connection
ArdourCanvas::Rectangle * canvas_rect
uint8_t _highest_note
currently visible
boost::shared_ptr< SMFSource > write_source(uint32_t n=0)
double child_height() const
double note_to_y(uint8_t note) const
void enable_display(bool)
double note_height() const
void set_length(framecnt_t)
ArdourCanvas::Color color_mod(std::string const &color, std::string const &modifier) const
LIBARDOUR_API PBD::PropertyDescriptor< Evoral::Beats > length_beats
static UIConfiguration * config()
virtual void update_contents_metrics(boost::shared_ptr< ARDOUR::Region >)
void add_region_view(boost::weak_ptr< ARDOUR::Region >)
void set_note_range(VisibleNoteRange r)
uint8_t highest_note() const
sigc::signal< void > ColorsChanged
uint8_t y_to_note(double y) const
bool paste(framepos_t pos, const ::Selection &selection, PasteContext &ctx)
void display_region(MidiRegionView *region_view, bool load_model)
framecnt_t length() const
boost::shared_ptr< MidiSource > midi_source(uint32_t n=0) const
ArdourCanvas::LineSet * _note_lines
double contents_height() const
void apply_note_range_to_regions()
uint32_t region_color
Contained region color.
Gtk::Adjustment note_range_adjustment
std::vector< boost::shared_ptr< Source > > SourceList
bool add(PropertyBase *prop)
boost::shared_ptr< MidiModel > model()
framepos_t current_capture_start() const
ArdourCanvas::Container * midi_underlay_group
void set_start(framepos_t)
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
LIBARDOUR_API PBD::PropertyDescriptor< bool > color