various fixes to MidiRegionView selection handling, key handling, drawing of ghost...
[ardour2.git] / gtk2_ardour / marker_time_axis.h
blobbb30bc24dbb8df803bfca382114234d5b671491c
1 /*
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__
23 #include <string>
24 #include <libgnomecanvas/libgnomecanvas.h>
26 #include "ardour_dialog.h"
27 #include "route_ui.h"
28 #include "enums.h"
29 #include "time_axis_view.h"
30 #include "canvas.h"
31 #include "visual_time_axis.h"
33 namespace ARDOUR {
34 class Session;
37 class PublicEditor;
38 class ImageFrameView ;
39 class ImageFrameTimeAxisView ;
40 class MarkerTimeAxisView ;
41 class MarkerView ;
43 /**
44 * MarkerTimeAxis defines a visual time axis for holding marker items associated with other time axis, and time axis items.
46 * The intention of this time axis is to allow markers with duration to be arranged on the time line
47 * to add additional timing information to items on an associated time axis, for instance the addition
48 * of effect duration and timings
50 class MarkerTimeAxis : public VisualTimeAxis
52 public:
53 //---------------------------------------------------------------------------------------//
54 // Constructor / Desctructor
56 /**
57 * Constructs a new MarkerTimeAxis
59 * @param ed the PublicEditor
60 * @param sess the current session
61 * @param canvas the parent canvas item
62 * @param name the name/id of this time axis
63 * @param tav the associated track view that this MarkerTimeAxis is marking up
65 MarkerTimeAxis(PublicEditor& ed, ARDOUR::Session* sess, ArdourCanvas::Canvas& canvas, const std::string & name, TimeAxisView* tav) ;
67 /**
68 * Destructor
69 * Responsible for destroying any marker items upon this time axis
71 virtual ~MarkerTimeAxis() ;
74 //---------------------------------------------------------------------------------------//
75 // ui methods & data
77 /**
78 * Sets the height of this TrackView to one of the defined TrackHeights
80 * @param h the number of pixels to set the height to
82 virtual void set_height(uint32_t h) ;
84 /**
85 * Sets the number of samples per unit that are used.
86 * This is used to determine the sizes 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 /**
94 * Show the popup edit menu
96 * @param button the mouse button pressed
97 * @param time when to show the popup
98 * @param clicked_mv the MarkerView that the event ocured upon, or 0 if none
99 * @param with_item true if an item has been selected upon the time axis, used to set context menu
101 void popup_marker_time_axis_edit_menu(int button, int32_t time, MarkerView* clicked_mv, bool with_item) ;
104 //---------------------------------------------------------------------------------------//
105 // Parent/Child helper object accessors
108 * Returns the view helper of this TimeAxis
110 * @return the view helper of this TimeAxis
112 MarkerTimeAxisView* get_view() ;
115 * Returns the TimeAxisView that this markerTimeAxis is marking up
117 * @return the TimeAXisView that this MarkerTimeAxis is marking
119 TimeAxisView* get_marked_time_axis() ;
122 private:
125 * convenience method to select a new track color and apply it to the view and view items
128 void select_track_color() ;
131 * Handles the building of the popup menu
133 virtual void build_display_menu() ;
136 * handles the building of the MarkerView sub menu
138 void build_marker_menu() ;
140 /** The associated TimeAxis that this MarkerTimeAxis is marking up */
141 TimeAxisView* marked_time_axis ;
143 /** Our time axis view helper */
144 MarkerTimeAxisView *view ;
146 /** the popup menu available by clicking upon this time axis */
147 Gtk::Menu *marker_menu ;
149 /** specialized sub menu available when clicking upon and item upon this time axis */
150 Gtk::Menu *marker_item_menu ;
153 } ; /* class MarkerTimeAxis */
155 #endif /* __ardour_imageframe_time_axis_h__ */