performance improvements + oscilloscope

This commit is contained in:
Boof2015
2026-06-18 15:52:48 -04:00
parent 5853edd933
commit 9fd37c93d7
14 changed files with 907 additions and 236 deletions
+37 -1
View File
@@ -23,6 +23,7 @@ import { colors, radius, spacing } from '@/theme';
import { motion } from '@/theme/motion';
import { usePlayerStore } from '@/stores/playerStore';
import { usePlaylistStore } from '@/stores/playlistStore';
import { useSettingsStore } from '@/stores/settingsStore';
import {
cycleRepeat,
seekTo,
@@ -130,6 +131,7 @@ export default function NowPlayingScreen() {
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
const [showScopeStage, setShowScopeStage] = useState(false);
const [queueOpen, setQueueOpen] = useState(false);
const scopeMode = useSettingsStore((s) => s.scopeMode);
const track = usePlayerStore((s) => s.currentTrack);
const playbackState = usePlayerStore((s) => s.playbackState);
const currentTime = usePlayerStore((s) => s.currentTime);
@@ -259,9 +261,30 @@ export default function NowPlayingScreen() {
height={layout.scopeHeight}
interactive={false}
showChrome={false}
mode="spectrum"
mode={scopeMode}
edgeFade
/>
{/* Nested Pressable: RN grants the responder to this
button, so a swap tap does not also collapse the
stage (the outer Pressable's onPress won't fire). */}
<Pressable
onPress={() =>
useSettingsStore
.getState()
.setScopeMode(scopeMode === 'spectrum' ? 'scope' : 'spectrum')
}
hitSlop={12}
style={styles.scopeSwap}
accessibilityRole="button"
accessibilityLabel={`Showing ${
scopeMode === 'spectrum' ? 'spectrum' : 'oscilloscope'
}. Tap to switch.`}
>
<Text variant="caption" style={styles.scopeSwapLabel}>
{scopeMode === 'spectrum' ? 'SPECTRUM' : 'SCOPE'}
</Text>
<Ionicons name="swap-horizontal" size={14} color={colors.textTertiary} />
</Pressable>
</View>
) : (
<View
@@ -476,6 +499,19 @@ const styles = StyleSheet.create({
justifyContent: 'center',
overflow: 'hidden',
},
scopeSwap: {
position: 'absolute',
top: spacing.xs,
right: spacing.sm,
flexDirection: 'row',
alignItems: 'center',
gap: spacing.xs,
},
scopeSwapLabel: {
color: colors.textTertiary,
letterSpacing: 1.5,
fontSize: 10,
},
artImage: {
width: '100%',
height: '100%',