Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqnxaudioutils_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNXAUDIOUTILS_H
5#define QNXAUDIOUTILS_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtMultimedia/private/qaudiosystem_p.h>
19#include <QtMultimedia/private/qaudiodevice_p.h>
20
21#include <memory>
22#include <optional>
23
24#include <sys/asoundlib.h>
25
26QT_BEGIN_NAMESPACE
27
29{
30 snd_pcm_channel_params_t formatToChannelParams(const QAudioFormat &format, QAudioDevice::Mode mode, int fragmentSize);
31
33 {
34 void operator()(snd_pcm_t *h) { if (h) snd_pcm_close(h); }
35 };
36
37 using HandleUniquePtr = std::unique_ptr<snd_pcm_t, HandleDeleter>;
38 HandleUniquePtr openPcmDevice(const QByteArray &id, QAudioDevice::Mode mode);
39
40 std::optional<snd_pcm_channel_info_t> pcmChannelInfo(snd_pcm_t *handle, QAudioDevice::Mode mode);
41 std::optional<snd_pcm_channel_info_t> pcmChannelInfo(const QByteArray &device, QAudioDevice::Mode mode);
42
43 std::optional<snd_pcm_channel_setup_t> pcmChannelSetup(snd_pcm_t *handle, QAudioDevice::Mode mode);
44 std::optional<snd_pcm_channel_setup_t> pcmChannelSetup(const QByteArray &device, QAudioDevice::Mode mode);
45
46 std::optional<snd_pcm_channel_status_t> pcmChannelStatus(snd_pcm_t *handle, QAudioDevice::Mode mode);
47 std::optional<snd_pcm_channel_status_t> pcmChannelStatus(const QByteArray &device, QAudioDevice::Mode mode);
48}
49
50QT_END_NAMESPACE
51
52#endif
std::optional< snd_pcm_channel_setup_t > pcmChannelSetup(const QByteArray &device, QAudioDevice::Mode mode)
std::optional< snd_pcm_channel_info_t > pcmChannelInfo(snd_pcm_t *handle, QAudioDevice::Mode mode)
std::unique_ptr< snd_pcm_t, HandleDeleter > HandleUniquePtr
std::optional< snd_pcm_channel_setup_t > pcmChannelSetup(snd_pcm_t *handle, QAudioDevice::Mode mode)
HandleUniquePtr openPcmDevice(const QByteArray &id, QAudioDevice::Mode mode)
std::optional< snd_pcm_channel_status_t > pcmChannelStatus(const QByteArray &device, QAudioDevice::Mode mode)
std::optional< snd_pcm_channel_info_t > pcmChannelInfo(const QByteArray &device, QAudioDevice::Mode mode)
std::optional< snd_pcm_channel_status_t > pcmChannelStatus(snd_pcm_t *handle, QAudioDevice::Mode mode)
snd_pcm_channel_params_t formatToChannelParams(const QAudioFormat &format, QAudioDevice::Mode mode, int fragmentSize)