|
Your first MP3 Delphi player
|
 |
Part 2: Building a MP3 player Delphi Project's GUI
|
|
 |
 |
|
Join the Discussion
|
"How do you use win amp to play mp3 while using Delphi?"
See how
|
|
 |
 |
|
|
 |
 |
|
|
 |
 |
|
|
 |
| |
|
Step by step...
If you haven't already; this is the time to start Delphi - new project is created with one blank form (form1, by default). This will be the main and the only one form in the mp3 player project.
As promissed, our player will not only play MP3 songs, we want the player to display (and even change) certain information about each file - the ID3 tag information. Why not even more: let there be a progress bar to show the current song's play progress.
Add following components to form:
From the Standard tab:
one ListBox component, name it 'mp3List'
one GroupBox component containing six Edit components (names: edTitle, edArtist, edAlbum, edYear, edGenre, edComment),
From the Additional tab:
one BitBtn component, name it 'btnOpenFolder',
one StaticText component, name it 'txtFolder',
From the System tab
one Timer component, name it 'ProgresTimer'.
one ProgressBar component, name it 'Progres'.
and of course, one MediaPlayer component, name it 'mp3Player'.
Notice that when you place the MediaPlayer component on a form all 9 buttons are visible. Since we are only going to code a simple player some of the buttons are not required. Therefore, use the VisibleButtons property and hide all the buttons except this three: btPlay, btPause, btStop.
The BitBtn and the StaticText are used to select and display the Folder where our MP3 songs are stored. All the MP3 files from the selected folder are listed in the ListBox. I have chosen BitBtn instead of the standard Button component simply because BitBtn has the glyph property - we can easily display a picture on it.
All the Edit components in the GroupBox will be used to display the ID3 tag information.
Timer component in conjuction with the ProgressBar will be used to display the play progress.
Next page > Building a MP3 player Delphi Project's Code > Page 1, 2, 3, 4, 5