- Author: Nabil Rahman
- Class: CS121 Section 4
- Semester: Spring 2017
This Java application plays songs in wav and mp3 format and provides useful controls to add and remove songs from the playlist. It can also save, modify and load saved playlist in a text based .npl format.
The easiest way to use this application is to import the project in Eclipse and then run it. As it uses 3rd party libraries, the libraries have to be compiled with the java compiler before it can be run.
If it shows any error, make sure to clean project and rebuild it before running.
I started with implementing the provided NRTunesPlayListInterface to my PlayList class. Then, I wrote all the methods that was provided by the interface.
After that, I jumped right into making the GUI components. I used BorderLayout as the main parent layout and added several JPanels of various layouts into that. The main BorderLayout had two sides consisting two separate panels on the left and on the right. Then, I added all the additional panels needed to make the GUI look the same as my design mockup.
While making the layouts, I expermented with all kinds of layoutManagers provided by the Java Swing Library. But, none of them actually provided my perfect control over my components position and style. Because of that, I started looking for solutions on the internet and found that MigLayout is a very efficient 3rd party layoutManager. So, I decided to implement that into my application. I think, deciding to use MigLayout was the best decision for this project! Without MigLayout, I wouldn't be able to make my design look the way it looks right now.
After I was done designing and adding the layouts and the components such as JButtons, JList, JScrollPane, JOptionPane, JMenuBar etc., I started implementing the actionListeners for the components. In addition to that, I also implemented changeListener for the buttons to apply hover effects.
Meeting all the requirements mentioned in the rubric, I started working on implementing extra functionalities. I thought, as I use audio player all the time on my PC, laptops, why not make an efficient yet good looking audio player that I can use.
After a lot of research and study, I implemented mp3 playing capabilities into my audio player. I used a 3rd party library called jLayer which can play mp3 files. In addition to that, a user can add mp3 files into the playlist. Even more, when adding new songs, the play length gets auto generated by calculating the frame length and frequency of the audio files. When adding mp3 songs, the song title, artist and playtime gets generated automatically by reading the tags of the given mp3 file. For reading tags from mp3 files, I used another library called jAudioTagger.
After implementing mp3 playing feature, I added the playlist saving and opening feature so that I can make my own playlists and save them.
In my opinion, this project was a lot different than the previous projects. This project was more about making a real-world application. I had a lot of fun working on it. I had a lot more freedom in this project than any of the previous ones. To make an efficient and functional audio player, I had write methods and classes of my own. Though the project required a lot of works, I found it very interesting to work on.
I tested the program by using the application and trying out all its functionalities. All the functionalities work as expected.
For extra credit, I implemented the gradient keybar for the songs and all other extra features like playing mp3s, saving and opening playlist, automated info gathering while adding a song etc.
- I gathered several concepts from Stack Overflow. Stack Overflow
- I studied several Java Tutorials made by Oracle. The Java™ Tutorials
- I studied about MigLayout on their website. MiG Layout Java Layout Manager for Swing and SWT
- I learned about JLayer from JavaZoom's website. JLayer - JavaZOOM