2021-12-29 09:59:18 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "core/time.h"
|
|
|
|
|
|
|
|
namespace kku
|
|
|
|
{
|
|
|
|
|
2022-05-07 23:43:12 -04:00
|
|
|
/// Music
|
|
|
|
///
|
|
|
|
/// Object for streaming music file
|
2021-12-29 09:59:18 -05:00
|
|
|
class Music
|
|
|
|
{
|
2022-10-17 22:59:51 -04:00
|
|
|
public:
|
2021-12-29 09:59:18 -05:00
|
|
|
virtual ~Music() = default;
|
|
|
|
|
2022-10-17 22:59:51 -04:00
|
|
|
virtual bool open(const std::string &filepath) = 0;
|
2021-12-29 09:59:18 -05:00
|
|
|
|
|
|
|
virtual void play() = 0;
|
|
|
|
virtual void pause() = 0;
|
|
|
|
virtual void stop() = 0;
|
|
|
|
|
|
|
|
virtual bool isPlaying() const = 0;
|
|
|
|
|
|
|
|
virtual void setVolume(float volume) = 0;
|
|
|
|
|
2022-10-17 22:59:51 -04:00
|
|
|
virtual void setOffset(const kku::microsec &offset) = 0;
|
|
|
|
virtual void moveOffset(const kku::microsec &delta) = 0;
|
2021-12-29 09:59:18 -05:00
|
|
|
|
|
|
|
virtual kku::microsec fetchOffset() = 0;
|
|
|
|
virtual kku::microsec getDuration() const = 0;
|
|
|
|
};
|
|
|
|
|
2022-10-17 22:59:51 -04:00
|
|
|
} // namespace kku
|