early-access version 2950

This commit is contained in:
pineappleEA
2022-09-15 04:48:53 +02:00
parent 875eae2c07
commit 52fcc73bd4
7 changed files with 42 additions and 23 deletions

View File

@@ -133,10 +133,10 @@ public:
return;
}
paused = false;
if (cubeb_stream_start(stream_backend) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error starting cubeb stream");
}
paused = false;
}
/**
@@ -149,12 +149,10 @@ public:
return;
}
paused = true;
if (cubeb_stream_stop(stream_backend) != CUBEB_OK) {
LOG_CRITICAL(Audio_Sink, "Error stopping cubeb stream");
}
was_playing.store(!paused);
paused = true;
}
private:

View File

@@ -112,8 +112,8 @@ public:
return;
}
SDL_PauseAudioDevice(device, 0);
paused = false;
SDL_PauseAudioDevice(device, 0);
}
/**
@@ -124,8 +124,8 @@ public:
if (device == 0 || paused) {
return;
}
SDL_PauseAudioDevice(device, 1);
paused = true;
SDL_PauseAudioDevice(device, 1);
}
private:

View File

@@ -220,8 +220,6 @@ protected:
u32 device_channels{2};
/// Is this stream currently paused?
std::atomic<bool> paused{true};
/// Was this stream previously playing?
std::atomic<bool> was_playing{false};
/// Name of this stream
std::string name{};