๐ต Music Player Streaming Engine
A modular Music Player Streaming Engine built using Object-Oriented Design principles and multiple Design Patterns.
The system simulates the backend logic of a modern music streaming platform, allowing flexible playback strategies, device connectivity, playlist management, and simplified interaction with complex subsystems.
This project demonstrates Low-Level System Design (LLD) concepts and design pattern implementations commonly used in scalable software systems.
๐ Features
๐ง Playlist Management
๐ Multiple Playback Strategies
๐ก Device Connectivity (Bluetooth, speakers, etc.)
๐ผ Song Streaming Simulation
๐ง Modular Architecture using Design Patterns
๐งฉ Simplified interface using Facade
โก Command-based action execution (Play, Pause, Next, etc.)
๐ System Architecture User โ โผ MusicSystemFacade โ โโโ PlaylistManager (Singleton) โโโ DeviceManager (Singleton) โโโ StreamingEngine (Singleton) โ โผ Player โ โผ Playback Strategy (Sequential / Random / Custom Queue) โ โผ DeviceFactory โ โผ Adapter (External Device Integration)
The Facade acts as the main entry point that coordinates all subsystems.
๐ง Design Patterns Implemented
1๏ธโฃ Strategy Pattern
Used to support different song playback strategies.
Playback modes include:
Sequential Play
Random Play
Custom Queue Play
This allows the system to switch playback behavior dynamically at runtime.
Example:
PlayStrategy
โโโ SequentialPlay
โโโ RandomPlay
โโโ CustomQueuePlay
2๏ธโฃ Factory Pattern
Used to create device objects dynamically without exposing creation logic.
Supported devices may include:
Bluetooth Speaker
Wired Headphones
Smart Speaker
External Audio Device
Example:
DeviceFactory โ createDevice(type)
3๏ธโฃ Adapter Pattern
Used to integrate external or third-party audio devices whose interfaces differ from the internal player interface.
The adapter converts external APIs into a common device interface so the player can interact with them seamlessly.
ExternalDeviceAPI
โ
โผ
DeviceAdapter
โ
โผ
Player
4๏ธโฃ Singleton Pattern
Ensures that only one instance of core managers exists in the system.
Singleton is used for:
PlaylistManager
DeviceManager
StreamingEngine
Benefits:
Global access
Controlled resource usage
Consistent system state
5๏ธโฃ Facade Pattern
Provides a simplified interface to interact with complex subsystems.
Instead of interacting with multiple managers directly, the client communicates through:
MusicSystemFacade
Example:
musicFacade.playSong("SongName");
The facade internally coordinates:
Playlist Manager
Device Manager
Streaming Engine
Player
6๏ธโฃ Command Pattern
Encapsulates actions as command objects, allowing flexible command execution.
Commands include:
PlaySongCommand
PauseSongCommand
NextSongCommand
PreviousSongCommand
Flow:
User โ UI Button โ Command โ MusicPlayer
Benefits:
Decouples request sender and receiver
Enables command queuing
Supports undo/redo operations
๐ Project Structure
Music-Player-Streaming-Engine
โ
โโโ models
โ โโโ Song
โ โโโ Playlist
โ
โโโ managers
โ โโโ PlaylistManager
โ โโโ DeviceManager
โ โโโ StreamingEngine
โ
โโโ strategies
โ โโโ SequentialPlay
โ โโโ RandomPlay
โ โโโ CustomQueuePlay
โ
โโโ factory
โ โโโ DeviceFactory
โ
โโโ adapters
โ โโโ DeviceAdapter
โ
โโโ commands
โ โโโ PlayCommand
โ โโโ PauseCommand
โ โโโ NextCommand
โ
โโโ facade
โ โโโ MusicSystemFacade
โ
โโโ main.cpp
๐ป Technologies Used
C++
Object-Oriented Programming
Design Patterns
Data Structures
๐ฏ Learning Objectives
This project demonstrates:
Low Level System Design
Design Pattern Implementation
Clean Modular Architecture
Real-world system modeling
It serves as a practice project for software engineering interviews and system design preparation.
๐ฎ Future Improvements
Possible enhancements include:
Song recommendation engine
Streaming buffer simulation
Observer pattern for playback events
Undo/Redo command history
UI integration
๐จโ๐ป Author
Naval Kumar
Computer Science Engineering Student
Interested in System Design, Backend Development, and Scalable Architectures