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.
- Core Features
- Underlying Data Architecture
- Product Flow Diagram
- Technologies & System Libraries
- Project Architecture Layout
- Use Cases & Algorithm Implementations
- Getting Started
- Author
- 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).
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
└───────────┘ └───────────┘ └───────────┘
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() ]
- Initialization Framework: The runtime establishes an isolated desktop canvas workspace through
initgraph(). - The Graphics Loop: The window frame updates continuously via
cleardevice(), repainting text arrays securely according to system tracking modifications. - Protected Capture State: Key registers pass through internal check blocks inside
getInput(). Intercepted backspaces safely rewrite character blocks toBLACKcolors to simulate seamless text clearing on screen. - Algorithmic Dispatches: Program blocks switch focus to data engine calls defined inside
Playlist, manipulating heap values directly before refreshing interface layers.
- 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 viasprintf().
├── 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)
| Menu Action | Algorithmic Process | Backend Implementation Method |
|---|---|---|
| 1. Add Song | Appends nodes onto tail spaces ( |
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() |
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:
Where the structural coefficients are mapped via explicit bitwise masks:
-
Multiplier (
$a$ ):1103515245 -
Increment (
$c$ ):12345 -
Modulus (
$m$ ):0x7FFFFFFF(Sign bit limit validation)
- Windows OS Environment.
- Dev-C++ IDE (Preferably version 5.11 or any version shipped with pre-packaged
graphics.hlinking directories).
- Launch your local desktop workspace directory and open
Project1.dev. - Make sure compiler link options include parameters for the graphics sub-components (
-lbgi,-lgdi32,-lcomdlg32,-luuid,-loleaut32,-lole32). - Press F11 to build compile targets and run the application window seamlessly.
Rayan Ahmer
⭐ Star this repository if you found it helpful!