allow zero-input (i.e. tone generator) processors to be added
[ardour2.git] / gtk2_ardour / marker_view.h
blob38088b078a093478df419f51028d3dc9eb06b0a5
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 __gtk_ardour_marker_view_h__
21 #define __gtk_ardour_marker_view_h__
23 #include <string>
24 #include "time_axis_view_item.h"
26 #include "canvas.h"
28 namespace Gdk {
29 class Color;
32 class MarkerTimeAxisView ;
33 class ImageFrameView ;
35 /**
36 * MarkerView defines a marker item that may be placed upon a MarkerTimeAxis.
38 * The aim of the MarkerView is to provide additional timing details for visual based time axis.
39 * The MarkerView item is associated with one other TimeAxisViewItem and has a start and a duration.
41 class MarkerView : public TimeAxisViewItem
43 public:
44 //---------------------------------------------------------------------------------------//
45 // Constructor / Desctructor
47 /**
48 * Constructs a new MarkerView
50 * @param parent the parent canvas item
51 * @param tv the parent TimeAxisView of this item
52 * @param marked the Item that this item is to be assciated (marking) with
53 * @param spu the current samples per unit
54 * @param base_color
55 * @param mark_type the marker type/name text, eg fade out, pan up etc.
56 * @param mark_id unique name/id of this item
57 * @param start the start time of this item
58 * @param duration the duration of this item
60 MarkerView(ArdourCanvas::Group *parent,
61 TimeAxisView *tv,
62 ImageFrameView* marked,
63 double spu,
64 Gdk::Color& base_color,
65 std::string mark_type,
66 std::string mark_id,
67 nframes_t start,
68 nframes_t duration) ;
70 /**
71 * Destructor
72 * Destroys this Marker Item and removes the association between itself and the item it is marking.
74 ~MarkerView() ;
76 static PBD::Signal1<void,MarkerView*> CatchDeletion;
78 //---------------------------------------------------------------------------------------//
79 // Marker Type Methods
81 /**
82 * Sets the marker Type text of this this MarkerItem, eg fade_out, pan up etc.
84 * @param type_text the marker type text of this item
86 void set_mark_type_text(std::string type_text) ;
88 /**
89 * Returns the marker Type of this this MarkerItem, eg fade_out, pan up etc.
91 * @return the marker type text of this item
93 std::string get_mark_type_text() const ;
96 //---------------------------------------------------------------------------------------//
97 // Marked Item Methods
99 /**
100 * Returns the time axis item being marked by this item
102 * @return the time axis item being marked by this item
104 ImageFrameView* get_marked_item() ;
107 * Sets the time axis item being marker by this item
109 * @param item the time axis item to be marked by this item
110 * @return the previously marked item, or 0 if no previous marked item exists
112 ImageFrameView* set_marked_item(ImageFrameView* item) ;
114 //---------------------------------------------------------------------------------//
115 // Emitted Signals
117 /** Emitted when the mark type text is changed */
118 sigc::signal<void,std::string,void*> MarkTypeChanged ;
120 /** Emitted when the Marked Item is changed */
121 sigc::signal<void,ImageFrameView*,void*> MarkedItemChanged ;
124 protected:
126 private:
127 /** the unique name/id of this item */
128 std::string mark_type_text ;
130 /* a pointer to the time axis item this marker is assoiated(marking up) with */
131 ImageFrameView* marked_item ;
133 } ; /* class MarkerView */
136 #endif /* __gtk_ardour_imageframe_view_h__ */