MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / SetSourcefv

Function SetSourcefv

Engine/lib/openal-soft/al/source.cpp:1102–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1100}
1101
1102bool SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp prop, const al::span<const float> values)
1103{
1104 int ival;
1105
1106 switch(prop)
1107 {
1108 case AL_SEC_OFFSET_LATENCY_SOFT:
1109 case AL_SEC_OFFSET_CLOCK_SOFT:
1110 /* Query only */
1111 SETERR_RETURN(Context, AL_INVALID_OPERATION, false,
1112 "Setting read-only source property 0x%04x", prop);
1113
1114 case AL_PITCH:
1115 CHECKSIZE(values, 1);
1116 CHECKVAL(values[0] >= 0.0f);
1117
1118 Source->Pitch = values[0];
1119 return UpdateSourceProps(Source, Context);
1120
1121 case AL_CONE_INNER_ANGLE:
1122 CHECKSIZE(values, 1);
1123 CHECKVAL(values[0] >= 0.0f && values[0] <= 360.0f);
1124
1125 Source->InnerAngle = values[0];
1126 return UpdateSourceProps(Source, Context);
1127
1128 case AL_CONE_OUTER_ANGLE:
1129 CHECKSIZE(values, 1);
1130 CHECKVAL(values[0] >= 0.0f && values[0] <= 360.0f);
1131
1132 Source->OuterAngle = values[0];
1133 return UpdateSourceProps(Source, Context);
1134
1135 case AL_GAIN:
1136 CHECKSIZE(values, 1);
1137 CHECKVAL(values[0] >= 0.0f);
1138
1139 Source->Gain = values[0];
1140 return UpdateSourceProps(Source, Context);
1141
1142 case AL_MAX_DISTANCE:
1143 CHECKSIZE(values, 1);
1144 CHECKVAL(values[0] >= 0.0f);
1145
1146 Source->MaxDistance = values[0];
1147 return UpdateSourceProps(Source, Context);
1148
1149 case AL_ROLLOFF_FACTOR:
1150 CHECKSIZE(values, 1);
1151 CHECKVAL(values[0] >= 0.0f);
1152
1153 Source->RolloffFactor = values[0];
1154 return UpdateSourceProps(Source, Context);
1155
1156 case AL_REFERENCE_DISTANCE:
1157 CHECKSIZE(values, 1);
1158 CHECKVAL(values[0] >= 0.0f);
1159

Callers 3

SetSourceivFunction · 0.85
SetSourcei64vFunction · 0.85
source.cppFile · 0.85

Calls 7

UpdateSourcePropsFunction · 0.85
GetSourceVoiceFunction · 0.85
GetSampleOffsetFunction · 0.85
SetVoiceOffsetFunction · 0.85
SetSourceivFunction · 0.85
setErrorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected