Skip to content

Commit

Permalink
Update for Monkey's Audio 10.82.
Browse files Browse the repository at this point in the history
  • Loading branch information
enzo1982 committed Dec 1, 2024
1 parent 564d8b5 commit 7fe486d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 47 deletions.
4 changes: 2 additions & 2 deletions components/decoder/mac/dllinterface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* BoCA - BonkEnc Component Architecture
* Copyright (C) 2007-2023 Robert Kausch <robert.kausch@freac.org>
* Copyright (C) 2007-2024 Robert Kausch <robert.kausch@freac.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -56,7 +56,7 @@ Bool LoadMACDLL()
*/
unsigned int interfaceVersion = ex_GetLibraryInterfaceVersion();

if (interfaceVersion > 10) { FreeMACDLL(); return False; }
if (interfaceVersion > 11) { FreeMACDLL(); return False; }

return True;
}
Expand Down
4 changes: 2 additions & 2 deletions components/encoder/mac/dllinterface.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* BoCA - BonkEnc Component Architecture
* Copyright (C) 2007-2023 Robert Kausch <robert.kausch@freac.org>
* Copyright (C) 2007-2024 Robert Kausch <robert.kausch@freac.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -56,7 +56,7 @@ Bool LoadMACDLL()
*/
unsigned int interfaceVersion = ex_GetLibraryInterfaceVersion();

if (interfaceVersion > 10) { FreeMACDLL(); return False; }
if (interfaceVersion > 11) { FreeMACDLL(); return False; }

return True;
}
Expand Down
25 changes: 4 additions & 21 deletions include/support/MAC/All.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ Global includes
#define ape_min(a,b) (((a) < (b)) ? (a) : (b))
#define APE_CLEAR(destination) memset(&destination, 0, sizeof(destination))

/**************************************************************************************************
Packing
We need to pack to the next byte or else we get warning 4820. We could also get around the
warning by adding padding to all our structures that is unused, but this isn't as elegant. The
actual packing code is in each header and CPP file because doing it globally leads to compiler
warnings on Linux.
**************************************************************************************************/

/**************************************************************************************************
Smart pointer
**************************************************************************************************/
Expand All @@ -100,7 +91,7 @@ Version
#include "Version.h"

// year in the copyright strings
#define APE_YEAR 2024
#define APE_YEAR 2025

// build the version string
#define STRINGIZE2(s) #s
Expand All @@ -124,27 +115,19 @@ Version
/**************************************************************************************************
Global compiler settings (useful for porting)
**************************************************************************************************/
// APE_BACKWARDS_COMPATIBILITY is only needed for decoding APE 3.92 or earlier files. It
// APE_BACKWARDS_COMPATIBILITY is only needed for decoding APE 3.92 or earlier files. It
// has not been possible to make these files for over 10 years, so it's unlikely
// that disabling APE_BACKWARDS_COMPATIBILITY would have any effect on a normal user. For
// that disabling APE_BACKWARDS_COMPATIBILITY would have any effect on a normal user. For
// porting or third party usage, it's probably best to not bother with APE_BACKWARDS_COMPATIBILITY.
// A future release of Monkey's Audio itself may remove support for these obsolete files.
#if !defined(PLATFORM_ANDROID)
#define APE_BACKWARDS_COMPATIBILITY
#endif
#define APE_BACKWARDS_COMPATIBILITY

// disable this to turn off compression code
#define APE_SUPPORT_COMPRESS

// flip this to enable float compression
#define APE_SUPPORT_FLOAT_COMPRESSION

// compression modes
#define ENABLE_COMPRESSION_MODE_FAST
#define ENABLE_COMPRESSION_MODE_NORMAL
#define ENABLE_COMPRESSION_MODE_HIGH
#define ENABLE_COMPRESSION_MODE_EXTRA_HIGH

