aboutsummaryrefslogtreecommitdiffstats
path: root/src/media/UAudioCore_Bass.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/media/UAudioCore_Bass.pas')
-rw-r--r--src/media/UAudioCore_Bass.pas12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/media/UAudioCore_Bass.pas b/src/media/UAudioCore_Bass.pas
index 12623dc1..197f9760 100644
--- a/src/media/UAudioCore_Bass.pas
+++ b/src/media/UAudioCore_Bass.pas
@@ -44,6 +44,7 @@ type
public
constructor Create();
class function GetInstance(): TAudioCore_Bass;
+ function CheckVersion(): boolean;
function ErrorGetString(): string; overload;
function ErrorGetString(errCode: integer): string; overload;
function ConvertAudioFormatToBASSFlags(Format: TAudioSampleFormat; out Flags: DWORD): boolean;
@@ -56,6 +57,12 @@ uses
UMain,
ULog;
+const
+ // TODO: 2.4.2 is not ABI compatible with older versions
+ // as (BASS_RECORDINFO.driver was removed)
+ //BASS_MIN_REQUIRED_VERSION = $02040201;
+ BASS_MIN_REQUIRED_VERSION = $02000000;
+
var
Instance: TAudioCore_Bass;
@@ -71,6 +78,11 @@ begin
Result := Instance;
end;
+function TAudioCore_Bass.CheckVersion(): boolean;
+begin
+ Result := BASS_GetVersion() >= BASS_MIN_REQUIRED_VERSION;
+end;
+
function TAudioCore_Bass.ErrorGetString(): string;
begin
Result := ErrorGetString(BASS_ErrorGetCode());