X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fghostregion.h;h=85b6d96ed143ba2b9260c691fb2103f1f5c04cdb;hb=37937d9c698e5fe9ce0f1857f3256dead43f3ebc;hp=2ebd33e64e4f433503de90214c127767e910e825;hpb=165a38e74e3829e156c8a18bfae58307c19d6404;p=ardour.git diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h index 2ebd33e64e..85b6d96ed1 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 +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::Rectangle* rect; }; MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos); @@ -98,21 +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 add_note(NoteBase*); + void update_note (NoteBase*); + void remove_note (NoteBase*); void clear_events(); private: - MidiGhostRegion::Event* find_event (ArdourCanvas::CanvasNote *); + MidiGhostRegion::GhostEvent* find_event (NoteBase*); - typedef std::list EventList; + typedef std::list EventList; EventList events; EventList::iterator _optimization_iterator; };