From 162c9f15f9c57c3d380e81d7eca4b9db1f73b7fd Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Tue, 21 May 2024 12:52:47 -0700 Subject: [PATCH] use _clients --- src/asio-input.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/asio-input.cpp b/src/asio-input.cpp index 50aff9d..6a57f19 100644 --- a/src/asio-input.cpp +++ b/src/asio-input.cpp @@ -348,7 +348,7 @@ 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; @@ -356,7 +356,7 @@ class AudioCB : public juce::AudioIODeviceCallback { } if (!found_client) - clients.push_back(client); + _clients.push_back(client); client->setCurrentCallback(this); client->setReadIndex(_write_index); @@ -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); @@ -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 @@ -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(); } @@ -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(); }