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