diff options
Diffstat (limited to 'al')
-rw-r--r-- | al/buffer.cpp | 46 | ||||
-rw-r--r-- | al/effects/chorus.cpp | 4 | ||||
-rw-r--r-- | al/effects/fshifter.cpp | 6 | ||||
-rw-r--r-- | al/effects/modulator.cpp | 6 | ||||
-rw-r--r-- | al/effects/vmorpher.cpp | 8 | ||||
-rw-r--r-- | al/source.cpp | 30 | ||||
-rw-r--r-- | al/state.cpp | 14 |
7 files changed, 57 insertions, 57 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp index 93daf4f5..6bf3ecbc 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -288,8 +288,8 @@ al::optional<AmbiLayout> AmbiLayoutFromEnum(ALenum layout) { switch(layout) { - case AL_FUMA_SOFT: return al::make_optional(AmbiLayout::FuMa); - case AL_ACN_SOFT: return al::make_optional(AmbiLayout::ACN); + case AL_FUMA_SOFT: return AmbiLayout::FuMa; + case AL_ACN_SOFT: return AmbiLayout::ACN; } return al::nullopt; } @@ -307,9 +307,9 @@ al::optional<AmbiScaling> AmbiScalingFromEnum(ALenum scale) { switch(scale) { - case AL_FUMA_SOFT: return al::make_optional(AmbiScaling::FuMa); - case AL_SN3D_SOFT: return al::make_optional(AmbiScaling::SN3D); - case AL_N3D_SOFT: return al::make_optional(AmbiScaling::N3D); + case AL_FUMA_SOFT: return AmbiScaling::FuMa; + case AL_SN3D_SOFT: return AmbiScaling::SN3D; + case AL_N3D_SOFT: return AmbiScaling::N3D; } return al::nullopt; } @@ -329,18 +329,18 @@ al::optional<FmtChannels> FmtFromUserFmt(UserFmtChannels chans) { switch(chans) { - case UserFmtMono: return al::make_optional(FmtMono); - case UserFmtStereo: return al::make_optional(FmtStereo); - case UserFmtRear: return al::make_optional(FmtRear); - case UserFmtQuad: return al::make_optional(FmtQuad); - case UserFmtX51: return al::make_optional(FmtX51); - case UserFmtX61: return al::make_optional(FmtX61); - case UserFmtX71: return al::make_optional(FmtX71); - case UserFmtBFormat2D: return al::make_optional(FmtBFormat2D); - case UserFmtBFormat3D: return al::make_optional(FmtBFormat3D); - case UserFmtUHJ2: return al::make_optional(FmtUHJ2); - case UserFmtUHJ3: return al::make_optional(FmtUHJ3); - case UserFmtUHJ4: return al::make_optional(FmtUHJ4); + case UserFmtMono: return FmtMono; + case UserFmtStereo: return FmtStereo; + case UserFmtRear: return FmtRear; + case UserFmtQuad: return FmtQuad; + case UserFmtX51: return FmtX51; + case UserFmtX61: return FmtX61; + case UserFmtX71: return FmtX71; + case UserFmtBFormat2D: return FmtBFormat2D; + case UserFmtBFormat3D: return FmtBFormat3D; + case UserFmtUHJ2: return FmtUHJ2; + case UserFmtUHJ3: return FmtUHJ3; + case UserFmtUHJ4: return FmtUHJ4; } return al::nullopt; } @@ -348,12 +348,12 @@ al::optional<FmtType> FmtFromUserFmt(UserFmtType type) { switch(type) { - case UserFmtUByte: return al::make_optional(FmtUByte); - case UserFmtShort: return al::make_optional(FmtShort); - case UserFmtFloat: return al::make_optional(FmtFloat); - case UserFmtDouble: return al::make_optional(FmtDouble); - case UserFmtMulaw: return al::make_optional(FmtMulaw); - case UserFmtAlaw: return al::make_optional(FmtAlaw); + case UserFmtUByte: return FmtUByte; + case UserFmtShort: return FmtShort; + case UserFmtFloat: return FmtFloat; + case UserFmtDouble: return FmtDouble; + case UserFmtMulaw: return FmtMulaw; + case UserFmtAlaw: return FmtAlaw; /* ADPCM not handled here. */ case UserFmtIMA4: break; case UserFmtMSADPCM: break; diff --git a/al/effects/chorus.cpp b/al/effects/chorus.cpp index 1651ebb9..a05ec10b 100644 --- a/al/effects/chorus.cpp +++ b/al/effects/chorus.cpp @@ -31,8 +31,8 @@ inline al::optional<ChorusWaveform> WaveformFromEnum(ALenum type) { switch(type) { - case AL_CHORUS_WAVEFORM_SINUSOID: return al::make_optional(ChorusWaveform::Sinusoid); - case AL_CHORUS_WAVEFORM_TRIANGLE: return al::make_optional(ChorusWaveform::Triangle); + case AL_CHORUS_WAVEFORM_SINUSOID: return ChorusWaveform::Sinusoid; + case AL_CHORUS_WAVEFORM_TRIANGLE: return ChorusWaveform::Triangle; } return al::nullopt; } diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp index 400c0bf4..9ca28775 100644 --- a/al/effects/fshifter.cpp +++ b/al/effects/fshifter.cpp @@ -24,9 +24,9 @@ al::optional<FShifterDirection> DirectionFromEmum(ALenum value) { switch(value) { - case AL_FREQUENCY_SHIFTER_DIRECTION_DOWN: return al::make_optional(FShifterDirection::Down); - case AL_FREQUENCY_SHIFTER_DIRECTION_UP: return al::make_optional(FShifterDirection::Up); - case AL_FREQUENCY_SHIFTER_DIRECTION_OFF: return al::make_optional(FShifterDirection::Off); + case AL_FREQUENCY_SHIFTER_DIRECTION_DOWN: return FShifterDirection::Down; + case AL_FREQUENCY_SHIFTER_DIRECTION_UP: return FShifterDirection::Up; + case AL_FREQUENCY_SHIFTER_DIRECTION_OFF: return FShifterDirection::Off; } return al::nullopt; } diff --git a/al/effects/modulator.cpp b/al/effects/modulator.cpp index e917e3a0..070b0998 100644 --- a/al/effects/modulator.cpp +++ b/al/effects/modulator.cpp @@ -24,9 +24,9 @@ al::optional<ModulatorWaveform> WaveformFromEmum(ALenum value) { switch(value) { - case AL_RING_MODULATOR_SINUSOID: return al::make_optional(ModulatorWaveform::Sinusoid); - case AL_RING_MODULATOR_SAWTOOTH: return al::make_optional(ModulatorWaveform::Sawtooth); - case AL_RING_MODULATOR_SQUARE: return al::make_optional(ModulatorWaveform::Square); + case AL_RING_MODULATOR_SINUSOID: return ModulatorWaveform::Sinusoid; + case AL_RING_MODULATOR_SAWTOOTH: return ModulatorWaveform::Sawtooth; + case AL_RING_MODULATOR_SQUARE: return ModulatorWaveform::Square; } return al::nullopt; } diff --git a/al/effects/vmorpher.cpp b/al/effects/vmorpher.cpp index e1b7a698..e26c6fe3 100644 --- a/al/effects/vmorpher.cpp +++ b/al/effects/vmorpher.cpp @@ -23,7 +23,7 @@ namespace { al::optional<VMorpherPhenome> PhenomeFromEnum(ALenum val) { #define HANDLE_PHENOME(x) case AL_VOCAL_MORPHER_PHONEME_ ## x: \ - return al::make_optional(VMorpherPhenome::x) + return VMorpherPhenome::x switch(val) { HANDLE_PHENOME(A); @@ -104,9 +104,9 @@ al::optional<VMorpherWaveform> WaveformFromEmum(ALenum value) { switch(value) { - case AL_VOCAL_MORPHER_WAVEFORM_SINUSOID: return al::make_optional(VMorpherWaveform::Sinusoid); - case AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE: return al::make_optional(VMorpherWaveform::Triangle); - case AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH: return al::make_optional(VMorpherWaveform::Sawtooth); + case AL_VOCAL_MORPHER_WAVEFORM_SINUSOID: return VMorpherWaveform::Sinusoid; + case AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE: return VMorpherWaveform::Triangle; + case AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH: return VMorpherWaveform::Sawtooth; } return al::nullopt; } diff --git a/al/source.cpp b/al/source.cpp index 5d95ba8a..1e4a5a50 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -839,8 +839,8 @@ al::optional<SourceStereo> StereoModeFromEnum(ALenum mode) { switch(mode) { - case AL_NORMAL_SOFT: return al::make_optional(SourceStereo::Normal); - case AL_SUPER_STEREO_SOFT: return al::make_optional(SourceStereo::Enhanced); + case AL_NORMAL_SOFT: return SourceStereo::Normal; + case AL_SUPER_STEREO_SOFT: return SourceStereo::Enhanced; } WARN("Unsupported stereo mode: 0x%04x\n", mode); return al::nullopt; @@ -859,9 +859,9 @@ al::optional<SpatializeMode> SpatializeModeFromEnum(ALenum mode) { switch(mode) { - case AL_FALSE: return al::make_optional(SpatializeMode::Off); - case AL_TRUE: return al::make_optional(SpatializeMode::On); - case AL_AUTO_SOFT: return al::make_optional(SpatializeMode::Auto); + case AL_FALSE: return SpatializeMode::Off; + case AL_TRUE: return SpatializeMode::On; + case AL_AUTO_SOFT: return SpatializeMode::Auto; } WARN("Unsupported spatialize mode: 0x%04x\n", mode); return al::nullopt; @@ -881,9 +881,9 @@ al::optional<DirectMode> DirectModeFromEnum(ALenum mode) { switch(mode) { - case AL_FALSE: return al::make_optional(DirectMode::Off); - case AL_DROP_UNMATCHED_SOFT: return al::make_optional(DirectMode::DropMismatch); - case AL_REMIX_UNMATCHED_SOFT: return al::make_optional(DirectMode::RemixMismatch); + case AL_FALSE: return DirectMode::Off; + case AL_DROP_UNMATCHED_SOFT: return DirectMode::DropMismatch; + case AL_REMIX_UNMATCHED_SOFT: return DirectMode::RemixMismatch; } WARN("Unsupported direct mode: 0x%04x\n", mode); return al::nullopt; @@ -903,13 +903,13 @@ al::optional<DistanceModel> DistanceModelFromALenum(ALenum model) { switch(model) { - case AL_NONE: return al::make_optional(DistanceModel::Disable); - case AL_INVERSE_DISTANCE: return al::make_optional(DistanceModel::Inverse); - case AL_INVERSE_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::InverseClamped); - case AL_LINEAR_DISTANCE: return al::make_optional(DistanceModel::Linear); - case AL_LINEAR_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::LinearClamped); - case AL_EXPONENT_DISTANCE: return al::make_optional(DistanceModel::Exponent); - case AL_EXPONENT_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::ExponentClamped); + case AL_NONE: return DistanceModel::Disable; + case AL_INVERSE_DISTANCE: return DistanceModel::Inverse; + case AL_INVERSE_DISTANCE_CLAMPED: return DistanceModel::InverseClamped; + case AL_LINEAR_DISTANCE: return DistanceModel::Linear; + case AL_LINEAR_DISTANCE_CLAMPED: return DistanceModel::LinearClamped; + case AL_EXPONENT_DISTANCE: return DistanceModel::Exponent; + case AL_EXPONENT_DISTANCE_CLAMPED: return DistanceModel::ExponentClamped; } return al::nullopt; } diff --git a/al/state.cpp b/al/state.cpp index d1c5605d..11202374 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -107,13 +107,13 @@ al::optional<DistanceModel> DistanceModelFromALenum(ALenum model) { switch(model) { - case AL_NONE: return al::make_optional(DistanceModel::Disable); - case AL_INVERSE_DISTANCE: return al::make_optional(DistanceModel::Inverse); - case AL_INVERSE_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::InverseClamped); - case AL_LINEAR_DISTANCE: return al::make_optional(DistanceModel::Linear); - case AL_LINEAR_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::LinearClamped); - case AL_EXPONENT_DISTANCE: return al::make_optional(DistanceModel::Exponent); - case AL_EXPONENT_DISTANCE_CLAMPED: return al::make_optional(DistanceModel::ExponentClamped); + case AL_NONE: return DistanceModel::Disable; + case AL_INVERSE_DISTANCE: return DistanceModel::Inverse; + case AL_INVERSE_DISTANCE_CLAMPED: return DistanceModel::InverseClamped; + case AL_LINEAR_DISTANCE: return DistanceModel::Linear; + case AL_LINEAR_DISTANCE_CLAMPED: return DistanceModel::LinearClamped; + case AL_EXPONENT_DISTANCE: return DistanceModel::Exponent; + case AL_EXPONENT_DISTANCE_CLAMPED: return DistanceModel::ExponentClamped; } return al::nullopt; } |