new transparent-background versions of track/bus list icons from thorsten
[ardour.git] / gtk2_ardour / ghostregion.h
index b28607e6f261d7493c962af80d5ff77c8e388c4c..103d7ecf97bacb26aba2e87327f609344385746d 100644 (file)
@@ -21,8 +21,8 @@
 #define __ardour_gtk_ghost_region_h__
 
 #include <vector>
-#include <sigc++/signal.h>
 #include <libgnomecanvasmm.h>
+#include "pbd/signals.h"
 #include "canvas.h"
 
 namespace Gnome {
@@ -52,12 +52,14 @@ public:
        guint source_track_color(unsigned char alpha = 0xff);
        bool is_automation_ghost();
 
-       sigc::signal<void,GhostRegion*> GoingAway;
-
+       /** TimeAxisView that is the AutomationTimeAxisView that we are on */
        TimeAxisView& trackview;
+       /** TimeAxisView that we are a ghost for */
        TimeAxisView& source_trackview;
        ArdourCanvas::Group* group;
        ArdourCanvas::SimpleRect* base_rect;
+
+       static PBD::Signal1<void,GhostRegion*> CatchDeletion;
 };
 
 class AudioGhostRegion : public GhostRegion {
@@ -78,7 +80,6 @@ public:
                Event(ArdourCanvas::CanvasNoteEvent*);
                virtual ~Event() {}
 
-               virtual void x_changed() = 0;
                ArdourCanvas::CanvasNoteEvent* event;
        };
 
@@ -87,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();
@@ -113,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__ */