92e4fdd24a4bb6192952c162850ba747c3993308
[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 GnomeCanvasWaveViewCache*
130 WaveView::create_cache ()
131 {
132         return gnome_canvas_waveview_cache_new ();
133 }
134
135 Glib::PropertyProxy<void*> WaveView::property_data_src()
136 {
137         return Glib::PropertyProxy<void*> (this, "data_src");
138 }
139 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_data_src() const
140 {
141         return Glib::PropertyProxy_ReadOnly<void*> (this, "data_src");
142 }
143 Glib::PropertyProxy<uint32_t> WaveView::property_channel() 
144 {
145         return Glib::PropertyProxy<uint32_t> (this, "channel");
146 }
147 Glib::PropertyProxy_ReadOnly<uint32_t> WaveView::property_channel()  const
148 {
149         return Glib::PropertyProxy_ReadOnly<uint32_t> (this, "channel");
150 }
151 Glib::PropertyProxy<void*> WaveView::property_length_function()
152 {
153         return Glib::PropertyProxy<void*> (this, "length_function");
154 }
155 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_length_function() const
156 {
157         return Glib::PropertyProxy_ReadOnly<void*> (this, "length_function");
158 }
159 Glib::PropertyProxy<void*> WaveView::property_sourcefile_length_function()
160 {
161         return Glib::PropertyProxy<void*> (this, "sourcefile_length_function");
162 }
163 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_sourcefile_length_function() const
164 {
165         return Glib::PropertyProxy_ReadOnly<void*> (this, "sourcefile_length_function");
166 }
167 Glib::PropertyProxy<void*> WaveView::property_peak_function()
168 {
169         return Glib::PropertyProxy<void*> (this, "peak_function");
170 }
171 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_peak_function() const
172 {
173         return Glib::PropertyProxy_ReadOnly<void*> (this, "peak_function");
174 }
175 Glib::PropertyProxy<void*> WaveView::property_gain_function()
176 {
177         return Glib::PropertyProxy<void*> (this, "gain_function");
178 }
179 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_function() const
180 {
181         return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_function");
182 }
183 Glib::PropertyProxy<void*> WaveView::property_gain_src()
184 {
185         return Glib::PropertyProxy<void*> (this, "gain_src");
186 }
187 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_src() const
188 {
189         return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_src");
190 }
191 Glib::PropertyProxy<void*> WaveView::property_cache()
192 {
193         return Glib::PropertyProxy<void*> (this, "cache");
194 }
195 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache() const
196 {
197         return Glib::PropertyProxy_ReadOnly<void*> (this, "cache");
198 }
199 Glib::PropertyProxy<bool> WaveView::property_cache_updater()
200 {
201         return Glib::PropertyProxy<bool> (this, "cache_updater");
202 }
203 Glib::PropertyProxy_ReadOnly<bool> WaveView::property_cache_updater() const
204 {
205         return Glib::PropertyProxy_ReadOnly<bool> (this, "cache_updater");
206 }
207 Glib::PropertyProxy<double> WaveView::property_samples_per_unit()
208 {
209         return Glib::PropertyProxy<double> (this, "samples_per_unit");
210 }
211 Glib::PropertyProxy_ReadOnly<double> WaveView::property_samples_per_unit() const
212 {
213         return Glib::PropertyProxy_ReadOnly<double> (this, "samples_per_unit");
214 }
215 Glib::PropertyProxy<double> WaveView::property_amplitude_above_axis()
216 {
217         return Glib::PropertyProxy<double> (this, "amplitude_above_axis");
218 }
219 Glib::PropertyProxy_ReadOnly<double> WaveView::property_amplitude_above_axis() const
220 {
221         return Glib::PropertyProxy_ReadOnly<double> (this, "amplitude_above_axis");
222 }
223 Glib::PropertyProxy<double> WaveView::property_x()
224 {
225         return Glib::PropertyProxy<double> (this, "x");
226 }
227 Glib::PropertyProxy_ReadOnly<double> WaveView::property_x() const
228 {
229         return Glib::PropertyProxy_ReadOnly<double> (this, "x");
230 }
231 Glib::PropertyProxy<double> WaveView::property_y()
232 {
233         return Glib::PropertyProxy<double> (this, "y");
234 }
235 Glib::PropertyProxy_ReadOnly<double> WaveView::property_y() const
236 {
237         return Glib::PropertyProxy_ReadOnly<double> (this, "y");
238 }
239 Glib::PropertyProxy<double> WaveView::property_height()
240 {
241         return Glib::PropertyProxy<double> (this, "height");
242 }
243 Glib::PropertyProxy_ReadOnly<double> WaveView::property_height() const
244 {
245         return Glib::PropertyProxy_ReadOnly<double> (this, "height");
246 }
247 Glib::PropertyProxy<guint> WaveView::property_wave_color()
248 {
249         return Glib::PropertyProxy<guint> (this, "wave_color");
250 }
251 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_wave_color() const
252 {
253         return Glib::PropertyProxy_ReadOnly<guint> (this, "wave_color");
254 }
255 Glib::PropertyProxy<gint> WaveView::property_rectified()
256 {
257         return Glib::PropertyProxy<gint> (this, "rectified");
258 }
259 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_rectified() const
260 {
261         return Glib::PropertyProxy_ReadOnly<gint> (this, "rectified");
262 }
263 Glib::PropertyProxy<guint> WaveView::property_region_start()
264 {
265         return Glib::PropertyProxy<guint> (this, "region_start");
266 }
267 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_region_start() const
268 {
269         return Glib::PropertyProxy_ReadOnly<guint> (this, "region_start");
270 }
271 Glib::PropertyProxy<gint> WaveView::property_logscaled()
272 {
273         return Glib::PropertyProxy<gint> (this, "logscaled");
274 }
275 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_logscaled() const
276 {
277         return Glib::PropertyProxy_ReadOnly<gint> (this, "logscaled");
278 }
279
280 } // namespace Canvas
281
282 } // namespace Gnome
283
284