/**************************************************************************************************
Global types
**************************************************************************************************/
Expand Down
2 changes: 0 additions & 2 deletions include/support/MAC/MACDll.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ typedef int (__stdcall * proc_APECompress_GetBufferBytesAvailable)(APE_COMPRESS_
typedef unsigned char * (__stdcall * proc_APECompress_LockBuffer)(APE_COMPRESS_HANDLE, APE::int64 *);
typedef int (__stdcall * proc_APECompress_UnlockBuffer)(APE_COMPRESS_HANDLE, int, BOOL);
typedef int (__stdcall * proc_APECompress_Finish)(APE_COMPRESS_HANDLE, unsigned char *, APE::int64, APE::int64);
typedef int (__stdcall * proc_APECompress_Kill)(APE_COMPRESS_HANDLE);

extern "C"
{
Expand All @@ -77,7 +76,6 @@ extern "C"
DLLEXPORT unsigned char * __stdcall c_APECompress_LockBuffer(APE_COMPRESS_HANDLE hAPECompress, APE::int64 * pBytesAvailable);
DLLEXPORT int __stdcall c_APECompress_UnlockBuffer(APE_COMPRESS_HANDLE hAPECompress, int nBytesAdded, BOOL bProcess = true);
DLLEXPORT int __stdcall c_APECompress_Finish(APE_COMPRESS_HANDLE hAPECompress, unsigned char * pTerminatingData, APE::int64 nTerminatingBytes, APE::int64 nWAVTerminatingBytes);
DLLEXPORT int __stdcall c_APECompress_Kill(APE_COMPRESS_HANDLE hAPECompress);
}

/**************************************************************************************************
Expand Down
21 changes: 8 additions & 13 deletions include/support/MAC/MACLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Unless otherwise specified, functions return ERROR_SUCCESS (0) on success and an
error code on failure.
The terminology "Sample" refers to a single sample value, and "Block" refers
to a collection of "Channel" samples. For simplicity, MAC typically uses blocks
to a collection of "Channel" samples. For simplicity, MAC typically uses blocks
everywhere so that channel mis-alignment cannot happen. (i.e. on a CD, a sample is
2 bytes and a block is 4 bytes ([2 bytes per sample] * [2 channels] = 4 bytes))
Expand Down Expand Up @@ -51,11 +51,11 @@ APE File Format Overview: (pieces in order -- only valid for the latest version
Junk:
This block may not be supported in the future, so don't write any software that adds meta data
before the APE_DESCRIPTOR. Please use the APE Tag for any meta data.
before the APE_DESCRIPTOR. Please use the APE Tag for any meta data.
Seek Table:
A 32-bit unsigned integer array of offsets from the header to the frame data. May become "delta"
A 32-bit unsigned integer array of offsets from the header to the frame data. May become "delta"
values someday to better suit huge files.
MD5 Hash:
Expand Down Expand Up @@ -190,7 +190,7 @@ struct APE_DESCRIPTOR
uint32 nAPEFrameDataBytesHigh; // the high order number of APE frame data bytes
uint32 nTerminatingDataBytes; // the terminating data of the file (not including tag data)

uint8 cFileMD5[16]; // the MD5 hash of the file (see notes for usage... it's a littly tricky)
uint8 cFileMD5[16]; // the MD5 hash of the file (see notes for usage... it's a little tricky)
};

/**************************************************************************************************
Expand Down Expand Up @@ -234,7 +234,7 @@ class IAPEDecompress
Note(s):
-the distinction between APE_INFO_XXXX and APE_DECOMPRESS_XXXX is that the first is querying the APE
information engine, and the other is querying the decompressor, and since the decompressor can be
a range of an APE file (for APL), differences will arise. Typically, use the APE_DECOMPRESS_XXXX
a range of an APE file (for APL), differences will arise. Typically, use the APE_DECOMPRESS_XXXX
fields when querying for info about the length, etc. so APL will work properly.
(i.e. (APE_INFO_TOTAL_BLOCKS != APE_DECOMPRESS_TOTAL_BLOCKS) for APL files)
**************************************************************************************************/
Expand Down Expand Up @@ -310,7 +310,7 @@ class IAPEDecompress
bool bApplySigned8BitProcessing;
bool bApplyBigEndianProcessing;
};
virtual int GetData(unsigned char * pBuffer, int64 nBlocks, int64 * pBlocksRetrieved, APE_GET_DATA_PROCESSING * pProcessing = NULL) = 0;
virtual int GetData(unsigned char * pBuffer, int64 nBlocks, int64 * pBlocksRetrieved, APE_GET_DATA_PROCESSING * pProcessing = APE_NULL) = 0;

