Skip to content

Commit

Permalink
use _clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersama authored May 21, 2024
1 parent 9fd25e7 commit 162c9f1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/asio-input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,15 @@ class AudioCB : public juce::AudioIODeviceCallback {
_thread = global_thread;

bool found_client = false;
for (auto known_client : clients) {
for (auto known_client : _clients) {
if (known_client == client) {
found_client = true;
break;
}
}

if (!found_client)
clients.push_back(client);
_clients.push_back(client);

client->setCurrentCallback(this);
client->setReadIndex(_write_index);
Expand All @@ -365,8 +365,8 @@ class AudioCB : public juce::AudioIODeviceCallback {

void remove_client(AudioListener *client)
{
auto it = std::remove(clients.begin(), clients.end(), client);
clients.erase(it, clients.end());
auto it = std::remove(_clients.begin(), _clients.end(), client);
_clients.erase(it, _clients.end());

if (_thread)
_thread->removeTimeSliceClient(client);
Expand Down Expand Up @@ -423,7 +423,7 @@ class AudioCB : public juce::AudioIODeviceCallback {
// was ok because _thread was unique to each AudioCB (the this pointer)
// I'm adding a redundant struct to keep track of the clients inside the AudioCB
*/
for (auto known_client : clients) {
for (auto known_client : _clients) {
known_client->setCurrentCallback(this);
// if the device for whatever reason stopped, or errored out
// the clients will have been disabled by the device disconnecting
Expand All @@ -438,7 +438,7 @@ class AudioCB : public juce::AudioIODeviceCallback {

void audioDeviceStopped()
{
for (auto known_client : clients) {
for (auto known_client : _clients) {
known_client->device_disconnect();
}

Expand All @@ -460,7 +460,7 @@ class AudioCB : public juce::AudioIODeviceCallback {
// which likely will cause problems
*/
// Instead we'll mark all clients as having the device disconnected
for (auto known_client : clients) {
for (auto known_client : _clients) {
known_client->device_disconnect();
}

Expand Down

0 comments on commit 162c9f1

Please sign in to comment.