Docsity

i++Tunes Project: Creating an MP3 Player with Advanced Features, Study Guides, Projects, Research of Computer Science

Toggle sidebar
bg1
Page 1 of 5
i++Tunes
C Sc 335 Spring 2008 – Final Project
Grader: Patrick Valenzuela
Abstract:
Apple's iTunes has become one of today's most popular software applications. However, it's
common to hear users (especially computer scientists) gripe about its bugginess, speed, and
limitations. i++Tunes is your opportunity to improve upon Apple's work or simply experience
what it's like to create such an application.
This project requires the implementation of a media player with iTunes-comparable features. Its
name, graphical user interface, and design are up to your team.
Requirements:
Play MP3s: Obviously, your music player will need to play music. We will be providing
libraries that make it easy to play MP3 files. See the “Implementation notes” section for more
details.
Song data: Each song must contain a specific set of attributes. They are: name, artist, album,
track number (and number of total tracks on album), genre, explicit (yes or no), user rating (from
0 to 5 – feel free to use stars or some other indicator), play count, and album artwork. You may
add more attributes, but these are the required items. Your GUI must have the ability to display
and edit all of this information.
Song library: Your player is built around a collection of songs (the library). The library must
have the ability to add and remove songs. All song data, library data, and preferences must be
persistent. That is, all data and settings are to be preserved each time you exit the application.
Saved data and settings should be reloaded on launch. Refer to the “Implementation notes”
section for more information about this. You can assume that the user will not move any files on
the disk.
Playlists: A playlist is a subset of the library (i.e. each song in a playlist must reside in the
library). Each playlist has manual add and remove functionality, but these operations do not
affect the song's presence in the library. If a song is deleted from the library, it should no longer
reside in any playlist. You should store playlists in a hierarchical manner (like folders/files on a
hard disk). The user should be able to browse all playlists and playlist folders. Of course, it
should be easy to create and modify playlists.
Smart playlists: A smart playlist should follow all of the properties of a normal playlist except
for how songs are added and removed. Each smart playlist should have a single rule for
membership. If any song in the library meets the rule, it belongs in the playlist. If it does not
meet the rule, it should not be in the playlist.
pf3
pf4
pf5

Partial preview of the text

Download i++Tunes Project: Creating an MP3 Player with Advanced Features and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

i++Tunes

C Sc 335 Spring 2008 – Final Project Grader: Patrick Valenzuela Abstract: Apple's iTunes has become one of today's most popular software applications. However, it's common to hear users (especially computer scientists) gripe about its bugginess, speed, and limitations. i++Tunes is your opportunity to improve upon Apple's work or simply experience what it's like to create such an application. This project requires the implementation of a media player with iTunes-comparable features. Its name, graphical user interface, and design are up to your team. Requirements: Play MP3s: Obviously, your music player will need to play music. We will be providing libraries that make it easy to play MP3 files. See the “Implementation notes” section for more details. Song data: Each song must contain a specific set of attributes. They are: name, artist, album, track number (and number of total tracks on album), genre, explicit (yes or no), user rating (from 0 to 5 – feel free to use stars or some other indicator), play count, and album artwork. You may add more attributes, but these are the required items. Your GUI must have the ability to display and edit all of this information. Song library: Your player is built around a collection of songs (the library). The library must have the ability to add and remove songs. All song data, library data, and preferences must be persistent. That is, all data and settings are to be preserved each time you exit the application. Saved data and settings should be reloaded on launch. Refer to the “Implementation notes” section for more information about this. You can assume that the user will not move any files on the disk. Playlists: A playlist is a subset of the library (i.e. each song in a playlist must reside in the library). Each playlist has manual add and remove functionality, but these operations do not affect the song's presence in the library. If a song is deleted from the library, it should no longer reside in any playlist. You should store playlists in a hierarchical manner (like folders/files on a hard disk). The user should be able to browse all playlists and playlist folders. Of course, it should be easy to create and modify playlists. Smart playlists: A smart playlist should follow all of the properties of a normal playlist except for how songs are added and removed. Each smart playlist should have a single rule for membership. If any song in the library meets the rule, it belongs in the playlist. If it does not meet the rule, it should not be in the playlist.

