1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file loader library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2006 by Christian Schoenebeck * |
* Copyright (C) 2003-2006 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
|
* This program is part of libgig. * |
9 |
|
* * |
10 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
11 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
12 |
* the Free Software Foundation; either version 2 of the License, or * |
* the Free Software Foundation; either version 2 of the License, or * |
153 |
gig::Sample* pSample = gig->GetFirstSample(); |
gig::Sample* pSample = gig->GetFirstSample(); |
154 |
while (pSample) { |
while (pSample) { |
155 |
samples++; |
samples++; |
156 |
|
// determine sample's name |
157 |
string name = pSample->pInfo->Name; |
string name = pSample->pInfo->Name; |
158 |
if (name == "") name = "<NO NAME>"; |
if (name == "") name = "<NO NAME>"; |
159 |
else name = '\"' + name + '\"'; |
else name = '\"' + name + '\"'; |
160 |
|
// determine group this sample belongs to |
161 |
|
int iGroup = 1; |
162 |
|
for (gig::Group* pGroup = gig->GetFirstGroup(); pGroup; pGroup = gig->GetNextGroup(), iGroup++) { |
163 |
|
if (pGroup == pSample->GetGroup()) break; |
164 |
|
} |
165 |
|
// print sample info |
166 |
cout << " Sample " << samples << ") " << name << ", "; |
cout << " Sample " << samples << ") " << name << ", "; |
167 |
|
cout << "Group " << iGroup << ", "; |
168 |
cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops << " Loops"; |
cout << pSample->SamplesPerSecond << "Hz, " << pSample->Channels << " Channels, " << pSample->Loops << " Loops"; |
169 |
if (pSample->Loops) { |
if (pSample->Loops) { |
170 |
cout << " (Type: "; |
cout << " (Type: "; |
395 |
} |
} |
396 |
|
|
397 |
string Revision() { |
string Revision() { |
398 |
string s = "$Revision: 1.20 $"; |
string s = "$Revision: 1.22 $"; |
399 |
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 |
400 |
} |
} |
401 |
|
|