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
;
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
& trackview
;
56 TimeAxisView
& source_trackview
;
57 ArdourCanvas::Group
* group
;
58 ArdourCanvas::SimpleRect
* base_rect
;
60 static PBD::Signal1
<void,GhostRegion
*> CatchDeletion
;
63 class AudioGhostRegion
: public GhostRegion
{
65 AudioGhostRegion(TimeAxisView
& tv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
67 void set_samples_per_unit(double spu
);
71 std::vector
<ArdourCanvas::WaveView
*> waves
;
74 class MidiGhostRegion
: public GhostRegion
{
76 class Event
: public sigc::trackable
{
78 Event(ArdourCanvas::CanvasNoteEvent
*);
81 virtual void x_changed() = 0;
82 ArdourCanvas::CanvasNoteEvent
* event
;
85 class Note
: public Event
{
87 Note(ArdourCanvas::CanvasNote
*, ArdourCanvas::Group
*);
91 ArdourCanvas::SimpleRect
* rect
;
94 class Hit
: public Event
{
96 Hit(ArdourCanvas::CanvasHit
*, ArdourCanvas::Group
*);
100 ArdourCanvas::Diamond
* diamond
;
103 MidiGhostRegion(TimeAxisView
& tv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
104 MidiGhostRegion(MidiStreamView
& msv
, TimeAxisView
& source_tv
, double initial_unit_pos
);
107 MidiStreamView
* midi_view();
110 void set_samples_per_unit(double spu
);
115 void add_note(ArdourCanvas::CanvasNote
*);
116 void add_hit(ArdourCanvas::CanvasHit
*);
120 typedef std::list
<MidiGhostRegion::Event
*> EventList
;
124 #endif /* __ardour_gtk_ghost_region_h__ */