~aleteoryx/muditaos

ref: 4942167c0a410a504edde0347e2484fbd3b9bc10 muditaos/module-services/service-audio/api/AudioServiceAPI.hpp -rw-r--r-- 2.9 KiB
4942167c — Tomas Rogala [EGD-3713] Rework repeat option data flow 5 years ago
                                                                                
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
59
60
61
#pragma once

#include "../messages/AudioMessage.hpp"
#include "Audio/decoder/decoder.hpp"

#include <optional>

class Service;

namespace AudioServiceAPI
{
    /*! @brief Starts playback operation.
     *
     * @param serv - requesting service.
     * @param playbackType - type of playback.
     * If none, request would still be valid and default volume would be used.
     * @param fileName - name of the file.
     * @return           Standard service-api return code. Success if suitable.
     */
    audio::RetCode PlaybackStart(sys::Service *serv,
                                 const audio::PlaybackType &playbackType,
                                 const std::string &fileName);
    audio::RetCode RecordingStart(sys::Service *serv, const std::string &fileName);
    audio::RetCode RoutingStart(sys::Service *serv);
    audio::RetCode RoutingRecordCtrl(sys::Service *serv, bool enable);
    audio::RetCode RoutingMute(sys::Service *serv, bool enable);
    audio::RetCode RoutingSpeakerPhone(sys::Service *serv, bool enable);
    audio::RetCode RoutingHeadset(sys::Service *serv, bool enable);
    audio::RetCode Stop(sys::Service *serv);
    audio::RetCode Pause(sys::Service *serv);
    audio::RetCode Resume(sys::Service *serv);
    std::optional<audio::Tags> GetFileTags(sys::Service *serv, const std::string &fileName);
    audio::RetCode SetOutputVolume(sys::Service *serv, const audio::Volume vol);
    /*! @brief Sets volume.
     *
     * @param serv - requesting service.
     * @param vol - volume to be set.
     * @param profileType - selected profile type.
     * @param playbackType -  type of playback. Not used when profileType is different than playback.
     * @return           Standard service-api return code. Success if suitable.
     */
    audio::RetCode SetVolume(sys::Service *serv,
                             const audio::Volume &vol,
                             const audio::Profile::Type &profileType,
                             const audio::PlaybackType &playbackType = audio::PlaybackType::None);
    /*! @brief Gets volume.
     *
     * @param serv - requesting service.
     * @param vol - requested volume.
     * @param profileType - selected profile type.
     * @param playbackType - type of playback. Not used when profileType is different than playback.
     * @return           Standard service-api return code. Success if suitable.
     */
    audio::RetCode GetVolume(sys::Service *serv,
                             audio::Volume &vol,
                             const audio::Profile::Type &profileType,
                             const audio::PlaybackType &playbackType = audio::PlaybackType::None);
    audio::RetCode GetOutputVolume(sys::Service *serv, audio::Volume &vol);
    audio::RetCode SetInputGain(sys::Service *serv, const audio::Gain gain);
    audio::RetCode GetInputGain(sys::Service *serv, audio::Gain &gain);
}; // namespace AudioServiceAPI