2
* (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de>
4
* This file is part of avcap.
6
* avcap is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* avcap is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with avcap. If not, see <http://www.gnu.org/licenses/>.
20
/* avcap is free for non-commercial use.
21
* To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>.
30
#include "Control_avcap.h"
32
#include "avcap-export.h"
36
class DS_DeviceDescriptor;
38
//! Implementation of the Control-class for DirectShow.
40
class AVCAP_Export DS_Control
45
CTRL_TYPE_INTEGER = 1,
46
CTRL_TYPE_BOOLEAN = 2,
52
IAM_CAMERACONTROL = 2,
55
//! Helper-class to query control-properties
70
DS_Control::DShowInterface DShowInterfaceType;
74
DShowInterface mDShowInterfaceType;
84
DS_DeviceDescriptor* mDSDeviceDescriptor;
87
DS_Control(DS_DeviceDescriptor *dd, Query_Ctrl* query);
88
virtual ~DS_Control();
90
inline int getId() const
93
inline int getDefaultValue() const
94
{ return mDefaultValue; }
96
inline const std::string& getName() const
99
int setValue(int val);
101
int getValue() const;
111
//! DirectShow integer valued control.
113
class DS_IntControl : public IntegerControl
117
DS_Control mControlBase;
120
inline DS_IntControl(DS_DeviceDescriptor *dd, struct DS_Control::Query_Ctrl* query) :
121
mInterval(query->minimum, query->maximum, query->step),
122
mControlBase(dd, query)
125
virtual inline ~DS_IntControl()
128
inline const Interval& getInterval() const
129
{ return mInterval; }
131
virtual inline int getId() const
132
{ return mControlBase.getId(); }
134
virtual inline int getDefaultValue() const
135
{ return mControlBase.getDefaultValue(); }
137
virtual inline const std::string& getName() const
138
{ return mControlBase.getName(); }
140
virtual inline int setValue(int val)
141
{ return mControlBase.setValue(val); }
143
virtual inline int getValue() const
144
{ return mControlBase.getValue(); }
146
virtual inline int reset()
147
{ return mControlBase.reset(); }
150
//! DirectShow boolean control.
152
class DS_BoolControl : public BoolControl
155
DS_Control mControlBase;
158
inline DS_BoolControl(DS_DeviceDescriptor *dd, struct DS_Control::Query_Ctrl* query) :
159
mControlBase(dd, query)
162
virtual inline ~DS_BoolControl()
165
virtual inline int getId() const
166
{ return mControlBase.getId(); }
168
virtual inline int getDefaultValue() const
169
{ return mControlBase.getDefaultValue(); }
171
virtual inline const std::string& getName() const
172
{ return mControlBase.getName(); }
174
virtual inline int setValue(int val)
175
{ return mControlBase.setValue(val); }
177
virtual inline int getValue() const
178
{ return mControlBase.getValue(); }
180
virtual inline int reset()
181
{ return mControlBase.reset(); }
185
#endif // DSCONTROL_H_
2
* (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de>
4
* This file is part of avcap.
6
* avcap is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* avcap is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with avcap. If not, see <http://www.gnu.org/licenses/>.
20
/* avcap is free for non-commercial use.
21
* To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>.
30
#include "Control_avcap.h"
32
#include "avcap-export.h"
36
class DS_DeviceDescriptor;
38
//! Implementation of the Control-class for DirectShow.
40
class AVCAP_Export DS_Control
45
CTRL_TYPE_INTEGER = 1,
46
CTRL_TYPE_BOOLEAN = 2,
52
IAM_CAMERACONTROL = 2,
55
//! Helper-class to query control-properties
70
DS_Control::DShowInterface DShowInterfaceType;
74
DShowInterface mDShowInterfaceType;
84
DS_DeviceDescriptor* mDSDeviceDescriptor;
87
DS_Control(DS_DeviceDescriptor *dd, Query_Ctrl* query);
88
virtual ~DS_Control();
90
inline int getId() const
93
inline int getDefaultValue() const
94
{ return mDefaultValue; }
96
inline const std::string& getName() const
99
int setValue(int val);
101
int getValue() const;
111
//! DirectShow integer valued control.
113
class DS_IntControl : public IntegerControl
117
DS_Control mControlBase;
120
inline DS_IntControl(DS_DeviceDescriptor *dd, struct DS_Control::Query_Ctrl* query) :
121
mInterval(query->minimum, query->maximum, query->step),
122
mControlBase(dd, query)
125
virtual inline ~DS_IntControl()
128
inline const Interval& getInterval() const
129
{ return mInterval; }
131
virtual inline int getId() const
132
{ return mControlBase.getId(); }
134
virtual inline int getDefaultValue() const
135
{ return mControlBase.getDefaultValue(); }
137
virtual inline const std::string& getName() const
138
{ return mControlBase.getName(); }
140
virtual inline int setValue(int val)
141
{ return mControlBase.setValue(val); }
143
virtual inline int getValue() const
144
{ return mControlBase.getValue(); }
146
virtual inline int reset()
147
{ return mControlBase.reset(); }
150
//! DirectShow boolean control.
152
class DS_BoolControl : public BoolControl
155
DS_Control mControlBase;
158
inline DS_BoolControl(DS_DeviceDescriptor *dd, struct DS_Control::Query_Ctrl* query) :
159
mControlBase(dd, query)
162
virtual inline ~DS_BoolControl()
165
virtual inline int getId() const
166
{ return mControlBase.getId(); }
168
virtual inline int getDefaultValue() const
169
{ return mControlBase.getDefaultValue(); }
171
virtual inline const std::string& getName() const
172
{ return mControlBase.getName(); }
174
virtual inline int setValue(int val)
175
{ return mControlBase.setValue(val); }
177
virtual inline int getValue() const
178
{ return mControlBase.getValue(); }
180
virtual inline int reset()
181
{ return mControlBase.reset(); }
185
#endif // DSCONTROL_H_