2 Copyright (C) 2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_imageframe_time_axis_h__
22 #define __ardour_imageframe_time_axis_h__
26 //#include <libgnomecanvas.h>
28 #include "ardour_dialog.h"
30 #include "time_axis_view.h"
32 #include "visual_time_axis.h"
43 class ImageFrameView ;
44 class ImageFrameTimeAxisView ;
45 class MarkersTimeAxisView ;
49 * ImageFrameTimeAxis defines a visual time axis view for holding and arranging image items.
52 class ImageFrameTimeAxis : public VisualTimeAxis
55 //---------------------------------------------------------------------------------------//
56 // Constructor / Desctructor
59 * Constructs a new ImageFrameTimeAxis.
61 * @param track_id the track name/id
62 * @param ed the PublicEditor
63 * @param sess the current session
64 * @param canvas the parent canvas item
66 ImageFrameTimeAxis(const string & track_id, PublicEditor& ed, ARDOUR::Session& sess, ArdourCanvas::Canvas& canvas) ;
70 * Responsible for destroying any child image items that may have been added to thie time axis
72 virtual ~ImageFrameTimeAxis() ;
74 //---------------------------------------------------------------------------------------//
78 * Sets the height of this TrackView to one of ths TrackHeghts
80 * @param h the TrackHeight value to set
82 virtual void set_height(TimeAxisView::TrackHeight) ;
85 * Sets the number of samples per unit that are used.
86 * This is used to determine the siezes of items upon this time axis
88 * @param spu the number of samples per unit
90 virtual void set_samples_per_unit(double spu) ;
93 * Returns the available height for images to be drawn onto
95 * @return the available height for an image item to be drawn onto
97 int get_image_display_height() ;
101 * Show the popup edit menu
103 * @param button the mouse button pressed
104 * @param time when to show the popup
105 * @param clicked_imageframe the ImageFrameItem that the event ocured upon, or 0 if none
106 * @param with_item true if an item has been selected upon the time axis, used to set context menu
108 void popup_imageframe_edit_menu(int button, int32_t time, ImageFrameView* clicked_imageframe, bool with_item) ;
111 //---------------------------------------------------------------------------------------//
112 // Marker Time Axis Methods
115 * Add a MarkerTimeAxis to the ilst of MarkerTimeAxis' associated with this ImageFrameTimeAxis
117 * @param marker_track the MarkerTimeAxis to add
118 * @param src the identity of the object that initiated the change
119 * @return true if the addition was a success,
122 bool add_marker_time_axis(MarkerTimeAxis* marker_track, void* src) ;
125 * Returns the named MarkerTimeAxis associated with this ImageFrameTimeAxis
127 * @param track_id the track_id of the MarkerTimeAxis to search for
128 * @return the named markerTimeAxis, or 0 if the named MarkerTimeAxis is not associated with this ImageFrameTimeAxis
130 MarkerTimeAxis* get_named_marker_time_axis(const string & track_id) ;
133 * Removes the named markerTimeAxis from those associated with this ImageFrameTimeAxis
135 * @param track_id the track id of the MarkerTimeAxis to remove
136 * @param src the identity of the object that initiated the change
137 * @return the removed MarkerTimeAxis
139 MarkerTimeAxis* remove_named_marker_time_axis(const string & track_id, void* src) ;
142 * Removes tav from the list of MarkerTimaAxis associated with this ImageFrameTimeAxis
144 * @param tav the TimeAxis to remove
145 * @param src the identity of the object that initiated the change
147 void remove_time_axis_view(MarkerTimeAxis* tav, void* src) ;
150 //---------------------------------------------------------------------------------------//
151 // Parent/Child helper object accessors
154 * Returns the view helper of this TimeAxis
156 * @return the view helper of this TimeAxis
158 ImageFrameTimeAxisView* get_view() ;
161 //---------------------------------------------------------------------------------//
164 /** Emitted when a Marker Time Axis is Added, or associated with, this time axis */
165 sigc::signal<void,MarkerTimeAxis*,void*> MarkerTimeAxisAdded ;
167 /** Emitted when a Marker Time Axis is removed, from this time axis */
168 sigc::signal<void,std::string,void*> MarkerTimeAxisRemoved ;
174 * convenience method to select a new track color and apply it to the view and view items
177 void select_track_color() ;
180 * Handles the building of the popup menu
182 virtual void build_display_menu() ;
185 * handles the building of the ImageFrameView sub menu
187 void create_imageframe_menu() ;
189 /* We may have multiple marker views, but each marker view should only be associated with one timeaxisview */
190 typedef std::list<MarkerTimeAxis*> MarkerTimeAxisList ;
191 MarkerTimeAxisList marker_time_axis_list;
193 /* the TimeAxis view helper */
194 ImageFrameTimeAxisView *view ;
196 // popup menu widgets
197 Gtk::Menu *image_action_menu ;
198 Gtk::Menu *imageframe_menu ;
199 Gtk::Menu *imageframe_item_menu ;
201 }; /* class ImageFrameTimeAxis */
203 #endif /* __ardour_imageframe_time_axis_h__ */