QtGStreamer 1.2.0
Loading...
Searching...
No Matches
childproxy.h
1/*
2 Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published
6 by the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#ifndef QGST_CHILDPROXY_H
18#define QGST_CHILDPROXY_H
19
20#include "object.h"
21
22namespace QGst {
23
27class QTGSTREAMER_EXPORT ChildProxy : public QGlib::Interface
28{
29 QGST_WRAPPER(ChildProxy)
30public:
31 uint childrenCount() const;
32 QGlib::ObjectPtr childByName(const char *name) const;
33 QGlib::ObjectPtr childByIndex(uint index) const;
34
35 bool findChildProperty(const char *name, QGlib::ObjectPtr *object,
36 QGlib::ParamSpecPtr *paramSpec) const;
37 QGlib::Value childProperty(const char *name) const;
38 template <typename T> void setChildProperty(const char *name, const T & value);
39};
40
41template <typename T>
42void ChildProxy::setChildProperty(const char *name, const T & value)
43{
45 QGlib::ObjectPtr object;
46 if (findChildProperty(name, &object, &param)) {
48 v.init(param->valueType());
49 v.set<T>(value);
50 object->setProperty(param->name(), value);
51 }
52}
53
54}
55
56QGST_REGISTER_TYPE(QGst::ChildProxy)
57QGLIB_REGISTER_INTERFACE(QGst::ChildProxy)
58
59#endif // QGST_CHILDPROXY_H
Base class for interface wrappers.
Definition object.h:100
Smart pointer class for working with wrapper classes that support reference counting.
Definition refpointer.h:91
Wrapper class for GValue.
Definition value.h:77
void set(const T &data)
Definition value.h:327
void init(Type type)
Definition value.cpp:241
Wrapper class for GstChildProxy.
Definition childproxy.h:28
Wrappers for GStreamer classes.