Skip to content

Commit 8a0ed2f

Browse files
author
Maciej Makowski
committed
Revert "Merge branch '@maciejmakowski/audio-context-oscillator'"
This reverts commit f0354ea, reversing changes made to a55e40f.
1 parent f0354ea commit 8a0ed2f

36 files changed

+883
-16962
lines changed

CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
[INSERT CONTACT METHOD].
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

android/CMakeLists.txt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
cmake_minimum_required(VERSION 3.9.0)
2-
project(react-native-audio-context)
1+
cmake_minimum_required(VERSION 3.4.1)
2+
project(AudioContext)
33

44
set (CMAKE_VERBOSE_MAKEFILE ON)
55
set (CMAKE_CXX_STANDARD 14)
66

7-
add_library(react-native-audio-context
8-
SHARED
9-
../cpp/JSIExampleHostObject.cpp
7+
add_library(react-native-audio-context SHARED
8+
../cpp/react-native-audio-context.cpp
109
cpp-adapter.cpp
1110
)
1211

1312
# Specifies a path to native header files.
1413
include_directories(
1514
../cpp
16-
../node_modules/react-native/ReactCommon/jsi
17-
)
18-
19-
find_package(ReactAndroid REQUIRED CONFIG)
20-
find_package(fbjni REQUIRED CONFIG)
21-
22-
target_link_libraries(
23-
react-native-audio-context
24-
ReactAndroid::jsi
25-
fbjni::fbjni
26-
android
2715
)

android/build.gradle

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import com.android.Version
2-
31
buildscript {
42
repositories {
53
google()
64
mavenCentral()
75
}
86

97
dependencies {
10-
classpath "com.android.tools.build:gradle:7.2.2"
8+
classpath "com.android.tools.build:gradle:7.2.1"
119
}
1210
}
1311

@@ -21,7 +19,6 @@ def isNewArchitectureEnabled() {
2119
}
2220

2321
apply plugin: "com.android.library"
24-
apply plugin: 'org.jetbrains.kotlin.android'
2522

2623
if (isNewArchitectureEnabled()) {
2724
apply plugin: "com.facebook.react"
@@ -35,8 +32,8 @@ def getExtOrIntegerDefault(name) {
3532
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AudioContext_" + name]).toInteger()
3633
}
3734

38-
static def supportsNamespace() {
39-
def parsed = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
35+
def supportsNamespace() {
36+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
4037
def major = parsed[0].toInteger()
4138
def minor = parsed[1].toInteger()
4239

@@ -67,7 +64,6 @@ android {
6764
cmake {
6865
cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
6966
abiFilters (*reactNativeArchitectures())
70-
arguments "-DANDROID_STL=c++_shared"
7167
}
7268
}
7369
}
@@ -80,7 +76,6 @@ android {
8076

8177
buildFeatures {
8278
buildConfig true
83-
prefab true
8479
}
8580

8681
buildTypes {
@@ -108,9 +103,6 @@ android {
108103
}
109104
}
110105
}
111-
kotlinOptions {
112-
jvmTarget = '17'
113-
}
114106
}
115107

116108
repositories {
@@ -124,14 +116,12 @@ dependencies {
124116
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
125117
//noinspection GradleDynamicVersion
126118
implementation "com.facebook.react:react-native:+"
127-
implementation 'androidx.core:core-ktx:1.13.1'
128-
implementation 'com.facebook.fbjni:fbjni:0.6.0'
129119
}
130120

131121
if (isNewArchitectureEnabled()) {
132122
react {
133123
jsRootDir = file("../src/")
134-
libraryName = "react-native-audio-context"
124+
libraryName = "AudioContext"
135125
codegenJavaPackageName = "com.audiocontext"
136126
}
137127
}

android/cpp-adapter.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
#include <jni.h>
2-
#include <jsi/jsi.h>
3-
#include "AudioContextHostObject.h"
4-
5-
using namespace facebook;
6-
7-
void install(jsi::Runtime& runtime) {
8-
auto hostObject = std::make_shared<audiocontext::AudioContextHostObject>();
9-
auto object = jsi::Object::createFromHostObject(runtime, hostObject);
10-
runtime.global().setProperty(runtime, "__JSIExampleProxy", std::move(object));
11-
}
2+
#include "react-native-audio-context.h"
123

134
extern "C"
14-
JNIEXPORT void JNICALL
15-
Java_com_audiocontext_jsi_AudioContextModule_00024Companion_nativeInstall(JNIEnv *env, jobject clazz, jlong jsiPtr) {
16-
auto runtime = reinterpret_cast<jsi::Runtime*>(jsiPtr);
17-
if (runtime) {
18-
install(*runtime);
19-
}
5+
JNIEXPORT jdouble JNICALL
6+
Java_com_audiocontext_AudioContextModule_nativeMultiply(JNIEnv *env, jclass type, jdouble a, jdouble b) {
7+
return audiocontext::multiply(a, b);
208
}

android/src/main/cpp/AudioContext.h

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.audiocontext;
2+
3+
import androidx.annotation.NonNull;
4+
5+
import com.facebook.react.bridge.ReactApplicationContext;
6+
import com.facebook.react.module.annotations.ReactModule;
7+
8+
@ReactModule(name = AudioContextModule.NAME)
9+
public class AudioContextModule extends NativeAudioContextSpec {
10+
public static final String NAME = "AudioContext";
11+
12+
public AudioContextModule(ReactApplicationContext reactContext) {
13+
super(reactContext);
14+
}
15+
16+
@Override
17+
@NonNull
18+
public String getName() {
19+
return NAME;
20+
}
21+
22+
static {
23+
System.loadLibrary("react-native-audio-context");
24+
}
25+
26+
private static native double nativeMultiply(double a, double b);
27+
28+
// Example method
29+
// See https://reactnative.dev/docs/native-modules-android
30+
@Override
31+
public double multiply(double a, double b) {
32+
return nativeMultiply(a, b);
33+
}
34+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.audiocontext;
2+
3+
import androidx.annotation.Nullable;
4+
5+
import com.facebook.react.bridge.NativeModule;
6+
import com.facebook.react.bridge.ReactApplicationContext;
7+
import com.facebook.react.module.model.ReactModuleInfo;
8+
import com.facebook.react.module.model.ReactModuleInfoProvider;
9+
import com.facebook.react.TurboReactPackage;
10+
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
14+
public class AudioContextPackage extends TurboReactPackage {
15+
16+
@Nullable
17+
@Override
18+
public NativeModule getModule(String name, ReactApplicationContext reactContext) {
19+
if (name.equals(AudioContextModule.NAME)) {
20+
return new AudioContextModule(reactContext);
21+
} else {
22+
return null;
23+
}
24+
}
25+
26+
@Override
27+
public ReactModuleInfoProvider getReactModuleInfoProvider() {
28+
return () -> {
29+
final Map<String, ReactModuleInfo> moduleInfos = new HashMap<>();
30+
moduleInfos.put(
31+
AudioContextModule.NAME,
32+
new ReactModuleInfo(
33+
AudioContextModule.NAME,
34+
AudioContextModule.NAME,
35+
false, // canOverrideExistingModule
36+
false, // needsEagerInit
37+
true, // hasConstants
38+
false, // isCxxModule
39+
true // isTurboModule
40+
));
41+
return moduleInfos;
42+
};
43+
}
44+
}

android/src/main/java/com/audiocontext/AudioContextPackage.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)