Guitarix
controlparameter.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/controlparameter.h>
7 #include <gxwmm/private/controlparameter_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/GxControlParameter.h>
29 
30 namespace
31 {
32 } // anonymous namespace
33 
34 
35 namespace Glib
36 {
37 
38 Glib::RefPtr<Gxw::ControlParameter> wrap(GxControlParameter* object, bool take_copy)
39 {
40  return Glib::RefPtr<Gxw::ControlParameter>( dynamic_cast<Gxw::ControlParameter*> (Glib::wrap_auto_interface<Gxw::ControlParameter> ((GObject*)(object), take_copy)) );
41  //We use dynamic_cast<> in case of multiple inheritance.
42 }
43 
44 } // namespace Glib
45 
46 
47 namespace Gxw
48 {
49 
50 
51 /* The *_Class implementation: */
52 
53 const Glib::Interface_Class& ControlParameter_Class::init()
54 {
55  if(!gtype_) // create the GType if necessary
56  {
57  // Glib::Interface_Class has to know the interface init function
58  // in order to add interfaces to implementing types.
59  class_init_func_ = &ControlParameter_Class::iface_init_function;
60 
61  // We can not derive from another interface, and it is not necessary anyway.
62  gtype_ = gx_control_parameter_get_type();
63  }
64 
65  return *this;
66 }
67 
68 void ControlParameter_Class::iface_init_function(void* g_iface, void*)
69 {
70  BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
71 
72  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
73  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
74  g_assert(klass != 0);
75 
76 
77 }
78 
79 
80 Glib::ObjectBase* ControlParameter_Class::wrap_new(GObject* object)
81 {
82  return new ControlParameter((GxControlParameter*)(object));
83 }
84 
85 
86 /* The implementation: */
87 
89 :
90  Glib::Interface(controlparameter_class_.init())
91 {}
92 
94 :
95  Glib::Interface((GObject*)(castitem))
96 {}
97 
98 ControlParameter::ControlParameter(const Glib::Interface_Class& interface_class)
99 : Glib::Interface(interface_class)
100 {
101 }
102 
104 {}
105 
106 // static
107 void ControlParameter::add_interface(GType gtype_implementer)
108 {
109  controlparameter_class_.init().add_interface(gtype_implementer);
110 }
111 
112 ControlParameter::CppClassType ControlParameter::controlparameter_class_; // initialize static member
113 
115 {
116  return controlparameter_class_.init().get_type();
117 }
118 
119 
121 {
122  return gx_control_parameter_get_type();
123 }
124 
125 
126 void ControlParameter::cp_configure(Glib::ustring group, Glib::ustring name, double lower, double upper, double step)
127 {
128  gx_control_parameter_cp_configure(gobj(), g_strdup((group).c_str()), g_strdup((name).c_str()), lower, upper, step);
129 }
130 
132 {
133  gx_control_parameter_cp_set_value(gobj(), value);
134 }
135 
137 {
138  return gx_control_parameter_cp_get_value(gobj());
139 }
140 
142 {
143  return gx_control_parameter_cp_get_int_value(gobj());
144 }
145 
147 {
148  return Glib::convert_return_gchar_ptr_to_ustring(gx_control_parameter_cp_get_var(gobj()));
149 }
150 
151 void ControlParameter::cp_set_var(Glib::ustring p1)
152 {
153  gx_control_parameter_cp_set_var(gobj(), g_strdup((p1).c_str()));
154 }
155 
156 
157 #ifdef GLIBMM_PROPERTIES_ENABLED
158 Glib::PropertyProxy< Glib::ustring > ControlParameter::property_var_id()
159 {
160  return Glib::PropertyProxy< Glib::ustring >(this, "var-id");
161 }
162 #endif //GLIBMM_PROPERTIES_ENABLED
163 
164 #ifdef GLIBMM_PROPERTIES_ENABLED
165 Glib::PropertyProxy_ReadOnly< Glib::ustring > ControlParameter::property_var_id() const
166 {
167  return Glib::PropertyProxy_ReadOnly< Glib::ustring >(this, "var-id");
168 }
169 #endif //GLIBMM_PROPERTIES_ENABLED
170 
171 
172 } // namespace Gxw
173 
174 
Glib
Definition: bigknob.cc:41
Gxw::ControlParameter::gobj
GxControlParameter * gobj()
Provides access to the underlying C GObject.
Definition: controlparameter.h:103
Gxw::ControlParameter::cp_set_value
void cp_set_value(double value)
Definition: controlparameter.cc:131
cabinet_impulse_former::init
void init(int samplingFreq)
Definition: cabinet_impulse_former.cc:37
Gxw::ControlParameter::CppClassType
ControlParameter_Class CppClassType
Definition: controlparameter.h:55
Gxw::ControlParameter::~ControlParameter
virtual ~ControlParameter()
Definition: controlparameter.cc:103
Gxw::ControlParameter::cp_configure
void cp_configure(Glib::ustring group, Glib::ustring name, double lower, double upper, double step)
Definition: controlparameter.cc:126
Gxw::ControlParameter::get_base_type
static GType get_base_type() G_GNUC_CONST
Definition: controlparameter.cc:120
Gxw::ControlParameter::get_type
static GType get_type() G_GNUC_CONST
Definition: controlparameter.cc:114
Gxw::ControlParameter::add_interface
static void add_interface(GType gtype_implementer)
Definition: controlparameter.cc:107
Gxw::ControlParameter::cp_set_var
void cp_set_var(Glib::ustring p1)
Definition: controlparameter.cc:151
GxControlParameter
struct _GxControlParameter GxControlParameter
Definition: controlparameter.h:37
Gxw
Definition: bigknob.cc:51
Glib::wrap
Gxw::BigKnob * wrap(GxBigKnob *object, bool take_copy)
Definition: bigknob.cc:44
Gxw::ControlParameter::ControlParameter
ControlParameter()
You should derive from this class to use it.
Definition: controlparameter.cc:88
Gxw::ControlParameter::cp_get_value
double cp_get_value()
Definition: controlparameter.cc:136
Gxw::ControlParameter::cp_get_int_value
int cp_get_int_value()
Definition: controlparameter.cc:141
Gxw::ControlParameter::cp_get_var
Glib::ustring cp_get_var()
Definition: controlparameter.cc:146