Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ AudioNodeHostObject::AudioNodeHostObject(const std::shared_ptr<AudioNode> &node)
JSI_EXPORT_FUNCTION(AudioNodeHostObject, disconnect));
}

// Explicitly define destructor here, as they to exist in order to act as a
// "key function" for the audio classes - this allow for RTTI to work
// properly across dynamic library boundaries (i.e. dynamic_cast that is used by
// isHostObject method), android specific issue
AudioNodeHostObject::~AudioNodeHostObject() = default;

JSI_PROPERTY_GETTER_IMPL(AudioNodeHostObject, numberOfInputs) {
return {node_->getNumberOfInputs()};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AudioNode;
class AudioNodeHostObject : public JsiHostObject {
public:
explicit AudioNodeHostObject(const std::shared_ptr<AudioNode> &node);
~AudioNodeHostObject() override;

JSI_PROPERTY_GETTER_DECL(numberOfInputs);
JSI_PROPERTY_GETTER_DECL(numberOfOutputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ BaseAudioContextHostObject::BaseAudioContextHostObject(
JSI_EXPORT_FUNCTION(BaseAudioContextHostObject, createWaveShaper));
}

// Explicitly define destructors here, as they to exist in order to act as a
// "key function" for the audio classes - this allow for RTTI to work
// properly across dynamic library boundaries (i.e. dynamic_cast that is used by
// isHostObject method), android specific issue
BaseAudioContextHostObject::~BaseAudioContextHostObject() = default;

JSI_PROPERTY_GETTER_IMPL(BaseAudioContextHostObject, destination) {
auto destination = std::make_shared<AudioDestinationNodeHostObject>(context_->getDestination());
return jsi::Object::createFromHostObject(runtime, destination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class BaseAudioContextHostObject : public JsiHostObject {
jsi::Runtime *runtime,
const std::shared_ptr<react::CallInvoker> &callInvoker);

~BaseAudioContextHostObject() override;

JSI_PROPERTY_GETTER_DECL(destination);
JSI_PROPERTY_GETTER_DECL(state);
JSI_PROPERTY_GETTER_DECL(sampleRate);
Expand Down