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.
20 #ifndef __ardour_imageframe_time_axis_h__
21 #define __ardour_imageframe_time_axis_h__
26 #include "ardour_dialog.h"
28 #include "time_axis_view.h"
29 #include "visual_time_axis.h"
40 class ImageFrameView ;
41 class ImageFrameTimeAxisView ;
42 class MarkersTimeAxisView ;
46 * ImageFrameTimeAxis defines a visual time axis view for holding and arranging image items.
49 class ImageFrameTimeAxis : public VisualTimeAxis
52 //---------------------------------------------------------------------------------------//
53 // Constructor / Desctructor
56 * Constructs a new ImageFrameTimeAxis.
58 * @param track_id the track name/id
59 * @param ed the PublicEditor
60 * @param sess the current session
61 * @param canvas the parent canvas item
63 ImageFrameTimeAxis(const std::string & track_id, PublicEditor& ed, ARDOUR::Session* sess, ArdourCanvas::Canvas& canvas) ;
67 * Responsible for destroying any child image items that may have been added to thie time axis
69 virtual ~ImageFrameTimeAxis() ;
71 //---------------------------------------------------------------------------------------//
75 * Sets the height of this TrackView to one of ths TrackHeghts
77 * @param h the number of pixels to set the height too
79 virtual void set_height(uint32_t h) ;
81 virtual void set_samples_per_pixel (double);
84 * Returns the available height for images to be drawn onto
86 * @return the available height for an image item to be drawn onto
88 int get_image_display_height() ;
92 * Show the popup edit menu
94 * @param button the mouse button pressed
95 * @param time when to show the popup
96 * @param clicked_imageframe the ImageFrameItem that the event ocured upon, or 0 if none
97 * @param with_item true if an item has been selected upon the time axis, used to set context menu
99 void popup_imageframe_edit_menu(int button, int32_t time, ImageFrameView* clicked_imageframe, bool with_item) ;
102 //---------------------------------------------------------------------------------------//
103 // Marker Time Axis Methods
106 * Add a MarkerTimeAxis to the ilst of MarkerTimeAxis' associated with this ImageFrameTimeAxis
108 * @param marker_track the MarkerTimeAxis to add
109 * @param src the identity of the object that initiated the change
110 * @return true if the addition was a success,
113 bool add_marker_time_axis(MarkerTimeAxis* marker_track, void* src) ;
116 * Returns the named MarkerTimeAxis associated with this ImageFrameTimeAxis
118 * @param track_id the track_id of the MarkerTimeAxis to search for
119 * @return the named markerTimeAxis, or 0 if the named MarkerTimeAxis is not associated with this ImageFrameTimeAxis
121 MarkerTimeAxis* get_named_marker_time_axis(const std::string & track_id) ;
124 * Removes the named markerTimeAxis from those associated with this ImageFrameTimeAxis
126 * @param track_id the track id of the MarkerTimeAxis to remove
127 * @param src the identity of the object that initiated the change
128 * @return the removed MarkerTimeAxis
130 MarkerTimeAxis* remove_named_marker_time_axis(const std::string & track_id, void* src) ;
133 * Potentially removes a MarkerTimeAxisView from the list of MarkerTimaAxis associated with this ImageFrameTimeAxis
135 * @param tav the TimeAxis to remove
136 * @param src the identity of the object that initiated the change
138 void remove_time_axis_view (TimeAxisView* av);
141 //---------------------------------------------------------------------------------------//
142 // Parent/Child helper object accessors
145 * Returns the view helper of this TimeAxis
147 * @return the view helper of this TimeAxis
149 ImageFrameTimeAxisView* get_view() ;
152 //---------------------------------------------------------------------------------//
155 /** Emitted when a Marker Time Axis is Added, or associated with, this time axis */
156 sigc::signal<void,MarkerTimeAxis*,void*> MarkerTimeAxisAdded ;
158 /** Emitted when a Marker Time Axis is removed, from this time axis */
159 sigc::signal<void,std::string,void*> MarkerTimeAxisRemoved ;
165 * convenience method to select a new track color and apply it to the view and view items
168 void select_track_color() ;
171 * Handles the building of the popup menu
173 virtual void build_display_menu() ;
176 * handles the building of the ImageFrameView sub menu
178 void create_imageframe_menu() ;
180 /* We may have multiple marker views, but each marker view should only be associated with one timeaxisview */
181 typedef std::list<MarkerTimeAxis*> MarkerTimeAxisList ;
182 MarkerTimeAxisList marker_time_axis_list;
184 /* the TimeAxis view helper */
185 ImageFrameTimeAxisView *view ;
187 // popup menu widgets
188 Gtk::Menu *image_action_menu ;
189 Gtk::Menu *imageframe_menu ;
190 Gtk::Menu *imageframe_item_menu ;
192 }; /* class ImageFrameTimeAxis */
194 #endif /* __ardour_imageframe_time_axis_h__ */