OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
AudioDevices.cpp
Go to the documentation of this file.
1
10// Copyright (c) 2008-2019 OpenShot Studios, LLC
11//
12// SPDX-License-Identifier: LGPL-3.0-or-later
13
14#include "AudioDevices.h"
15
16using namespace openshot;
17
18using AudioDeviceList = std::vector<std::pair<std::string, std::string>>;
19
20// Build a list of devices found, and return
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}
std::vector< std::pair< std::string, std::string > > AudioDeviceList
Header file for Audio Device Info struct.
AudioDeviceList getNames()
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29
std::vector< std::pair< std::string, std::string > > AudioDeviceList