Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages