分类:
2008-10-15 16:40:55
#include
#include
#include
#include
#pragma comment(lib,"winmm.lib")
void print()
{
cout<<"\n\t\t\t>>>>*简单音乐播放器*<<<<";
cout<
cout<<"*程序名称:简单音乐播放器";
cout<<"\n*编程语言:Visual Window API";
cout<<"\n*软件作者:青涩橄榄";
cout<<"\n*制作时间:2006年10月14日"<
}
int main()
{
system("color 0a");
system("title 音乐播放器");
char command,b;
char filename[81];
char listname[81];
char number;
int i=1,j=1,Num;
print();
loop:
cout<<"请输入命令:\n\n>> ";
cin.get(command);
cout<
ifstream infile;
switch (command)
{
case '?':
system("cls");
cout<<"********************************************************************************";
cout<<"帮助说明:1.输入L(List)查看播放列表"<
cin.ignore (1);
Sleep(1000);
goto loop;
case 'E':
Sleep(1000);
cout<<"你确定要退出吗?(Y\\N):\n\n>> ";
cin.ignore (1);
cin.get(command);
cout<
{
cout<<"\t\t\t>>>>谢谢使用! 再见>>>>"<
return 1;
}
else
system("cls");
cin.ignore (1);
goto loop;
case 'P':
cout<<"输入文件名需要播放的歌曲文件名:\n\n>> ";
cin.ignore (1);
cin.getline (filename,80);
cout<
OpenParms.lpstrDeviceType = "mpegvideo";
OpenParms.lpstrElementName =filename;
OpenParms.wDeviceID = NULL;
mciSendCommand (NULL, MCI_OPEN,MCI_OPEN_ELEMENT, (DWORD)&OpenParms);
MCI_PLAY_PARMS PlayParms;//播放文件
PlayParms.dwFrom = 0;
mciSendCommand (OpenParms.wDeviceID, MCI_PLAY, MCI_FROM, (DWORD)&PlayParms);
cout<<"正在播放....."<
[1]