How kanishkkar2817/circular-music-palyer works
This is a browser-based music player and data-structures learning demo. Users add or search songs, enqueue normal or play-next tracks, and control playback; the app coordinates queue selection, synthesized audio, and saved preferences. Separate views visualize circular-queue operations, priority ordering, stack history, and hash lookup, with guide, complexity, and operation-log panels. The excerpts establish the app’s calls into core services and structures; wiring for several UI components is documented only by the App import index, so uncertain component-to-component links are omitted.
Main entry points: App.tsx Player coordinator · MusicPlayer.tsx Playback controls · PriorityQueuePanel.tsx Priority panel · StackPanel.tsx Stack panel
Components 24
App coordination
- Player coordinator
src/App.tsx - Sample catalog
src/data/sampleSongs.ts - Browser storage
src/services/StorageService.ts - Add song modal
src/components/AddSongModal.tsx - Playlist view
src/components/Playlist.tsx - Navigation
src/components/Navbar.tsx - Sidebar
src/components/Sidebar.tsx - Toast notifications
src/components/ToastContainer.tsx
Music playback
- Synth audio service
src/services/AudioService.ts - Playback controls
src/components/MusicPlayer.tsx
Data structures
- Circular queue
src/dataStructures/CircularQueue.ts - Priority queue
src/dataStructures/PriorityQueue.ts - Recent history stack
src/dataStructures/Stack.ts - Song hash map
src/dataStructures/SongHashMap.ts
Learning interface
- Queue visualizer
src/components/CircularQueueVisualizer.tsx - DSA mode panel
src/components/DSAModePanel.tsx - Priority panel
src/components/PriorityQueuePanel.tsx - Stack panel
src/components/StackPanel.tsx - Hash search panel
src/components/HashMapSearchPanel.tsx - How-it-works guide
src/components/HowItWorksGuide.tsx - Complexity panel
src/components/ComplexityPanel.tsx - Operation log
src/components/OperationLog.tsx - Presentation mode
src/components/PresentationModeModal.tsx
Other components
- Listener
Connections 26
- Listener → Player coordinator: uses player
- Player coordinator → Sample catalog: loads catalog
src/App.tsx - Player coordinator → Browser storage: loads and saves
src/App.tsx - Player coordinator → Circular queue: manages playback queue
src/App.tsx - Player coordinator → Priority queue: enqueues priority
src/App.tsx - Player coordinator → Song hash map: indexes songs
src/App.tsx - Player coordinator → Recent history stack: maintains history
src/App.tsx - Player coordinator → Synth audio service: controls audio
src/App.tsx - Player coordinator → Playback controls: renders controls
src/App.tsx - Playback controls → Synth audio service: reads playback data
src/components/MusicPlayer.tsx - Player coordinator → Add song modal: renders modal
src/App.tsx - Player coordinator → Playlist view: renders view
src/App.tsx - Player coordinator → Navigation: renders navigation
src/App.tsx - Player coordinator → Sidebar: renders sidebar
src/App.tsx - Player coordinator → Queue visualizer: renders visualizer
src/App.tsx - Player coordinator → DSA mode panel: renders DSA panel
src/App.tsx - Player coordinator → Priority panel: renders panel
src/App.tsx - Player coordinator → Stack panel: renders panel
src/App.tsx - Player coordinator → Hash search panel: renders search panel
src/App.tsx - Player coordinator → How-it-works guide: renders guide
src/App.tsx - Player coordinator → Complexity panel: renders panel
src/App.tsx - Player coordinator → Operation log: renders log
src/App.tsx - Player coordinator → Presentation mode: renders modal
src/App.tsx - Player coordinator → Toast notifications: renders notifications
src/App.tsx - Priority panel → Priority queue: reads queue
src/components/PriorityQueuePanel.tsx - Stack panel → Recent history stack: reads history
src/components/StackPanel.tsx