Files
MuditaOS/module-audio/Audio/Operation/RecorderOperation.hpp
Marcin Smoczyński bda18b5b54 [EGD-5706] Refactor creating audio device
Audio devices are created in the audio subsystem and it is not possible
to send a device to bt service upon creation.

Introduce hookable audio device factory to allow sharing bluetooth
audio device. Move audio devices from bsp to audio allowing removal of
unwanted bsp -> audio dependency.

Remove Bluetooth proxy device which turned out to be a dead end.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-17 16:20:59 +01:00

39 lines
1.0 KiB
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "Operation.hpp"
#include <Audio/encoder/Encoder.hpp>
#include <Audio/AudioDevice.hpp>
namespace audio
{
class RecorderOperation : public Operation
{
public:
RecorderOperation(const char *file, AudioServiceMessage::Callback callback);
audio::RetCode Start(audio::Token token) final;
audio::RetCode Stop() final;
audio::RetCode Pause() final;
audio::RetCode Resume() final;
audio::RetCode SendEvent(std::shared_ptr<Event> evt) final;
audio::RetCode SwitchProfile(const Profile::Type type) final;
audio::RetCode SetOutputVolume(float vol) final;
audio::RetCode SetInputGain(float gain) final;
Position GetPosition() final;
uint32_t GetSize()
{
return enc->GetFileSize();
}
private:
std::unique_ptr<Encoder> enc;
};
} // namespace audio