aboutsummaryrefslogtreecommitdiffstats
path: root/src/media/UAudioInput_Bass.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-13 16:23:14 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-04-13 16:23:14 +0000
commitf1566a45ac7de81f31a1b419d88e1742089ae56d (patch)
tree889408caab4da0325663305c2ef9ac4b7bc47c9c /src/media/UAudioInput_Bass.pas
parent189d127196a855ca6a79793ba0bbe548bd415049 (diff)
downloadusdx-f1566a45ac7de81f31a1b419d88e1742089ae56d.tar.gz
usdx-f1566a45ac7de81f31a1b419d88e1742089ae56d.tar.xz
usdx-f1566a45ac7de81f31a1b419d88e1742089ae56d.zip
- save input device names as UTF8Strings
- device names of basslib are assumed to be in local encoding - device names of portaudio are assumed to be in utf-8 fixes: display of device names w/ special characters w/ basslib ('รค' for me) to-do: proof encoding of device names for basslib and portaudio git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2234 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/media/UAudioInput_Bass.pas')
-rw-r--r--src/media/UAudioInput_Bass.pas10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/media/UAudioInput_Bass.pas b/src/media/UAudioInput_Bass.pas
index 9d4417f1..e51ba254 100644
--- a/src/media/UAudioInput_Bass.pas
+++ b/src/media/UAudioInput_Bass.pas
@@ -46,6 +46,7 @@ uses
UIni,
ULog,
UAudioCore_Bass,
+ UTextEncoding,
UCommon, // (Note: for MakeLong on non-windows platforms)
{$IFDEF MSWINDOWS}
Windows, // (Note: for MakeLong)
@@ -352,7 +353,7 @@ end;
function TAudioInput_Bass.EnumDevices(): boolean;
var
- Descr: PChar;
+ Descr: UTF8String;
SourceName: PChar;
Flags: integer;
BassDeviceID: integer;
@@ -389,9 +390,12 @@ begin
BassDevice := TBassInputDevice.Create();
AudioInputProcessor.DeviceList[DeviceIndex] := BassDevice;
- Descr := DeviceInfo.name;
-
BassDevice.BassDeviceID := BassDeviceID;
+
+ // bass device name seems to be encoded w/ local encoding
+ // to-do : check if this is correct
+ Descr := DecodeStringUTF8(DeviceInfo.name, encLocale);
+
BassDevice.Name := UnifyDeviceName(Descr, DeviceIndex);
// zero info-struct as some fields might not be set (e.g. freq is just set on Vista and MacOSX)