early-access version 2947

This commit is contained in:
pineappleEA
2022-09-12 23:41:59 +02:00
parent 0281449da2
commit be5f850e61
15 changed files with 28 additions and 141 deletions

View File

@@ -129,21 +129,14 @@ public:
* Default false.
*/
void Start(bool resume = false) override {
if (!ctx) {
if (!ctx || !paused) {
return;
}
if (resume && was_playing) {
if (cubeb_stream_start(stream_backend) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream");
}
paused = false;
} else if (!resume) {
if (cubeb_stream_start(stream_backend) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream");
}
paused = false;
if (cubeb_stream_start(stream_backend) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream");
}
paused = false;
}
/**
@@ -151,7 +144,8 @@ public:
*/
void Stop() override {
Unstall();
if (!ctx) {
if (!ctx || paused) {
return;
}
@@ -286,18 +280,6 @@ void CubebSink::CloseStreams() {
sink_streams.clear();
}
void CubebSink::PauseStreams() {
for (auto& stream : sink_streams) {
stream->Stop();
}
}
void CubebSink::UnpauseStreams() {
for (auto& stream : sink_streams) {
stream->Start(true);
}
}
f32 CubebSink::GetDeviceVolume() const {
if (sink_streams.empty()) {
return 1.0f;