Tutorials to .com

Tutorials to .com » Database » Foxpro » VFP songs with the preparation of the on-demand multi-media devices

VFP songs with the preparation of the on-demand multi-media devices

Print View , by: iSee ,Total views: 17 ,Word Count: 627 ,Date: Sat, 18 Apr 2009 Time: 11:36 PM

1. First of all, the establishment of a database containing songs information Mid. dbf, the database has two fields, one is Midname field, a length of 20 characters is stored in the Chinese Mid songs music files (such as "Aquacade"); the other is the Filename field, a length of 8 characters, Mid document is stored in the file name (without extension). After the establishment of a good database, the Mid document information into music files database. Note: All the songs with the procedures and documents stored in a database directory.

2. The establishment of a form Form1, add in the data environment Mid. dbf, set the caption of Form1 attributes as "on-demand multi-media music device", the load process of the preparation of Form1:

setlibrarytofoxtools.fll
publicPlaySound
PlaySound=REGFN(″MCIExecute″,″C″,″I″,″MSYSTEM″)
3. The establishment of a combo box Combo1, the properties of the Style is set to 2 (drop-down list box), the attribute is set to Displayvalue the Mid. dbf database of the songs the first song of the set to Rowsource attributes Midname, the Rowsourcetype attribute is set to 6 (field).

4. Drop-down list box in the top of the establishment of a label Label1, the caption of the attribute set to "on-demand songs please:."

5. The establishment of the first button (Command1), set the caption of the property as a "player", the process of the preparation of Click:

midt=″Open″
midw=″TypeSEQUENCER″
Locateformidname=thisform.combol.value
midd=midt+space(1)+rtrim(filename)+″.mid″+space(1)+midw
=CALLFN(PlaySound,midd)
=CALLFN(PlaySound,″play″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.F.
6.(Command2),caption“”,Click:
=CALLFN(PlaySound,″close″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.T.
midt=″Open″
midw=″TypeSEQUENCER″
Locateformidname=thisform.combol.value
midd=midt+space(1)+rtrim(filename)+″.mid″+space(1)+midw
=CALLFN(PlaySound,midd)
=CALLFN(PlaySound,″play″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.F.
6.(Command2),caption“”,Click:
=CALLFN(PlaySound,″close″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.T.
midt=″Open″
midw=″TypeSEQUENCER″
Locateformidname=thisform.combol.value
midd=midt+space(1)+rtrim(filename)+″.mid″+space(1)+midw
=CALLFN(PlaySound,midd)
=CALLFN(PlaySound,″play″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.F.
6.(Command2),caption“”,Click:
=CALLFN(PlaySound,″close″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.T.
midt=″Open″
midw=″TypeSEQUENCER″
Locateformidname=thisform.combol.value
midd=midt+space(1)+rtrim(filename)+″.mid″+space(1)+midw
=CALLFN(PlaySound,midd)
=CALLFN(PlaySound,″play″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.F.
6.(Command2),caption“”,Click:
=CALLFN(PlaySound,″close″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.T.
midt=″Open″
midw=″TypeSEQUENCER″
Locateformidname=thisform.combol.value
midd=midt+space(1)+rtrim(filename)+″.mid″+space(1)+midw
=CALLFN(PlaySound,midd)
=CALLFN(PlaySound,″play″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.F.
6.(Command2),caption“”,Click:
=CALLFN(PlaySound,″close″+rtrim(filename)+″.mid″)
thisform.combol.enabled=.T.
7. The establishment of the third button (Command3), set the properties for the caption "Exit", the process of the preparation of Click:

relethisform
clearevents
setlibraryto
closeall

This created a complete on-demand songs, and run the form, simply drop-down list box to choose a song, click "Play" button, that is to play.


FoxPro Tutorial Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.