summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/ape/apewrapper.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/plugins/ape/apewrapper.cpp b/plugins/ape/apewrapper.cpp
index 8cb46268..3d25f3b4 100644
--- a/plugins/ape/apewrapper.cpp
+++ b/plugins/ape/apewrapper.cpp
@@ -20,8 +20,32 @@ ape_decompress_destroy (void *d) {
delete dec;
}
+
+// decode process:
+// 1. get input format:
+// WAVEFORMATEX wfe;
+// GetInfo(APE_INFO_WAVEFORMATEX, (intptr_t)&wfe)
+// 2. get wav header
+// int size = GetInfo(APE_INFO_WAV_HEADER_BYTES)
+// char buf[size];
+// GetInfo (APE_INFO_WAV_HEADER_DATA, (intptr_t)buf, size);
+// 3. allocate space for readbuffer
+// int bufsize = GetInfo(APE_INFO_BLOCK_ALIGN) * BLOCKS_PER_DECODE;
+// char readbuf[bufsize];
+// 4. get total number of blocks
+// int blocksleft = GetInfo(APE_DECOMPRESS_TOTAL_BLOCKS);
+// 5. decompress
+// while (blocksleft > 0) {
+// int ndecoded;
+// GetData (readbuf, BLOCKS_PER_DECODE, &ndecoded);
+// nblocksleft -= ndecoded;
+// }
+// 6. terminate output
+// if (GetInfo(APE_INFO_WAV_TERMINATING_BYTES) > 0) {
+// GetInfo(APE_INFO_WAV_TERMINATING_DATA, (intptr_t)readbuf, GetInfo(APE_INFO_WAV_TERMINATING_BYTES));
+// }
int
-ape_decompress_info (void *d, int id) {
+ape_decompress_info_int (void *d, int id) {
IAPEDecompress *dec = (IAPEDecompress *)d;
return dec->GetInfo ((APE_DECOMPRESS_FIELDS)id);
}