use entered track for fit-tracks if in internal edit mode and no tracks or regions...
[ardour2.git] / gtk2_ardour / waveview.cc
blob9cc53355be97b3071b444f7b9d0a9e2788b2be89
1 #include "waveview.h"
2 #include "waveview_p.h"
5 /* waveview.cc
7 * Copyright (C) 1998 EMC Capital Management Inc.
8 * Developed by Havoc Pennington <hp@pobox.com>
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.
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.
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.
25 //#include <libgnomecanvasmm/group.h>
27 namespace Gnome
30 namespace Canvas
33 WaveView::WaveView(Group& parentx)
34 : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
36 item_construct(parentx);
39 } /* namespace Canvas */
40 } /* namespace Gnome */
43 namespace Glib
46 Gnome::Canvas::WaveView* wrap(GnomeCanvasWaveView* object, bool take_copy)
48 return dynamic_cast<Gnome::Canvas::WaveView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
51 } /* namespace Glib */
53 namespace Gnome
56 namespace Canvas
60 /* The *_Class implementation: */
62 const Glib::Class& WaveView_Class::init()
64 if(!gtype_) // create the GType if necessary
66 // Glib::Class has to know the class init function to clone custom types.
67 class_init_func_ = &WaveView_Class::class_init_function;
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();
73 // Create the wrapper type, with the same class/instance size as the base type.
74 register_derived_type(gnome_canvas_waveview_get_type());
76 // Add derived versions of interfaces, if the C type implements any interfaces:
79 return *this;
82 void WaveView_Class::class_init_function(void* g_class, void* class_data)
84 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
85 CppClassParent::class_init_function(klass, class_data);
90 Glib::ObjectBase* WaveView_Class::wrap_new(GObject* o)
92 return manage(new WaveView((GnomeCanvasWaveView*)(o)));
97 /* The implementation: */
99 WaveView::WaveView(const Glib::ConstructParams& construct_params)
101 Item(construct_params)
105 WaveView::WaveView(GnomeCanvasWaveView* castitem)
107 Item((GnomeCanvasItem*)(castitem))
111 WaveView::~WaveView()
113 destroy_();
116 WaveView::CppClassType WaveView::waveview_class_; // initialize static member
118 GType WaveView::get_type()
120 return waveview_class_.init().get_type();
123 GType WaveView::get_base_type()
125 return gnome_canvas_waveview_get_type();
128 GnomeCanvasWaveViewCache*
129 WaveView::create_cache ()
131 return gnome_canvas_waveview_cache_new ();
134 Glib::PropertyProxy<void*> WaveView::property_data_src()
136 return Glib::PropertyProxy<void*> (this, "data_src");
138 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_data_src() const
140 return Glib::PropertyProxy_ReadOnly<void*> (this, "data_src");
142 Glib::PropertyProxy<uint32_t> WaveView::property_channel()
144 return Glib::PropertyProxy<uint32_t> (this, "channel");
146 Glib::PropertyProxy_ReadOnly<uint32_t> WaveView::property_channel() const
148 return Glib::PropertyProxy_ReadOnly<uint32_t> (this, "channel");
150 Glib::PropertyProxy<void*> WaveView::property_length_function()
152 return Glib::PropertyProxy<void*> (this, "length_function");
154 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_length_function() const
156 return Glib::PropertyProxy_ReadOnly<void*> (this, "length_function");
158 Glib::PropertyProxy<void*> WaveView::property_sourcefile_length_function()
160 return Glib::PropertyProxy<void*> (this, "sourcefile_length_function");
162 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_sourcefile_length_function() const
164 return Glib::PropertyProxy_ReadOnly<void*> (this, "sourcefile_length_function");
166 Glib::PropertyProxy<void*> WaveView::property_peak_function()
168 return Glib::PropertyProxy<void*> (this, "peak_function");
170 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_peak_function() const
172 return Glib::PropertyProxy_ReadOnly<void*> (this, "peak_function");
174 Glib::PropertyProxy<void*> WaveView::property_gain_function()
176 return Glib::PropertyProxy<void*> (this, "gain_function");
178 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_function() const
180 return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_function");
182 Glib::PropertyProxy<void*> WaveView::property_gain_src()
184 return Glib::PropertyProxy<void*> (this, "gain_src");
186 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_gain_src() const
188 return Glib::PropertyProxy_ReadOnly<void*> (this, "gain_src");
190 Glib::PropertyProxy<void*> WaveView::property_cache()
192 return Glib::PropertyProxy<void*> (this, "cache");
194 Glib::PropertyProxy_ReadOnly<void*> WaveView::property_cache() const
196 return Glib::PropertyProxy_ReadOnly<void*> (this, "cache");
198 Glib::PropertyProxy<bool> WaveView::property_cache_updater()
200 return Glib::PropertyProxy<bool> (this, "cache_updater");
202 Glib::PropertyProxy_ReadOnly<bool> WaveView::property_cache_updater() const
204 return Glib::PropertyProxy_ReadOnly<bool> (this, "cache_updater");
206 Glib::PropertyProxy<double> WaveView::property_samples_per_unit()
208 return Glib::PropertyProxy<double> (this, "samples_per_unit");
210 Glib::PropertyProxy_ReadOnly<double> WaveView::property_samples_per_unit() const
212 return Glib::PropertyProxy_ReadOnly<double> (this, "samples_per_unit");
214 Glib::PropertyProxy<double> WaveView::property_amplitude_above_axis()
216 return Glib::PropertyProxy<double> (this, "amplitude_above_axis");
218 Glib::PropertyProxy_ReadOnly<double> WaveView::property_amplitude_above_axis() const
220 return Glib::PropertyProxy_ReadOnly<double> (this, "amplitude_above_axis");
222 Glib::PropertyProxy<double> WaveView::property_x()
224 return Glib::PropertyProxy<double> (this, "x");
226 Glib::PropertyProxy_ReadOnly<double> WaveView::property_x() const
228 return Glib::PropertyProxy_ReadOnly<double> (this, "x");
230 Glib::PropertyProxy<double> WaveView::property_y()
232 return Glib::PropertyProxy<double> (this, "y");
234 Glib::PropertyProxy_ReadOnly<double> WaveView::property_y() const
236 return Glib::PropertyProxy_ReadOnly<double> (this, "y");
238 Glib::PropertyProxy<double> WaveView::property_height()
240 return Glib::PropertyProxy<double> (this, "height");
242 Glib::PropertyProxy_ReadOnly<double> WaveView::property_height() const
244 return Glib::PropertyProxy_ReadOnly<double> (this, "height");
246 Glib::PropertyProxy<guint> WaveView::property_wave_color()
248 return Glib::PropertyProxy<guint> (this, "wave_color");
250 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_wave_color() const
252 return Glib::PropertyProxy_ReadOnly<guint> (this, "wave_color");
254 Glib::PropertyProxy<guint> WaveView::property_clip_color()
256 return Glib::PropertyProxy<guint> (this, "clip_color");
258 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_clip_color() const
260 return Glib::PropertyProxy_ReadOnly<guint> (this, "clip_color");
262 Glib::PropertyProxy<guint> WaveView::property_zero_color()
264 return Glib::PropertyProxy<guint> (this, "zero_color");
266 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_zero_color() const
268 return Glib::PropertyProxy_ReadOnly<guint> (this, "zero_color");
270 Glib::PropertyProxy<guint> WaveView::property_fill_color()
272 return Glib::PropertyProxy<guint> (this, "fill_color");
274 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_fill_color() const
276 return Glib::PropertyProxy_ReadOnly<guint> (this, "fill_color");
278 Glib::PropertyProxy<gint> WaveView::property_filled()
280 return Glib::PropertyProxy<gint> (this, "filled");
282 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_filled() const
284 return Glib::PropertyProxy_ReadOnly<gint> (this, "filled");
286 Glib::PropertyProxy<gint> WaveView::property_rectified()
288 return Glib::PropertyProxy<gint> (this, "rectified");
290 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_rectified() const
292 return Glib::PropertyProxy_ReadOnly<gint> (this, "rectified");
294 Glib::PropertyProxy<gint> WaveView::property_zero_line()
296 return Glib::PropertyProxy<gint> (this, "zero_line");
298 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_zero_line() const
300 return Glib::PropertyProxy_ReadOnly<gint> (this, "zero_line");
302 Glib::PropertyProxy<guint> WaveView::property_region_start()
304 return Glib::PropertyProxy<guint> (this, "region_start");
306 Glib::PropertyProxy_ReadOnly<guint> WaveView::property_region_start() const
308 return Glib::PropertyProxy_ReadOnly<guint> (this, "region_start");
310 Glib::PropertyProxy<gint> WaveView::property_logscaled()
312 return Glib::PropertyProxy<gint> (this, "logscaled");
314 Glib::PropertyProxy_ReadOnly<gint> WaveView::property_logscaled() const
316 return Glib::PropertyProxy_ReadOnly<gint> (this, "logscaled");
319 } // namespace Canvas
321 } // namespace Gnome