-
-
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.
fix: moved creating audio context host object method to host object
- Loading branch information
Maciej Makowski
committed
Jul 19, 2024
1 parent
ea2de9e
commit fc190c8
Showing
2 changed files
with
20 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
#pragma once | ||
|
||
#include <jsi/jsi.h> | ||
#include "AudioContextWrapper.h" | ||
|
||
namespace audiocontext | ||
{ | ||
using namespace facebook; | ||
using namespace facebook; | ||
|
||
class AudioContextWrapper; | ||
class AudioContextWrapper; | ||
|
||
class AudioContextHostObject : public jsi::HostObject | ||
{ | ||
private: | ||
std::shared_ptr<AudioContextWrapper> wrapper_; | ||
class AudioContextHostObject : public jsi::HostObject | ||
{ | ||
private: | ||
std::shared_ptr<AudioContextWrapper> wrapper_; | ||
|
||
public: | ||
explicit AudioContextHostObject(std::shared_ptr<AudioContextWrapper> wrapper) : wrapper_(wrapper) {} | ||
public: | ||
explicit AudioContextHostObject(std::shared_ptr<AudioContextWrapper> wrapper) : wrapper_(wrapper) {} | ||
|
||
jsi::Value get(jsi::Runtime &runtime, const jsi::PropNameID &name) override; | ||
void set(jsi::Runtime &runtime, const jsi::PropNameID &name, const jsi::Value &value) override; | ||
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override; | ||
static std::shared_ptr<AudioContextHostObject> createFromWrapper(std::shared_ptr<AudioContextWrapper> wrapper) { | ||
return std::make_shared<AudioContextHostObject>(wrapper); | ||
} | ||
|
||
jsi::Value get(jsi::Runtime &runtime, const jsi::PropNameID &name) override; | ||
void set(jsi::Runtime &runtime, const jsi::PropNameID &name, const jsi::Value &value) override; | ||
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override; | ||
|
||
jsi::Value createOscillator(jsi::Runtime& runtime, const jsi::PropNameID& propNameId); | ||
jsi::Value getDestination(jsi::Runtime& runtime, const jsi::PropNameID& propNameId); | ||
|
||
jsi::Value createOscillator(jsi::Runtime& runtime, const jsi::PropNameID& propNameId); | ||
jsi::Value getDestination(jsi::Runtime& runtime, const jsi::PropNameID& propNameId); | ||
}; | ||
} // namespace audiocontext |