目录
目录
自己制作
因为需要的文件超级多,所以这里只给主程序代码,其他的文件可以根据实际情况改变。
开始制作!
1、主界面按钮
(1)选择音乐
这里我设置的是自己喜欢的歌曲,你也可以改成其他的。(打开文件功能正在研究)
Button RememberSummer = NewButton(1, 5, 12, "忆夏");
Button YourRiversAndMount = NewButton(3, 5, 14, "你的万水千山(原版)");
Button YourRiversAndMountDJ = NewButton(5, 5, 11, "你的万水千山(DJ版)");
//Button Files = NewButton(7, 5, 13, "打开文件...");
(2)选择播放模式
Button Empty = NewButton(1, 10, 3, "直接播放");
Button Repeat = NewButton(3, 10, 5, "单曲循环");
Button Sleepy = NewButton(5, 9, 6, "沉浸式播放");
2、初始化
Art_Title("音乐播放器 - 作者Maker");
HideCursor();
system("mode con cols=30 lines=8 ");
3、选择音乐判断
while(1)
{
if(Preserve(RememberSummer) == 1)
{
Title = "忆夏";
SendSong("忆夏.mp3");
}
else if(Preserve(YourRiversAndMount) == 1)
{
Title = "你的万水千山";
SendSong("你的万水千山.mp3");
}
else if(Preserve(YourRiversAndMountDJ) == 1)
{
Title = "你的万水千山DJ";
SendSong("你的万水千山DJ.mp3");
}
}
如果直接选择、播放音乐,会消耗很多代码。当然,代码越少越好,所以直接使用函数SendSong不香吗。。。。。。
直接跑路!
4、模式判断
这里定义一个BEEPOF,0 = 直接播放,1 = 循环播放,2 = 沉浸式播放
int BEEPOF;
system("color 0f");
system("cls");
system("color 1f");
system("color 2f");
system("color 3f");
system("color 4f");
system("color 5f");
system("color 6f");
system("color 7f");
system("color 8f");
system("color 9f");
system("color af");
system("color bf");
system("color cf");
system("color df");
system("color ef");
system("color 0f");
system("cls");
while(1)
{
if(Preserve((Empty)))
{
BEEPOF = 0;
break;
}
else if(Preserve((Repeat)))
{
BEEPOF = 1;
break;
}
else if(Preserve((Sleepy)))
{
BEEPOF = 2;