aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib/portmixer/delphi/portmixer.pas
diff options
context:
space:
mode:
authormogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-13 19:58:44 +0000
committermogguh <mogguh@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-02-13 19:58:44 +0000
commit949fea202f6c963ad6c8a40040e1e9e6f909161b (patch)
tree9f6f683d203d55e41e5b7483b4038103d471ce76 /Game/Code/lib/portmixer/delphi/portmixer.pas
parent1a7da68ae6e1368dae25821b15318bd1d2d9f88e (diff)
parentefe5b06fd5715f550334692d28c2218896b62ce1 (diff)
downloadusdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.tar.gz
usdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.tar.xz
usdx-949fea202f6c963ad6c8a40040e1e9e6f909161b.zip
First multi platform version, works on Linux and Windows
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.1@855 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/lib/portmixer/delphi/portmixer.pas')
-rw-r--r--Game/Code/lib/portmixer/delphi/portmixer.pas152
1 files changed, 152 insertions, 0 deletions
diff --git a/Game/Code/lib/portmixer/delphi/portmixer.pas b/Game/Code/lib/portmixer/delphi/portmixer.pas
new file mode 100644
index 00000000..a9e27516
--- /dev/null
+++ b/Game/Code/lib/portmixer/delphi/portmixer.pas
@@ -0,0 +1,152 @@
+{*
+ * PortMixer
+ * PortMixer API Header File
+ *
+ * Copyright (c) 2002, 2006
+ *
+ * Written by Dominic Mazzoni
+ * and Leland Lucius
+ *
+ * PortMixer is intended to work side-by-side with PortAudio,
+ * the Portable Real-Time Audio Library by Ross Bencina and
+ * Phil Burk.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *}
+unit portmixer;
+
+{$IFDEF FPC}
+ {$IFNDEF win32}
+ {$LINKLIB libportaudio}
+ {$ENDIF}
+ {$PACKRECORDS C} (* GCC/Visual C/C++ compatible record packing *)
+ {$MODE DELPHI }
+{$ENDIF}
+
+interface
+
+uses
+ portaudio;
+
+const
+{$IFDEF WIN32}
+ LibName = 'portmixer.dll';
+{$ENDIF}
+{$IFDEF LINUX}
+ LibName = 'libportmixer.so';
+{$ENDIF}
+{$IFDEF MACOS}
+ LibName = 'libportmixer.dylib';
+{$ENDIF}
+
+type
+ PPxMixer = Pointer;
+ TPxVolume = Single; {* 0.0 (min) --> 1.0 (max) *}
+ TPxBalance = Single; {* -1.0 (left) --> 1.0 (right) *}
+
+{*
+ Px_OpenMixer() returns a mixer which will work with the given PortAudio
+ audio device. Pass 0 as the index for the first (default) mixer.
+*}
+
+function Px_OpenMixer( pa_stream: Pointer; i: Integer ): PPxMixer; cdecl; external LibName;
+
+{*
+ Px_CloseMixer() closes a mixer opened using Px_OpenMixer and frees any
+ memory associated with it.
+*}
+
+procedure Px_CloseMixer( mixer: PPxMixer ); cdecl; external LibName;
+
+{*
+ Px_GetNumMixers returns the number of mixers which could be
+ used with the given PortAudio device. On most systems, there
+ will be only one mixer for each device; however there may be
+ multiple mixers for each device, or possibly multiple mixers
+ which are independent of any particular PortAudio device.
+*}
+
+function Px_GetNumMixers( mixer: PPxMixer ): Integer; cdecl; external LibName;
+function Px_GetMixerName( mixer: PPxMixer; i: Integer ): PChar; cdecl; external LibName;
+
+{*
+ Master (output) volume
+*}
+
+function Px_GetMasterVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName;
+procedure Px_SetMasterVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName;
+
+{*
+ Main output volume
+*}
+
+function Px_GetPCMOutputVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName;
+procedure Px_SetPCMOutputVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName;
+function Px_SupportsPCMOutputVolume( mixer: PPxMixer ): Integer; cdecl; external LibName;
+
+{*
+ All output volumes
+*}
+
+function Px_GetNumOutputVolumes( mixer: PPxMixer ): Integer; cdecl; external LibName;
+function Px_GetOutputVolumeName( mixer: PPxMixer; i: Integer ): PChar; cdecl; external LibName;
+function Px_GetOutputVolume( mixer: PPxMixer; i: Integer ): TPxVolume; cdecl; external LibName;
+procedure Px_SetOutputVolume( mixer: PPxMixer; i: Integer; volume: TPxVolume ); cdecl; external LibName;
+
+{*
+ Input source
+*}
+
+function Px_GetNumInputSources( mixer: PPxMixer ): Integer; cdecl; external LibName;
+function Px_GetInputSourceName( mixer: PPxMixer; i: Integer): PChar; cdecl; external LibName;
+function Px_GetCurrentInputSource( mixer: PPxMixer ): Integer; cdecl; external LibName; {* may return -1 == none *}
+procedure Px_SetCurrentInputSource( mixer: PPxMixer; i: Integer ); cdecl; external LibName;
+
+{*
+ Input volume
+*}
+
+function Px_GetInputVolume( mixer: PPxMixer ): TPxVolume; cdecl; external LibName;
+procedure Px_SetInputVolume( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName;
+
+{*
+ Balance
+*}
+
+function Px_SupportsOutputBalance( mixer: PPxMixer ): Integer; cdecl; external LibName;
+function Px_GetOutputBalance( mixer: PPxMixer ): TPxBalance; cdecl; external LibName;
+procedure Px_SetOutputBalance( mixer: PPxMixer; balance: TPxBalance ); cdecl; external LibName;
+
+{*
+ Playthrough
+*}
+
+function Px_SupportsPlaythrough( mixer: PPxMixer ): Integer; cdecl; external LibName;
+function Px_GetPlaythrough( mixer: PPxMixer ): TPxVolume; cdecl; external LibName;
+procedure Px_SetPlaythrough( mixer: PPxMixer; volume: TPxVolume ); cdecl; external LibName;
+
+implementation
+
+end.