-
Notifications
You must be signed in to change notification settings - Fork 6
/
hostaudiodevice.cpp
125 lines (105 loc) · 3.43 KB
/
hostaudiodevice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* This file is part of libvbox
* Copyright (C) 2022 Michael Hansen
*
* libvbox is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* libvbox is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with libvbox; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "libvbox_p.h"
#if VirtualBoxSDK_VERSION >= VBox_MAKE_VERSION(7, 0, 0)
COM_WRAP_IFC(IHostAudioDevice)
std::u16string VBox::IHostAudioDevice::id() const
{
std::u16string result;
COM_GetString(get_IFC(), Id, result);
return result;
}
std::u16string VBox::IHostAudioDevice::name() const
{
std::u16string result;
COM_GetString(get_IFC(), Name, result);
return result;
}
void VBox::IHostAudioDevice::set_name(const std::u16string &value)
{
COM_SetString(get_IFC(), Name, value);
}
VBox::AudioDeviceType VBox::IHostAudioDevice::type() const
{
COM_Enum(::AudioDeviceType) result;
COM_GetValue(get_IFC(), Type, result);
return static_cast<AudioDeviceType>(result);
}
void VBox::IHostAudioDevice::set_type(AudioDeviceType value)
{
COM_SetValue(get_IFC(), Type, static_cast<COM_Enum(::AudioDeviceType)>(value));
}
VBox::AudioDirection VBox::IHostAudioDevice::usage() const
{
COM_Enum(::AudioDirection) result;
COM_GetValue(get_IFC(), Usage, result);
return static_cast<AudioDirection>(result);
}
void VBox::IHostAudioDevice::set_usage(AudioDirection value)
{
COM_SetValue(get_IFC(), Usage, static_cast<COM_Enum(::AudioDirection)>(value));
}
bool VBox::IHostAudioDevice::defaultIn() const
{
COM_Bool result;
COM_GetValue(get_IFC(), DefaultIn, result);
return static_cast<bool>(result);
}
void VBox::IHostAudioDevice::set_defaultIn(bool value)
{
COM_SetValue(get_IFC(), DefaultIn, static_cast<COM_Bool>(value));
}
bool VBox::IHostAudioDevice::defaultOut() const
{
COM_Bool result;
COM_GetValue(get_IFC(), DefaultOut, result);
return static_cast<bool>(result);
}
void VBox::IHostAudioDevice::set_defaultOut(bool value)
{
COM_SetValue(get_IFC(), DefaultOut, static_cast<COM_Bool>(value));
}
bool VBox::IHostAudioDevice::isHotPlug() const
{
COM_Bool result;
COM_GetValue(get_IFC(), IsHotPlug, result);
return static_cast<bool>(result);
}
void VBox::IHostAudioDevice::set_isHotPlug(bool value)
{
COM_SetValue(get_IFC(), IsHotPlug, static_cast<COM_Bool>(value));
}
VBox::AudioDeviceState VBox::IHostAudioDevice::state() const
{
COM_Enum(::AudioDeviceState) result;
COM_GetValue(get_IFC(), State, result);
return static_cast<AudioDeviceState>(result);
}
void VBox::IHostAudioDevice::set_state(AudioDeviceState value)
{
COM_SetValue(get_IFC(), State, static_cast<COM_Enum(::AudioDeviceState)>(value));
}
std::u16string VBox::IHostAudioDevice::getProperty(const std::u16string &key) const
{
COM_StringProxy pResult;
COM_StringProxy pKey(key);
auto rc = get_IFC()->GetProperty(pKey.m_text, &pResult.m_text);
COM_ERROR_CHECK(rc);
return pResult.toString();
}
#endif