X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view_item.h;h=97e7a73745eb5b1dff8a0229b8f04a4223dcc27a;hb=e57c4d4c43c0d302c0b06128e0ba10c4683ee8fe;hp=9ddb06876a1c37100b24657fb1d6a75e5bad0367;hpb=edde9b59833183904ec7bd7fd49bb2bc8515f7e9;p=ardour.git diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index 9ddb06876a..97e7a73745 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __gtk_ardour_time_axis_view_item_h__ @@ -24,7 +23,7 @@ #include #include -#include +#include #include "selectable.h" #include "simplerect.h" @@ -39,7 +38,7 @@ class TimeAxisView; class TimeAxisViewItem : public Selectable { public: - virtual ~TimeAxisViewItem() ; + virtual ~TimeAxisViewItem() ; /** * Set the position of this item upon the timeline to the specified value @@ -48,14 +47,14 @@ class TimeAxisViewItem : public Selectable * @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) ; + virtual bool set_position(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 ; + nframes_t get_position() const ; /** * Sets the duration of this item @@ -64,13 +63,13 @@ class TimeAxisViewItem : public Selectable * @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) ; + virtual bool set_duration(nframes_t dur, void* src) ; /** * Returns the duration of this item * */ - jack_nframes_t get_duration() const ; + nframes_t get_duration() const ; /** * Sets the maximum duration that this item make have. @@ -78,14 +77,14 @@ class TimeAxisViewItem : public Selectable * @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) ; + virtual void set_max_duration(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 ; + nframes_t get_max_duration() const ; /** * Sets the minimu duration that this item may be set to @@ -93,14 +92,14 @@ class TimeAxisViewItem : public Selectable * @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) ; + virtual void set_min_duration(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 ; + nframes_t get_min_duration() const ; /** * Sets whether the position of this Item is locked to its current position @@ -177,6 +176,9 @@ class TimeAxisViewItem : public Selectable * @param yn true if this item should show its selected status */ virtual void set_should_show_selection (bool yn) ; + + void set_sensitive (bool yn) { _sensitive = yn; } + bool sensitive () const { return _sensitive; } //---------------------------------------------------------------------------------------// // Parent Component Methods @@ -197,7 +199,7 @@ class TimeAxisViewItem : public Selectable * * @param new_name the new name text to display */ - void set_name_text(std::string new_name) ; + void set_name_text(const Glib::ustring& new_name) ; /** * Set the height of this item @@ -205,11 +207,13 @@ class TimeAxisViewItem : public Selectable * @param h the new height */ virtual void set_height(double h) ; - + + void set_y (double); + /** * */ - void set_color(Gdk::Color& color) ; + void set_color (Gdk::Color const &); /** * @@ -219,7 +223,7 @@ class TimeAxisViewItem : public Selectable /** * */ - ArdourCanvas::Item* get_canvas_group(); + ArdourCanvas::Group* get_canvas_group(); /** * @@ -229,9 +233,14 @@ class TimeAxisViewItem : public Selectable /** * */ - ArdourCanvas::Text* get_name_text(); + ArdourCanvas::Pixbuf* get_name_pixbuf(); + /** + * Returns the time axis that this item is upon + */ + TimeAxisView& get_trackview() const { return trackview; } + /** * Sets the samples per unit of this item. * this item is used to determine the relative visual size and position of this item @@ -259,7 +268,7 @@ class TimeAxisViewItem : public Selectable bool name_active() const { return name_connected; } // Default sizes, font and spacing - static Pango::FontDescription NAME_FONT ; + static Pango::FontDescription* NAME_FONT ; static bool have_name_font; static const double NAME_X_OFFSET ; static const double GRAB_HANDLE_LENGTH ; @@ -289,27 +298,26 @@ class TimeAxisViewItem : public Selectable * the destructor, this allows us to capture the source of the deletion * event */ + sigc::signal ItemRemoved ; /** Emitted when the name/Id of this item is changed */ sigc::signal NameChanged ; /** Emiited when the position of this item changes */ - sigc::signal PositionChanged ; + sigc::signal PositionChanged ; /** Emitted when the position lock of this item is changed */ sigc::signal PositionLockChanged ; /** Emitted when the duration of this item changes */ - sigc::signal DurationChanged ; + sigc::signal DurationChanged ; /** Emitted when the maximum item duration is changed */ - sigc::signal MaxDurationChanged ; + sigc::signal MaxDurationChanged ; /** Emitted when the mionimum item duration is changed */ - sigc::signal MinDurationChanged ; - - protected: + sigc::signal MinDurationChanged ; enum Visibility { ShowFrame = 0x1, @@ -321,7 +329,7 @@ class TimeAxisViewItem : public Selectable HideFrameTB = 0x40, FullWidthNameHighlight = 0x80 }; - + protected: /** * Constructs a new TimeAxisViewItem. * @@ -333,15 +341,19 @@ class TimeAxisViewItem : public Selectable * @param start the start point of this item * @param duration the duration of this item */ - TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, - jack_nframes_t start, jack_nframes_t duration, Visibility v = Visibility (0)); + TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color, + nframes_t start, nframes_t duration, bool recording = false, Visibility v = Visibility (0)); + + TimeAxisViewItem (const TimeAxisViewItem& other); + + void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes_t start, nframes_t duration, Visibility vis); /** * Calculates some contrasting color for displaying various parts of this item, based upon the base color * * @param color the base color of the item */ - virtual void compute_colors(Gdk::Color& color) ; + virtual void compute_colors (Gdk::Color const & color); /** * convenience method to set the various canvas item colors @@ -351,7 +363,7 @@ class TimeAxisViewItem : public Selectable /** * Sets the frame color depending on whether this item is selected */ - void set_frame_color() ; + virtual void set_frame_color() ; /** * Sets the colors of the start and end trim handle depending on object state @@ -379,16 +391,16 @@ class TimeAxisViewItem : public Selectable bool position_locked ; /** The posotion of this item on the timeline */ - jack_nframes_t frame_position ; + nframes_t frame_position ; /** the duration of this item upon the timeline */ - jack_nframes_t item_duration ; + nframes_t item_duration ; /** the maximum duration that we allow this item to take */ - jack_nframes_t max_item_duration ; + nframes_t max_item_duration ; /** the minimu duration that we allow this item to take */ - jack_nframes_t min_item_duration ; + nframes_t min_item_duration ; /** indicates whether this Max Duration constraint is active */ bool max_duration_active ; @@ -404,6 +416,9 @@ class TimeAxisViewItem : public Selectable /** should the item show its selected status */ bool should_show_selection; + + /** should the item respond to events */ + bool _sensitive; /** * The unique item name of this Item @@ -442,12 +457,14 @@ class TimeAxisViewItem : public Selectable ArdourCanvas::Group* group; ArdourCanvas::SimpleRect* vestigial_frame; ArdourCanvas::SimpleRect* frame; - ArdourCanvas::Text* name_text; + ArdourCanvas::Pixbuf* name_pixbuf; ArdourCanvas::SimpleRect* name_highlight; ArdourCanvas::SimpleRect* frame_handle_start; ArdourCanvas::SimpleRect* frame_handle_end; Visibility visibility; + bool _recregion; + }; /* class TimeAxisViewItem */