-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #44 from software-mansion-labs/feat/android/audio-…
…param Feat/android/audio param
- Loading branch information
Showing
50 changed files
with
396 additions
and
196 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
#include "AudioParam.h" | ||
|
||
namespace audiocontext { | ||
|
||
AudioParam::AudioParam(alias_ref<AudioParam::jhybridobject> &jThis): javaObject_(make_global(jThis)) {} | ||
|
||
double AudioParam::getValue() { | ||
static const auto method = javaClassLocal()->getMethod<double()>("getValue"); | ||
return method(javaObject_.get()); | ||
} | ||
|
||
void AudioParam::setValue(double value) { | ||
static const auto method = javaClassLocal()->getMethod<void(double)>("setValue"); | ||
method(javaObject_.get(), value); | ||
} | ||
} |
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,39 @@ | ||
#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 AudioParam : public jni::HybridClass<AudioParam> { | ||
public: | ||
static auto constexpr kJavaDescriptor = "Lcom/audiocontext/nodes/parameters/AudioParam;"; | ||
|
||
static jni::local_ref<AudioParam::jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis) | ||
{ | ||
return makeCxxInstance(jThis); | ||
} | ||
|
||
static void registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod("initHybrid", AudioParam::initHybrid), | ||
}); | ||
} | ||
|
||
double getValue(); | ||
void setValue(double value); | ||
|
||
protected: | ||
friend HybridBase; | ||
|
||
global_ref<AudioParam::javaobject> javaObject_; | ||
|
||
explicit AudioParam(jni::alias_ref<AudioParam::jhybridobject>& jThis); | ||
}; | ||
|
||
} // namespace audiocontext |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
#include "GainNode.h" | ||
|
||
namespace audiocontext{ | ||
|
||
using namespace facebook::jni; | ||
|
||
std::shared_ptr<AudioParam> GainNode::getGainParam() { | ||
static const auto method = javaClassLocal()->getMethod<AudioParam()>("getGain"); | ||
auto gain = method(javaObject_.get()); | ||
auto gainCppInstance = gain->cthis(); | ||
|
||
return std::shared_ptr<AudioParam>(gainCppInstance); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
#include <fbjni/fbjni.h> | ||
#include "OscillatorNode.h" | ||
#include "AudioContext.h" | ||
#include "AudioDestinationNode.h" | ||
#include "AudioNode.h" | ||
#include "AudioParam.h" | ||
|
||
using namespace audiocontext; | ||
|
||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) | ||
{ | ||
return facebook::jni::initialize(vm, [] { | ||
OscillatorNode::registerNatives(); | ||
AudioContext::registerNatives(); | ||
AudioDestinationNode::registerNatives(); | ||
AudioNode::registerNatives(); | ||
AudioParam::registerNatives(); | ||
}); | ||
} |
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 was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
android/src/main/cpp/StereoPannerNode/StereoPannerNode.cpp
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,14 @@ | ||
#include "StereoPannerNode.h" | ||
|
||
namespace audiocontext{ | ||
|
||
using namespace facebook::jni; | ||
|
||
std::shared_ptr<AudioParam> StereoPannerNode::getPanParam() { | ||
static const auto method = javaClassLocal()->getMethod<AudioParam()>("getPan"); | ||
auto pan = method(javaObject_.get()); | ||
auto panCppInstance = pan->cthis(); | ||
|
||
return std::shared_ptr<AudioParam>(panCppInstance); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
android/src/main/java/com/audiocontext/nodes/AudioDestinationNode.kt
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.