because must first solve the problem of the play, so the code more humble
[b] source: [/b
#include
#include
#include
#include
#include
#include
# pragma comment (lib, "winmm. Lib")
//links/specified MCI library, McISendString function definition in winmm.
in the libStruct SongList
{
Char Num [5].
Char Song [20].
Char Singer [20].
Char Album [30].
};
Void PlayList ()
{
Struct SongList Ls [20]={{" 01 ", "the wind moved", "li", "" miss you" "},
{" 02 ", "to accompany me to stray," sad "o", "" to accompany me to stray" "},
{" 03 ", "faith", "eason chan", "" eason chan" "},
{" 04 ", "lullaby", "engine", "" the rose television soundtrack" "},
Leaves {" 5 ", "the myth", "jin sha", "" moon myth" "},
{" 6 ", "may have a heart", "Li Xingliang", "" may have a heart" "},
{" 7 ", "make", "aska," "" "" dove},
{" 08 ", "all for you", "wu ke qun", "" lonely come to do" "},
{" 09 ", "elegant" break up, "lim yee chung," "" "" bride},
{" 10 ", "monkey", "Dai Quan", "" Monkey King" "}};
Printf (" song number song singer album \ n ");
for(int i=0; i<10; I++)
Printf (" % s % s \ \ t t % s % s \ n ", Ls [I] Num, Ls [I] Song, Ls [I] Singer, Ls [I] Album);
}
Void New_Favorities ()
{
Struct SongList Fav [20].
}
Void PlaySong ()
{
Int s;
Printf (" please enter the song number: \ n ");
The scanf (" % d ", & amp; S);
The switch (s)
{
Case 1:
PlaySound (" D://music//FCML wav ", NULL, SND_FILENAME | SND_ASYNC));
break;
}
}
Void menu ();
Int main ()
{
Int the Key;
Do
{
The menu ();
The scanf (" % d ", & amp; Key);
The switch (Key)
{
Case 1://open the playlist
PlayList (); break;
Case 2://play songs
PlaySong (); break;
//case 3:/play/pause
}
} while (Key!=0);
return 0;
}
Void menu ()
{
Printf (" + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + \ n ");
Printf (" | 1. Open the playlist | \ n ");
Printf (" | 2. Play music | \ n ");
Printf (" | 3. Pause music | \ n ");
Printf (" a | | 4. \ n ");
Printf (" the next | | 5. \ n ");
Printf (" | 6. Looping | \ n ");
Printf (" | 7. Open the favorites | \ n ");
Printf (" + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + \ n ");
}
CodePudding user response:
The specified winmm. Lib path? Such as GCC xx - lwinmmCodePudding user response: