Skip to content

Commit

Permalink
Revert "chore: works on testflight without pitch detector"
Browse files Browse the repository at this point in the history
This reverts commit 67d4a52.
  • Loading branch information
tsargent committed Jan 22, 2024
1 parent 67d4a52 commit c95b0b1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
14 changes: 14 additions & 0 deletions ios/Podfile.lock
@@ -1,4 +1,6 @@
PODS:
- Beethoven (5.0.0):
- Pitchy (~> 3.0)
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
Expand Down Expand Up @@ -75,6 +77,7 @@ PODS:
- hermes-engine/Pre-built (0.72.7)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- Pitchy (3.0.0)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -375,6 +378,9 @@ PODS:
- React-jsinspector (0.72.7)
- React-logger (0.72.7):
- glog
- react-native-pitch-detector (0.1.6):
- Beethoven
- React-Core
- react-native-safe-area-context (4.8.2):
- React-Core
- React-NativeModulesApple (0.72.7):
Expand Down Expand Up @@ -543,6 +549,7 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-pitch-detector (from `../node_modules/react-native-pitch-detector`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
Expand All @@ -567,6 +574,7 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- Beethoven
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
Expand All @@ -579,6 +587,7 @@ SPEC REPOS:
- fmt
- libevent
- OpenSSL-Universal
- Pitchy
- SocketRocket
- YogaKit

Expand Down Expand Up @@ -626,6 +635,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-pitch-detector:
:path: "../node_modules/react-native-pitch-detector"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
React-NativeModulesApple:
Expand Down Expand Up @@ -670,6 +681,7 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Beethoven: e318691697c38933a69081d4bf4d2506213505fd
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
Expand All @@ -688,6 +700,7 @@ SPEC CHECKSUMS:
hermes-engine: 9180d43df05c1ed658a87cc733dc3044cf90c00a
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Pitchy: 15407e4425b6d88fa3e7eef8927ba659fab52d7a
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 83bca1c184feb4d2e51c72c8369b83d641443f95
RCTTypeSafety: 13c4a87a16d7db6cd66006ce9759f073402ef85b
Expand All @@ -703,6 +716,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b
React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
react-native-pitch-detector: c0d98b009279015d721cd1e6255e91766c1a9780
react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89
React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"react": "18.2.0",
"react-native": "0.72.7",
"react-native-permissions": "^4.0.0",
"react-native-pitch-detector": "^0.1.6",
"react-native-safe-area-context": "^4.8.2",
"react-native-screens": "^3.29.0"
},
Expand Down
30 changes: 28 additions & 2 deletions src/components/Tuner.tsx
Expand Up @@ -6,14 +6,40 @@
*/

import React from 'react';
import {Text, StyleSheet} from 'react-native';
import {Text, View, StyleSheet} from 'react-native';
import {PitchDetector} from 'react-native-pitch-detector';
import {useSafeAreaInsets} from 'react-native-safe-area-context';

import ScreenContainer from './ScreenContainer';
import Wheel from './Wheel';
import Rotater from './Rotater';
import frequencyToDegrees from '../lib/frequencyToDegrees';

function Tuner(): React.JSX.Element {
const [data, setData] = React.useState({tone: '--', frequency: 0});
const insets = useSafeAreaInsets();

React.useEffect(() => {
PitchDetector.start();
PitchDetector.addListener(data => {
setData(data);
});
return () => {
PitchDetector.stop();
PitchDetector.removeListener();
};
}, []);

const degrees = React.useMemo(
() => frequencyToDegrees(data?.frequency) * -1,
[data.frequency],
);

return (
<ScreenContainer>
<Text>Hello</Text>
<Rotater degrees={degrees || 0}>
<Wheel />
</Rotater>
</ScreenContainer>
);
}
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Expand Up @@ -5534,11 +5534,23 @@ react-is@^17.0.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-native-permissions@^3.8.0:
version "3.10.1"
resolved "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-3.10.1.tgz#cb0171c8d12113869deaabbdfb979aad1a44752b"
integrity sha512-Gc5BxxpjZn4QNUDiVeHOO0vXh3AH7ToolmwTJozqC6DsxV7NAf3ttap+8BSmzDR8WxuAM3Cror+YNiBhHJx7/w==

react-native-permissions@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.0.0.tgz#64eb341993b0d317fb753104bc72f911d253d613"
integrity sha512-VWdETvRVf5WWLOKxle88UtB+LNQR99LvWOkg8C/azNTYLhuAqeSI+SYll+og/A0TIepeTsxnBrtX/YNB3hNQ0w==

react-native-pitch-detector@^0.1.6:
version "0.1.6"
resolved "https://registry.npmjs.org/react-native-pitch-detector/-/react-native-pitch-detector-0.1.6.tgz#3e44959c4d15bea1b395a5b509be2c2eef0d3a6d"
integrity sha512-UAgTMvNYEYXbKvfdwvAB0gopOBGDKKnTgL6/DnF5t8jWrNZrGaDVdMPX29L6mDbchDjqQVUfcb+Chv61LwXXuw==
dependencies:
react-native-permissions "^3.8.0"

react-native-safe-area-context@^4.8.2:
version "4.8.2"
resolved "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.8.2.tgz#e6b3d8acf3c6afcb4b5db03a97f9c37df7668f65"
Expand Down

0 comments on commit c95b0b1

Please sign in to comment.