/[svn]/libgig/trunk/src/tools/gigdump.cpp
ViewVC logotype

Diff of /libgig/trunk/src/tools/gigdump.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

libgig/trunk/src/gigdump.cpp revision 2493 by schoenebeck, Wed Jan 1 17:06:51 2014 UTC libgig/trunk/src/tools/gigdump.cpp revision 2609 by schoenebeck, Sun Jun 8 19:00:30 2014 UTC
# Line 2  Line 2 
2   *                                                                         *   *                                                                         *
3   *   libgig - C++ cross-platform Gigasampler format file access library    *   *   libgig - C++ cross-platform Gigasampler format file access library    *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003-2009 by Christian Schoenebeck                      *   *   Copyright (C) 2003-2014 by Christian Schoenebeck                      *
6   *                              <cuse@users.sourceforge.net>               *   *                              <cuse@users.sourceforge.net>               *
7   *                                                                         *   *                                                                         *
8   *   This program is part of libgig.                                       *   *   This program is part of libgig.                                       *
# Line 31  Line 31 
31  #include <cstdlib>  #include <cstdlib>
32  #include <string>  #include <string>
33    
34  #include "gig.h"  #include "../gig.h"
35    
36  using namespace std;  using namespace std;
37    
# Line 40  void PrintVersion(); Line 40  void PrintVersion();
40  void PrintFileInformations(gig::File* gig);  void PrintFileInformations(gig::File* gig);
41  void PrintGroups(gig::File* gig);  void PrintGroups(gig::File* gig);
42  void PrintSamples(gig::File* gig);  void PrintSamples(gig::File* gig);
43    void PrintScripts(gig::File* gig);
44  void PrintInstruments(gig::File* gig);  void PrintInstruments(gig::File* gig);
45  void PrintRegions(gig::Instrument* instr);  void PrintRegions(gig::Instrument* instr);
46  void PrintUsage();  void PrintUsage();
# Line 73  int main(int argc, char *argv[]) Line 74  int main(int argc, char *argv[])
74          cout << endl;          cout << endl;
75          PrintSamples(gig);          PrintSamples(gig);
76          cout << endl;          cout << endl;
77            PrintScripts(gig);
78            cout << endl;
79          PrintInstruments(gig);          PrintInstruments(gig);
80          delete gig;          delete gig;
81          delete riff;          delete riff;
# Line 181  void PrintSamples(gig::File* gig) { Line 184  void PrintSamples(gig::File* gig) {
184      }      }
185  }  }
186    
187    void PrintScripts(gig::File* gig) {
188        cout << "ALL Available Real-Time Instrument Scripts (as there might be more than referenced by Instruments):" << endl;
189        for (int g = 0; gig->GetScriptGroup(g); ++g) {
190            gig::ScriptGroup* pGroup = gig->GetScriptGroup(g);
191            cout << "    Group " << g+1 << ") '" << pGroup->Name << "'\n";
192            for (int s = 0; pGroup->GetScript(s); ++s) {
193                gig::Script* pScript = pGroup->GetScript(s);
194                cout << "        Script " << s+1 << ") '" << pScript->Name << "':\n";
195                cout << "[START OF SCRIPT]\n";
196                cout << pScript->GetScriptAsText();
197                cout << "[END OF SCRIPT]\n";
198            }
199        }
200    }
201    
202  void PrintInstruments(gig::File* gig) {  void PrintInstruments(gig::File* gig) {
203      int instruments = 0;      int instruments = 0;
204      cout << "Available Instruments:" << endl;      cout << "Available Instruments:" << endl;
# Line 193  void PrintInstruments(gig::File* gig) { Line 211  void PrintInstruments(gig::File* gig) {
211          cout << "    Instrument " << instruments << ") " << name << ", ";          cout << "    Instrument " << instruments << ") " << name << ", ";
212    
213          cout << " MIDIBank=" << pInstrument->MIDIBank << ", MIDIProgram=" << pInstrument->MIDIProgram << endl;          cout << " MIDIBank=" << pInstrument->MIDIBank << ", MIDIProgram=" << pInstrument->MIDIProgram << endl;
214    
215            cout << "        ScriptSlots=" << pInstrument->ScriptSlotCount() << endl;
216            for (int s = 0; s < pInstrument->ScriptSlotCount(); ++s) {
217                gig::Script* pScript = pInstrument->GetScriptOfSlot(s);
218                string name = pScript->Name;
219                cout << "        ScriptSlot[" << s << "]='" << name << "'\n";
220            }
221    
222          PrintRegions(pInstrument);          PrintRegions(pInstrument);
223    
224          pInstrument = gig->GetNextInstrument();          pInstrument = gig->GetNextInstrument();

Legend:
Removed from v.2493  
changed lines
  Added in v.2609

  ViewVC Help
Powered by ViewVC