36 |
string Revision(); |
string Revision(); |
37 |
void PrintVersion(); |
void PrintVersion(); |
38 |
void PrintFileInformations(gig::File* gig); |
void PrintFileInformations(gig::File* gig); |
39 |
|
void PrintGroups(gig::File* gig); |
40 |
void PrintSamples(gig::File* gig); |
void PrintSamples(gig::File* gig); |
41 |
void PrintInstruments(gig::File* gig); |
void PrintInstruments(gig::File* gig); |
42 |
void PrintRegions(gig::Instrument* instr); |
void PrintRegions(gig::Instrument* instr); |
67 |
gig::File* gig = new gig::File(riff); |
gig::File* gig = new gig::File(riff); |
68 |
PrintFileInformations(gig); |
PrintFileInformations(gig); |
69 |
cout << endl; |
cout << endl; |
70 |
|
PrintGroups(gig); |
71 |
|
cout << endl; |
72 |
PrintSamples(gig); |
PrintSamples(gig); |
73 |
cout << endl; |
cout << endl; |
74 |
PrintInstruments(gig); |
PrintInstruments(gig); |
132 |
} |
} |
133 |
} |
} |
134 |
|
|
135 |
|
void PrintGroups(gig::File* gig) { |
136 |
|
int groups = 0; |
137 |
|
cout << "ALL defined Groups:" << endl; |
138 |
|
for (gig::Group* pGroup = gig->GetFirstGroup(); pGroup; pGroup = gig->GetNextGroup()) { |
139 |
|
groups++; |
140 |
|
string name = pGroup->Name; |
141 |
|
if (name == "") name = "<NO NAME>"; |
142 |
|
else name = '\"' + name + '\"'; |
143 |
|
cout << " Group " << groups << ")" << endl; |
144 |
|
cout << " Name: " << name << endl; |
145 |
|
} |
146 |
|
} |
147 |
|
|
148 |
void PrintSamples(gig::File* gig) { |
void PrintSamples(gig::File* gig) { |
149 |
int samples = 0; |
int samples = 0; |
150 |
cout << "ALL Available Samples (as there might be more than referenced by Instruments):" << endl; |
cout << "ALL Available Samples (as there might be more than referenced by Instruments):" << endl; |
151 |
gig::Sample* pSample = gig->GetFirstSample(); |
gig::Sample* pSample = gig->GetFirstSample(); |
152 |
while (pSample) { |
while (pSample) { |
153 |
samples++; |
samples++; |
154 |
|
// determine sample's name |
155 |
string name = pSample->pInfo->Name; |
string name = pSample->pInfo->Name; |
156 |
if (name == "") name = "<NO NAME>"; |
if (name == "") name = "<NO NAME>"; |
157 |
else name = '\"' + name + '\"'; |
else name = '\"' + name + '\"'; |
158 |
|
// determine group this sample belongs to |
159 |
|
int iGroup = 1; |
160 |
|
for (gig::Group* pGroup = gig->GetFirstGroup(); pGroup; pGroup = gig->GetNextGroup(), iGroup++) { |
161 |
|
if (pGroup == pSample->GetGroup()) break; |
162 |
|
} |
163 |
|
// print sample info |
164 |
cout << " Sample " << samples << ") " << name << ", "; |
cout << " Sample " << samples << ") " << name << ", "; |
165 |
|
cout << "Group " << iGroup << ", "; |
166 |
cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops << " Loops"; |
cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops << " Loops"; |
167 |
if (pSample->Loops) { |
if (pSample->Loops) { |
168 |
cout << " (Type: "; |
cout << " (Type: "; |
393 |
} |
} |
394 |
|
|
395 |
string Revision() { |
string Revision() { |
396 |
string s = "$Revision: 1.19 $"; |
string s = "$Revision: 1.21 $"; |
397 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
398 |
} |
} |
399 |
|
|