Debian Codegraph @

gstreamer/gstreamermm/audiofilter.cc

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <gstreamermm/audiofilter.h>
7 #include <gstreamermm/private/audiofilter_p.h>
8
9
10 /* gstreamermm - a C++ wrapper for gstreamer
11 *
12 * Copyright 2008-2016 The gstreamermm Development Team
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29 #include <gst/audio/gstaudiofilter.h>
30
31
32 namespace
33 {
34 } // anonymous namespace
35
36
37 namespace Glib
38 {
39
40 Glib::RefPtr<Gst::AudioFilter> wrap(GstAudioFilter* object, bool take_copy)
41 {
42 return Glib::RefPtr<Gst::AudioFilter>( dynamic_cast<Gst::AudioFilter*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
43 //We use dynamic_cast<> in case of multiple inheritance.
44 }
45
46 } /* namespace Glib */
47
48
49 namespace Gst
50 {
51
52
53 /* The *_Class implementation: */
54
55 const Glib::Class& AudioFilter_Class::init()
56 {
57 if(!gtype_) // create the GType if necessary
58 {
59 // Glib::Class has to know the class init function to clone custom types.
60 class_init_func_ = &AudioFilter_Class::class_init_function;
61
62 // This is actually just optimized away, apparently with no harm.
63 // Make sure that the parent type has been created.
64 //CppClassParent::CppObjectType::get_type();
65
66 // Create the wrapper type, with the same class/instance size as the base type.
67 register_derived_type(gst_audio_filter_get_type());
68
69 // Add derived versions of interfaces, if the C type implements any interfaces:
70
71 }
72
73 return *this;
74 }
75
76
77 void AudioFilter_Class::class_init_function(void* g_class, void* class_data)
78 {
79 const auto klass = static_cast<BaseClassType*>(g_class);
80 CppClassParent::class_init_function(klass, class_data);
81
82 klass->setup = &setup_vfunc_callback;
83
84 }
85
86 gboolean AudioFilter_Class::setup_vfunc_callback(GstAudioFilter* self, const GstAudioInfo* info)
87 {
88 const auto obj_base = static_cast<Glib::ObjectBase*>(
89 Glib::ObjectBase::_get_current_wrapper((GObject*)self));
90
91 // Non-gtkmmproc-generated custom classes implicitly call the default
92 // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
93 // generated classes can use this optimisation, which avoids the unnecessary
94 // parameter conversions if there is no possibility of the virtual function
95 // being overridden:
96 if(obj_base && obj_base->is_derived_())
97 {
98 const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
99 if(obj) // This can be NULL during destruction.
100 {
101 try // Trap C++ exceptions which would normally be lost because this is a C callback.
102 {
103 // Call the virtual member method, which derived classes might override.
104 return static_cast<int>(obj->setup_vfunc(Gst::AudioInfo(const_cast<GstAudioInfo*>(info))
105 ));
106 }
107 catch(...)
108 {
109 Glib::exception_handlers_invoke();
110 }
111 }
112 }
113
114 BaseClassType *const base = static_cast<BaseClassType*>(
115 g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
116 );
117
118 // Call the original underlying C function:
119 if(base && base->setup)
120 return (*base->setup)(self, info);
121
122 using RType = gboolean;
123 return RType();
124 }
125
126
127 Glib::ObjectBase* AudioFilter_Class::wrap_new(GObject* object)
128 {
129 return new AudioFilter((GstAudioFilter*)object);
130 }
131
132
133 /* The implementation: */
134
135 GstAudioFilter* AudioFilter::gobj_copy()
136 {
137 reference();
138 return gobj();
139 }
140
141 AudioFilter::AudioFilter(const Glib::ConstructParams& construct_params)
142 :
143 Gst::BaseTransform(construct_params)
144 {
145
146 }
147
148 AudioFilter::AudioFilter(GstAudioFilter* castitem)
149 :
150 Gst::BaseTransform((GstBaseTransform*)(castitem))
151 {}
152
153
154 AudioFilter::AudioFilter(AudioFilter&& src) noexcept
155 : Gst::BaseTransform(std::move(src))
156 {}
157
158 AudioFilter& AudioFilter::operator=(AudioFilter&& src) noexcept
159 {
160 Gst::BaseTransform::operator=(std::move(src));
161 return *this;
162 }
163
164
165 AudioFilter::~AudioFilter() noexcept
166 {}
167
168
169 AudioFilter::CppClassType AudioFilter::audiofilter_class_; // initialize static member
170
171 GType AudioFilter::get_type()
172 {
173 return audiofilter_class_.init().get_type();
174 }
175
176
177 GType AudioFilter::get_base_type()
178 {
179 return gst_audio_filter_get_type();
180 }
181
182
183 bool Gst::AudioFilter::setup_vfunc(const Gst::AudioInfo& info)
184 {
185 const auto base = static_cast<BaseClassType*>(
186 g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
187 );
188
189 if(base && base->setup)
190 {
191 bool retval((*base->setup)(gobj(),info.gobj()));
192 return retval;
193 }
194
195 using RType = bool;
196 return RType();
197 }
198
199
200 } // namespace Gst
201
202