synchronize preferences and monitor-section
[ardour.git] / gtk2_ardour / ghostregion.h
index 2ebd33e64e4f433503de90214c127767e910e825..85b6d96ed143ba2b9260c691fb2103f1f5c04cdb 100644 (file)
 #define __ardour_gtk_ghost_region_h__
 
 #include <vector>
-#include <libgnomecanvasmm.h>
 #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<void,GhostRegion*> 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<MidiGhostRegion::Event*> EventList;
+       typedef std::list<MidiGhostRegion::GhostEvent*> EventList;
        EventList events;
        EventList::iterator _optimization_iterator;
 };