Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Lecture 25 May 16, 2000 Agenda • Using JComboBox • Class ID3V1_Tag – Using it. – Implementation. • Class MP3_File – Dummy Version • Quiz JComboBox • Constructors – No-arg • void addItem( Object ) or void setItemAt( … ) – Array of Objects • Objects are usually Strings, but don’t have to be. – Vector • • • • Object getSelectedItem() Object[] getSelectedObjects() void setEditable( boolean ) void setEnabled( boolean ) ID3V1 Tag Structure • • • • • • • Starts 128 bytes from end of file. First three bytes contain ASCII “TAG” Title starts at offset 3 (30 bytes) Artist starts at offset 33 (30 bytes) Album starts at offset 63 (30 bytes) Year starts at offset 93 (4 bytes) Comment starts at offset 97 (30 bytes) – If the 29th comment byte is ASCII nul (000000002), then the track number is a one-byte integer value in the 30th byte of the comment. • Genre is encoded as an index into an array of Strings. – Integer value is one byte at offset 127 into the tag. Sample Code • [ TagEditor.java ] – Provides the user with a JComboBox for setting the genre in the ID3V1 tag of a file. – Note: If you use this program on a real MP3 file, you will lose the ID3V2 tag and the audio data in the file! • [ MP3_File.java ] • [ ID3V1_Tag.java ] • [ ID3V2_Tag.java ] Quiz • Write an application that puts up a JFrame with a File->Exit menu item. When the user clicks on either File->Exit or the “close” button in the title bar, the application exits. • Solutions – Using static variables: [ Quiz_3a.java ] – Using instance variables: [ Quiz_3b.java ]