Implemented on GIT ChannelState return values

Paul59

New member
CX Code Contributor
Joined
Dec 13, 2018
Messages
375
Just an idea: should these values be defined as constants by CX eg PLAYING, STOPPED, PAUSED, UNKNOWN instead of having to define them (or use these magic numbers) in each program?

Function ChannelState : Int ( channel:Int )
Returns the state of the specified audio channel: 0 if the channel is currently stopped, 1 if the channel is currently playing, 2 if the channel is currently paused or -1 if the channel state cannot be determined.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,165
Any suggestions about naming these?

Maybe CS_PLAYING, CS_STOPPED, CS_PAUSED CS_UNKNOWN ?
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
912
What about AUDIO_PLAYING ,AUDIO_STOPPED, AUDIO_PAUSED, and AUDIO_UNKNOWN?
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
643
My preference is CHANNELSTATE_PLAYING, ...
It's verbose, but it helps readability and is not ambiguous.
Having the function name duplicated also helps if we have code completion at some point.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Messages
3,165
Implemented CHANNELSTATE_PLAYING, CHANNELSTATE_STOPPED, CHANNELSTATE_PAUSED, CHANNELSTATE_UNKNOWN
 
Top Bottom