Download presentation
Presentation is loading. Please wait.
Published byDelphia Norton Modified over 9 years ago
1
Lecture 25 May 16, 2000
2
Agenda Using JComboBox Class ID3V1_Tag –Using it. –Implementation. Class MP3_File –Dummy Version Quiz
3
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 )
4
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 29 th comment byte is ASCII nul (00000000 2 ), then the track number is a one-byte integer value in the 30 th 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.
5
Sample Code [ TagEditor.java ]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 ]MP3_File.java [ ID3V1_Tag.java ]ID3V1_Tag.java [ ID3V2_Tag.java ]ID3V2_Tag.java
6
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 ]Quiz_3a.java –Using instance variables: [ Quiz_3b.java ]Quiz_3b.java
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.