23 lines
836 B
C++
23 lines
836 B
C++
// OctoRadio (Gitea #5): in-client player for the Octo radio stations. The add-on talks to it over the local
|
|
// "OctoRadio" addon channel (session.cpp); only stations from radio_stations.hpp can be played.
|
|
#pragma once
|
|
#include "gateway/radio_stream.hpp"
|
|
#include <string>
|
|
#include <string_view>
|
|
namespace gateway {
|
|
class RadioPlayer {
|
|
public:
|
|
static RadioPlayer& instance(); // process-lifetime; never destroyed (its thread may still be running at exit)
|
|
void play(unsigned cmd);
|
|
void stop();
|
|
void volume(unsigned percent); // 0..100
|
|
std::string status() const; // radio_status() line
|
|
struct State;
|
|
private:
|
|
RadioPlayer();
|
|
State* s_;
|
|
};
|
|
// Handles one add-on command; returns the status line to send back (Q, and after every command).
|
|
std::string radio_control(std::string_view text);
|
|
}
|