X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fghostregion.h;h=64211669d12511bb7a7a49f45d990c1af41e1d99;hb=3cbd73de498b2136c9821030c41d6861d71c29f1;hp=50924619ff6eaf7682c925b2a15a53f2cd1072ac;hpb=fecf120f1e778f1a2344e0adcaf3aed0b0c4e5e3;p=ardour.git diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index 50924619ff..64211669d1 100644 --- a/gtk2_ardour/ghostregion.h +++ b/gtk2_ardour/ghostregion.h @@ -21,29 +21,25 @@ #define __ardour_gtk_ghost_region_h__ #include -#include #include "pbd/signals.h" -#include "canvas.h" - -namespace Gnome { - namespace Canvas { - class CanvasNoteEvent; - class CanvasNote; - class CanvasHit; - class Diamond; - } + +namespace ArdourCanvas { + class WaveView; } +class NoteBase; +class Note; +class Hit; class MidiStreamView; class TimeAxisView; class GhostRegion : public sigc::trackable { public: - GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); + GhostRegion(ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); virtual ~GhostRegion(); - virtual void set_samples_per_unit(double spu) = 0; + virtual void set_samples_per_pixel (double) = 0; virtual void set_height(); virtual void set_colors(); @@ -56,8 +52,8 @@ public: TimeAxisView& trackview; /** TimeAxisView that we are a ghost for */ TimeAxisView& source_trackview; - ArdourCanvas::Group* group; - ArdourCanvas::SimpleRect* base_rect; + ArdourCanvas::Container* group; + ArdourCanvas::Rectangle* base_rect; static PBD::Signal1 CatchDeletion; }; @@ -66,7 +62,7 @@ class AudioGhostRegion : public GhostRegion { public: AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); - void set_samples_per_unit(double spu); + void set_samples_per_pixel (double); void set_height(); void set_colors(); @@ -75,20 +71,13 @@ public: class MidiGhostRegion : public GhostRegion { public: - class Event : public sigc::trackable { - public: - Event(ArdourCanvas::CanvasNoteEvent*); - virtual ~Event() {} - - ArdourCanvas::CanvasNoteEvent* event; - }; - - class Note : public Event { - public: - Note(ArdourCanvas::CanvasNote*, ArdourCanvas::Group*); - ~Note(); - - ArdourCanvas::SimpleRect* rect; + class GhostEvent : public sigc::trackable { + public: + GhostEvent(::NoteBase *, ArdourCanvas::Container *); + virtual ~GhostEvent (); + + NoteBase* event; + ArdourCanvas::Item* item; }; MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); @@ -98,22 +87,22 @@ public: MidiStreamView* midi_view(); void set_height(); - void set_samples_per_unit(double spu); + void set_samples_per_pixel (double spu); void set_colors(); void update_range(); - void add_note(ArdourCanvas::CanvasNote*); - void update_note (ArdourCanvas::CanvasNote *); - void remove_note (ArdourCanvas::CanvasNoteEvent *); + void add_note(NoteBase*); + void update_note (NoteBase*); + void remove_note (NoteBase*); void clear_events(); private: - MidiGhostRegion::Event* find_event (ArdourCanvas::CanvasNoteEvent *); + MidiGhostRegion::GhostEvent* find_event (NoteBase*); - typedef std::list EventList; + typedef std::list EventList; EventList events; EventList::iterator _optimization_iterator; };