aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/UMediaCore_SDL.pas
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-02 17:25:26 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-02 17:25:26 +0000
commit7a01b05b3861a667eb32ce2e0fc88ff3bacb99ae (patch)
tree3ceaf345e679ad993c5e1a78f9b5a84c1f0ac134 /src/base/UMediaCore_SDL.pas
parent4859734e7e6699e5c88added2df53ba3ff168300 (diff)
downloadusdx-7a01b05b3861a667eb32ce2e0fc88ff3bacb99ae.tar.gz
usdx-7a01b05b3861a667eb32ce2e0fc88ff3bacb99ae.tar.xz
usdx-7a01b05b3861a667eb32ce2e0fc88ff3bacb99ae.zip
Moved: The folder classes has been renamed to base
Updated: ultrastardx.dpr has been changed accordingly git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1339 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/UMediaCore_SDL.pas')
-rw-r--r--src/base/UMediaCore_SDL.pas38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/base/UMediaCore_SDL.pas b/src/base/UMediaCore_SDL.pas
new file mode 100644
index 00000000..252f72a0
--- /dev/null
+++ b/src/base/UMediaCore_SDL.pas
@@ -0,0 +1,38 @@
+unit UMediaCore_SDL;
+
+interface
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+{$I switches.inc}
+
+uses
+ UMusic,
+ sdl;
+
+function ConvertAudioFormatToSDL(Format: TAudioSampleFormat; out SDLFormat: UInt16): boolean;
+
+implementation
+
+function ConvertAudioFormatToSDL(Format: TAudioSampleFormat; out SDLFormat: UInt16): boolean;
+begin
+ case Format of
+ asfU8: SDLFormat := AUDIO_U8;
+ asfS8: SDLFormat := AUDIO_S8;
+ asfU16LSB: SDLFormat := AUDIO_U16LSB;
+ asfS16LSB: SDLFormat := AUDIO_S16LSB;
+ asfU16MSB: SDLFormat := AUDIO_U16MSB;
+ asfS16MSB: SDLFormat := AUDIO_S16MSB;
+ asfU16: SDLFormat := AUDIO_U16;
+ asfS16: SDLFormat := AUDIO_S16;
+ else begin
+ Result := false;
+ Exit;
+ end;
+ end;
+ Result := true;
+end;
+
+end.