new transparent-background versions of track/bus list icons from thorsten
[ardour.git] / gtk2_ardour / ghostregion.h
index 9f0442decb1c7fc35eee87e431ab67e347d346d1..103d7ecf97bacb26aba2e87327f609344385746d 100644 (file)
@@ -37,7 +37,7 @@ namespace Gnome {
 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);
@@ -80,7 +80,6 @@ public:
                Event(ArdourCanvas::CanvasNoteEvent*);
                virtual ~Event() {}
 
-               virtual void x_changed() = 0;
                ArdourCanvas::CanvasNoteEvent* event;
        };
 
@@ -89,19 +88,9 @@ public:
                Note(ArdourCanvas::CanvasNote*, ArdourCanvas::Group*);
                ~Note();
 
-               void x_changed();
                ArdourCanvas::SimpleRect* rect;
        };
 
-       class Hit : public Event {
-       public:
-               Hit(ArdourCanvas::CanvasHit*, ArdourCanvas::Group*);
-               ~Hit();
-
-               void x_changed();
-               ArdourCanvas::Diamond* diamond;
-       };
-
        MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
        MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos);
        ~MidiGhostRegion();
@@ -115,12 +104,17 @@ public:
        void update_range();
 
        void add_note(ArdourCanvas::CanvasNote*);
-       void add_hit(ArdourCanvas::CanvasHit*);
+       void update_note (ArdourCanvas::CanvasNote *);
 
        void clear_events();
 
+private:
+
+       MidiGhostRegion::Event* find_event (ArdourCanvas::CanvasNote *);
+
        typedef std::list<MidiGhostRegion::Event*> EventList;
        EventList events;
+       EventList::iterator _optimization_iterator;
 };
 
 #endif /* __ardour_gtk_ghost_region_h__ */