forked from LahiruPAA/LahiruPAA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmp3
128 lines (95 loc) · 2.96 KB
/
mp3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE * pFile;
#define ARRAYSIZE 100
#define SONGNAME 25
#define SONGARTIST 25
#define SONGLENGTH 25
#define TRACK_NUMBER
void func1(void);
void func2(void);
void func3(void);
void func4(void);
void delete_song(void);
void func6(void);
typedef struct Mp3rec
{
char name[SONGNAME];
char artist[SONGARTIST];
char length[SONGLENGTH];
char tname[TRACK_NUMBER];
};
int main (void)
{
int menuchoice=0;
//fp= fopen("mp3_list.txt", "r" "W" "a"); either to add or read a text file.
do
{
printf ("********************************************\n");
printf ("************************************\n");
printf ("*********** MP3 Player **********\n");
printf ("********************************************");
printf("\n1: Play File");
printf("\n2: Show Library");
printf("\n3: Add Record");
printf("\n4: Edit/Modify ");
printf("\n5: Delete Record");
printf("\n6: Quit");
printf("\n\nEnter Choice From 1-6: ");
scanf("%d", &menuchoice);
switch (menuchoice)
{
case 1:
func1();
break;
case 2:
func2();
break;
case 3:
func3();
break;
case 4:
func4();
break;
case 5:delete_song();
break;
case 6:
break;
default:
printf("\nInvalid Choice: 1-4 Only Please");
}
}while(menuchoice!=4);
system("pause");
}
void func1(void)
{
printf("\n\n Play File\n\n");
printf ("********************************************\n");
printf ("************************************\n");
printf ("*********** **********\n");
printf ("********************************************");
{
char commandarray[ARRAYSIZE];
char mp3filename[ARRAYSIZE] ="C:\\mplayer\\Robin S - Show me Love.mp3";
sprintf(commandarray, "C:\\mplayer\\mplayer.exe \"%s\"", mp3filename);
printf("\nAttempting to Run Command \"%s\"...\n\n", commandarray);
system(commandarray);
int menuchoice=0;
switch (menuchoice)
printf("\n1: Back To Menu");
printf("\n5: Quit");
printf("\nDone.\n\n");
system("pause");
}
}
void func2(void)
{
printf("\n\n Show Library\n\n");
}
void func3(void)
{
printf("\n\n Add Record/Song\n\n");
fopen("ListofSongs.txt","r+");
printf("\n\n Add Record\n\n");
}