1 #pragma once 2 3 #include <inttypes.h> 4 #include <vector> 5 #include <string> 6 #include <util/ErrorCode.h> 7 #include <util/Option.h> 8 9 namespace mous { 10 11 class IRenderer 12 { 13 public: ~IRenderer()14 virtual ~IRenderer() { } 15 16 virtual ErrorCode Open() = 0; 17 virtual void Close() = 0; 18 19 virtual ErrorCode Setup(int32_t& channels, int32_t& sampleRate, int32_t& bitsPerSample) = 0; 20 virtual ErrorCode Write(const char* dat, uint32_t len) = 0; 21 22 // 0(muted) to 100(max) 23 virtual int VolumeLevel() const = 0; 24 virtual void SetVolumeLevel(int level) = 0; 25 26 // reimplement this to provide options Options()27 virtual std::vector<const BaseOption*> Options() const 28 { 29 return {}; 30 }; 31 }; 32 33 } 34