VirtualBox

Changeset 73429 in vbox for trunk/src


Ignore:
Timestamp:
Aug 1, 2018 2:47:53 PM (6 years ago)
Author:
vboxsync
Message:

Audio/Common: Added DrvAudioHlpStreamStatusCanRead() and DrvAudioHlpStreamStatusCanWrite().

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r73423 r73429  
    220220/** @name Audio stream helper methods.
    221221 * @{ */
     222bool DrvAudioHlpStreamStatusCanRead(PDMAUDIOSTREAMSTS enmStatus);
     223bool DrvAudioHlpStreamStatusCanWrite(PDMAUDIOSTREAMSTS enmStatus);
    222224bool DrvAudioHlpStreamStatusIsReady(PDMAUDIOSTREAMSTS enmStatus);
    223225/** @}  */
  • trunk/src/VBox/Devices/Audio/DrvAudioCommon.cpp

    r73423 r73429  
    10331033
    10341034/**
    1035  * Returns @c true if the given stream status indicates a ready-to-operate stream,
     1035 * Returns @c true if the given stream status indicates a can-be-read-from stream,
    10361036 * @c false if not.
    10371037 *
    1038  * @returns @c true if ready to operate, @c if not.
     1038 * @returns @c true if ready to be read from, @c if not.
    10391039 * @param   enmStatus           Stream status to evaluate.
    10401040 */
    1041 bool DrvAudioHlpStreamStatusIsReady(PDMAUDIOSTREAMSTS enmStatus)
     1041bool DrvAudioHlpStreamStatusCanRead(PDMAUDIOSTREAMSTS enmStatus)
     1042{
     1043    AssertReturn(enmStatus & PDMAUDIOSTREAMSTS_VALID_MASK, false);
     1044
     1045    return      enmStatus & PDMAUDIOSTREAMSTS_FLAG_INITIALIZED
     1046           &&   enmStatus & PDMAUDIOSTREAMSTS_FLAG_ENABLED
     1047           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PAUSED)
     1048           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PENDING_REINIT);
     1049}
     1050
     1051/**
     1052 * Returns @c true if the given stream status indicates a can-be-written-to stream,
     1053 * @c false if not.
     1054 *
     1055 * @returns @c true if ready to be written to, @c if not.
     1056 * @param   enmStatus           Stream status to evaluate.
     1057 */
     1058bool DrvAudioHlpStreamStatusCanWrite(PDMAUDIOSTREAMSTS enmStatus)
    10421059{
    10431060    AssertReturn(enmStatus & PDMAUDIOSTREAMSTS_VALID_MASK, false);
     
    10471064           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PAUSED)
    10481065           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PENDING_DISABLE)
     1066           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PENDING_REINIT);
     1067}
     1068
     1069/**
     1070 * Returns @c true if the given stream status indicates a ready-to-operate stream,
     1071 * @c false if not.
     1072 *
     1073 * @returns @c true if ready to operate, @c if not.
     1074 * @param   enmStatus           Stream status to evaluate.
     1075 */
     1076bool DrvAudioHlpStreamStatusIsReady(PDMAUDIOSTREAMSTS enmStatus)
     1077{
     1078    AssertReturn(enmStatus & PDMAUDIOSTREAMSTS_VALID_MASK, false);
     1079
     1080    return      enmStatus & PDMAUDIOSTREAMSTS_FLAG_INITIALIZED
     1081           &&   enmStatus & PDMAUDIOSTREAMSTS_FLAG_ENABLED
    10491082           && !(enmStatus & PDMAUDIOSTREAMSTS_FLAG_PENDING_REINIT);
    10501083}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette