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 <libgnomecanvasmm.h>
25 #include "pbd/signals.h"
30 class CanvasNoteEvent
;
40 class GhostRegion
: public sigc::trackable
43 GhostRegion(ArdourCanvas::Group
* parent
, TimeAxisView
& tv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
44 virtual ~GhostRegion();
46 virtual void set_samples_per_unit(double spu
) = 0;
47 virtual void set_height();
48 virtual void set_colors();
50 void set_duration(double units
);
52 guint
source_track_color(unsigned char alpha
= 0xff);
53 bool is_automation_ghost();
55 /** TimeAxisView that is the AutomationTimeAxisView that we are on */
56 TimeAxisView
& trackview
;
57 /** TimeAxisView that we are a ghost for */
58 TimeAxisView
& source_trackview
;
59 ArdourCanvas::Group
* group
;
60 ArdourCanvas::SimpleRect
* base_rect
;
62 static PBD::Signal1
<void,GhostRegion
*> CatchDeletion
;
65 class AudioGhostRegion
: public GhostRegion
{
67 AudioGhostRegion(TimeAxisView
& tv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
69 void set_samples_per_unit(double spu
);
73 std::vector
<ArdourCanvas::WaveView
*> waves
;
76 class MidiGhostRegion
: public GhostRegion
{
78 class Event
: public sigc::trackable
{
80 Event(ArdourCanvas::CanvasNoteEvent
*);
83 ArdourCanvas::CanvasNoteEvent
* event
;
86 class Note
: public Event
{
88 Note(ArdourCanvas::CanvasNote
*, ArdourCanvas::Group
*);
91 ArdourCanvas::SimpleRect
* rect
;
94 MidiGhostRegion(TimeAxisView
& tv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
95 MidiGhostRegion(MidiStreamView
& msv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
98 MidiStreamView
* midi_view();
101 void set_samples_per_unit(double spu
);
106 void add_note(ArdourCanvas::CanvasNote
*);
107 void update_note (ArdourCanvas::CanvasNote
*);
113 MidiGhostRegion::Event
* find_event (ArdourCanvas::CanvasNote
*);
115 typedef std::list
<MidiGhostRegion::Event
*> EventList
;
117 EventList::iterator _optimization_iterator
;
120 #endif /* __ardour_gtk_ghost_region_h__ */