File: AudioDevices.h

package info (click to toggle)
libopenshot 0.5.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,228 kB
  • sloc: cpp: 32,692; python: 92; sh: 67; makefile: 21; ruby: 5
file content (58 lines) | stat: -rw-r--r-- 1,144 bytes parent folder | download | duplicates (3)
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
/**
 * @file
 * @brief Header file for Audio Device Info struct
 * @author Jonathan Thomas <jonathan@openshot.org>
 *
 * @ref License
 */

// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef OPENSHOT_AUDIODEVICEINFO_H
#define OPENSHOT_AUDIODEVICEINFO_H

#include <string>
#include <vector>
#include <OpenShotAudio.h>

namespace openshot {
/**
 * @brief This struct hold information about Audio Devices
 *
 * The type and name of the audio device.
 */
struct
AudioDeviceInfo {
	juce::String type;
	juce::String name;

	// Get the std::string device type
	std::string get_type() {
		return type.toStdString();
	}

	// Get the std::string device name
	std::string get_name() {
		return name.toStdString();
	}
};

using AudioDeviceList = std::vector<std::pair<std::string, std::string>>;

	/// A class which probes the available audio devices
class AudioDevices
{
public:
		AudioDevices() = default;

	/// Return a vector of std::pair<> objects holding the
	/// device name and type for each audio device detected
	AudioDeviceList getNames();
private:
	AudioDeviceList m_devices;
};

}
#endif