diff --git a/ReadMe.md b/ReadMe.md index 7be3352..1726501 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,72 +1,123 @@ -# Seventh Assignment — JavaFX Music Player Project +# 🎵 Music Player -This is a starter JavaFX application for a simple Music Player interface. Your goal is to design the UI and connect it to the provided controller logic to create basic music player interactions. +A minimal JavaFX music player with playlist support and dark mode. -## 📋 Assignment Objectives +--- -### Complete the following features: +## Features -**1. Design the Music Player UI** +- Play, pause, skip, and seek through songs +- Shuffle and repeat modes +- Volume control +- Album art display (loaded from file metadata) +- Library tab — manage all your songs +- Playlists tab — create custom playlists and add songs to them +- Dark mode toggle +- Right-click on any song to add it to a playlist -Create a layout for a simple music player interface. Your UI should display at least **three songs**, each containing: +--- -- Song title -- Artist name -- Duration -- A **Play** button -- An **Add to Playlist** button +## Project Structure -**2. Connect UI Components to the Controller** +``` +MusicPlayer/ +├── src/ +│ └── main/ +│ ├── java/sbu/javafx/ +│ │ ├── MainApp.java +│ │ ├── MusicController.java +│ │ ├── Song.java +│ │ └── Playlist.java +│ └── resources/sbu/javafx/ +│ ├── player.fxml +│ └── style.css +└── pom.xml +``` -Link your UI elements to the provided `MusicController` class: +--- -- Connect buttons to their corresponding controller methods. -- Ensure that clicking buttons triggers the correct actions. +## Requirements -**3. Display the Currently Playing Song** +- Java 17+ +- JavaFX 17+ +- JAudioTagger 3.0.1 (for reading song metadata) -When a user clicks a **Play** button: +--- -- Update a label in the UI showing the currently playing song (e.g., "Now Playing: Song Title"). +## Dependencies (pom.xml) -**4. Implement a Playlist** +```xml + + org.openjfx + javafx-controls + 17 + + + org.openjfx + javafx-fxml + 17 + + + org.openjfx + javafx-media + 17 + + + net.jthink + jaudiotagger + 3.0.1 + +``` -When the **Add to Playlist** button is clicked: +--- -- Add the selected song to a playlist data structure (e.g., an `ArrayList`). +## How to Run -**5. Create a Playlist Page** +```bash +mvn clean javafx:run +``` -Add a **"View Playlist"** button to the main UI: +--- -- When clicked, switch to a **new scene** that displays the playlist. -- Use `stage.setScene(...)` to switch between scenes. -- Show the playlist content using a `ListView` or any other layout. +## How to Use +### Adding Songs +1. Go to the **Library** tab +2. Click **+ Add Song** +3. Select one or more audio files (mp3, wav, aac, flac) +4. Songs will appear in the library with their metadata -## 🎨 UI Design Reference +### Playing Songs +- Double-click any song in the library to start playing +- Use the control buttons to play/pause, skip, or go back +- Drag the progress bar to seek -To help you get started, refer to the layout below. Your application should have a similar, clean, and simple structure: +### Playlists +1. Go to the **Playlists** tab +2. Click **+ New** to create a playlist +3. Go back to the Library tab +4. Right-click any song and select **Add to Playlist** +5. Double-click a playlist to open it +6. Double-click a song inside the playlist to play it -![Music Player UI Layout](https://uploadkon.ir/uploads/85a922_26music.png) +### Dark Mode +- Click the 🌙 button on the top right of the player panel to toggle dark mode -*(Note: This is a wireframe. You are encouraged to keep your implementation simple and focus on functionality.)* +--- +## Supported Formats -## ⭐ Bonus Tasks (Optional) +| Format | Supported | +|--------|-----------| +| MP3 | ✅ | +| WAV | ✅ | +| AAC | ✅ | +| FLAC | ✅ | -**The core requirements above do not include actual audio playback.** The following tasks are optional (Bonus) and should only be attempted if you have completed the core requirements. - -**1. Play Functionality** - -- Implement actual audio playback using JavaFX `Media` and `MediaPlayer` classes. - -**2. Add Visual Feedback** - -- When a song is playing, change the row style or update the **Play** button text to "Playing". - -**3. Dark Mode / Light Mode** - -- Add a toggle button to switch between two CSS stylesheets (e.g., `dark.css` and `light.css`) at runtime. - +--- +## Preview +![](src\main\resources\sbu\images\Screenshot1.png) +![](src\main\resources\sbu\images\Screenshot2.png) +![](src\main\resources\sbu\images\Screenshot3.png) +![](src\main\resources\sbu\images\Screenshot4.png) \ No newline at end of file diff --git a/src/main/resources/sbu/images/Screenshot1.png b/src/main/resources/sbu/images/Screenshot1.png new file mode 100644 index 0000000..c143a12 Binary files /dev/null and b/src/main/resources/sbu/images/Screenshot1.png differ diff --git a/src/main/resources/sbu/images/Screenshot2.png b/src/main/resources/sbu/images/Screenshot2.png new file mode 100644 index 0000000..96f7e34 Binary files /dev/null and b/src/main/resources/sbu/images/Screenshot2.png differ diff --git a/src/main/resources/sbu/images/Screenshot3.png b/src/main/resources/sbu/images/Screenshot3.png new file mode 100644 index 0000000..8c7594e Binary files /dev/null and b/src/main/resources/sbu/images/Screenshot3.png differ diff --git a/src/main/resources/sbu/images/Screenshot4.png b/src/main/resources/sbu/images/Screenshot4.png new file mode 100644 index 0000000..60608b5 Binary files /dev/null and b/src/main/resources/sbu/images/Screenshot4.png differ