Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsek committed Nov 26, 2024
1 parent d0fcd3e commit 46e0796
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <algorithm>

#include "AudioBus.h"
#include "AudioArray.h"
#include "BaseAudioContext.h"
Expand Down
28 changes: 14 additions & 14 deletions packages/react-native-audio-api/common/cpp/core/AudioNodeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ namespace audioapi {
class AudioNode;

class AudioNodeManager {
public:
enum class ConnectionType { CONNECT, DISCONNECT };
AudioNodeManager();
~AudioNodeManager();
public:
enum class ConnectionType { CONNECT, DISCONNECT };
AudioNodeManager();
~AudioNodeManager();

void preProcessGraph();
void addPendingConnection(const std::shared_ptr<AudioNode> &from, const std::shared_ptr<AudioNode> &to, ConnectionType type);
void preProcessGraph();
void addPendingConnection(const std::shared_ptr<AudioNode> &from, const std::shared_ptr<AudioNode> &to, ConnectionType type);

void addSourceNode(const std::shared_ptr<AudioNode> &node);
void addSourceNode(const std::shared_ptr<AudioNode> &node);

std::mutex& getGraphLock();
std::mutex& getGraphLock();

private:
std::mutex graphLock_;
private:
std::mutex graphLock_;

std::vector<std::shared_ptr<AudioNode>> sourceNodes_;
std::vector<std::tuple<std::shared_ptr<AudioNode>, std::shared_ptr<AudioNode>, ConnectionType>> audioNodesToConnect_;
std::vector<std::shared_ptr<AudioNode>> sourceNodes_;
std::vector<std::tuple<std::shared_ptr<AudioNode>, std::shared_ptr<AudioNode>, ConnectionType>> audioNodesToConnect_;

void settlePendingConnections();
void removeFinishedSourceNodes();
void settlePendingConnections();
void removeFinishedSourceNodes();
};

} // namespace audioapi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace audioapi {

class AudioScheduledSourceNode : public AudioNode {
public:
enum class PlaybackState { UNSCHEDULED, SCHEDULED, PLAYING, FINISHED };
enum class PlaybackState { UNSCHEDULED, SCHEDULED, PLAYING, FINISHED };
explicit AudioScheduledSourceNode(BaseAudioContext *context);

void start(double time);
Expand All @@ -25,7 +25,6 @@ class AudioScheduledSourceNode : public AudioNode {
protected:
std::atomic<PlaybackState> playbackState_;


private:
void startPlayback();
void stopPlayback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ void StereoPannerNode::processNode(AudioBus* processingBus, int framesToProcess)

time += deltaTime;
}

}

} // namespace audioapi
4 changes: 2 additions & 2 deletions packages/react-native-audio-api/common/cpp/utils/Locker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace audioapi {
// Small easy interface to manage locking
class Locker {
public:
Locker(): lockPtr_(0) {}
Locker(std::mutex& lockPtr): lockPtr_(&lockPtr) {
explicit Locker(): lockPtr_(0) {}
explicit Locker(std::mutex& lockPtr): lockPtr_(&lockPtr) {
lock();
}

Expand Down

0 comments on commit 46e0796

Please sign in to comment.