Guitarix
racktuner.cc
Go to the documentation of this file.
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2 
3 
4 #include <glibmm.h>
5 
6 #include <gxwmm/racktuner.h>
7 #include <gxwmm/private/racktuner_p.h>
8 
9 
10 /*
11  * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26  */
27 
28 #include <gxw/GxRackTuner.h>
29 
30 namespace
31 {
32 
33 
34 static const Glib::SignalProxyInfo RackTuner_signal_frequency_poll_info =
35 {
36  "frequency-poll",
37  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback,
38  (GCallback) &Glib::SignalProxyNormal::slot0_void_callback
39 };
40 
41 
42 static void RackTuner_signal_poll_status_changed_callback(GxRackTuner* self, gboolean p0,void* data)
43 {
44  using namespace Gxw;
45  typedef sigc::slot< void,bool > SlotType;
46 
47  // Do not try to call a signal on a disassociated wrapper.
48  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
49  {
50  #ifdef GLIBMM_EXCEPTIONS_ENABLED
51  try
52  {
53  #endif //GLIBMM_EXCEPTIONS_ENABLED
54  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
55  (*static_cast<SlotType*>(slot))(p0
56 );
57  #ifdef GLIBMM_EXCEPTIONS_ENABLED
58  }
59  catch(...)
60  {
61  Glib::exception_handlers_invoke();
62  }
63  #endif //GLIBMM_EXCEPTIONS_ENABLED
64  }
65 }
66 
67 static const Glib::SignalProxyInfo RackTuner_signal_poll_status_changed_info =
68 {
69  "poll-status-changed",
70  (GCallback) &RackTuner_signal_poll_status_changed_callback,
71  (GCallback) &RackTuner_signal_poll_status_changed_callback
72 };
73 
74 
75 } // anonymous namespace
76 
77 
78 namespace Glib
79 {
80 
81 Gxw::RackTuner* wrap(GxRackTuner* object, bool take_copy)
82 {
83  return dynamic_cast<Gxw::RackTuner *> (Glib::wrap_auto ((GObject*)(object), take_copy));
84 }
85 
86 } /* namespace Glib */
87 
88 namespace Gxw
89 {
90 
91 
92 /* The *_Class implementation: */
93 
94 const Glib::Class& RackTuner_Class::init()
95 {
96  if(!gtype_) // create the GType if necessary
97  {
98  // Glib::Class has to know the class init function to clone custom types.
99  class_init_func_ = &RackTuner_Class::class_init_function;
100 
101  // This is actually just optimized away, apparently with no harm.
102  // Make sure that the parent type has been created.
103  //CppClassParent::CppObjectType::get_type();
104 
105  // Create the wrapper type, with the same class/instance size as the base type.
106  register_derived_type(gx_rack_tuner_get_type());
107 
108  // Add derived versions of interfaces, if the C type implements any interfaces:
109 
110  }
111 
112  return *this;
113 }
114 
115 
116 void RackTuner_Class::class_init_function(void* g_class, void* class_data)
117 {
118  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
119  CppClassParent::class_init_function(klass, class_data);
120 
121 
122  klass->frequency_poll = &frequency_poll_callback;
123  klass->poll_status_changed = &poll_status_changed_callback;
124 }
125 
126 
127 void RackTuner_Class::frequency_poll_callback(GxRackTuner* self)
128 {
129  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
130  Glib::ObjectBase::_get_current_wrapper((GObject*)self));
131 
132  // Non-gtkmmproc-generated custom classes implicitly call the default
133  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
134  // generated classes can use this optimisation, which avoids the unnecessary
135  // parameter conversions if there is no possibility of the virtual function
136  // being overridden:
137  if(obj_base && obj_base->is_derived_())
138  {
139  CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
140  if(obj) // This can be NULL during destruction.
141  {
142  #ifdef GLIBMM_EXCEPTIONS_ENABLED
143  try // Trap C++ exceptions which would normally be lost because this is a C callback.
144  {
145  #endif //GLIBMM_EXCEPTIONS_ENABLED
146  // Call the virtual member method, which derived classes might override.
147  obj->on_frequency_poll();
148  return;
149  #ifdef GLIBMM_EXCEPTIONS_ENABLED
150  }
151  catch(...)
152  {
153  Glib::exception_handlers_invoke();
154  }
155  #endif //GLIBMM_EXCEPTIONS_ENABLED
156  }
157  }
158 
159  BaseClassType *const base = static_cast<BaseClassType*>(
160  g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
161  );
162 
163  // Call the original underlying C function:
164  if(base && base->frequency_poll)
165  (*base->frequency_poll)(self);
166 }
167 void RackTuner_Class::poll_status_changed_callback(GxRackTuner* self, gboolean p0)
168 {
169  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
170  Glib::ObjectBase::_get_current_wrapper((GObject*)self));
171 
172  // Non-gtkmmproc-generated custom classes implicitly call the default
173  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
174  // generated classes can use this optimisation, which avoids the unnecessary
175  // parameter conversions if there is no possibility of the virtual function
176  // being overridden:
177  if(obj_base && obj_base->is_derived_())
178  {
179  CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
180  if(obj) // This can be NULL during destruction.
181  {
182  #ifdef GLIBMM_EXCEPTIONS_ENABLED
183  try // Trap C++ exceptions which would normally be lost because this is a C callback.
184  {
185  #endif //GLIBMM_EXCEPTIONS_ENABLED
186  // Call the virtual member method, which derived classes might override.
187  obj->on_poll_status_changed(p0
188 );
189  return;
190  #ifdef GLIBMM_EXCEPTIONS_ENABLED
191  }
192  catch(...)
193  {
194  Glib::exception_handlers_invoke();
195  }
196  #endif //GLIBMM_EXCEPTIONS_ENABLED
197  }
198  }
199 
200  BaseClassType *const base = static_cast<BaseClassType*>(
201  g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
202  );
203 
204  // Call the original underlying C function:
205  if(base && base->poll_status_changed)
206  (*base->poll_status_changed)(self, p0);
207 }
208 
209 
210 Glib::ObjectBase* RackTuner_Class::wrap_new(GObject* o)
211 {
212  return manage(new RackTuner((GxRackTuner*)(o)));
213 
214 }
215 
216 
217 /* The implementation: */
218 
219 RackTuner::RackTuner(const Glib::ConstructParams& construct_params)
220 :
221  Gxw::Tuner(construct_params)
222 {
223  }
224 
226 :
227  Gxw::Tuner((GxTuner*)(castitem))
228 {
229  }
230 
232 {
233  destroy_();
234 }
235 
236 RackTuner::CppClassType RackTuner::racktuner_class_; // initialize static member
237 
239 {
240  return racktuner_class_.init().get_type();
241 }
242 
243 
245 {
246  return gx_rack_tuner_get_type();
247 }
248 
249 
251 :
252  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
253  Glib::ObjectBase(0),
254  Gxw::Tuner(Glib::ConstructParams(racktuner_class_.init()))
255 {
256 
257 
258 }
259 
261 {
262  return gx_rack_tuner_get_poll_status(gobj());
263 }
264 
265 void RackTuner::set_freq(double p1)
266 {
267  gx_rack_tuner_set_freq(gobj(), p1);
268 }
269 
271 {
272  gx_rack_tuner_set_scale_lim(gobj(), p1);
273 }
274 
276 {
277  return gx_rack_tuner_get_scale_lim(gobj());
278 }
279 
280 void RackTuner::set_speed(double p1)
281 {
282  gx_rack_tuner_set_speed(gobj(), p1);
283 }
284 
286 {
287  return gx_rack_tuner_get_speed(gobj());
288 }
289 
291 {
292  gx_rack_tuner_set_streaming(gobj(), static_cast<int>(p1));
293 }
294 
296 {
297  return gx_rack_tuner_get_streaming(gobj());
298 }
299 
301 {
302  gx_rack_tuner_set_display_flat(gobj(), static_cast<int>(p1));
303 }
304 
306 {
307  return gx_rack_tuner_get_display_flat(gobj());
308 }
309 
311 {
312  gx_rack_tuner_set_timestep(gobj(), p1);
313 }
314 
316 {
317  return gx_rack_tuner_get_timestep(gobj());
318 }
319 
321 {
322  gx_rack_tuner_set_limit_timestep(gobj(), p1);
323 }
324 
326 {
327  return gx_rack_tuner_get_limit_timestep(gobj());
328 }
329 
331 {
332  gx_rack_tuner_set_temperament(gobj(), p1);
333 }
334 
336 {
337  return gx_rack_tuner_get_temperament(gobj());
338 }
339 
341 {
342  gx_rack_tuner_clear_notes(gobj());
343 }
344 
345 void RackTuner::push_note(int p1, int p2, int p3)
346 {
347  gx_rack_tuner_push_note(gobj(), p1, p2, p3);
348 }
349 
350 
351 Glib::SignalProxy0< void > RackTuner::signal_frequency_poll()
352 {
353  return Glib::SignalProxy0< void >(this, &RackTuner_signal_frequency_poll_info);
354 }
355 
356 
357 Glib::SignalProxy1< void,bool > RackTuner::signal_poll_status_changed()
358 {
359  return Glib::SignalProxy1< void,bool >(this, &RackTuner_signal_poll_status_changed_info);
360 }
361 
362 
363 #ifdef GLIBMM_PROPERTIES_ENABLED
364 Glib::PropertyProxy< double > RackTuner::property_freq()
365 {
366  return Glib::PropertyProxy< double >(this, "freq");
367 }
368 #endif //GLIBMM_PROPERTIES_ENABLED
369 
370 #ifdef GLIBMM_PROPERTIES_ENABLED
371 Glib::PropertyProxy_ReadOnly< double > RackTuner::property_freq() const
372 {
373  return Glib::PropertyProxy_ReadOnly< double >(this, "freq");
374 }
375 #endif //GLIBMM_PROPERTIES_ENABLED
376 
377 #ifdef GLIBMM_PROPERTIES_ENABLED
378 Glib::PropertyProxy< double > RackTuner::property_scale_lim()
379 {
380  return Glib::PropertyProxy< double >(this, "scale-lim");
381 }
382 #endif //GLIBMM_PROPERTIES_ENABLED
383 
384 #ifdef GLIBMM_PROPERTIES_ENABLED
385 Glib::PropertyProxy_ReadOnly< double > RackTuner::property_scale_lim() const
386 {
387  return Glib::PropertyProxy_ReadOnly< double >(this, "scale-lim");
388 }
389 #endif //GLIBMM_PROPERTIES_ENABLED
390 
391 #ifdef GLIBMM_PROPERTIES_ENABLED
392 Glib::PropertyProxy< double > RackTuner::property_speed()
393 {
394  return Glib::PropertyProxy< double >(this, "speed");
395 }
396 #endif //GLIBMM_PROPERTIES_ENABLED
397 
398 #ifdef GLIBMM_PROPERTIES_ENABLED
399 Glib::PropertyProxy_ReadOnly< double > RackTuner::property_speed() const
400 {
401  return Glib::PropertyProxy_ReadOnly< double >(this, "speed");
402 }
403 #endif //GLIBMM_PROPERTIES_ENABLED
404 
405 #ifdef GLIBMM_PROPERTIES_ENABLED
406 Glib::PropertyProxy< bool > RackTuner::property_display_flat()
407 {
408  return Glib::PropertyProxy< bool >(this, "display-flat");
409 }
410 #endif //GLIBMM_PROPERTIES_ENABLED
411 
412 #ifdef GLIBMM_PROPERTIES_ENABLED
413 Glib::PropertyProxy_ReadOnly< bool > RackTuner::property_display_flat() const
414 {
415  return Glib::PropertyProxy_ReadOnly< bool >(this, "display-flat");
416 }
417 #endif //GLIBMM_PROPERTIES_ENABLED
418 
419 #ifdef GLIBMM_PROPERTIES_ENABLED
420 Glib::PropertyProxy< bool > RackTuner::property_streaming()
421 {
422  return Glib::PropertyProxy< bool >(this, "streaming");
423 }
424 #endif //GLIBMM_PROPERTIES_ENABLED
425 
426 #ifdef GLIBMM_PROPERTIES_ENABLED
427 Glib::PropertyProxy_ReadOnly< bool > RackTuner::property_streaming() const
428 {
429  return Glib::PropertyProxy_ReadOnly< bool >(this, "streaming");
430 }
431 #endif //GLIBMM_PROPERTIES_ENABLED
432 
433 #ifdef GLIBMM_PROPERTIES_ENABLED
434 Glib::PropertyProxy< int > RackTuner::property_timestep()
435 {
436  return Glib::PropertyProxy< int >(this, "timestep");
437 }
438 #endif //GLIBMM_PROPERTIES_ENABLED
439 
440 #ifdef GLIBMM_PROPERTIES_ENABLED
441 Glib::PropertyProxy_ReadOnly< int > RackTuner::property_timestep() const
442 {
443  return Glib::PropertyProxy_ReadOnly< int >(this, "timestep");
444 }
445 #endif //GLIBMM_PROPERTIES_ENABLED
446 
447 #ifdef GLIBMM_PROPERTIES_ENABLED
448 Glib::PropertyProxy< int > RackTuner::property_limit_timestep()
449 {
450  return Glib::PropertyProxy< int >(this, "limit-timestep");
451 }
452 #endif //GLIBMM_PROPERTIES_ENABLED
453 
454 #ifdef GLIBMM_PROPERTIES_ENABLED
455 Glib::PropertyProxy_ReadOnly< int > RackTuner::property_limit_timestep() const
456 {
457  return Glib::PropertyProxy_ReadOnly< int >(this, "limit-timestep");
458 }
459 #endif //GLIBMM_PROPERTIES_ENABLED
460 
461 #ifdef GLIBMM_PROPERTIES_ENABLED
462 Glib::PropertyProxy< int > RackTuner::property_temperament()
463 {
464  return Glib::PropertyProxy< int >(this, "temperament");
465 }
466 #endif //GLIBMM_PROPERTIES_ENABLED
467 
468 #ifdef GLIBMM_PROPERTIES_ENABLED
469 Glib::PropertyProxy_ReadOnly< int > RackTuner::property_temperament() const
470 {
471  return Glib::PropertyProxy_ReadOnly< int >(this, "temperament");
472 }
473 #endif //GLIBMM_PROPERTIES_ENABLED
474 
475 
477 {
478  BaseClassType *const base = static_cast<BaseClassType*>(
479  g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
480  );
481 
482  if(base && base->frequency_poll)
483  (*base->frequency_poll)(gobj());
484 }
486 {
487  BaseClassType *const base = static_cast<BaseClassType*>(
488  g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
489  );
490 
491  if(base && base->poll_status_changed)
492  (*base->poll_status_changed)(gobj(),static_cast<int>(p1));
493 }
494 
495 
496 } // namespace Gxw
497 
498 
Glib
Definition: bigknob.cc:41
cabinet_impulse_former::init
void init(int samplingFreq)
Definition: cabinet_impulse_former.cc:37
Gxw::RackTuner::get_display_flat
bool get_display_flat()
Definition: racktuner.cc:305
Gxw::RackTuner::get_poll_status
bool get_poll_status()
Definition: racktuner.cc:260
Gxw::RackTuner::signal_poll_status_changed
Glib::SignalProxy1< void, bool > signal_poll_status_changed()
Definition: racktuner.cc:357
Gxw::RackTuner::get_limit_timestep
int get_limit_timestep()
Definition: racktuner.cc:325
Gxw::RackTuner::get_speed
double get_speed()
Definition: racktuner.cc:285
GxTuner
struct _GxTuner GxTuner
Definition: tuner.h:32
Gxw::RackTuner::get_temperament
int get_temperament()
Definition: racktuner.cc:335
Gxw::RackTuner_Class
Definition: wrap_init.cc:97
Gxw::RackTuner::get_base_type
static GType get_base_type() G_GNUC_CONST
Definition: racktuner.cc:244
GxRackTuner
struct _GxRackTuner GxRackTuner
Definition: racktuner.h:32
Gxw::RackTuner::clear_notes
void clear_notes()
Definition: racktuner.cc:340
Gxw::RackTuner::get_type
static GType get_type() G_GNUC_CONST
Definition: racktuner.cc:238
Gxw::RackTuner::~RackTuner
virtual ~RackTuner()
Definition: racktuner.cc:231
Gxw::RackTuner::set_limit_timestep
void set_limit_timestep(int p1)
Definition: racktuner.cc:320
Gxw::RackTuner_Class::wrap_new
static Glib::ObjectBase * wrap_new(GObject *)
Definition: racktuner.cc:210
Gxw::RackTuner::BaseClassType
GxRackTunerClass BaseClassType
Definition: racktuner.h:48
Gxw::RackTuner::set_freq
void set_freq(double p1)
Definition: racktuner.cc:265
Gxw::RackTuner::push_note
void push_note(int p1, int p2, int p3)
Definition: racktuner.cc:345
Gxw::RackTuner::set_display_flat
void set_display_flat(bool p1)
Definition: racktuner.cc:300
Gxw::RackTuner::signal_frequency_poll
Glib::SignalProxy0< void > signal_frequency_poll()
Definition: racktuner.cc:351
Gxw::RackTuner
Definition: racktuner.h:42
Gxw
Definition: bigknob.cc:51
Gxw::RackTuner::get_timestep
int get_timestep()
Definition: racktuner.cc:315
Glib::wrap
Gxw::BigKnob * wrap(GxBigKnob *object, bool take_copy)
Definition: bigknob.cc:44
Gxw::RackTuner::set_scale_lim
void set_scale_lim(double p1)
Definition: racktuner.cc:270
Gxw::RackTuner::set_speed
void set_speed(double p1)
Definition: racktuner.cc:280
Gxw::RackTuner::get_streaming
bool get_streaming()
Definition: racktuner.cc:295
Gxw::RackTuner::set_timestep
void set_timestep(int p1)
Definition: racktuner.cc:310
Gxw::RackTuner::on_frequency_poll
virtual void on_frequency_poll()
This is a default handler for the signal signal_frequency_poll().
Definition: racktuner.cc:476
Gxw::RackTuner::RackTuner
RackTuner()
Definition: racktuner.cc:250
Gxw::RackTuner::set_temperament
void set_temperament(int p1)
Definition: racktuner.cc:330
Gxw::RackTuner::on_poll_status_changed
virtual void on_poll_status_changed(bool p1)
This is a default handler for the signal signal_poll_status_changed().
Definition: racktuner.cc:485
Gxw::RackTuner::set_streaming
void set_streaming(bool p1)
Definition: racktuner.cc:290
Gxw::RackTuner::get_scale_lim
double get_scale_lim()
Definition: racktuner.cc:275
Gxw::RackTuner::gobj
GxRackTuner * gobj()
Provides access to the underlying C GtkObject.
Definition: racktuner.h:78
gx_rack_tuner_get_type
GType gx_rack_tuner_get_type(void)
Gxw::Tuner
Definition: tuner.h:42