Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

🎵 BeatFlow - C++ GUI Playlist Management System

A dynamic, desktop music playlist management application developed in C++ using the Dev-C++ environment. The system integrates fundamental low-level Data Structures (Doubly Linked Lists) with a graphical rendering framework (graphics.h) to deliver an interactive user interface for organizing, sorting, and structural shuffling of audio tracks.

📋 Table of Contents

🚀 Core Features

  • Interactive Graphical UI: Replaces standard command-line console printing with styled canvas rendering (graphics.h) featuring responsive, dynamic text updates.
  • Persistent Playlist Operations: Full support for real-time track allocation (insertion) and specific target pruning (deletion by Unique ID).
  • Double-Ended Traversal Structure: Powered natively via pointers for instantaneous multi-directional list access.
  • Algorithmic Asset Ordering: Native alphanumeric data mutations capable of restructuring structural chains dynamically into ascending, descending, or pseudo-random linear patterns.
  • Custom Interactive Buffers: Safe input parsing that prevents unexpected graphic loop drops by explicitly mapping backspace events (ASCII 8) and carriage returns (ASCII 13).

🧱 Underlying Data Architecture

The underlying architecture relies heavily on custom object structures linked continuously via memory reference points. Each song element is defined as an isolated Node mapping metadata elements next to two reference addresses:

       ┌───────────┐      ┌───────────┐      ┌───────────┐
NULL ◄─┤   prev    │◄────┼─┤   prev    │◄────┼─┤   prev    │
       ├───────────┤      ├───────────┤      ├───────────┤
       │ Song Data │      │ Song Data │      │ Song Data │
       ├───────────┤      ├───────────┤      ├───────────┤
       │   next    ├─────►│   next    ├─────►│   next    ├─► NULL
       └───────────┘      └───────────┘      └───────────┘


🔄 Product Flow

The application executes along a centralized event-driven menu lifecycle loop orchestrated inside main.cpp:

   [ Launch Application Window ]
                 │
                 ▼
     ┌───► [ cleardevice() ]
     │           │
     │           ▼
     │     [ Render Menu Options ] (Green UI Matrix)
     │           │
     │           ▼
     │     [ Wait for User Input ] (getInput validation)
     │           │
     │           ▼
     │     [ Switch Action Route ]
     │           │
     ├───────────┼────────────────────────┐
     │           │                        │
  [ Case 1-6 ]   │                     [ Case 7 ]
  Execute Core   │                        │
  Logic Engine   │                        ▼
     │           │               [ Clear Allocations ]
     └───────────┘                        │
                                          ▼
                                  [ closegraph() ]

  1. Initialization Framework: The runtime establishes an isolated desktop canvas workspace through initgraph().
  2. The Graphics Loop: The window frame updates continuously via cleardevice(), repainting text arrays securely according to system tracking modifications.
  3. Protected Capture State: Key registers pass through internal check blocks inside getInput(). Intercepted backspaces safely rewrite character blocks to BLACK colors to simulate seamless text clearing on screen.
  4. Algorithmic Dispatches: Program blocks switch focus to data engine calls defined inside Playlist, manipulating heap values directly before refreshing interface layers.

🛠️ Technologies & System Libraries

  • Language Core: Standard C++ Runtime
  • Graphics Architecture: WinBGIm (graphics.h) for direct win32 visual workspace creation.
  • Device I/O: <conio.h> for unbuffered sequential keyboard tracking interception (getch()).
  • Formatting: <cstdio> for underlying memory string buffer formatting via sprintf().

📁 Project Architecture Layout

├── header.h               # Core structures, data schemas, and class method signatures
├── implementation.cpp     # Explicit link-state definitions and structural algorithms
├── main.cpp               # Master entry driver, display canvas, and window event-loop
├── Project1.dev           # Dev-C++ project compilation structural map configuration
└── .gitignore             # Suppresses tracking of temporary IDE files (*.o, *.exe, Makefile)


✅ Use Cases & Algorithm Implementations

Menu Action Algorithmic Process Backend Implementation Method
1. Add Song Appends nodes onto tail spaces ($O(N)$ traversal tracking). Playlist::createList(...)
2. Delete Song Standard node target detachment; re-links trailing and leading pointer elements securely. Playlist::del(int n)
3. Display Playlist Iterative link chain extraction translated into layout string visuals. Playlist::display()
4. Sort Ascending Pointer-swapping Bubble Sort matching element strings (i->SongName > j->SongName). Playlist::accending_order()
5. Sort Descending Inverse pointer-swapping Bubble Sort filtering operations alphabetically. Playlist::decendingOrder()
6. Random Shuffle Custom Linear Congruential Generator (LCG) random index mapping framework. Playlist::shuffleList()

Deep Dive: Custom LCG Pseudo-Random Shuffle Engine

Instead of utilizing bloated, non-portable standard random libraries, BeatFlow incorporates an optimized Linear Congruential Generator formula to guarantee deterministic list mixing across standard desktop processors:

$$X_{n+1} = (a \cdot X_n + c) \pmod m$$

Where the structural coefficients are mapped via explicit bitwise masks:

  • Multiplier ($a$): 1103515245
  • Increment ($c$): 12345
  • Modulus ($m$): 0x7FFFFFFF (Sign bit limit validation)

🔧 Getting Started

Prerequisites

  • Windows OS Environment.
  • Dev-C++ IDE (Preferably version 5.11 or any version shipped with pre-packaged graphics.h linking directories).

Compilation Pipeline

  1. Launch your local desktop workspace directory and open Project1.dev.
  2. Make sure compiler link options include parameters for the graphics sub-components (-lbgi, -lgdi32, -lcomdlg32, -luuid, -loleaut32, -lole32).
  3. Press F11 to build compile targets and run the application window seamlessly.

🙋 Author

Rayan Ahmer

⭐ Star this repository if you found it helpful!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages