Assignment Lab OOP
Assignment Lab OOP
Received Date :
Submission Due Date: 23rd May 2024
Lecturer :
Weightage : 30%
Semester : FEBRUARY 2024
Instruction to students:
• This is a GROUP assignment.
• Complete this cover sheet and attach it to your assignment (first page).
Student declaration:
I declare that:
• This assignment is my/our own work.
• I/we understand what is meant by plagiarism.
• My lecturer has the right to deduct my marks in case of:
- Late submission
Any plagiarism found in my assignment.
GUI Components
Playback controls:
Play Button: JButton (Swing) / Button (JavaFX): Initiates audio playback.
Pause Button: JButton (Swing) / Button (JavaFX): Pauses the audio playback.
Stop Button: JButton (Swing) / Button (JavaFX): Stops the audio playback.
Forward Button: JButton (Swing) / Button (JavaFX): Skips to the next track or moves forward in
the current track.
Rewind Button: JButton (Swing) / Button (JavaFX): Goes back to the previous track or rewinds
the current track.
Menu Bar:
JMenuBar (Swing) / Menu Bar (JavaFX): Provides a menu system for additional functionality
like opening files, saving playlists, or exiting the application.
File Menu:
Open File:
JMenuItem (Swing) / Menu Item (JavaFX): Allows users to open and select audio files.
Exit:
JMenuItem (Swing) / MenuItem (JavaFX): Closes the application.
Playlist Management:
Playlist Panel:
OOP-DCS20504
JList (Swing) / ListView (JavaFX): Displays a list of audio tracks that the user can select and
play.
Add/Remove Buttons: JButton (Swing) / Button (JavaFX): Adds or removes tracks from the
playlist.
Status Display:
Status Bar:
JLabel (Swing) / Label (JavaFX): Displays the status of the player, such as "Playing", "Paused",
or "Stopped".
Identify User Needs: Stakeholders: Determine who will be using the audio player (e.g., general
users, audiophiles, visually impaired users) and what they expect from it.
Primary Functionalities: Establish the core features required, such as play, pause, stop, volume
control, track navigation, and support for various audio formats.
Accessibility Requirements: Visually Impaired Users: Consider features that make the
application accessible, such as screen reader compatibility, keyboard shortcuts, high contrast
modes, and text-to-speech support.
Usability: Ensure that the UI is designed for easy navigation and operation by all users,
including those with disabilities.
Technical Specifications:
Performance Requirements: Define performance criteria such as fast loading times, smooth
playback, and low resource consumption.
Audio Format Support: List the audio formats that the player must support, such as MP3, WAV,
AAC, etc.
OOP-DCS20504
Component Arrangement: Proper arrangement of playback controls (play, pause, stop, etc.),
volume controls, and progress bars to make them easily accessible.
Aesthetics: Ensuring the UI is visually appealing with appropriate use of colors, fonts, and
spacing.
Usability: Designing the interface to be intuitive, so users can understand and navigate it without
extensive instructions.
Responsiveness: Making sure the UI responds quickly to user actions, providing immediate
feedback (e.g., changing the play button to a pause button when clicked).
OOP-DCS20504
AudioPlayer.Java
package AudioPlayer;
import javax.swing.*;
import java.awt.*;
public AudioPlayerFrame() {
super("Audio Player");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(600, 400);
setLocationRelativeTo(null);
// Initialize components
playbackPanel = new PlaybackPanel();
infoPanel = new InfoPanel();
volumeControlSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 50);
volumeStatusLabel = new JLabel("Volume: " + volumeControlSlider.getValue(),
JLabel.CENTER);
// Layout configuration
setLayout(new BorderLayout(10, 10));
add(playbackPanel, BorderLayout.NORTH);
add(infoPanel, BorderLayout.CENTER);
add(volumeControlPanel, BorderLayout.SOUTH);
add(songListPanel, BorderLayout.WEST);
ControlPanel.java
package AudioPlayer;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
public PlaybackPanel() {
setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));
playButton = new JButton("Play");
pauseButton = new JButton("Pause");
stopButton = new JButton("Stop");
add(playButton);
add(pauseButton);
add(stopButton);
}
}
}
InfoPanel.java
package AudioPlayer;
import javax.swing.*;
import java.awt.*;
public InfoPanel() {
setLayout(new BorderLayout(5, 5));
statusLabel = new JLabel("Status: Not Playing", JLabel.RIGHT);
progressBar = new JProgressBar();
progressBar.setValue(0);
add(statusPanel, BorderLayout.NORTH);
add(progressBar, BorderLayout.CENTER);
UIManager.put("ProgressBar.selectionBackground", Color.BLACK);
UIManager.put("ProgressBar.selectionForeground", Color.WHITE);
}
Sample Output:
Lauch screen of the audio player
The media player application showcased in the image provides a straightforward and user-friendly
interface for audio playback. The main components of the interface are clearly displayed,
including the track list, playback controls, and volume slider.
The track list features five song titles, allowing users to navigate and select the desired audio
content. The playback controls, consisting of "Play", "Pause", and "Stop" buttons, enable
seamless control over the playback experience. Additionally, the volume slider provides a
convenient way for users to adjust the audio output level to their preference.
The clean and minimalist design of the interface suggests a focus on simplicity and ease of use.
This approach likely caters to a wide range of users, from casual listeners to more experienced
media enthusiasts, by offering a straightforward and intuitive way to manage their audio files.
Overall, the media player application appears to provide a basic, yet functional, set of features
that allow users to efficiently play, pause, stop, and control the volume of their audio content. This
simplicity and accessibility could make the application appealing to a diverse user base seeking
a reliable and uncomplicated media playback experience.
OOP-DCS20504
The image shows a media player application with a simple and clean user interface. The main
components of the interface include the track list, playback controls (Play, Pause, Stop), and a
volume slider.
The track list displays five song titles: "Song A", "Song B", "Song C", "Song D", and "Song E". The
status information indicates that "Song A" is currently playing.
The playback controls allow the user to play, pause, and stop the audio playback. The volume
slider is present, with the current volume level set to 50.
The overall design of the interface is minimalist and user-friendly, suggesting a focus on providing
a straightforward and accessible media playback experience. This approach likely caters to a wide
range of users, from casual listeners to more experienced media enthusiasts, by offering a simple
and intuitive way to manage their audio content.
OOP-DCS20504
The image shows the media player application with the status indicating that the playback is
currently paused.
OOP-DCS20504
The updated image shows the media player application with the status indicating that "Song B" is
currently playing.
RUBRIC FOR ASSIGNMNET 3
TOTAL MARKS
REMARKS
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________