2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file loader library * |
* libgig - C++ cross-platform Gigasampler format file loader library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2005 by Christian Schoenebeck * |
* Copyright (C) 2003-2006 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
35 |
|
|
36 |
string Revision(); |
string Revision(); |
37 |
void PrintVersion(); |
void PrintVersion(); |
38 |
|
void PrintFileInformations(gig::File* gig); |
39 |
void PrintSamples(gig::File* gig); |
void PrintSamples(gig::File* gig); |
40 |
void PrintInstruments(gig::File* gig); |
void PrintInstruments(gig::File* gig); |
41 |
void PrintRegions(gig::Instrument* instr); |
void PrintRegions(gig::Instrument* instr); |
64 |
try { |
try { |
65 |
RIFF::File* riff = new RIFF::File(argv[1]); |
RIFF::File* riff = new RIFF::File(argv[1]); |
66 |
gig::File* gig = new gig::File(riff); |
gig::File* gig = new gig::File(riff); |
67 |
|
PrintFileInformations(gig); |
68 |
|
cout << endl; |
69 |
PrintSamples(gig); |
PrintSamples(gig); |
70 |
cout << endl; |
cout << endl; |
71 |
PrintInstruments(gig); |
PrintInstruments(gig); |
84 |
return EXIT_SUCCESS; |
return EXIT_SUCCESS; |
85 |
} |
} |
86 |
|
|
87 |
|
void PrintFileInformations(gig::File* gig) { |
88 |
|
cout << "Global File Informations:" << endl; |
89 |
|
cout << " Total instruments: " << gig->Instruments << endl; |
90 |
|
if (gig->pVersion) { |
91 |
|
cout << " Version: " << gig->pVersion->major << "." |
92 |
|
<< gig->pVersion->minor << "." |
93 |
|
<< gig->pVersion->release << "." |
94 |
|
<< gig->pVersion->build << endl; |
95 |
|
} |
96 |
|
if (gig->pInfo) { |
97 |
|
if (gig->pInfo->Name.size()) |
98 |
|
cout << " Name: '" << gig->pInfo->Name << "'\n"; |
99 |
|
if (gig->pInfo->ArchivalLocation.size()) |
100 |
|
cout << " ArchivalLocation: '" << gig->pInfo->ArchivalLocation << "'\n"; |
101 |
|
if (gig->pInfo->CreationDate.size()) |
102 |
|
cout << " CreationDate: '" << gig->pInfo->CreationDate << "'\n"; |
103 |
|
if (gig->pInfo->Comments.size()) |
104 |
|
cout << " Comments: '" << gig->pInfo->Comments << "'\n"; |
105 |
|
if (gig->pInfo->Product.size()) |
106 |
|
cout << " Product: '" << gig->pInfo->Product << "'\n"; |
107 |
|
if (gig->pInfo->Copyright.size()) |
108 |
|
cout << " Copyright: '" << gig->pInfo->Copyright << "'\n"; |
109 |
|
if (gig->pInfo->Artists.size()) |
110 |
|
cout << " Artists: '" << gig->pInfo->Artists << "'\n"; |
111 |
|
if (gig->pInfo->Genre.size()) |
112 |
|
cout << " Genre: '" << gig->pInfo->Genre << "'\n"; |
113 |
|
if (gig->pInfo->Keywords.size()) |
114 |
|
cout << " Keywords: '" << gig->pInfo->Keywords << "'\n"; |
115 |
|
if (gig->pInfo->Engineer.size()) |
116 |
|
cout << " Engineer: '" << gig->pInfo->Engineer << "'\n"; |
117 |
|
if (gig->pInfo->Technician.size()) |
118 |
|
cout << " Technician: '" << gig->pInfo->Technician << "'\n"; |
119 |
|
if (gig->pInfo->Software.size()) |
120 |
|
cout << " Software: '" << gig->pInfo->Software << "'\n"; |
121 |
|
if (gig->pInfo->Medium.size()) |
122 |
|
cout << " Medium: '" << gig->pInfo->Medium << "'\n"; |
123 |
|
if (gig->pInfo->Source.size()) |
124 |
|
cout << " Source: '" << gig->pInfo->Source << "'\n"; |
125 |
|
if (gig->pInfo->SourceForm.size()) |
126 |
|
cout << " SourceForm: '" << gig->pInfo->SourceForm << "'\n"; |
127 |
|
if (gig->pInfo->Commissioned.size()) |
128 |
|
cout << " Commissioned: '" << gig->pInfo->Commissioned << "'\n"; |
129 |
|
} |
130 |
|
} |
131 |
|
|
132 |
void PrintSamples(gig::File* gig) { |
void PrintSamples(gig::File* gig) { |
133 |
int samples = 0; |
int samples = 0; |
134 |
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; |
369 |
} |
} |
370 |
|
|
371 |
string Revision() { |
string Revision() { |
372 |
string s = "$Revision: 1.18 $"; |
string s = "$Revision: 1.19 $"; |
373 |
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 |
374 |
} |
} |
375 |
|
|