Ring Daemon 16.0.0
Loading...
Searching...
No Matches
portaudiolayer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include "audio/audiolayer.h"
20#include "noncopyable.h"
21
22#include <memory>
23#include <array>
24
25namespace jami {
26
28{
29public:
32
33 std::vector<std::string> getCaptureDeviceList() const override;
34 std::vector<std::string> getPlaybackDeviceList() const override;
35 int getAudioDeviceIndex(const std::string& name, AudioDeviceType type) const override;
36 std::string getAudioDeviceName(int index, AudioDeviceType type) const override;
37 int getIndexCapture() const override;
38 int getIndexPlayback() const override;
39 int getIndexRingtone() const override;
40
45 void startStream(AudioDeviceType stream = AudioDeviceType::ALL) override;
46
51 void stopStream(AudioDeviceType stream = AudioDeviceType::ALL) override;
52
53 void updatePreference(AudioPreference& pref, int index, AudioDeviceType type) override;
54
55private:
57
58 struct PortAudioLayerImpl;
59 std::unique_ptr<PortAudioLayerImpl> pimpl_;
60};
61
62} // namespace jami
Main sound class.
int getIndexCapture() const override
void updatePreference(AudioPreference &pref, int index, AudioDeviceType type) override
int getIndexPlayback() const override
void stopStream(AudioDeviceType stream=AudioDeviceType::ALL) override
Stop the playback and capture streams.
int getIndexRingtone() const override
std::vector< std::string > getPlaybackDeviceList() const override
int getAudioDeviceIndex(const std::string &name, AudioDeviceType type) const override
std::vector< std::string > getCaptureDeviceList() const override
void startStream(AudioDeviceType stream=AudioDeviceType::ALL) override
Start the capture stream and prepare the playback stream.
std::string getAudioDeviceName(int index, AudioDeviceType type) const override
void emitSignal(Args... args)
Definition ring_signal.h:64
AudioDeviceType
Definition audiolayer.h:58
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
Definition noncopyable.h:30