//////////////////////////////////////////////////////////////////////////////////////////////
// Seek(...) - seeks
Expand Down Expand Up @@ -453,7 +453,7 @@ class IAPECompress
virtual int64 AddDataFromInputSource(CInputSource * pInputSource, int64 nMaxBytes = 0, int64 * pBytesAdded = APE_NULL) = 0;

/**************************************************************************************************
* Finish / Kill
* Finish
**************************************************************************************************/

//////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -471,12 +471,6 @@ class IAPECompress
// WAV file (it's basically nTerminatingBytes - the bytes that make up the tag)
//////////////////////////////////////////////////////////////////////////////////////////////
virtual int Finish(unsigned char * pTerminatingData, int64 nTerminatingBytes, int64 nWAVTerminatingBytes) = 0;

//////////////////////////////////////////////////////////////////////////////////////////////
// Kill(...) - stops encoding and deletes the output file
// --- NOT CURRENTLY IMPLEMENTED ---
//////////////////////////////////////////////////////////////////////////////////////////////
virtual int Kill() = 0;
};

} // namespace APE
Expand Down Expand Up @@ -539,4 +533,5 @@ extern "C"
DLLEXPORT int __stdcall FillRF64Header(APE::RF64_HEADER * pWAVHeader, APE::int64 nAudioBytes, const APE::WAVEFORMATEX * pWaveFormatEx);
DLLEXPORT int __stdcall GetAPEFileType(const APE::str_utfn * pInputFilename, APE::str_ansi cFileType[8]);
DLLEXPORT void __stdcall GetAPECompressionLevelName(int nCompressionLevel, APE::str_utfn * pCompressionLevel, size_t nBufferCharacters, bool bTitleCase);
DLLEXPORT void __stdcall GetAPEModeName(APE::APE_MODES Mode, APE::str_utfn * pModeName, size_t nBufferCharacters, bool bActive);
}
5 changes: 3 additions & 2 deletions include/support/MAC/SmartPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ template <class TYPE> class CSmartPtr
return m_pObject;
}

// declare assignment, but don't implement (compiler error if we try to use)
private:
// declare assignment, but mark it private so it can't be used
// that way we can't carelessly mix smart pointers and regular pointers
__forceinline void * operator =(void *) const;
__forceinline void * operator =(void *) const { return APE_NULL; }
};

#pragma pack(pop)
Expand Down
10 changes: 5 additions & 5 deletions include/support/MAC/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
/* build batch file */
/*
#ifdef APE_BATCH_FILE_VERSION
Set _MA=1039
Set _MAV=10.39
Set _MA=1082
Set _MAV=10.82
#endif
*/

/* major version number */
#define APE_VERSION_MAJOR 10

/* build version number */
#define APE_VERSION_REVISION 39
#define APE_VERSION_REVISION_NUMBER 39
#define APE_VERSION_REVISION 82
#define APE_VERSION_REVISION_NUMBER 82

/* library interface version, update this whenever the signature of an exported function changes */
#define APE_INTERFACE_VERSION 10
#define APE_INTERFACE_VERSION 11

/* leave this so the end of file doesn't get truncated */

0 comments on commit 7fe486d

Please sign in to comment.