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 by Christian Schoenebeck * |
* Copyright (C) 2003-2005 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 * |
9 |
* 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 * |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
21 |
* MA 02111-1307 USA * |
* MA 02111-1307 USA * |
22 |
***************************************************************************/ |
***************************************************************************/ |
23 |
|
|
24 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
25 |
#include <config.h> |
#include <config.h> |
26 |
#endif |
#endif |
27 |
|
|
28 |
#include <iostream> |
#include <iostream> |
29 |
#include <cstdlib> |
#include <cstdlib> |
30 |
|
#include <string> |
31 |
|
|
32 |
#include "DLS.h" |
#include "DLS.h" |
33 |
|
|
34 |
using namespace std; |
using namespace std; |
35 |
|
|
36 |
|
string Revision(); |
37 |
|
void PrintVersion(); |
38 |
void PrintSamples(DLS::File* dls); |
void PrintSamples(DLS::File* dls); |
39 |
void PrintInstruments(DLS::File* dls); |
void PrintInstruments(DLS::File* dls); |
40 |
void PrintRegions(DLS::Instrument* instr); |
void PrintRegions(DLS::Instrument* instr); |
46 |
PrintUsage(); |
PrintUsage(); |
47 |
return EXIT_FAILURE; |
return EXIT_FAILURE; |
48 |
} |
} |
49 |
|
if (argv[1][0] == '-') { |
50 |
|
switch (argv[1][1]) { |
51 |
|
case 'v': |
52 |
|
PrintVersion(); |
53 |
|
return EXIT_SUCCESS; |
54 |
|
} |
55 |
|
} |
56 |
FILE* hFile = fopen(argv[1], "r"); |
FILE* hFile = fopen(argv[1], "r"); |
57 |
if (!hFile) { |
if (!hFile) { |
58 |
cout << "Invalid file argument!" << endl; |
cout << "Invalid file argument!" << endl; |
136 |
} |
} |
137 |
} |
} |
138 |
|
|
139 |
|
string Revision() { |
140 |
|
string s = "$Revision: 1.3 $"; |
141 |
|
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
142 |
|
} |
143 |
|
|
144 |
|
void PrintVersion() { |
145 |
|
cout << "dlsdump revision " << Revision() << endl; |
146 |
|
cout << "using " << DLS::libraryName() << " " << DLS::libraryVersion() << endl; |
147 |
|
} |
148 |
|
|
149 |
void PrintUsage() { |
void PrintUsage() { |
150 |
cout << "dlsdump - parses DLS (Downloadable Sounds) Level 1 and Level 2 files and prints out the content." << endl; |
cout << "dlsdump - parses DLS (Downloadable Sounds) Level 1 and Level 2 files and prints out the content." << endl; |
151 |
cout << endl; |
cout << endl; |
152 |
cout << "Usage: dlsdump FILE" << endl; |
cout << "Usage: dlsdump [-v] FILE" << endl; |
153 |
|
cout << endl; |
154 |
|
cout << " -v Print version and exit." << endl; |
155 |
|
cout << endl; |
156 |
} |
} |