2 #include "waveview_p.h"
8 * Copyright (C) 1998 EMC Capital Management Inc.
9 * Developed by Havoc Pennington <hp@pobox.com>
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.
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.
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.
26 //#include <libgnomecanvasmm/group.h>
34 WaveView::WaveView(Group& parentx)
35 : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
37 item_construct(parentx);
40 } /* namespace Canvas */
41 } /* namespace Gnome */
47 Gnome::Canvas::WaveView* wrap(GnomeCanvasWaveView* object, bool take_copy)
49 return dynamic_cast<Gnome::Canvas::WaveView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
52 } /* namespace Glib */
61 /* The *_Class implementation: */
63 const Glib::Class& WaveView_Class::init()
65 if(!gtype_) // create the GType if necessary
67 // Glib::Class has to know the class init function to clone custom types.
68 class_init_func_ = &WaveView_Class::class_init_function;
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();
74 // Create the wrapper type, with the same class/instance size as the base type.
75 register_derived_type(gnome_canvas_waveview_get_type());
77 // Add derived versions of interfaces, if the C type implements any interfaces:
83 void WaveView_Class::class_init_function(void* g_class, void* class_data)
85 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
86 CppClassParent::class_init_function(klass, class_data);
91 Glib::ObjectBase* WaveView_Class::wrap_new(GObject* o)
93 return manage(new WaveView((GnomeCanvasWaveView*)(o)));
98 /* The implementation: */
100 WaveView::WaveView(const Glib::ConstructParams& construct_params)
102 Item(construct_params)
106 WaveView::WaveView(GnomeCanvasWaveView* castitem)
108 Item((GnomeCanvasItem*)(castitem))
112 WaveView::~WaveView()
117 WaveView::CppClassType WaveView::waveview_class_; // initialize static member
119 GType WaveView::get_type()
121 return waveview_class_.init().get_type();
124 GType WaveView::get_base_type()
126 return gnome_canvas_waveview_get_type();
129 GnomeCanvasWaveViewCache*
130 WaveView::create_cache ()
132 return gnome_canvas_waveview_cache_new ();
135 Glib::PropertyProxy<void*> WaveView::property_data_src()
137 return Glib::PropertyProxy<void*> (this, "data_src");
139 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_data_src() const
141 return Glib::PropertyProxy_ReadOnly<void*> (this, "data_src");
143 Glib::PropertyProxy<uint32_t> WaveView::property_channel()
145 return Glib::PropertyProxy<uint32_t> (this, "channel");
147 Glib::PropertyProxy_ReadOnly<uint32_t> WaveView::property_channel() const
149 return Glib::PropertyProxy_ReadOnly<uint32_t> (this, "channel");
151 Glib::PropertyProxy<void*> WaveView::property_length_function()
153 return Glib::PropertyProxy<void*> (this, "length_function");
155 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_length_function() const
157 return Glib::PropertyProxy_ReadOnly<void*> (this, "length_function");
159 Glib::PropertyProxy<void*> WaveView::property_sourcefile_length_function()
161 return Glib::PropertyProxy<void*> (this, "sourcefile_length_function");
163 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_sourcefile_length_function() const
165 return Glib::PropertyProxy_ReadOnly<void*> (this, "sourcefile_length_function");
167 Glib::PropertyProxy<void*> WaveView::property_peak_function()
169 return Glib::PropertyProxy<void*> (this, "peak_function");
171 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_peak_function() const
173 return Glib::PropertyProxy_ReadOnly<void*> (this, "peak_function");
175 Glib::PropertyProxy<void*> WaveView::property_gain_function()
177 return Glib::PropertyProxy<void*> (this, "gain_function");
179 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_function() const
181 return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_function");
183 Glib::PropertyProxy<void*> WaveView::property_gain_src()
185 return Glib::PropertyProxy<void*> (this, "gain_src");
187 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_src() const
189 return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_src");
191 Glib::PropertyProxy<void*> WaveView::property_cache()
193 return Glib::PropertyProxy<void*> (this, "cache");
195 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache() const
197 return Glib::PropertyProxy_ReadOnly<void*> (this, "cache");
199 Glib::PropertyProxy<bool> WaveView::property_cache_updater()
201 return Glib::PropertyProxy<bool> (this, "cache_updater");
203 Glib::PropertyProxy_ReadOnly<bool> WaveView::property_cache_updater() const
205 return Glib::PropertyProxy_ReadOnly<bool> (this, "cache_updater");
207 Glib::PropertyProxy<double> WaveView::property_samples_per_unit()
209 return Glib::PropertyProxy<double> (this, "samples_per_unit");
211 Glib::PropertyProxy_ReadOnly<double> WaveView::property_samples_per_unit() const
213 return Glib::PropertyProxy_ReadOnly<double> (this, "samples_per_unit");
215 Glib::PropertyProxy<double> WaveView::property_amplitude_above_axis()
217 return Glib::PropertyProxy<double> (this, "amplitude_above_axis");
219 Glib::PropertyProxy_ReadOnly<double> WaveView::property_amplitude_above_axis() const
221 return Glib::PropertyProxy_ReadOnly<double> (this, "amplitude_above_axis");
223 Glib::PropertyProxy<double> WaveView::property_x()
225 return Glib::PropertyProxy<double> (this, "x");
227 Glib::PropertyProxy_ReadOnly<double> WaveView::property_x() const
229 return Glib::PropertyProxy_ReadOnly<double> (this, "x");
231 Glib::PropertyProxy<double> WaveView::property_y()
233 return Glib::PropertyProxy<double> (this, "y");
235 Glib::PropertyProxy_ReadOnly<double> WaveView::property_y() const
237 return Glib::PropertyProxy_ReadOnly<double> (this, "y");
239 Glib::PropertyProxy<double> WaveView::property_height()
241 return Glib::PropertyProxy<double> (this, "height");
243 Glib::PropertyProxy_ReadOnly<double> WaveView::property_height() const
245 return Glib::PropertyProxy_ReadOnly<double> (this, "height");
247 Glib::PropertyProxy<guint> WaveView::property_wave_color()
249 return Glib::PropertyProxy<guint> (this, "wave_color");
251 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_wave_color() const
253 return Glib::PropertyProxy_ReadOnly<guint> (this, "wave_color");
255 Glib::PropertyProxy<gint> WaveView::property_rectified()
257 return Glib::PropertyProxy<gint> (this, "rectified");
259 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_rectified() const
261 return Glib::PropertyProxy_ReadOnly<gint> (this, "rectified");
263 Glib::PropertyProxy<guint> WaveView::property_region_start()
265 return Glib::PropertyProxy<guint> (this, "region_start");
267 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_region_start() const
269 return Glib::PropertyProxy_ReadOnly<guint> (this, "region_start");
272 } // namespace Canvas