MCPcopy Create free account
hub / github.com/crownengine/crown / SetSourcefv

Function SetSourcefv

3rdparty/openal/al/source.cpp:873–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873bool SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp prop, const al::span<const ALfloat> values)
874{
875 ALint ival;
876
877 switch(prop)
878 {
879 case AL_SEC_OFFSET_LATENCY_SOFT:
880 case AL_SEC_OFFSET_CLOCK_SOFT:
881 /* Query only */
882 SETERR_RETURN(Context, AL_INVALID_OPERATION, false,
883 "Setting read-only source property 0x%04x", prop);
884
885 case AL_PITCH:
886 CHECKSIZE(values, 1);
887 CHECKVAL(values[0] >= 0.0f);
888
889 Source->Pitch = values[0];
890 return UpdateSourceProps(Source, Context);
891
892 case AL_CONE_INNER_ANGLE:
893 CHECKSIZE(values, 1);
894 CHECKVAL(values[0] >= 0.0f && values[0] <= 360.0f);
895
896 Source->InnerAngle = values[0];
897 return UpdateSourceProps(Source, Context);
898
899 case AL_CONE_OUTER_ANGLE:
900 CHECKSIZE(values, 1);
901 CHECKVAL(values[0] >= 0.0f && values[0] <= 360.0f);
902
903 Source->OuterAngle = values[0];
904 return UpdateSourceProps(Source, Context);
905
906 case AL_GAIN:
907 CHECKSIZE(values, 1);
908 CHECKVAL(values[0] >= 0.0f);
909
910 Source->Gain = values[0];
911 return UpdateSourceProps(Source, Context);
912
913 case AL_MAX_DISTANCE:
914 CHECKSIZE(values, 1);
915 CHECKVAL(values[0] >= 0.0f);
916
917 Source->MaxDistance = values[0];
918 return UpdateSourceProps(Source, Context);
919
920 case AL_ROLLOFF_FACTOR:
921 CHECKSIZE(values, 1);
922 CHECKVAL(values[0] >= 0.0f);
923
924 Source->RolloffFactor = values[0];
925 return UpdateSourceProps(Source, Context);
926
927 case AL_REFERENCE_DISTANCE:
928 CHECKSIZE(values, 1);
929 CHECKVAL(values[0] >= 0.0f);
930

Callers 3

SetSourceivFunction · 0.85
SetSourcei64vFunction · 0.85
source.cppFile · 0.85

Calls 8

UpdateSourcePropsFunction · 0.85
IsPlayingOrPausedFunction · 0.85
GetSourceVoiceFunction · 0.85
GetSampleOffsetFunction · 0.85
SetSourceivFunction · 0.85
setErrorMethod · 0.80
getMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected