b84edd03e04fdd25d9397171a75eec8210d0f233
[ardour.git] / gtk2_ardour / waveview.cc
1 #include "waveview.h"
2 #include "waveview_p.h"
3
4 /* $Id$ */
5
6 /* waveview.cc
7  *
8  * Copyright (C) 1998 EMC Capital Management Inc.
9  * Developed by Havoc Pennington <hp@pobox.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25
26 //#include <libgnomecanvasmm/group.h>
27
28 namespace Gnome
29 {
30
31 namespace Canvas
32 {
33
34 WaveView::WaveView(Group& parentx)
35         : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
36 {
37         item_construct(parentx);
38 }
39
40 } /* namespace Canvas */
41 } /* namespace Gnome */
42
43
44 namespace Glib
45 {
46
47 Gnome::Canvas::WaveView* wrap(GnomeCanvasWaveView* object, bool take_copy)
48 {
49   return dynamic_cast<Gnome::Canvas::WaveView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
50 }
51
52 } /* namespace Glib */
53
54 namespace Gnome
55 {
56
57 namespace Canvas
58 {
59
60
61 /* The *_Class implementation: */
62
63 const Glib::Class& WaveView_Class::init()
64 {
65   if(!gtype_) // create the GType if necessary
66   {
67     // Glib::Class has to know the class init function to clone custom types.
68     class_init_func_ = &WaveView_Class::class_init_function;
69
70     // This is actually just optimized away, apparently with no harm.
71     // Make sure that the parent type has been created.
72     //CppClassParent::CppObjectType::get_type();
73
74     // Create the wrapper type, with the same class/instance size as the base type.
75     register_derived_type(gnome_canvas_waveview_get_type());
76
77     // Add derived versions of interfaces, if the C type implements any interfaces:
78   }
79
80   return *this;
81 }
82
83 void WaveView_Class::class_init_function(void* g_class, void* class_data)
84 {
85   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
86   CppClassParent::class_init_function(klass, class_data);
87
88 }
89
90
91 Glib::ObjectBase* WaveView_Class::wrap_new(GObject* o)
92 {
93   return manage(new WaveView((GnomeCanvasWaveView*)(o)));
94
95 }
96
97
98 /* The implementation: */
99
100 WaveView::WaveView(const Glib::ConstructParams& construct_params)
101 :
102   Item(construct_params)
103 {
104   }
105
106 WaveView::WaveView(GnomeCanvasWaveView* castitem)
107 :
108   Item((GnomeCanvasItem*)(castitem))
109 {
110   }
111
112 WaveView::~WaveView()
113 {
114   destroy_();
115 }
116
117 WaveView::CppClassType WaveView::waveview_class_; // initialize static member
118
119 GType WaveView::get_type()
120 {
121   return waveview_class_.init().get_type();
122 }
123
124 GType WaveView::get_base_type()
125 {
126   return gnome_canvas_waveview_get_type();
127 }
128
129 Glib::PropertyProxy<void*> WaveView::property_data_src()
130 {
131         return Glib::PropertyProxy<void*> (this, "data-src");
132 }
133 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_data_src() const
134 {
135         return Glib::PropertyProxy_ReadOnly<void*> (this, "data-src");
136 }
137 Glib::PropertyProxy<void*> WaveView::property_channel() 
138 {
139         return Glib::PropertyProxy<void*> (this, "channel");
140 }
141 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_channel()  const
142 {
143         return Glib::PropertyProxy_ReadOnly<void*> (this, "channel");
144 }
145 Glib::PropertyProxy<void*> WaveView::property_length_function()
146 {
147         return Glib::PropertyProxy<void*> (this, "length-function");
148 }
149 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_length_function() const
150 {
151         return Glib::PropertyProxy_ReadOnly<void*> (this, "length-function");
152 }
153 Glib::PropertyProxy<void*> WaveView::property_sourcefile_length_function()
154 {
155         return Glib::PropertyProxy<void*> (this, "sourcefile-length-function");
156 }
157 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_sourcefile_length_function() const
158 {
159         return Glib::PropertyProxy_ReadOnly<void*> (this, "sourcefile-length-function");
160 }
161 Glib::PropertyProxy<void*> WaveView::property_peak_function()
162 {
163         return Glib::PropertyProxy<void*> (this, "peak-function");
164 }
165 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_peak_function() const
166 {
167         return Glib::PropertyProxy_ReadOnly<void*> (this, "peak-function");
168 }
169 Glib::PropertyProxy<void*> WaveView::property_gain_function()
170 {
171         return Glib::PropertyProxy<void*> (this, "gain-function");
172 }
173 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_function() const
174 {
175         return Glib::PropertyProxy_ReadOnly<void*> (this, "gain-function");
176 }
177 Glib::PropertyProxy<void*> WaveView::property_gain_src()
178 {
179         return Glib::PropertyProxy<void*> (this, "gain-src");
180 }
181 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_src() const
182 {
183         return Glib::PropertyProxy_ReadOnly<void*> (this, "gain-src");
184 }
185 Glib::PropertyProxy<void*> WaveView::property_cache()
186 {
187         return Glib::PropertyProxy<void*> (this, "cache");
188 }
189 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache() const
190 {
191         return Glib::PropertyProxy_ReadOnly<void*> (this, "cache");
192 }
193 Glib::PropertyProxy<void*> WaveView::property_cache_updater()
194 {
195         return Glib::PropertyProxy<void*> (this, "cache-updater");
196 }
197 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache_updater() const
198 {
199         return Glib::PropertyProxy_ReadOnly<void*> (this, "cache-updater");
200 }
201 Glib::PropertyProxy<double> WaveView::property_samples_per_unit()
202 {
203         return Glib::PropertyProxy<double> (this, "samples-per-unit");
204 }
205 Glib::PropertyProxy_ReadOnly<double> WaveView::property_samples_per_unit() const
206 {
207         return Glib::PropertyProxy_ReadOnly<double> (this, "samples-per-unit");
208 }
209 Glib::PropertyProxy<double> WaveView::property_amplitude_above_axis()
210 {
211         return Glib::PropertyProxy<double> (this, "amplitude-above-axis");
212 }
213 Glib::PropertyProxy_ReadOnly<double> WaveView::property_amplitude_above_axis() const
214 {
215         return Glib::PropertyProxy_ReadOnly<double> (this, "amplitude-above-axis");
216 }
217 Glib::PropertyProxy<double> WaveView::property_x()
218 {
219         return Glib::PropertyProxy<double> (this, "x");
220 }
221 Glib::PropertyProxy_ReadOnly<double> WaveView::property_x() const
222 {
223         return Glib::PropertyProxy_ReadOnly<double> (this, "x");
224 }
225 Glib::PropertyProxy<double> WaveView::property_y()
226 {
227         return Glib::PropertyProxy<double> (this, "y");
228 }
229 Glib::PropertyProxy_ReadOnly<double> WaveView::property_y() const
230 {
231         return Glib::PropertyProxy_ReadOnly<double> (this, "y");
232 }
233 Glib::PropertyProxy<double> WaveView::property_height()
234 {
235         return Glib::PropertyProxy<double> (this, "height");
236 }
237 Glib::PropertyProxy_ReadOnly<double> WaveView::property_height() const
238 {
239         return Glib::PropertyProxy_ReadOnly<double> (this, "height");
240 }
241 Glib::PropertyProxy<guint> WaveView::property_wave_color()
242 {
243         return Glib::PropertyProxy<guint> (this, "wave_color");
244 }
245 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_wave_color() const
246 {
247         return Glib::PropertyProxy_ReadOnly<guint> (this, "wave_color");
248 }
249 Glib::PropertyProxy<gint> WaveView::property_rectified()
250 {
251         return Glib::PropertyProxy<gint> (this, "rectified");
252 }
253 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_rectified() const
254 {
255         return Glib::PropertyProxy_ReadOnly<gint> (this, "rectified");
256 }
257 Glib::PropertyProxy<guint> WaveView::property_region_start()
258 {
259         return Glib::PropertyProxy<guint> (this, "region-start");
260 }
261 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_region_start() const
262 {
263         return Glib::PropertyProxy_ReadOnly<guint> (this, "region-start");
264 }
265
266 } // namespace Canvas
267
268 } // namespace Gnome
269
270