Skip to content

This is a CLI (Command Line Interface) application written in C++ for Linux systems, designed to serve as a basic media files browser and player.

Notifications You must be signed in to change notification settings

quandang246/Cpp-mediaplayer

Repository files navigation

Media Files Browser & Player CLI Application

This is a CLI (Command Line Interface) application written in C++ for Linux systems, designed to serve as a basic media files browser and player. The application allows users to navigate through directories, view media files, create playlists, view metadata of media files, edit metadata, and play music using SDL2/taglib library.

Requirements

  • Linux Operating System (Currently, I'm using Ubuntu 20.04)
  • Compiler C++20 (Maybe C++17 can also work)
  • Taglib Library
  • SDL2 Library
  • CMake (Currently, I'm using CMake 3.16.3)

Installation

  1. Clone the repository:

    git clone https://github.com/quandang246/Cpp-mediaplayer.git
  2. Compile the taglib:

    cd path-to-taglib
    mkdir build
    cd build/
    cmake -S .. -B .
    make
    sudo make install 
  3. Navigate to the project directory:

    cd path-to-Cpp-mediaplayer
  4. Compile the source code:

    mkdir build
    cd build/
    cmake -S .. -B .
    make
    sudo make install 
  5. Run the application (can run anywhere in your computer):

    media 

Usage

Running the Application

  • The application can be run from any directory on your computer or from an external USB device (ensure the device is mounted).

Note (using with usb)

  • First, you need to mount your usb int usb/ folder with following command:

    sudo mount -t drvfs usb_disk_name: path_to_usb_folder
    sudo mount -t drvfs E: /home/quan246/projects/src/mock_prj/usb
  • Last, you need to unmount your usb with following command:

    sudo umount path_to_usb_folder
    sudo umount /home/quan246/projects/src/mock_prj/usb

Available Options

  1. View List of Media Files:

    • Displays a list of media files (audio and video) in the current folder and all sub-folders with pagination (25 files per page).
  2. Playlists:

    • Allows users to manage playlists:
      • View existing playlists
      • View contents of a playlist
      • Create, update, and delete playlists
  3. Metadata of a File:

    • Retrieve and edit metadata of media files:
      • View metadata such as track name, album, artist, duration, genre, publisher, publish year for audio files; name, size, duration, bitrate, codec for video files.
      • Edit metadata: modify existing values or add new keys.
  4. Play Music:

    • Utilizes SDL2 library to play music:
      • Play functionality (in another thread)
      • Pause/Resume functionality
      • Next/Previous track
      • Automatically moves to the next song when the current song finishes
      • Displays current time and duration of the song
  5. Change Volume:

    • Adjust the volume of the device.

Dependencies

  • Taglib Library: This application uses Taglib library for read/edit metadata.
  • SDL2 Library: This application uses SDL2 library for multimedia playback.

Acknowledgments

  • Special thanks to the SDL2 and Taglib community for providing a powerful library for multimedia applications.
  • Thanks to TagLib for the library to handle audio metadata.
  • Thanks to SDL2 for the library to handle play audio/video.

Please let me know if you need further assistance or have any questions!

About

This is a CLI (Command Line Interface) application written in C++ for Linux systems, designed to serve as a basic media files browser and player.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published