2 |
libakai - C++ cross-platform akai sample disk reader |
libakai - C++ cross-platform akai sample disk reader |
3 |
Copyright (C) 2002-2003 Sébastien Métrot |
Copyright (C) 2002-2003 Sébastien Métrot |
4 |
|
|
5 |
Linux port by Christian Schoenebeck <cuse@users.sourceforge.net> 2003-2014 |
Linux port by Christian Schoenebeck <cuse@users.sourceforge.net> 2003-2015 |
6 |
|
|
7 |
This library is free software; you can redistribute it and/or |
This library is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU Lesser General Public |
modify it under the terms of the GNU Lesser General Public |
124 |
|
|
125 |
static void printUsage() { |
static void printUsage() { |
126 |
#ifdef WIN32 |
#ifdef WIN32 |
127 |
printf( |
const wchar_t* msg = |
128 |
"akaiextract <source-drive-letter>: <destination-dir>\n" |
L"akaiextract <source-drive-letter>: <destination-dir>\n" |
129 |
"by Sebastien Métrot (meeloo@meeloo.net)\n\n" |
"by S\351bastien M\351trot (meeloo@meeloo.net)\n\n" |
130 |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
131 |
"samples as .wav files to the given output directory. If the given output\n" |
"samples as .wav files to the given output directory. If the given output\n" |
132 |
"directory does not exist yet, then it will be created.\n\n" |
"directory does not exist yet, then it will be created.\n\n" |
133 |
"Available types of your drives:\n" |
"Available types of your drives:\n"; |
134 |
); |
DWORD n = wcslen(msg); |
135 |
|
WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), msg, n, &n, NULL); |
136 |
char rootpath[4]="a:\\"; |
char rootpath[4]="a:\\"; |
137 |
for (char drive ='a'; drive <= 'z'; drive++) { |
for (char drive ='a'; drive <= 'z'; drive++) { |
138 |
rootpath[0] = drive; |
rootpath[0] = drive; |
152 |
} |
} |
153 |
printf("\n"); |
printf("\n"); |
154 |
#elif defined _CARBON_ |
#elif defined _CARBON_ |
155 |
printf( |
setlocale(LC_CTYPE, ""); |
156 |
"akaiextract [<source-path>] <destination-dir>\n" |
printf("%ls", |
157 |
"by Sebastien Métrot (meeloo@meeloo.net)\n\n" |
L"akaiextract [<source-path>] <destination-dir>\n" |
158 |
|
"by S\351bastien M\351trot (meeloo@meeloo.net)\n\n" |
159 |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
160 |
"samples as .wav files to the given output directory. If the given output\n" |
"samples as .wav files to the given output directory. If the given output\n" |
161 |
"directory does not exist yet, then it will be created.\n\n" |
"directory does not exist yet, then it will be created.\n\n" |
164 |
"<destination-dir> - target directory where samples will be written to\n\n" |
"<destination-dir> - target directory where samples will be written to\n\n" |
165 |
); |
); |
166 |
#else |
#else |
167 |
printf( |
setlocale(LC_CTYPE, ""); |
168 |
"akaiextract <source-path> <destination-dir>\n" |
printf("%ls", |
169 |
"by Sebastien Métrot (meeloo@meeloo.net)\n" |
L"akaiextract <source-path> <destination-dir>\n" |
170 |
|
"by S\351bastien M\351trot (meeloo@meeloo.net)\n" |
171 |
"Linux port by Christian Schoenebeck\n\n" |
"Linux port by Christian Schoenebeck\n\n" |
172 |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
"Reads an AKAI media (i.e. CDROM, ZIP disk) and extracts all its audio\n" |
173 |
"samples as .wav files to the given output directory. If the given output\n" |
"samples as .wav files to the given output directory. If the given output\n" |
299 |
#endif // !HAVE_SNDFILE |
#endif // !HAVE_SNDFILE |
300 |
|
|
301 |
totalSamplesSize *= 2; // due to 16 bit samples |
totalSamplesSize *= 2; // due to 16 bit samples |
302 |
printf("There are %d samples on this disk with a total size of %d Bytes. ", |
printf("There are %ld samples on this disk with a total size of %ld Bytes. ", |
303 |
totalSamples, totalSamplesSize); |
totalSamples, totalSamplesSize); |
304 |
printf("Do you want to extract them (.wav files will be written to '%s')? [y/n]\n", outPath); |
printf("Do you want to extract them (.wav files will be written to '%s')? [y/n]\n", outPath); |
305 |
char c = getchar(); |
char c = getchar(); |
368 |
for (it = Samples.begin(); it != end && !errorOccured; it++) { |
for (it = Samples.begin(); it != end && !errorOccured; it++) { |
369 |
AkaiDirEntry DirEntry = *it; |
AkaiDirEntry DirEntry = *it; |
370 |
AkaiSample* pSample = pVolume->GetSample(samp); |
AkaiSample* pSample = pVolume->GetSample(samp); |
371 |
printf("Extracting Sample (%d/%d) %s...", |
printf("Extracting Sample (%ld/%ld) %s...", |
372 |
currentsample++, |
currentsample++, |
373 |
totalSamples, |
totalSamples, |
374 |
DirEntry.mName.c_str()); |
DirEntry.mName.c_str()); |