VirtualBox

Changeset 55005 in vbox for trunk/include


Ignore:
Timestamp:
Mar 30, 2015 12:07:39 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99276
Message:

PDM/Audio: Added volume through virtual mixer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r54491 r55005  
    3030#include <iprt/list.h>
    3131
     32#ifndef VBOX_WITH_PDM_AUDIO_DRIVER
    3233typedef struct
    3334{
     
    3637    uint32_t l;
    3738} volume_t;
     39#endif
    3840
    3941#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
     
    137139    PDMAUDIOMIXERCTL_PCM,
    138140    PDMAUDIOMIXERCTL_LINE_IN,
     141    PDMAUDIOMIXERCTL_MIC_IN,
    139142    /** Hack to blow the type up to 32-bit. */
    140143    PDMAUDIOMIXERCTL_32BIT_HACK = 0x7fffffff
     
    199202    bool        fSwapEndian;
    200203} PDMPCMPROPS, *PPDMPCMPROPS;
     204
     205/**
     206 * Structure keeping an audio volume level.
     207 */
     208typedef struct PDMAUDIOVOLUME
     209{
     210    /** Set to @c true if this stream is muted, @c false if not. */
     211    bool                   fMuted;
     212    /** Left channel volume. */
     213    uint32_t               uLeft;
     214    /** Right channel volume. */
     215    uint32_t               uRight;
     216} PDMAUDIOVOLUME, *PPDMAUDIOVOLUME;
    201217
    202218/**
     
    243259     *  in the samples buffer. */
    244260    uint32_t               offReadWrite;
    245     /** Total samples already mixed down to the
    246      *  parent buffer (if any). Always starting at
    247      *  the parent's offReadWrite position.
    248      *  Note: Count always is specified in parent samples,
    249      *        as the sample count can differ between parent
    250      *        and child. */
     261    /**
     262     * Total samples already mixed down to the parent buffer (if any). Always starting at
     263     * the parent's offReadWrite position.
     264     *
     265     * Note: Count always is specified in parent samples, as the sample count can differ between parent
     266     *       and child.
     267     */
    251268    uint32_t               cMixed;
    252269    uint32_t               cProcessed;
    253270    /** Pointer to parent buffer (if any). */
    254271    PPDMAUDIOMIXBUF        pParent;
    255     /** List of children mix buffers to keep
    256      *  in sync with (if being a parent buffer). */
     272    /** List of children mix buffers to keep in sync with (if being a parent buffer). */
    257273    RTLISTANCHOR           lstBuffers;
    258     /** Intermediate structure for buffer
    259      *  conversion tasks. */
     274    /** Intermediate structure for buffer conversion tasks. */
    260275    PPDMAUDIOSTRMRATE      pRate;
     276    /** Current volume used for mixing. */
     277    PDMAUDIOVOLUME         Volume;
    261278    /** This buffer's audio format. */
    262279    PDMAUDIOMIXBUFFMT      AudioFmt;
     
    335352    /** Guest audio output stream has some samples or not. */
    336353    bool                   fEmpty;
    337     /** Set to @c true if this stream is muted, @c false if not. */
    338     bool                   fMuted;
    339354    /** Name of this stream. */
    340355    char                  *pszName;
    341     /** Left channel volume. */
    342     uint32_t               uVolumeLeft;
    343     /** Right channel volume. */
    344     uint32_t               uVolumeRight;
    345356} PDMAUDIOGSTSTRMSTATE, *PPDMAUDIOGSTSTRMSTATE;
    346357
     
    443454     */
    444455    DECLR3CALLBACKMEMBER(int, pfnInitNull, (PPDMIAUDIOCONNECTOR pInterface));
    445 
    446     /**
    447      * Sets the audio volume of a specific guest output stream.
    448      *
    449      * @returns VBox status code.
    450      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    451      * @param   pGstStrmOut     Pointer to guest output stream.
    452      * @param   fMute           Whether to mute or not.
    453      * @param   uVolLeft        Left audio stream volume.
    454      * @param   uVolRight       Right audio stream volume.
    455      */
    456     DECLR3CALLBACKMEMBER(int, pfnSetVolumeOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
    457                                                 bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
    458 
    459     /**
    460      * Sets the overall audio volume.
    461      *
    462      * @returns VBox status code.
    463      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    464      * @param   fMute           Whether to mute or not.
    465      * @param   uVolLeft        Left audio stream volume.
    466      * @param   uVolRight       Right audio stream volume.
    467      */
    468     DECLR3CALLBACKMEMBER(int, pfnSetVolume, (PPDMIAUDIOCONNECTOR pInterface,
    469                                              bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
    470456
    471457    /**
Note: See TracChangeset for help on using the changeset viewer.

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