Newer
Older
#include "datastructure.h"
#include "cds.h"
#include "tools.h"
#include "datetime.h"
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
sCD CDData[MAXCDS];
void createCD()
{
if (countCDs == MAXCDS)
{
puts("Maximum number of cds reached!");
exit(0);
}
clearScreen();
puts("Erfassung einer neuen CD");
printLine('=', 50);
(CDData + countCDs)->numberOfSongs = 0;
getText("Geben Sie bitte den Titel der CD ein:", 35, &(CDData + countCDs)->title, 0);
getText("Geben Sie bitte den Interpreten ein:", 35, &(CDData + countCDs)->artist, 1);
getNumber("Geben Sie bitte das Erscheinungsjahr ein:", &(CDData + countCDs)->publicationYear, 1982, 2022);
puts("Geben Sie bitte die Daten der Lieder ein:");
creatSong();
countCDs++;
}
void creatSong()
{
do
{
printf("Lied %i:\n", ((CDData + countCDs)->numberOfSongs) + 1);
getText("Geben Sie bitte den Titel des Liedes ein:", 35, &(CDData + countCDs)->Songs[(CDData + countCDs)->numberOfSongs].title, 0);
getText("Geben Sie bitte den Interpreten ein:", 35, &(CDData + countCDs)->Songs[(CDData + countCDs)->numberOfSongs].artist, 1);
inputTime("Geben Sie bitte die Dauer des Liedes ein\n (Format hh:mm:ss oder mm:ss):\n -> ", &(CDData + countCDs)->Songs[(CDData + countCDs)->numberOfSongs].duration);
(CDData + countCDs)->numberOfSongs++;
} while ((askYesOrNo("Moechten Sie noch ein weiteres Lied eingeben (j/n)?")) && ((CDData + countCDs)->numberOfSongs) < MAXSONGS);
}
void editCd()
{
puts("editCd");
waitForEnter();
}
void deleteCD()
{
puts("deleteCd");
waitForEnter();
}
void searchSong()
{
puts("deleteCd");
waitForEnter();
}
void sortCDs()
{
puts("SortCd");
waitForEnter();
}
void ListCDs()
{
{
putchar('\n');
printf("Titel : %s\n", (CDData + i)->title);
if ((CDData + i)->artist)
printf("artist : %s\n", (CDData + i)->artist);
printf("Erscheinungsjahr : %i\n", (CDData + i)->publicationYear);
printf("Anzahl Lieder : %i\n", (CDData + i)->numberOfSongs);
puts("Lieder");
{
listOneSong(i, j);
}
}
waitForEnter();
}
if ((CDData + i)->Songs[j].artist)
{
printf("%.1i. %s (%s; ", (j + 1), (CDData + i)->Songs[j].title, (CDData + i)->Songs[j].artist);
printTime((CDData + i)->Songs[j].duration, 1);
puts(")");
}
else
{
printf("%.1i. %s ( ", (j + 1), (CDData + i)->Songs[j].title);
printTime((CDData + i)->Songs[j].duration, 1);
puts(")");
}
}