- virtual ~TimeAxisViewItem() ;
-
- /**
- * Set the position of this item upon the timeline to the specified value
- *
- * @param pos the new position
- * @param src the identity of the object that initiated the change
- * @return true if the position change was a success, false otherwise
- */
- virtual bool set_position(jack_nframes_t pos, void* src, double* delta = 0) ;
-
- /**
- * Return the position of this item upon the timeline
- *
- * @return the position of this item
- */
- jack_nframes_t get_position() const ;
-
- /**
- * Sets the duration of this item
- *
- * @param dur the new duration of this item
- * @param src the identity of the object that initiated the change
- * @return true if the duration change was succesful, false otherwise
- */
- virtual bool set_duration(jack_nframes_t dur, void* src) ;
-
- /**
- * Returns the duration of this item
- *
- */
- jack_nframes_t get_duration() const ;
-
- /**
- * Sets the maximum duration that this item make have.
- *
- * @param dur the new maximum duration
- * @param src the identity of the object that initiated the change
- */
- virtual void set_max_duration(jack_nframes_t dur, void* src) ;
-
- /**
- * Returns the maxmimum duration that this item may be set to
- *
- * @return the maximum duration that this item may be set to
- */
- jack_nframes_t get_max_duration() const ;
-
- /**
- * Sets the minimu duration that this item may be set to
- *
- * @param the minimum duration that this item may be set to
- * @param src the identity of the object that initiated the change
- */
- virtual void set_min_duration(jack_nframes_t dur, void* src) ;
-
- /**
- * Returns the minimum duration that this item mey be set to
- *
- * @return the nimum duration that this item mey be set to
- */
- jack_nframes_t get_min_duration() const ;
-
- /**
- * Sets whether the position of this Item is locked to its current position
- * Locked items cannot be moved until the item is unlocked again.
- *
- * @param yn set to true to lock this item to its current position
- * @param src the identity of the object that initiated the change
- */
- virtual void set_position_locked(bool yn, void* src) ;
-
- /**
- * Returns whether this item is locked to its current position
- *
- * @return true if this item is locked to its current posotion
- * false otherwise
- */
- bool get_position_locked() const ;
-
- /**
- * Sets whether the Maximum Duration constraint is active and should be enforced
- *
- * @param active set true to enforce the max duration constraint
- * @param src the identity of the object that initiated the change
- */
- void set_max_duration_active(bool active, void* src) ;
-
- /**
- * Returns whether the Maximum Duration constraint is active and should be enforced
- *
- * @return true if the maximum duration constraint is active, false otherwise
- */
- bool get_max_duration_active() const ;
-
- /**
- * Sets whether the Minimum Duration constraint is active and should be enforced
- *
- * @param active set true to enforce the min duration constraint
- * @param src the identity of the object that initiated the change
- */
- void set_min_duration_active(bool active, void* src) ;
-
- /**
- * Returns whether the Maximum Duration constraint is active and should be enforced
- *
- * @return true if the maximum duration constraint is active, false otherwise
- */
- bool get_min_duration_active() const ;
-
- /**
- * Set the name/Id of this item.
- *
- * @param new_name the new name of this item
- * @param src the identity of the object that initiated the change
- */
- void set_item_name(std::string new_name, void* src) ;
-
- /**
- * Returns the name/id of this item
- *
- * @return the name/id of this item
- */
- virtual std::string get_item_name() const ;
-
- /**
- * Set to true to indicate that this item is currently selected
- *
- * @param yn true if this item is currently selected
- * @param src the identity of the object that initiated the change
- */
- virtual void set_selected(bool yn, void* src) ;
-
- /**
- * Set to true to indicate that this item should show its selection status
- *
- * @param yn true if this item should show its selected status
- */
- virtual void set_should_show_selection (bool yn) ;
-
- /**
- * Returns whether this item is currently selected.
- *
- * @return true if this item is currently selected, false otherwise
- */
- bool get_selected() const ;
-
- //---------------------------------------------------------------------------------------//
- // Parent Component Methods
-
- /**
- * Returns the TimeAxisView that this item is upon
- *
- * @return the timeAxisView that this item is placed upon
- */
- TimeAxisView& get_time_axis_view() ;
-
- //---------------------------------------------------------------------------------------//
- // ui methods & data
-
- /**
- * Sets the displayed item text
- * This item is the visual text name displayed on the canvas item, this can be different to the name of the item
- *
- * @param new_name the new name text to display
- */
- void set_name_text(std::string new_name) ;
-
- /**
- * Set the height of this item
- *
- * @param h the new height
- */
- virtual void set_height(double h) ;
-
- /**
- *
- */
- void set_color(GdkColor& color) ;
-
- /**
- *
- */
- GnomeCanvasItem* get_canvas_frame() ;
-
- /**
- *
- */
- GnomeCanvasItem* get_canvas_group();
-
- /**
- *
- */
- GnomeCanvasItem* get_name_highlight();
-
- /**
- *
- */
- GnomeCanvasItem* get_name_text();
-
- /**
- * Sets the samples per unit of this item.
- * this item is used to determine the relative visual size and position of this item
- * based upon its duration and start value.
- *
- * @param spu the new samples per unit value
- */
- virtual void set_samples_per_unit(double spu) ;
-
- /**
- * Returns the current samples per unit of this item
- *
- * @return the samples per unit of this item
- */
- double get_samples_per_unit() ;
-
- virtual void raise () { return; }
- virtual void raise_to_top () { return; }
- virtual void lower () { return; }
- virtual void lower_to_bottom () { return; }
-
- /**
- * returns true if the name area should respond to events.
- */
- bool name_active() const { return name_connected; }
-
- // Default sizes, font and spacing
- static std::string NAME_FONT ;
- static const double NAME_X_OFFSET ;
- static const double NAME_Y_OFFSET ;
- static const double NAME_HIGHLIGHT_SIZE ;
- static const double NAME_HIGHLIGHT_THRESH ;
- static const double GRAB_HANDLE_LENGTH ;
-
- /**
- * Handles the Removal of this time axis item
- * This _needs_ to be called to alert others of the removal properly, ie where the source
- * of the removal came from.
- *
- * XXX Although im not too happy about this method of doing things, I cant think of a cleaner method
- * just now to capture the source of the removal
- *
- * @param src the identity of the object that initiated the change
- */
- virtual void remove_this_item(void* src) ;
-
- /**
- * Emitted when this Group has been removed
- * This is different to the GoingAway signal in that this signal
- * is emitted during the deletion of this Time Axis, and not during
- * the destructor, this allows us to capture the source of the deletion
- * event
- */
- sigc::signal<void,std::string,void*> ItemRemoved ;
-
- /** Emitted when the name/Id of this item is changed */
- sigc::signal<void,std::string,std::string,void*> NameChanged ;
-
- /** Emiited when the position of this item changes */
- sigc::signal<void,jack_nframes_t,void*> PositionChanged ;
-
- /** Emitted when the position lock of this item is changed */
- sigc::signal<void,bool,void*> PositionLockChanged ;
-
- /** Emitted when the duration of this item changes */
- sigc::signal<void,jack_nframes_t,void*> DurationChanged ;
-
- /** Emitted when the maximum item duration is changed */
- sigc::signal<void,jack_nframes_t,void*> MaxDurationChanged ;
-
- /** Emitted when the mionimum item duration is changed */
- sigc::signal<void,jack_nframes_t,void*> MinDurationChanged ;
-
- /** Emitted when the selected status of this item changes */
- sigc::signal<void, bool> Selected ;
-
+ virtual ~TimeAxisViewItem();
+
+ virtual bool set_position(framepos_t, void*, double* delta = 0);
+ framepos_t get_position() const;
+ virtual bool set_duration(framecnt_t, void*);
+ framecnt_t get_duration() const;
+ virtual void set_max_duration(framecnt_t, void*);
+ framecnt_t get_max_duration() const;
+ virtual void set_min_duration(framecnt_t, void*);
+ framecnt_t get_min_duration() const;
+ virtual void set_position_locked(bool, void*);
+ bool get_position_locked() const;
+ void set_max_duration_active(bool, void*);
+ bool get_max_duration_active() const;
+ void set_min_duration_active(bool, void*);
+ bool get_min_duration_active() const;
+ void set_item_name(std::string, void*);
+ virtual std::string get_item_name() const;
+ virtual void set_selected(bool yn);
+ void set_sensitive (bool yn) { _sensitive = yn; }
+ bool sensitive () const { return _sensitive; }
+ TimeAxisView& get_time_axis_view () const;
+ void set_name_text(const std::string&);
+ virtual void set_height(double h);
+ void set_y (double);
+ void set_color (Gdk::Color const &);
+
+ ArdourCanvas::Item* get_canvas_frame();
+ ArdourCanvas::Group* get_canvas_group();
+ ArdourCanvas::Item* get_name_highlight();
+ ArdourCanvas::Pixbuf* get_name_pixbuf();
+
+ virtual void set_samples_per_unit(double spu);
+
+ double get_samples_per_unit();
+
+ virtual void raise () { return; }
+ virtual void raise_to_top () { return; }
+ virtual void lower () { return; }
+ virtual void lower_to_bottom () { return; }
+
+ virtual void hide_rect ();
+ virtual void show_rect ();
+
+ /** @return true if the name area should respond to events */
+ bool name_active() const { return name_connected; }
+
+ // Default sizes, font and spacing
+ static Pango::FontDescription NAME_FONT;
+ static void set_constant_heights ();
+ static const double NAME_X_OFFSET;
+ static const double GRAB_HANDLE_LENGTH;
+
+ /* these are not constant, but vary with the pixel size
+ of the font used to display the item name.
+ */
+ static int NAME_HEIGHT;
+ static double NAME_Y_OFFSET;
+ static double NAME_HIGHLIGHT_SIZE;
+ static double NAME_HIGHLIGHT_THRESH;
+
+ /**
+ * Emitted when this Group has been removed.
+ * This is different to the CatchDeletion signal in that this signal
+ * is emitted during the deletion of this Time Axis, and not during
+ * the destructor, this allows us to capture the source of the deletion
+ * event
+ */
+
+ sigc::signal<void,std::string,void*> ItemRemoved;
+
+ /** Emitted when the name of this item is changed */
+ sigc::signal<void,std::string,std::string,void*> NameChanged;
+
+ /** Emiited when the position of this item changes */
+ sigc::signal<void,framepos_t,void*> PositionChanged;
+
+ /** Emitted when the position lock of this item is changed */
+ sigc::signal<void,bool,void*> PositionLockChanged;
+
+ /** Emitted when the duration of this item changes */
+ sigc::signal<void,framecnt_t,void*> DurationChanged;
+
+ /** Emitted when the maximum item duration is changed */
+ sigc::signal<void,framecnt_t,void*> MaxDurationChanged;
+
+ /** Emitted when the mionimum item duration is changed */
+ sigc::signal<void,framecnt_t,void*> MinDurationChanged;
+
+ enum Visibility {
+ ShowFrame = 0x1,
+ ShowNameHighlight = 0x2,
+ ShowNameText = 0x4,
+ ShowHandles = 0x8,
+ HideFrameLeft = 0x10,
+ HideFrameRight = 0x20,
+ HideFrameTB = 0x40,
+ FullWidthNameHighlight = 0x80
+ };