We will restrict possible smart playlist rules to three parts of a song: name, artist, and album. A rule will only concern one of these items. For each field, there should be four options: is, is not, contains, and does not contain. All rules should be case-insensitive. Below are four example smart playlist rules and a description of which songs belong in each corresponding playlist:

  • song name is “If You Break My Heart” (all songs that have the name "If You Break My Heart")
  • artist is not “Modest Mouse” (all songs that are not by the artist “Modest Mouse”)
  • artist does not contain “Zeppelin” (all songs with artists that do not contain the string “Zeppelin”)
  • album contains “Shadow” (all songs whose album name contains the string “Shadow”) Note that membership in smart playlists should be decided automatically. For example, suppose a user has a smart playlist set up to contain all songs by The Beatles. If a song by The Beatles is added to the library, it should automatically be added to this smart playlist at the same time. Essentially, if any song in the library currently meets a smart playlist's criteria, it belongs in the playlist. Manual additions/removals of songs should not be allowed. Views: When viewing the library or a playlist, the user should have the ability to display all information of all songs. A good implementation would allow the user to decide which information to show. The user should also be able to sort by all of the different song information (except total number of tracks on album and album art). Live search: Users should be able to search the currently displayed songs in real-time. That is, you should provide a search box that searches a song's information and provides instant feedback. For example, if the user enters "The" into the search box, songs with a name, artist, or album containing "The" should be among the search results. This is a big feature of Apple's iTunes; refer to it and attempt to model its functionality. Play order: You will need to determine (and keep track of) the order of songs played. A general rule: if the song currently playing is displayed in the current view (library or playlist), then you should queue up the remaining songs in that view. If you switch views, then it makes sense to clear the queue. Any logical way (to the user) of handling this is fine. Note that if the current view is restricted by a live search, then songs not matching the search should not be queued up. In addition, you’ll need to implement a shuffle play mode. The above rules still apply, but the order of songs should be as random as possible (so that it appears random to the user). Parental control: You should provide the ability to restrict playing of songs marked as explicit. One way to do this is to prompt for a password (a mock password system is fine; don't worry about actual security) whenever the user attempts to play a song marked as explicit. However, the default player setting should not restrict explicit songs. The restriction should be a user option.

Implementation notes: MP3 player: We are providing a Java class called SongPlayer (and an associated enum type SongPlayerStatus) that makes use of the JavaZoom JLayer MP3 library. Your job is to integrate SongPlayer into your system. Since SongPlayer extends the class java.util.Observable, you will need to make your play-handling class implement the java.util.Observer interface. When constructing a SongPlayer, pass the reference to your Observer. SongPlayer has a very important method: public boolean playSong(java.io.File songFile) This is the method used to play a song given a reference to an MP3 file. After a song has been played or an error has been encountered, SongPlayer will notify its Observers, passing along a value of SongPlayerStatus. Javadoc documentation and the necessary files (with complete instructions) are linked from the class web site. Persistence: There are a few ways that this can be implemented:

  • Text file(s) o As you’ve seen in the past, reading and writing to text files is a decent way to store application data. However, this is not the best way to store data for your media player; there is a lot of data to be saved.
  • Database o This is a more sophisticated option that will require additional work. Feel free to utilize a database if your team feels comfortable doing so. Be sure to include instructions about database setup when turning in the project.
  • Object serialization o Your data should already be grouped into objects, so it makes sense to just save those objects. What you lose in efficiency (you will no doubt be saving object data not necessary), you make up in simplicity. Java provides an easy way of saving and restoring objects. We recommend the use of Java’s object serialization feature. For more information, consult the Java API for information about the following types (located in the java.io package): Serializable, FileInputStream, FileOutputStream, ObjectInputStream, and ObjectOutputStream. Additionally, there are several tutorials available online. One is listed in the “References” section below.

References: Apple's iTunes page (information and download): http://www.apple.com/itunes/jukebox/ iTunes article on Wikipedia (history and feature overview): http://en.wikipedia.org/wiki/Itunes Object Serialization Made Easy: http://www.javacoffeebreak.com/articles/serialization/