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_marker_time_axis_h__
21 #define __ardour_marker_time_axis_h__
25 #include "ardour_dialog.h"
28 #include "time_axis_view.h"
29 #include "visual_time_axis.h"
36 class ImageFrameView ;
37 class ImageFrameTimeAxisView ;
38 class MarkerTimeAxisView ;
42 * MarkerTimeAxis defines a visual time axis for holding marker items associated with other time axis, and time axis items.
44 * The intention of this time axis is to allow markers with duration to be arranged on the time line
45 * to add additional timing information to items on an associated time axis, for instance the addition
46 * of effect duration and timings
48 class MarkerTimeAxis : public VisualTimeAxis
51 //---------------------------------------------------------------------------------------//
52 // Constructor / Desctructor
55 * Constructs a new MarkerTimeAxis
57 * @param ed the PublicEditor
58 * @param sess the current session
59 * @param canvas the parent canvas item
60 * @param name the name/id of this time axis
61 * @param tav the associated track view that this MarkerTimeAxis is marking up
63 MarkerTimeAxis(PublicEditor& ed, ARDOUR::Session* sess, ArdourCanvas::Canvas& canvas, const std::string & name, TimeAxisView* tav) ;
67 * Responsible for destroying any marker items upon this time axis
69 virtual ~MarkerTimeAxis() ;
72 //---------------------------------------------------------------------------------------//
76 * Sets the height of this TrackView to one of the defined TrackHeights
78 * @param h the number of pixels to set the height to
80 virtual void set_height(uint32_t h) ;
82 virtual void set_samples_per_pixel (double);
86 * Show the popup edit menu
88 * @param button the mouse button pressed
89 * @param time when to show the popup
90 * @param clicked_mv the MarkerView that the event ocured upon, or 0 if none
91 * @param with_item true if an item has been selected upon the time axis, used to set context menu
93 void popup_marker_time_axis_edit_menu(int button, int32_t time, MarkerView* clicked_mv, bool with_item) ;
96 //---------------------------------------------------------------------------------------//
97 // Parent/Child helper object accessors
100 * Returns the view helper of this TimeAxis
102 * @return the view helper of this TimeAxis
104 MarkerTimeAxisView* get_view() ;
107 * Returns the TimeAxisView that this markerTimeAxis is marking up
109 * @return the TimeAXisView that this MarkerTimeAxis is marking
111 TimeAxisView* get_marked_time_axis() ;
117 * convenience method to select a new track color and apply it to the view and view items
120 void select_track_color() ;
123 * Handles the building of the popup menu
125 virtual void build_display_menu() ;
128 * handles the building of the MarkerView sub menu
130 void build_marker_menu() ;
132 /** The associated TimeAxis that this MarkerTimeAxis is marking up */
133 TimeAxisView* marked_time_axis ;
135 /** Our time axis view helper */
136 MarkerTimeAxisView *view ;
138 /** the popup menu available by clicking upon this time axis */
139 Gtk::Menu *marker_menu ;
141 /** specialized sub menu available when clicking upon and item upon this time axis */
142 Gtk::Menu *marker_item_menu ;
145 } ; /* class MarkerTimeAxis */
147 #endif /* __ardour_imageframe_time_axis_h__ */