MIDI branch becomes trunk
[ardour.git] / gtk2_ardour / midi_region_view.h
1 /*
2     Copyright (C) 2001-2006 Paul Davis 
3
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.
8
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.
13
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.
17 */
18
19 #ifndef __gtk_ardour_midi_region_view_h__
20 #define __gtk_ardour_midi_region_view_h__
21
22 #include <vector>
23
24 #include <libgnomecanvasmm.h>
25 #include <libgnomecanvasmm/polygon.h>
26 #include <sigc++/signal.h>
27 #include <ardour/midi_region.h>
28
29 #include "region_view.h"
30 #include "route_time_axis.h"
31 #include "time_axis_view_item.h"
32 #include "automation_line.h"
33 #include "enums.h"
34 #include "canvas.h"
35 #include "color.h"
36
37 namespace ARDOUR {
38         class MidiRegion;
39 };
40
41 class MidiTimeAxisView;
42 class GhostRegion;
43 class AutomationTimeAxisView;
44
45 class MidiRegionView : public RegionView
46 {
47   public:
48         MidiRegionView (ArdourCanvas::Group *, 
49                         RouteTimeAxisView&,
50                         boost::shared_ptr<ARDOUR::MidiRegion>,
51                         double initial_samples_per_unit,
52                         Gdk::Color& basic_color);
53
54         ~MidiRegionView ();
55         
56         virtual void init (Gdk::Color& base_color, bool wait_for_data = false);
57         
58         boost::shared_ptr<ARDOUR::MidiRegion> midi_region() const;
59     
60     void show_region_editor ();
61
62     GhostRegion* add_ghost (AutomationTimeAxisView&);
63
64   protected:
65
66     /* this constructor allows derived types
67        to specify their visibility requirements
68        to the TimeAxisViewItem parent class
69     */
70     
71     MidiRegionView (ArdourCanvas::Group *, 
72                         RouteTimeAxisView&,
73                         boost::shared_ptr<ARDOUR::MidiRegion>,
74                         double samples_per_unit,
75                         Gdk::Color& basic_color,
76                         TimeAxisViewItem::Visibility);
77     
78     void region_moved (void *);
79
80     void set_flags (XMLNode *);
81     void store_flags ();
82 };
83
84 #endif /* __gtk_ardour_midi_region_view_h__ */