Skip to content

Commit b24deb3

Browse files
author
maciejmakowski2003
committed
Merge branch 'main' into feat/wave-shaper
2 parents 94ea611 + a4116e8 commit b24deb3

File tree

29 files changed

+410
-306
lines changed

29 files changed

+410
-306
lines changed

CONTRIBIUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing
2+
3+
## Development
4+
5+
To contribute by resolving already opened issues, please follow these steps:
6+
7+
1. Fork the repository to your own GitHub account.
8+
2. Create a new branch for your feature or bug fix.
9+
3. Stage your changes and commit them. (Follow [Conventional Commit Specification](https://www.conventionalcommits.org/en/v1.0.0/))
10+
4. Submit PR for review.
11+
12+
After your pull request is submitted, we will review it at as soon as possible.
13+
We may suggest changes or request additional improvements, so please enable
14+
[Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
15+
on your PR.
16+
17+
**Contribiuting by implementing your own feature should be preceeded by design doc. It can be any kind of document desciribing all important api and implementation details.**
18+
19+
## Reporting Issues and Feature Requests
20+
21+
If you encounter any bug, please report it [here](https://github.com/software-mansion/react-native-audio-api/issues/new?template=bug_report.yaml).
22+
23+
For feature requests, please submit them [here](https://github.com/software-mansion/react-native-audio-api/issues/new?template=feature_request.yaml). You can also create a [discussion](https://github.com/software-mansion/react-native-audio-api/discussions) first to talk about your idea or join existing one.
24+
25+

apps/common-app/src/App.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
import React from 'react';
2-
import type { FC } from 'react';
3-
import Animated from 'react-native-reanimated';
1+
import { NavigationContainer, useNavigation } from '@react-navigation/native';
42
import { createStackNavigator } from '@react-navigation/stack';
3+
import type { FC } from 'react';
4+
import React from 'react';
55
import {
66
FlatList,
7+
ListRenderItem,
8+
Pressable,
79
StyleSheet,
810
Text,
9-
Pressable,
10-
ListRenderItem,
1111
} from 'react-native';
1212
import { GestureHandlerRootView } from 'react-native-gesture-handler';
13-
import { NavigationContainer, useNavigation } from '@react-navigation/native';
1413

14+
import { Spacer } from './components';
1515
import Container from './components/Container';
1616
import { Example, Examples, MainStackProps } from './examples';
17-
import { layout, colors } from './styles';
18-
import { Spacer } from './components';
17+
import { colors, layout } from './styles';
1918

2019
const Stack = createStackNavigator();
2120

22-
// Our slider component uses the text prop to display shared value
23-
// We need it whitelisted in order to have it "animated".
24-
Animated.addWhitelistedNativeProps({ text: true });
25-
2621
const ItemSeparatorComponent = () => <Spacer.Vertical size={16} />;
2722

2823
const HomeScreen: FC = () => {
@@ -35,7 +30,8 @@ const HomeScreen: FC = () => {
3530
style={({ pressed }) => [
3631
styles.button,
3732
{ borderStyle: pressed ? 'solid' : 'dashed' },
38-
]}>
33+
]}
34+
>
3935
<Text style={styles.title}>{item.title}</Text>
4036
<Text style={styles.subtitle}>{item.subtitle}</Text>
4137
</Pressable>
@@ -68,7 +64,8 @@ const App: FC = () => {
6864
headerTintColor: colors.white,
6965
headerBackTitle: ' ',
7066
headerBackAccessibilityLabel: 'Go back',
71-
}}>
67+
}}
68+
>
7269
<Stack.Screen
7370
name="Home"
7471
component={HomeScreen}

apps/fabric-example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,7 @@ PODS:
26752675
- RNWorklets
26762676
- SocketRocket
26772677
- Yoga
2678-
- RNScreens (4.17.1):
2678+
- RNScreens (4.18.0):
26792679
- boost
26802680
- DoubleConversion
26812681
- fast_float
@@ -2702,10 +2702,10 @@ PODS:
27022702
- ReactCodegen
27032703
- ReactCommon/turbomodule/bridging
27042704
- ReactCommon/turbomodule/core
2705-
- RNScreens/common (= 4.17.1)
2705+
- RNScreens/common (= 4.18.0)
27062706
- SocketRocket
27072707
- Yoga
2708-
- RNScreens/common (4.17.1):
2708+
- RNScreens/common (4.18.0):
27092709
- boost
27102710
- DoubleConversion
27112711
- fast_float
@@ -3219,7 +3219,7 @@ SPEC CHECKSUMS:
32193219
RNAudioAPI: c763dbacdb8d89b7ce829484306df54322a7d951
32203220
RNGestureHandler: f1dd7f92a0faa2868a919ab53bb9d66eb4ebfcf5
32213221
RNReanimated: e4993dd98196c698cbacc1441a4ac5b855ae56dc
3222-
RNScreens: 833237c48c756d40764540246a501b47dadb2cac
3222+
RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479
32233223
RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6
32243224
RNWorklets: d4553da98908962b6b834d5f2d26525b0d6840ad
32253225
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748

packages/audiodocs/docs/fundamentals/getting-started.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ const config = {
119119
module.exports = wrapWithAudioAPIMetroConfig(config);
120120
```
121121

122+
### Step 4: Install system-wide bash (only Windows OS)
123+
124+
There are many ways to do that f.e. using git bash. To make sure just test if any unix command works.
125+
```bash
126+
bash -c 'echo Hello World!'
127+
```
128+
122129
### Possible additional dependencies
123130

124131
If you plan to use any of [`WorkletNode`](/docs/worklets/worklet-node), [`WorkletSourceNode`](/docs/worklets/worklet-source-node), [`WorkletProcessingNode`](/docs/worklets/worklet-processing-node), it is required to have

packages/react-native-audio-api/android/src/main/cpp/audioapi/android/AudioAPIModule.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ void AudioAPIModule::registerNatives() {
5050
makeNativeMethod(
5151
"invokeHandlerWithEventNameAndEventBody",
5252
AudioAPIModule::invokeHandlerWithEventNameAndEventBody),
53-
makeNativeMethod("closeAllContexts", AudioAPIModule::closeAllContexts),
5453
});
5554
}
5655

@@ -96,8 +95,4 @@ void AudioAPIModule::invokeHandlerWithEventNameAndEventBody(
9695
audioEventHandlerRegistry_->invokeHandlerWithEventBody(eventName->toStdString(), body);
9796
}
9897
}
99-
100-
void AudioAPIModule::closeAllContexts() {
101-
AudioAPIModuleInstaller::closeAllContexts();
102-
}
10398
} // namespace audioapi

packages/react-native-audio-api/android/src/main/cpp/audioapi/android/AudioAPIModule.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class AudioAPIModule : public jni::HybridClass<AudioAPIModule> {
3434

3535
void injectJSIBindings();
3636
void invokeHandlerWithEventNameAndEventBody(jni::alias_ref<jni::JString> eventName, jni::alias_ref<jni::JMap<jstring, jobject>> eventBody);
37-
void closeAllContexts();
3837

3938
private:
4039
friend HybridBase;

packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class AudioAPIModule(
4040
eventBody: Map<String, Any>,
4141
)
4242

43-
private external fun closeAllContexts()
44-
4543
init {
4644
try {
4745
System.loadLibrary("react-native-audio-api")
@@ -77,15 +75,14 @@ class AudioAPIModule(
7775
}
7876

7977
override fun onHostDestroy() {
80-
closeAllContexts()
78+
// do nothing
8179
}
8280

8381
override fun initialize() {
8482
reactContext.get()?.addLifecycleEventListener(this)
8583
}
8684

8785
override fun invalidate() {
88-
closeAllContexts()
8986
reactContext.get()?.removeLifecycleEventListener(this)
9087
// think about cleaning up resources, singletons etc.
9188
}

packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/system/AudioFocusListener.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class AudioFocusListener(
2828
}
2929
audioAPIModule.get()?.invokeHandlerWithEventNameAndEventBody("interruption", body)
3030
}
31+
3132
AudioManager.AUDIOFOCUS_LOSS_TRANSIENT -> {
3233
playOnAudioFocus = lockScreenManager.get()?.isPlaying == true
3334
val body =
@@ -37,6 +38,7 @@ class AudioFocusListener(
3738
}
3839
audioAPIModule.get()?.invokeHandlerWithEventNameAndEventBody("interruption", body)
3940
}
41+
4042
AudioManager.AUDIOFOCUS_GAIN -> {
4143
if (playOnAudioFocus) {
4244
val body =

packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/system/LockScreenManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class LockScreenManager(
155155
"state_playing" -> {
156156
this.playbackState = PlaybackStateCompat.STATE_PLAYING
157157
}
158+
158159
"state_paused" -> {
159160
this.playbackState = PlaybackStateCompat.STATE_PAUSED
160161
}

packages/react-native-audio-api/common/cpp/audioapi/AudioAPIModuleInstaller.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ namespace audioapi {
2323
using namespace facebook;
2424

2525
class AudioAPIModuleInstaller {
26-
private:
27-
inline static std::vector<std::weak_ptr<AudioContext>> contexts_ = {};
28-
2926
public:
3027
static void injectJSIBindings(
3128
jsi::Runtime *jsiRuntime,
@@ -56,19 +53,6 @@ class AudioAPIModuleInstaller {
5653
jsi::Object::createFromHostObject(*jsiRuntime, audioEventHandlerRegistryHostObject));
5754
}
5855

59-
static void closeAllContexts() {
60-
for (auto it = contexts_.begin(); it != contexts_.end(); ++it) {
61-
auto weakContext = *it;
62-
63-
if (auto context = weakContext.lock()) {
64-
context->close();
65-
}
66-
67-
it = contexts_.erase(it);
68-
--it;
69-
}
70-
}
71-
7256
private:
7357
static jsi::Function getCreateAudioContextFunction(
7458
jsi::Runtime *jsiRuntime,
@@ -97,7 +81,6 @@ class AudioAPIModuleInstaller {
9781

9882
audioContext = std::make_shared<AudioContext>(
9983
sampleRate, audioEventHandlerRegistry, runtimeRegistry);
100-
AudioAPIModuleInstaller::contexts_.push_back(audioContext);
10184

10285
auto audioContextHostObject =
10386
std::make_shared<AudioContextHostObject>(audioContext, &runtime, jsCallInvoker);

0 commit comments

Comments
 (0)