AudioMixer.h revision 40c2e9b6b038e0cb63afd10932a8561418d1d6a7
/* $Id$ */
/** @file
* VBox audio: Mixing routines, mainly used by the various audio device
* devices LUNs.
*/
/*
* Copyright (C) 2014-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef AUDIO_MIXER_H
#define AUDIO_MIXER_H
typedef struct AUDIOMIXER
{
/** Mixer name. */
char *pszName;
* data to so that the underlying device emulation
* can work with it. */
/** The master volume of this mixer. */
/* List of audio mixer sinks. */
/** Number of used audio sinks. */
} AUDIOMIXER, *PAUDIOMIXER;
typedef struct AUDMIXSTREAM
{
union
{
};
typedef enum AUDMIXSINKDIR
{
/** The usual 32-bit hack. */
AUDMIXSINKDIR_32BIT_HACK = 0x7fffffff
typedef struct AUDMIXSINK
{
/** Name of this sink. */
char *pszName;
/** The sink direction, that is,
* if this sink handles input or output. */
/** Pointer to mixer object this sink is bound
* to. */
/** Number of streams assigned. */
/** List of assigned streams. */
/** This sink's mixing buffer. */
/** The volume of this sink. The volume always will
* be combined with the mixer's master volume. */
} AUDMIXSINK, *PAUDMIXSINK;
typedef enum AUDMIXOP
{
AUDMIXOP_NONE = 0,
/** The usual 32-bit hack. */
AUDMIXOP_32BIT_HACK = 0x7fffffff
} AUDMIXOP;
int audioMixerAddSink(PAUDIOMIXER pMixer, const char *pszName, AUDMIXSINKDIR enmDir, PAUDMIXSINK *ppSink);
int audioMixerAddStreamIn(PAUDMIXSINK pSink, PPDMIAUDIOCONNECTOR pConnector, PPDMAUDIOGSTSTRMIN pStream, uint32_t uFlags, PAUDMIXSTREAM *ppStream);
int audioMixerAddStreamOut(PAUDMIXSINK pSink, PPDMIAUDIOCONNECTOR pConnector, PPDMAUDIOGSTSTRMOUT pStream, uint32_t uFlags, PAUDMIXSTREAM *ppStream);
int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);
int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);
#endif /* AUDIO_MIXER_H */