Guitarix
iredit.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/iredit.h>
7 #include <gxwmm/private/iredit_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/GxIREdit.h>
29 
30 namespace Gxw
31 {
32 
34  float *data, int chan, int data_len, int samplerate, int cutoff_low,
35  int cutoff_high, int offset, const Gainline& gain)
36 {
37  gx_ir_edit_set_state(
38  gobj(), data, chan, data_len, samplerate, cutoff_low, cutoff_high,
39  offset, gain.points(), gain.size());
40 }
41 
42 Gainline IREdit::get_gain()
43 {
44  gain_points* p;
45  int n;
46  gx_ir_edit_get_gain(gobj(), &p, &n);
47  return Gainline(p, n);
48 }
49 
50 void IREdit::set_gain(const Gainline& g)
51 {
52  gx_ir_edit_set_gain(gobj(), g.points(), g.size());
53 }
54 
55 } // namespace Gxw
56 
57 namespace
58 {
59 
60 
61 static void IREdit_signal_delay_changed_callback(GxIREdit* self, gint p0,gint p1,void* data)
62 {
63  using namespace Gxw;
64  typedef sigc::slot< void,int,int > SlotType;
65 
66  // Do not try to call a signal on a disassociated wrapper.
67  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
68  {
69  #ifdef GLIBMM_EXCEPTIONS_ENABLED
70  try
71  {
72  #endif //GLIBMM_EXCEPTIONS_ENABLED
73  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
74  (*static_cast<SlotType*>(slot))(p0
75 , p1
76 );
77  #ifdef GLIBMM_EXCEPTIONS_ENABLED
78  }
79  catch(...)
80  {
81  Glib::exception_handlers_invoke();
82  }
83  #endif //GLIBMM_EXCEPTIONS_ENABLED
84  }
85 }
86 
87 static const Glib::SignalProxyInfo IREdit_signal_delay_changed_info =
88 {
89  "delay-changed",
90  (GCallback) &IREdit_signal_delay_changed_callback,
91  (GCallback) &IREdit_signal_delay_changed_callback
92 };
93 
94 
95 static void IREdit_signal_offset_changed_callback(GxIREdit* self, gint p0,gint p1,void* data)
96 {
97  using namespace Gxw;
98  typedef sigc::slot< void,int,int > SlotType;
99 
100  // Do not try to call a signal on a disassociated wrapper.
101  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
102  {
103  #ifdef GLIBMM_EXCEPTIONS_ENABLED
104  try
105  {
106  #endif //GLIBMM_EXCEPTIONS_ENABLED
107  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
108  (*static_cast<SlotType*>(slot))(p0
109 , p1
110 );
111  #ifdef GLIBMM_EXCEPTIONS_ENABLED
112  }
113  catch(...)
114  {
115  Glib::exception_handlers_invoke();
116  }
117  #endif //GLIBMM_EXCEPTIONS_ENABLED
118  }
119 }
120 
121 static const Glib::SignalProxyInfo IREdit_signal_offset_changed_info =
122 {
123  "offset-changed",
124  (GCallback) &IREdit_signal_offset_changed_callback,
125  (GCallback) &IREdit_signal_offset_changed_callback
126 };
127 
128 
129 static void IREdit_signal_length_changed_callback(GxIREdit* self, gint p0,gint p1,void* data)
130 {
131  using namespace Gxw;
132  typedef sigc::slot< void,int,int > SlotType;
133 
134  // Do not try to call a signal on a disassociated wrapper.
135  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
136  {
137  #ifdef GLIBMM_EXCEPTIONS_ENABLED
138  try
139  {
140  #endif //GLIBMM_EXCEPTIONS_ENABLED
141  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
142  (*static_cast<SlotType*>(slot))(p0
143 , p1
144 );
145  #ifdef GLIBMM_EXCEPTIONS_ENABLED
146  }
147  catch(...)
148  {
149  Glib::exception_handlers_invoke();
150  }
151  #endif //GLIBMM_EXCEPTIONS_ENABLED
152  }
153 }
154 
155 static const Glib::SignalProxyInfo IREdit_signal_length_changed_info =
156 {
157  "length-changed",
158  (GCallback) &IREdit_signal_length_changed_callback,
159  (GCallback) &IREdit_signal_length_changed_callback
160 };
161 
162 
163 static void IREdit_signal_scale_max_reached_callback(GxIREdit* self, gboolean p0,void* data)
164 {
165  using namespace Gxw;
166  typedef sigc::slot< void,bool > SlotType;
167 
168  // Do not try to call a signal on a disassociated wrapper.
169  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
170  {
171  #ifdef GLIBMM_EXCEPTIONS_ENABLED
172  try
173  {
174  #endif //GLIBMM_EXCEPTIONS_ENABLED
175  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
176  (*static_cast<SlotType*>(slot))(p0
177 );
178  #ifdef GLIBMM_EXCEPTIONS_ENABLED
179  }
180  catch(...)
181  {
182  Glib::exception_handlers_invoke();
183  }
184  #endif //GLIBMM_EXCEPTIONS_ENABLED
185  }
186 }
187 
188 static const Glib::SignalProxyInfo IREdit_signal_scale_max_reached_info =
189 {
190  "scale-max-reached",
191  (GCallback) &IREdit_signal_scale_max_reached_callback,
192  (GCallback) &IREdit_signal_scale_max_reached_callback
193 };
194 
195 
196 static void IREdit_signal_scale_min_reached_callback(GxIREdit* self, gboolean p0,void* data)
197 {
198  using namespace Gxw;
199  typedef sigc::slot< void,bool > SlotType;
200 
201  // Do not try to call a signal on a disassociated wrapper.
202  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
203  {
204  #ifdef GLIBMM_EXCEPTIONS_ENABLED
205  try
206  {
207  #endif //GLIBMM_EXCEPTIONS_ENABLED
208  if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
209  (*static_cast<SlotType*>(slot))(p0
210 );
211  #ifdef GLIBMM_EXCEPTIONS_ENABLED
212  }
213  catch(...)
214  {
215  Glib::exception_handlers_invoke();
216  }
217  #endif //GLIBMM_EXCEPTIONS_ENABLED
218  }
219 }
220 
221 static const Glib::SignalProxyInfo IREdit_signal_scale_min_reached_info =
222 {
223  "scale-min-reached",
224  (GCallback) &IREdit_signal_scale_min_reached_callback,
225  (GCallback) &IREdit_signal_scale_min_reached_callback
226 };
227 
228 
229 } // anonymous namespace
230 
231 
232 namespace Glib
233 {
234 
235 Gxw::IREdit* wrap(GxIREdit* object, bool take_copy)
236 {
237  return dynamic_cast<Gxw::IREdit *> (Glib::wrap_auto ((GObject*)(object), take_copy));
238 }
239 
240 } /* namespace Glib */
241 
242 namespace Gxw
243 {
244 
245 
246 /* The *_Class implementation: */
247 
248 const Glib::Class& IREdit_Class::init()
249 {
250  if(!gtype_) // create the GType if necessary
251  {
252  // Glib::Class has to know the class init function to clone custom types.
253  class_init_func_ = &IREdit_Class::class_init_function;
254 
255  // This is actually just optimized away, apparently with no harm.
256  // Make sure that the parent type has been created.
257  //CppClassParent::CppObjectType::get_type();
258 
259  // Create the wrapper type, with the same class/instance size as the base type.
260  register_derived_type(gx_ir_edit_get_type());
261 
262  // Add derived versions of interfaces, if the C type implements any interfaces:
263 
264  }
265 
266  return *this;
267 }
268 
269 
270 void IREdit_Class::class_init_function(void* g_class, void* class_data)
271 {
272  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
273  CppClassParent::class_init_function(klass, class_data);
274 
275 
276 }
277 
278 
279 Glib::ObjectBase* IREdit_Class::wrap_new(GObject* o)
280 {
281  return manage(new IREdit((GxIREdit*)(o)));
282 
283 }
284 
285 
286 /* The implementation: */
287 
288 IREdit::IREdit(const Glib::ConstructParams& construct_params)
289 :
290  Gtk::DrawingArea(construct_params)
291 {
292  }
293 
295 :
296  Gtk::DrawingArea((GtkDrawingArea*)(castitem))
297 {
298  }
299 
301 {
302  destroy_();
303 }
304 
305 IREdit::CppClassType IREdit::iredit_class_; // initialize static member
306 
308 {
309  return iredit_class_.init().get_type();
310 }
311 
312 
314 {
315  return gx_ir_edit_get_type();
316 }
317 
318 
320 :
321  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
322  Glib::ObjectBase(0),
323  Gtk::DrawingArea(Glib::ConstructParams(iredit_class_.init()))
324 {
325 
326 
327 }
328 
329 void IREdit::set_ir_data(float* p1, int p2, int p3, int p4)
330 {
331  gx_ir_edit_set_ir_data(gobj(), p1, p2, p3, p4);
332 }
333 
335 {
336  gx_ir_edit_home(gobj());
337 }
338 
340 {
341  gx_ir_edit_jump_zoom_mark(gobj());
342 }
343 
345 {
346  gx_ir_edit_set_channel(gobj(), p1);
347 }
348 
349 void IREdit::incr_scale(double p1)
350 {
351  gx_ir_edit_incr_scale(gobj(), p1);
352 }
353 
354 void IREdit::decr_scale(double p1)
355 {
356  gx_ir_edit_decr_scale(gobj(), p1);
357 }
358 
359 void IREdit::set_log(bool p1)
360 {
361  gx_ir_edit_set_log(gobj(), static_cast<int>(p1));
362 }
363 
365 {
366  return gx_ir_edit_get_delay(gobj());
367 }
368 
369 void IREdit::set_delay(int p1)
370 {
371  gx_ir_edit_set_delay(gobj(), p1);
372 }
373 
375 {
376  return gx_ir_edit_get_offset(gobj());
377 }
378 
379 void IREdit::set_offset(int p1)
380 {
381  gx_ir_edit_set_offset(gobj(), p1);
382 }
383 
385 {
386  return gx_ir_edit_get_length(gobj());
387 }
388 
389 void IREdit::set_length(int p1)
390 {
391  gx_ir_edit_set_length(gobj(), p1);
392 }
393 
394 
395 Glib::SignalProxy2< void,int,int > IREdit::signal_delay_changed()
396 {
397  return Glib::SignalProxy2< void,int,int >(this, &IREdit_signal_delay_changed_info);
398 }
399 
400 
401 Glib::SignalProxy2< void,int,int > IREdit::signal_offset_changed()
402 {
403  return Glib::SignalProxy2< void,int,int >(this, &IREdit_signal_offset_changed_info);
404 }
405 
406 
407 Glib::SignalProxy2< void,int,int > IREdit::signal_length_changed()
408 {
409  return Glib::SignalProxy2< void,int,int >(this, &IREdit_signal_length_changed_info);
410 }
411 
412 
413 Glib::SignalProxy1< void,bool > IREdit::signal_scale_max_reached()
414 {
415  return Glib::SignalProxy1< void,bool >(this, &IREdit_signal_scale_max_reached_info);
416 }
417 
418 
419 Glib::SignalProxy1< void,bool > IREdit::signal_scale_min_reached()
420 {
421  return Glib::SignalProxy1< void,bool >(this, &IREdit_signal_scale_min_reached_info);
422 }
423 
424 
425 #ifdef GLIBMM_PROPERTIES_ENABLED
426 Glib::PropertyProxy< int > IREdit::property_y_border_top()
427 {
428  return Glib::PropertyProxy< int >(this, "y-border-top");
429 }
430 #endif //GLIBMM_PROPERTIES_ENABLED
431 
432 #ifdef GLIBMM_PROPERTIES_ENABLED
433 Glib::PropertyProxy_ReadOnly< int > IREdit::property_y_border_top() const
434 {
435  return Glib::PropertyProxy_ReadOnly< int >(this, "y-border-top");
436 }
437 #endif //GLIBMM_PROPERTIES_ENABLED
438 
439 #ifdef GLIBMM_PROPERTIES_ENABLED
440 Glib::PropertyProxy< int > IREdit::property_y_border_bottom()
441 {
442  return Glib::PropertyProxy< int >(this, "y-border-bottom");
443 }
444 #endif //GLIBMM_PROPERTIES_ENABLED
445 
446 #ifdef GLIBMM_PROPERTIES_ENABLED
447 Glib::PropertyProxy_ReadOnly< int > IREdit::property_y_border_bottom() const
448 {
449  return Glib::PropertyProxy_ReadOnly< int >(this, "y-border-bottom");
450 }
451 #endif //GLIBMM_PROPERTIES_ENABLED
452 
453 #ifdef GLIBMM_PROPERTIES_ENABLED
454 Glib::PropertyProxy< int > IREdit::property_x_border()
455 {
456  return Glib::PropertyProxy< int >(this, "x-border");
457 }
458 #endif //GLIBMM_PROPERTIES_ENABLED
459 
460 #ifdef GLIBMM_PROPERTIES_ENABLED
461 Glib::PropertyProxy_ReadOnly< int > IREdit::property_x_border() const
462 {
463  return Glib::PropertyProxy_ReadOnly< int >(this, "x-border");
464 }
465 #endif //GLIBMM_PROPERTIES_ENABLED
466 
467 #ifdef GLIBMM_PROPERTIES_ENABLED
468 Glib::PropertyProxy< int > IREdit::property_label_sep()
469 {
470  return Glib::PropertyProxy< int >(this, "label-sep");
471 }
472 #endif //GLIBMM_PROPERTIES_ENABLED
473 
474 #ifdef GLIBMM_PROPERTIES_ENABLED
475 Glib::PropertyProxy_ReadOnly< int > IREdit::property_label_sep() const
476 {
477  return Glib::PropertyProxy_ReadOnly< int >(this, "label-sep");
478 }
479 #endif //GLIBMM_PROPERTIES_ENABLED
480 
481 #ifdef GLIBMM_PROPERTIES_ENABLED
482 Glib::PropertyProxy< double > IREdit::property_dot_diameter()
483 {
484  return Glib::PropertyProxy< double >(this, "dot-diameter");
485 }
486 #endif //GLIBMM_PROPERTIES_ENABLED
487 
488 #ifdef GLIBMM_PROPERTIES_ENABLED
489 Glib::PropertyProxy_ReadOnly< double > IREdit::property_dot_diameter() const
490 {
491  return Glib::PropertyProxy_ReadOnly< double >(this, "dot-diameter");
492 }
493 #endif //GLIBMM_PROPERTIES_ENABLED
494 
495 #ifdef GLIBMM_PROPERTIES_ENABLED
496 Glib::PropertyProxy< double > IREdit::property_segment_distance()
497 {
498  return Glib::PropertyProxy< double >(this, "segment-distance");
499 }
500 #endif //GLIBMM_PROPERTIES_ENABLED
501 
502 #ifdef GLIBMM_PROPERTIES_ENABLED
503 Glib::PropertyProxy_ReadOnly< double > IREdit::property_segment_distance() const
504 {
505  return Glib::PropertyProxy_ReadOnly< double >(this, "segment-distance");
506 }
507 #endif //GLIBMM_PROPERTIES_ENABLED
508 
509 #ifdef GLIBMM_PROPERTIES_ENABLED
510 Glib::PropertyProxy< double > IREdit::property_limit()
511 {
512  return Glib::PropertyProxy< double >(this, "limit");
513 }
514 #endif //GLIBMM_PROPERTIES_ENABLED
515 
516 #ifdef GLIBMM_PROPERTIES_ENABLED
517 Glib::PropertyProxy_ReadOnly< double > IREdit::property_limit() const
518 {
519  return Glib::PropertyProxy_ReadOnly< double >(this, "limit");
520 }
521 #endif //GLIBMM_PROPERTIES_ENABLED
522 
523 #ifdef GLIBMM_PROPERTIES_ENABLED
524 Glib::PropertyProxy_ReadOnly< int > IREdit::property_fs() const
525 {
526  return Glib::PropertyProxy_ReadOnly< int >(this, "fs");
527 }
528 #endif //GLIBMM_PROPERTIES_ENABLED
529 
530 #ifdef GLIBMM_PROPERTIES_ENABLED
531 Glib::PropertyProxy< double > IREdit::property_max_scale_fact()
532 {
533  return Glib::PropertyProxy< double >(this, "max-scale-fact");
534 }
535 #endif //GLIBMM_PROPERTIES_ENABLED
536 
537 #ifdef GLIBMM_PROPERTIES_ENABLED
538 Glib::PropertyProxy_ReadOnly< double > IREdit::property_max_scale_fact() const
539 {
540  return Glib::PropertyProxy_ReadOnly< double >(this, "max-scale-fact");
541 }
542 #endif //GLIBMM_PROPERTIES_ENABLED
543 
544 #ifdef GLIBMM_PROPERTIES_ENABLED
545 Glib::PropertyProxy< double > IREdit::property_min_scale()
546 {
547  return Glib::PropertyProxy< double >(this, "min-scale");
548 }
549 #endif //GLIBMM_PROPERTIES_ENABLED
550 
551 #ifdef GLIBMM_PROPERTIES_ENABLED
552 Glib::PropertyProxy_ReadOnly< double > IREdit::property_min_scale() const
553 {
554  return Glib::PropertyProxy_ReadOnly< double >(this, "min-scale");
555 }
556 #endif //GLIBMM_PROPERTIES_ENABLED
557 
558 #ifdef GLIBMM_PROPERTIES_ENABLED
559 Glib::PropertyProxy< double > IREdit::property_scale()
560 {
561  return Glib::PropertyProxy< double >(this, "scale");
562 }
563 #endif //GLIBMM_PROPERTIES_ENABLED
564 
565 #ifdef GLIBMM_PROPERTIES_ENABLED
566 Glib::PropertyProxy_ReadOnly< double > IREdit::property_scale() const
567 {
568  return Glib::PropertyProxy_ReadOnly< double >(this, "scale");
569 }
570 #endif //GLIBMM_PROPERTIES_ENABLED
571 
572 #ifdef GLIBMM_PROPERTIES_ENABLED
573 Glib::PropertyProxy< Glib::ustring > IREdit::property_no_data_text()
574 {
575  return Glib::PropertyProxy< Glib::ustring >(this, "no-data-text");
576 }
577 #endif //GLIBMM_PROPERTIES_ENABLED
578 
579 #ifdef GLIBMM_PROPERTIES_ENABLED
580 Glib::PropertyProxy_ReadOnly< Glib::ustring > IREdit::property_no_data_text() const
581 {
582  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "no-data-text");
583 }
584 #endif //GLIBMM_PROPERTIES_ENABLED
585 
586 
587 } // namespace Gxw
588 
589 
virtual ~IREdit()
Definition: iredit.cc:300
void init(int samplingFreq)
Glib::SignalProxy2< void, int, int > signal_length_changed()
Definition: iredit.cc:407
GType gx_ir_edit_get_type(void)
void set_ir_data(float *p1, int p2, int p3, int p4)
Definition: iredit.cc:329
void home()
Definition: iredit.cc:334
Glib::SignalProxy2< void, int, int > signal_delay_changed()
Definition: iredit.cc:395
static Glib::ObjectBase * wrap_new(GObject *)
Definition: iredit.cc:279
GxIREdit * gobj()
Provides access to the underlying C GtkObject.
Definition: iredit.h:80
void set_log(bool p1)
Definition: iredit.cc:359
static GType get_base_type() G_GNUC_CONST
Definition: iredit.cc:313
void set_delay(int p1)
Definition: iredit.cc:369
void set_channel(int p1)
Definition: iredit.cc:344
void set_length(int p1)
Definition: iredit.cc:389
int get_length()
Definition: iredit.cc:384
void decr_scale(double p1)
Definition: iredit.cc:354
Glib::SignalProxy1< void, bool > signal_scale_max_reached()
Definition: iredit.cc:413
Gainline get_gain()
Definition: iredit.cc:42
void jump_zoom_mark()
Definition: iredit.cc:339
Definition: bigknob.cc:51
void set_offset(int p1)
Definition: iredit.cc:379
struct _GxIREdit GxIREdit
Definition: iredit.h:34
Glib::SignalProxy1< void, bool > signal_scale_min_reached()
Definition: iredit.cc:419
Glib::SignalProxy2< void, int, int > signal_offset_changed()
Definition: iredit.cc:401
int get_offset()
Definition: iredit.cc:374
void set_state(float *data, int chan, int data_len, int samplerate, int cutoff_low, int cutoff_high, int offset, const Gainline &gain)
Definition: iredit.cc:33
void incr_scale(double p1)
Definition: iredit.cc:349
void set_gain(const Gainline &gain)
Definition: iredit.cc:50
GxIREditClass BaseClassType
Definition: iredit.h:50
Definition: bigknob.cc:41
static GType get_type() G_GNUC_CONST
Definition: iredit.cc:307
int get_delay()
Definition: iredit.cc:364
Gxw::IREdit * wrap(GxIREdit *object, bool take_copy=false)
A Glib::wrap() method for this object.
Definition: iredit.cc:235