License • Contributing • Gallery • Installation • Troubleshooting • Configuration • Core Features • User Interface • Shortcuts • Logging • Playlist Maker • Usage
A feature-rich music player application with playlist management, playback controls, song information display, volume and progress tracking, Discord integration, and more.
- DarkDetect for the source code for windows dark mode detection.
- Where used? Here It was used as a base for getting ColorizationColor from the registry.
TODO: Click here
-
Playlists Management:
- Load Playlist: Load playlists from a specified directory.
- Reload Playlists: Refresh the list of available playlists.
- Delete Playlist: Remove a selected playlist.
- Create/Edit Playlist: Use the Playlist Maker to create or edit playlists.
-
Music Playback Controls:
- Play/Pause/Resume/Stop: Start, pause, resume, or stop the currently playing song.
- Previous/Next: Skip to the previous or next song in the playlist.
- Loop/Shuffle: Toggle loop and shuffle modes.
-
Song Information:
- Display Song Info: Show details of the currently playing song (artist and title).
- Update Window Title: Reflect the current song info and playlist in the window title.
-
Volume Control:
- Adjust Volume: Change playback volume via a slider.
-
Progress Tracking:
- Track Progress: Display and update the progress of the currently playing song.
- Format Time: Convert elapsed time and total duration into a readable format.
-
Discord Integration:
- Update Discord Status: Display the current song info in Discord status.
- Custom Presence Images: Display custom playlist images in Discord status.
- Check Discord Connection: Monitor and display connection status to Discord.
-
Key Bindings:
- Media Keys: Handle media keys for play/pause, next, and previous track.
-
External Actions:
- Open YouTube: Open the YouTube video for the current song, if available.
-
Accent Color:
- With the settings page added, you can change most of the settings directly from the application.
- Use System Accent Color: Use the system's accent color. (Windows and macOS only)
- In order to use the system's accent color, you must set the
automatic
value for thecolorization_color
in the config.json file.
- In order to use the system's accent color, you must set the
- Set your own Accent Color: Specify the hex color code of the accent color.
- In order to use your own accent color, you must set the
your_hex_color
value for thecolorization_color
in the config.json file.
- In order to use your own accent color, you must set the
-
Playlists and Songs Display:
- Playlist List: Show available playlists and their song counts.
- Song List: Display the list of songs in the currently loaded playlist.
- Song information: For displaying the currently playing song's artist(s), title, album and genre.
-
Controls and Layouts:
- Control Buttons: Various buttons for playback control, playlist management, and external actions.
- Sliders: For adjusting volume and tracking song progress.
- Labels: For displaying song info, playback time, and Discord status.
-
Dialogs:
- Open Playlist Dialog: Select and load playlists.
- Delete Playlist: Select a playlist and press the
Delete
key to remove it from the list.- Delete Song: (From Playlist Maker) Select the song and press the
Delete
key to remove it from the playlist.
- Delete Song: (From Playlist Maker) Select the song and press the
- Play/Pause: Use the
Media Play/Pause
(FN + F7
) key to toggle play/pause. - Next Track: Use the
Media Next
(FN + F6
) key to skip to the next track. - Previous Track: Use the
Media Previous
(FN + F5
) key to return to the previous track.
- Logging Setup:
- Console Logging: Output logs to the console.
- File Logging: Save logs to a rotating file for persistent records.
The PlaylistMaker
class provides a user-friendly interface for creating and managing playlists. It allows users to select folders containing songs, add songs manually, and save playlists in JSON format.
- Select Folder: Automatically populate the playlist with songs from a selected folder.
- Add Songs Manually: Enter song details manually including artist, title, YouTube ID, and song path.
- Save Playlist: Save the created playlist in JSON format.
- Open Existing Playlist: Load and edit an existing playlist.
- Edit Songs: Double-click on a song entry to edit its details.
- Delete Songs: Select a song and press the Delete key to remove it.
-
Select Folder:
- Click on the "Select Folder" button to choose a folder containing MP3 files.
- The application will automatically process the folder and add all MP3 files matching the naming pattern to the playlist.
-
Add Songs Manually:
- Fill in the "Artist", "Title", "YouTube ID" (optional), and "Song Path" fields.
- Click the "Add Song" button to add the song to the playlist.
-
Save Playlist:
- Enter a name for the playlist in the "Enter playlist name" field.
- Add a playlist image if you want to. It's optional after all.
- Click the "Save Playlist" button to save the playlist as a JSON file.
-
Open Existing Playlist:
- Click the "Open Existing Playlist" button to load a playlist.
- Select the JSON file of the playlist you want to open.
-
Edit and Delete Songs:
- To edit a song, double-click on the corresponding cell in the table.
- To delete a song, select the row and press the Delete key.
For automatic recognition, the song files in the selected folder should follow this naming scheme:
- Artist: The name of the artist.
- Title: The title of the song.
- YouTube ID: (Optional) The YouTube ID for the song.
Example(s):
Artist - Title [YouTube ID].mp3
Artist - Title [dQw4w9WgXcQ].mp3 Artist (feat. Artist) - Title (Bass Boosted) [dQw4w9WgXcQ].mp3
{
"playlist_name": "default",
"playlist_large_image_key":"https://i.pinimg.com/236x/42/43/03/424303bef006eb35803ae00505248d7a.jpg",
"song_count": 2,
"songs": [
{
"artist": "Artist 1",
"title": "Title 1",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 1 - Title 1 [dQw4w9WgXcQ].mp3",
"playlist": "default",
"album": "Album 1",
"genre": "Genre 2",
"picture_path": "C:\\Users\\USER\\Music\\FOLDER\\picture.jpg"
},
{
"artist": "Artist 2",
"title": "Title 2",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 2 - Title 2 [dQw4w9WgXcQ].mp3",
"playlist": "default",
"album": "Album 2",
"genre": "Genre 2",
"picture_path": "C:\\Users\\USER\\Music\\FOLDER\\picture.jpg"
}
]
}
-
Clone the repository:
git clone https://github.com/vorlie/IotaPlayer.git
-
Navigate to the project directory:
cd IotaPlayer
-
Make virtual environment:
python -m venv venv ./venv/bin/activate
-
Install the required dependencies: (To install using git, you must install Git.)
pip install PyQt5==5.15.10 pip install pygame==2.6.0 pip install git+https://github.com/qwertyquerty/pypresence.git@master pip install mutagen==1.47.0 pip install pynput==1.7.7 pip install git+https://github.com/vorlie/PyQtDarkTheme.git@main --ignore-requires-python
-
Ensure you have the necessary environment variables and configuration files:
- Create a
config.json
file with necessary configuration details.- Otherwise the application will generate a default configuration.
- Add your Discord client ID in the appropriate place if needed.
- The default value is
1150680286649143356
.
- The default value is
- Create a
-
Building from source using pyinstaller:
-
If planning to build from source.
pip install pyinstaller==6.6.0
pyinstaller IotaPlayerWIN.spec
-
If you want console output:
- Change the
console
value toTrue
in theIotaPlayerWIN.spec
file. If you decide to leave it asFalse
, then be aware of how PyInstaller works, it can trigger your anti virus.exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name='IotaPlayer', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, icon=['icon.ico'], )
- Change the
-
-
Run the application:
python main.py
or use the executable you built in the previous step.
-
Control the application:
- Use the UI buttons to control playback, manage playlists, and access external actions.
- Use media keys on your keyboard to control playback.
-
Create/Edit Playlists:
- Access the Playlist Maker to create or edit playlists.
-
Discord Integration:
- The application will automatically update your Discord status with the current song info if connected.
With the settings page added, you can change most of the settings directly from the application.
-
config.json
: Place your configuration settings here. Example:- If file is not present, application will create it with default values.
{ "discord_comments": { "1": "Connect to Discord? If set to true, application will try to connect to discord in order to set your presence.", "2": "Set it to false if you don't want to connect to Discord.", "3": "The default value is 'true'.", "4": "Enter your Discord Client ID. You can find it in your Discord Developer Portal.", "5": { "1":"Enter your Discord Large Image Key. You can find it in your Discord Developer Portal.", "2":"You can use links as well.", "3":"The default value is 'default_image'." } }, "connect_to_discord": true, "discord_client_id": "1150680286649143356", "large_image_key": "default_image", "use_playing_status": false, "root_playlist_folder_comment": { "1": "Specify the directory where your playlists are saved. You can change this path if needed.", "2": "The default value is 'playlists'." }, "root_playlist_folder": "playlists", "default_playlist_comment": "Enter the name of the default playlist that will be loaded initially. You can modify this name as required.", "default_playlist": "default", "colorization_color_comment": { "1": "Enter the hex color code of the accent color. You can modify this color as required.", "2": "If set to 'automatic' the application will use the system's accent color.", "3": "The default value is 'automatic'." }, "colorization_color": "automatic" }
-
Logging Configuration:
- In
musicPlayer.py
there are commented logging configurations. Uncomment them to use them.- Logs are written to
combined_app.log
for application and discord logs.
- Logs are written to
- In
-
Ensure all dependencies are installed: Verify the installation of all required packages.
PyQt5==5.15.10 pygame==2.6.0 git+https://github.com/qwertyquerty/pypresence.git@master mutagen==1.47.0 pynput==1.7.7 git+https://github.com/vorlie/PyQtDarkTheme.git@main
-
Check Discord connection: Ensure your Discord client ID is correct and that you are connected to Discord.
-
Review logs: Check
combined_app.log
for detailed logging information if issues arise.
This project is licensed under the MIT License. See the LICENSE file for details.
- PyQt5: A set of Python bindings for the Qt application framework, which provides the GUI capabilities for this application.
- qdarktheme: A library for applying dark themes to PyQt5 applications, enhancing the visual appeal of the interface.
- pygame: A cross-platform set of Python modules designed for writing video games, providing functionality for sound and music.
- pypresence: A Python library for integrating with Discord's Rich Presence, allowing you to display custom activity information.
- mutagen: A Python module used for handling audio metadata, enabling the application to read and write metadata in audio files.
- pynput: A library for controlling and monitoring input devices, such as keyboards and mice.
- pyinstaller: A tool for converting Python applications into stand-alone executables, allowing for easier distribution and deployment.