2 Copyright (C) 2001-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __gtk_ardour_midi_region_view_h__
20 #define __gtk_ardour_midi_region_view_h__
24 #include <libgnomecanvasmm.h>
25 #include <libgnomecanvasmm/polygon.h>
26 #include <sigc++/signal.h>
27 #include <ardour/midi_region.h>
28 #include <ardour/types.h>
30 #include "region_view.h"
31 #include "route_time_axis.h"
32 #include "time_axis_view_item.h"
33 #include "automation_line.h"
41 class MidiTimeAxisView;
43 class AutomationTimeAxisView;
45 class MidiRegionView : public RegionView
48 MidiRegionView (ArdourCanvas::Group *,
50 boost::shared_ptr<ARDOUR::MidiRegion>,
51 double initial_samples_per_unit,
52 Gdk::Color& basic_color);
56 virtual void init (Gdk::Color& base_color, bool wait_for_data = false);
58 boost::shared_ptr<ARDOUR::MidiRegion> midi_region() const;
60 void set_y_position_and_height (double, double);
62 void show_region_editor ();
64 GhostRegion* add_ghost (AutomationTimeAxisView&);
66 void add_event(const ARDOUR::MidiEvent& ev);
70 void extend_active_notes();
74 /* this constructor allows derived types
75 to specify their visibility requirements
76 to the TimeAxisViewItem parent class
79 MidiRegionView (ArdourCanvas::Group *,
81 boost::shared_ptr<ARDOUR::MidiRegion>,
82 double samples_per_unit,
83 Gdk::Color& basic_color,
84 TimeAxisViewItem::Visibility);
86 void region_resized (ARDOUR::Change);
88 void set_flags (XMLNode *);
91 void reset_width_dependent_items (double pixel_width);
95 void display_events();
97 std::vector<ArdourCanvas::Item*> _events;
98 ArdourCanvas::SimpleRect** _active_notes;
101 #endif /* __gtk_ardour_midi_region_view_h__ */