-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from software-mansion-labs/feat/android/audio-…
…node Feat/android/audio node
- Loading branch information
Showing
25 changed files
with
192 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "AudioNode.h" | ||
|
||
namespace audiocontext { | ||
|
||
AudioNode::AudioNode(alias_ref<AudioNode::jhybridobject> &jThis): javaObject_(make_global(jThis)) {} | ||
|
||
void AudioNode::connect(const std::shared_ptr<AudioNode> node) { | ||
static const auto method = javaClassLocal()->getMethod<void(AudioNode::javaobject)>( | ||
"connect"); | ||
method(javaObject_.get(), node->javaObject_.get()); | ||
} | ||
|
||
void AudioNode::disconnect(const std::shared_ptr<AudioNode> node) { | ||
static const auto method = javaClassLocal()->getMethod<void(AudioNode::javaobject)>( | ||
"disconnect"); | ||
method(javaObject_.get(), node->javaObject_.get()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <fbjni/fbjni.h> | ||
#include <react/jni/CxxModuleWrapper.h> | ||
#include <react/jni/JMessageQueueThread.h> | ||
#include <memory> | ||
|
||
namespace audiocontext { | ||
|
||
using namespace facebook; | ||
using namespace facebook::jni; | ||
|
||
class AudioNode : public jni::HybridClass<AudioNode> { | ||
public: | ||
static auto constexpr kJavaDescriptor = "Lcom/audiocontext/nodes/AudioNode;"; | ||
|
||
static jni::local_ref<AudioNode::jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis) | ||
{ | ||
return makeCxxInstance(jThis); | ||
} | ||
|
||
static void registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod("initHybrid", AudioNode::initHybrid), | ||
}); | ||
} | ||
|
||
void connect(const std::shared_ptr<AudioNode> node); | ||
void disconnect(const std::shared_ptr<AudioNode> node); | ||
|
||
protected: | ||
friend HybridBase; | ||
friend class AudioNode; | ||
|
||
global_ref<AudioNode::javaobject> javaObject_; | ||
|
||
explicit AudioNode(jni::alias_ref<AudioNode::jhybridobject>& jThis); | ||
}; | ||
|
||
} // namespace audiocontext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.