Debian Codegraph @

components/decoder/cdrip/info/cdinfo.cpp

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2020 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #include "cdinfo.h"
14
15 BoCA::CDInfo::CDInfo()
16 {
17 }
18
19 BoCA::CDInfo::~CDInfo()
20 {
21 }
22
23 Int BoCA::CDInfo::Clear()
24 {
25 artist = NIL;
26 title = NIL;
27 songwriter = NIL;
28 composer = NIL;
29 arranger = NIL;
30 comment = NIL;
31 genre = NIL;
32 catalog = NIL;
33 barcode = NIL;
34
35 trackArtists.RemoveAll();
36 trackTitles.RemoveAll();
37 trackSongwriters.RemoveAll();
38 trackComposers.RemoveAll();
39 trackArrangers.RemoveAll();
40 trackComments.RemoveAll();
41 trackISRCs.RemoveAll();
42
43 return Success();
44 }
45
46 Void BoCA::CDInfo::ReserveTracks(Int n)
47 {
48 while (trackArtists.Length() < n)
49 {
50 trackArtists.Add(NIL);
51 trackTitles.Add(NIL);
52 trackSongwriters.Add(NIL);
53 trackComposers.Add(NIL);
54 trackArrangers.Add(NIL);
55 trackComments.Add(NIL);
56 trackISRCs.Add(NIL);
57 }
58 }
59
60 Void BoCA::CDInfo::SetTrackArtist(Int n, const String &nArtist)
61 {
62 ReserveTracks(n);
63
64 if (nArtist.Trim() != NIL) trackArtists.SetNth(n - 1, nArtist);
65 }
66
67 Void BoCA::CDInfo::SetTrackTitle(Int n, const String &nTitle)
68 {
69 ReserveTracks(n);
70
71 if (nTitle.Trim() != NIL) trackTitles.SetNth(n - 1, nTitle);
72 }
73
74 Void BoCA::CDInfo::SetTrackSongwriter(Int n, const String &nSongwriter)
75 {
76 ReserveTracks(n);
77
78 if (nSongwriter.Trim() != NIL) trackSongwriters.SetNth(n - 1, nSongwriter);
79 }
80
81 Void BoCA::CDInfo::SetTrackComposer(Int n, const String &nComposer)
82 {
83 ReserveTracks(n);
84
85 if (nComposer.Trim() != NIL) trackComposers.SetNth(n - 1, nComposer);
86 }
87
88 Void BoCA::CDInfo::SetTrackArranger(Int n, const String &nArranger)
89 {
90 ReserveTracks(n);
91
92 if (nArranger.Trim() != NIL) trackArrangers.SetNth(n - 1, nArranger);
93 }
94
95 Void BoCA::CDInfo::SetTrackComment(Int n, const String &nComment)
96 {
97 ReserveTracks(n);
98
99 if (nComment.Trim() != NIL) trackComments.SetNth(n - 1, nComment);
100 }
101
102 Void BoCA::CDInfo::SetTrackISRC(Int n, const String &nISRC)
103 {
104 ReserveTracks(n);
105
106 if (nISRC.Trim() != NIL) trackISRCs.SetNth(n - 1, nISRC.Replace(" ", NIL).Replace("-", NIL));
107 }