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 {
36 class GhostRegion : public sigc::trackable
39 GhostRegion(ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
40 virtual ~GhostRegion();
42 virtual void set_samples_per_pixel (double) = 0;
43 virtual void set_height();
44 virtual void set_colors();
46 void set_duration(double units);
48 guint source_track_color(unsigned char alpha = 0xff);
49 bool is_automation_ghost();
51 /** TimeAxisView that is the AutomationTimeAxisView that we are on */
52 TimeAxisView& trackview;
53 /** TimeAxisView that we are a ghost for */
54 TimeAxisView& source_trackview;
55 ArdourCanvas::Container* group;
56 ArdourCanvas::Rectangle* base_rect;
58 static PBD::Signal1<void,GhostRegion*> CatchDeletion;
61 class AudioGhostRegion : public GhostRegion {
63 AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
65 void set_samples_per_pixel (double);
69 std::vector<ArdourCanvas::WaveView*> waves;
72 class MidiGhostRegion : public GhostRegion {
74 class GhostEvent : public sigc::trackable {
76 GhostEvent(::NoteBase *, ArdourCanvas::Container *);
77 virtual ~GhostEvent ();
80 ArdourCanvas::Rectangle* rect;
83 MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
84 MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos);
87 MidiStreamView* midi_view();
90 void set_samples_per_pixel (double spu);
95 void add_note(NoteBase*);
96 void update_note (NoteBase*);
97 void remove_note (NoteBase*);
103 MidiGhostRegion::GhostEvent* find_event (NoteBase*);
105 typedef std::list<MidiGhostRegion::GhostEvent*> EventList;
107 EventList::iterator _optimization_iterator;
110 #endif /* __ardour_gtk_ghost_region_h__ */