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 "pbd/signals.h"
26 namespace ArdourCanvas {
37 class GhostRegion : public sigc::trackable
40 GhostRegion(RegionView& rv,
41 ArdourCanvas::Container* parent,
43 TimeAxisView& source_tv,
44 double initial_unit_pos);
46 virtual ~GhostRegion();
48 virtual void set_samples_per_pixel (double) = 0;
49 virtual void set_height();
50 virtual void set_colors();
52 void set_duration(double units);
54 guint source_track_color(unsigned char alpha = 0xff);
55 bool is_automation_ghost();
57 RegionView& parent_rv;
58 /** TimeAxisView that is the AutomationTimeAxisView that we are on */
59 TimeAxisView& trackview;
60 /** TimeAxisView that we are a ghost for */
61 TimeAxisView& source_trackview;
62 ArdourCanvas::Container* group;
63 ArdourCanvas::Rectangle* base_rect;
66 class AudioGhostRegion : public GhostRegion {
68 AudioGhostRegion(RegionView& rv,
70 TimeAxisView& source_tv,
71 double initial_unit_pos);
73 void set_samples_per_pixel (double);
77 std::vector<ArdourCanvas::WaveView*> waves;
80 class MidiGhostRegion : public GhostRegion {
82 class GhostEvent : public sigc::trackable {
84 GhostEvent(::NoteBase *, ArdourCanvas::Container *);
85 virtual ~GhostEvent ();
88 ArdourCanvas::Item* item;
91 MidiGhostRegion(RegionView& rv,
93 TimeAxisView& source_tv,
94 double initial_unit_pos);
96 MidiGhostRegion(RegionView& rv,
98 TimeAxisView& source_tv,
99 double initial_unit_pos);
103 MidiStreamView* midi_view();
106 void set_samples_per_pixel (double spu);
111 void add_note(NoteBase*);
112 void update_note (NoteBase*);
113 void remove_note (NoteBase*);
119 MidiGhostRegion::GhostEvent* find_event (NoteBase*);
121 typedef std::list<MidiGhostRegion::GhostEvent*> EventList;
123 EventList::iterator _optimization_iterator;
126 #endif /* __ardour_gtk_ghost_region_h__ */