2 Copyright (C) 2004 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.
20 #ifndef __ardour_gtk_ghost_region_h__
21 #define __ardour_gtk_ghost_region_h__
24 #include <sigc++/signal.h>
25 #include <libgnomecanvasmm.h>
26 #include <ardour/configuration.h>
31 class CanvasMidiEvent;
41 class GhostRegion : public sigc::trackable
44 GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
45 virtual ~GhostRegion();
47 virtual void set_samples_per_unit(double spu) = 0;
48 virtual void set_height();
49 virtual void set_colors();
51 void set_duration(double units);
53 guint source_track_color(unsigned char alpha = 0xff);
54 bool is_automation_ghost();
56 sigc::signal<void,GhostRegion*> GoingAway;
58 TimeAxisView& trackview;
59 TimeAxisView& source_trackview;
60 ArdourCanvas::Group* group;
61 ArdourCanvas::SimpleRect* base_rect;
64 class AudioGhostRegion : public GhostRegion {
66 AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
68 void set_samples_per_unit(double spu);
72 std::vector<ArdourCanvas::WaveView*> waves;
75 class MidiGhostRegion : public GhostRegion {
77 class Event : public sigc::trackable {
79 Event(ArdourCanvas::CanvasMidiEvent*);
82 virtual void x_changed() = 0;
83 ArdourCanvas::CanvasMidiEvent* event;
86 class Note : public Event {
88 Note(ArdourCanvas::CanvasNote*, ArdourCanvas::Group*);
92 ArdourCanvas::SimpleRect* rect;
95 class Hit : public Event {
97 Hit(ArdourCanvas::CanvasHit*, ArdourCanvas::Group*);
101 ArdourCanvas::Diamond* diamond;
104 MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
105 MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos);
108 MidiStreamView* midi_view();
111 void set_samples_per_unit(double spu);
116 void add_note(ArdourCanvas::CanvasNote*);
117 void add_hit(ArdourCanvas::CanvasHit*);
121 typedef std::list<MidiGhostRegion::Event*> EventList;
125 #endif /* __ardour_gtk_ghost_region_h__ */