Use enums to specify the default channel configuration and sample type

This commit is contained in:
Chris Robinson 2012-03-13 15:32:44 -07:00
parent f7f1dd1346
commit 07e34cc3cf
2 changed files with 11 additions and 7 deletions

View File

@ -2485,8 +2485,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
InitUIntMap(&device->FilterMap, ~0);
//Set output format
device->FmtChans = DevFmtStereo;
device->FmtType = DevFmtFloat;
device->FmtChans = DevFmtChannelsDefault;
device->FmtType = DevFmtTypeDefault;
device->Frequency = DEFAULT_OUTPUT_RATE;
device->NumUpdates = 4;
device->UpdateSize = 1024;
@ -2747,9 +2747,9 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
device->NumUpdates = 0;
device->UpdateSize = 0;
device->Frequency = 44100;
device->FmtChans = DevFmtStereo;
device->FmtType = DevFmtShort;
device->Frequency = DEFAULT_OUTPUT_RATE;
device->FmtChans = DevFmtChannelsDefault;
device->FmtType = DevFmtTypeDefault;
ConfigValueUInt(NULL, "sources", &device->MaxNoOfSources);
if(device->MaxNoOfSources == 0) device->MaxNoOfSources = 256;

View File

@ -515,7 +515,9 @@ enum DevFmtType {
DevFmtUShort = ALC_UNSIGNED_SHORT_SOFT,
DevFmtInt = ALC_INT_SOFT,
DevFmtUInt = ALC_UNSIGNED_INT_SOFT,
DevFmtFloat = ALC_FLOAT_SOFT
DevFmtFloat = ALC_FLOAT_SOFT,
DevFmtTypeDefault = DevFmtFloat
};
enum DevFmtChannels {
DevFmtMono = ALC_MONO_SOFT,
@ -526,7 +528,9 @@ enum DevFmtChannels {
DevFmtX71 = ALC_7POINT1_SOFT,
/* Similar to 5.1, except using the side channels instead of back */
DevFmtX51Side = 0x80000000 | ALC_5POINT1_SOFT
DevFmtX51Side = 0x80000000,
DevFmtChannelsDefault = DevFmtStereo
};
ALuint BytesFromDevFmt(enum DevFmtType type);