From 7fe486dae8a4bf2ff381a607695e215ed842e296 Mon Sep 17 00:00:00 2001 From: Robert Kausch Date: Sun, 1 Dec 2024 18:31:34 +0100 Subject: [PATCH] Update for Monkey's Audio 10.82. --- components/decoder/mac/dllinterface.cpp | 4 ++-- components/encoder/mac/dllinterface.cpp | 4 ++-- include/support/MAC/All.h | 25 ++++--------------------- include/support/MAC/MACDll.h | 2 -- include/support/MAC/MACLib.h | 21 ++++++++------------- include/support/MAC/SmartPtr.h | 5 +++-- include/support/MAC/Version.h | 10 +++++----- 7 files changed, 24 insertions(+), 47 deletions(-) diff --git a/components/decoder/mac/dllinterface.cpp b/components/decoder/mac/dllinterface.cpp index 3be07678..b9f78d18 100755 --- a/components/decoder/mac/dllinterface.cpp +++ b/components/decoder/mac/dllinterface.cpp @@ -1,5 +1,5 @@ /* BoCA - BonkEnc Component Architecture - * Copyright (C) 2007-2023 Robert Kausch + * Copyright (C) 2007-2024 Robert Kausch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -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; } diff --git a/components/encoder/mac/dllinterface.cpp b/components/encoder/mac/dllinterface.cpp index f6e537a2..a9f0358b 100755 --- a/components/encoder/mac/dllinterface.cpp +++ b/components/encoder/mac/dllinterface.cpp @@ -1,5 +1,5 @@ /* BoCA - BonkEnc Component Architecture - * Copyright (C) 2007-2023 Robert Kausch + * Copyright (C) 2007-2024 Robert Kausch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -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; } diff --git a/include/support/MAC/All.h b/include/support/MAC/All.h index 491b7ec2..ef620521 100644 --- a/include/support/MAC/All.h +++ b/include/support/MAC/All.h @@ -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 **************************************************************************************************/ @@ -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 @@ -124,14 +115,12 @@ 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 @@ -139,12 +128,6 @@ Global compiler settings (useful for porting) // 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 **************************************************************************************************/ diff --git a/include/support/MAC/MACDll.h b/include/support/MAC/MACDll.h index ba17dc4a..ead1939a 100644 --- a/include/support/MAC/MACDll.h +++ b/include/support/MAC/MACDll.h @@ -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" { @@ -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); } /************************************************************************************************** diff --git a/include/support/MAC/MACLib.h b/include/support/MAC/MACLib.h index 52a206da..5cba9ead 100644 --- a/include/support/MAC/MACLib.h +++ b/include/support/MAC/MACLib.h @@ -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)) @@ -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: @@ -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) }; /************************************************************************************************** @@ -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) **************************************************************************************************/ @@ -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 @@ -453,7 +453,7 @@ class IAPECompress virtual int64 AddDataFromInputSource(CInputSource * pInputSource, int64 nMaxBytes = 0, int64 * pBytesAdded = APE_NULL) = 0; /************************************************************************************************** - * Finish / Kill + * Finish **************************************************************************************************/ ////////////////////////////////////////////////////////////////////////////////////////////// @@ -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 @@ -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); } diff --git a/include/support/MAC/SmartPtr.h b/include/support/MAC/SmartPtr.h index bda94a5d..23a9e3ef 100644 --- a/include/support/MAC/SmartPtr.h +++ b/include/support/MAC/SmartPtr.h @@ -78,9 +78,10 @@ template 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) diff --git a/include/support/MAC/Version.h b/include/support/MAC/Version.h index a31dfde4..b4b6efe9 100644 --- a/include/support/MAC/Version.h +++ b/include/support/MAC/Version.h @@ -3,8 +3,8 @@ /* build batch file */ /* #ifdef APE_BATCH_FILE_VERSION -Set _MA=1039 -Set _MAV=10.39 +Set _MA=1082 +Set _MAV=10.82 #endif */ @@ -12,10 +12,10 @@ Set _MAV=10.39 #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 */