OpenShot Library | libopenshot
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
AudioDevices.cpp
Go to the documentation of this file.
1
9
10
// Copyright (c) 2008-2019 OpenShot Studios, LLC
11
//
12
// SPDX-License-Identifier: LGPL-3.0-or-later
13
14
#include "
AudioDevices.h
"
15
16
using namespace
openshot
;
17
18
using
AudioDeviceList
= std::vector<std::pair<std::string, std::string>>;
19
20
// Build a list of devices found, and return
21
AudioDeviceList
AudioDevices::getNames
() {
22
// A temporary device manager, used to scan device names.
23
// Its initialize() is never called, and devices are not opened.
24
std::unique_ptr<juce::AudioDeviceManager>
25
manager(
new
juce::AudioDeviceManager());
26
27
m_devices.clear();
28
29
auto
&types = manager->getAvailableDeviceTypes();
30
for
(
auto
* t : types) {
31
t->scanForDevices();
32
const
auto
names = t->getDeviceNames();
33
for
(
const
auto
& name : names) {
34
m_devices.emplace_back(
35
name.toStdString(), t->getTypeName().toStdString());
36
}
37
}
38
return
m_devices;
39
}
40
41
// Build a list of audio input devices found, and return
42
AudioDeviceList
AudioDevices::getInputNames
() {
43
// A temporary device manager, used to scan device names.
44
// Its initialize() is never called, and devices are not opened.
45
std::unique_ptr<juce::AudioDeviceManager>
46
manager(
new
juce::AudioDeviceManager());
47
48
m_devices.clear();
49
50
auto
&types = manager->getAvailableDeviceTypes();
51
for
(
auto
* t : types) {
52
t->scanForDevices();
53
const
auto
names = t->getDeviceNames(
true
);
54
for
(
const
auto
& name : names) {
55
m_devices.emplace_back(
56
name.toStdString(), t->getTypeName().toStdString());
57
}
58
}
59
return
m_devices;
60
}
AudioDeviceList
std::vector< std::pair< std::string, std::string > > AudioDeviceList
Definition
AudioDevices.cpp:18
AudioDevices.h
Header file for Audio Device Info struct.
openshot::AudioDevices::getInputNames
AudioDeviceList getInputNames()
Return only audio input devices, for recording workflows.
Definition
AudioDevices.cpp:42
openshot::AudioDevices::getNames
AudioDeviceList getNames()
Definition
AudioDevices.cpp:21
openshot
This namespace is the default namespace for all code in the openshot library.
Definition
AnimatedCurve.h:24
openshot::AudioDeviceList
std::vector< std::pair< std::string, std::string > > AudioDeviceList
Definition
AudioDevices.h:42
AudioDevices.cpp
Generated by
1.17.0