Files
pilotclient/src/blackcore/audio_mixer.h
Roland Winklmeier 8812f3ba28 refs #372 Add audio mixer interface and vatlib implementation
This class is an audio router. In order to route audio connect a
producer to an input port and a consumer to an output port. The
connection is later established by making the mixer connection
between an input and an output port.
2015-03-20 16:32:19 +01:00

62 lines
1.7 KiB
C++

/* Copyright (C) 2014
* swift project community / contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#ifndef BLACKCORE_AUDIOMIXER_H
#define BLACKCORE_AUDIOMIXER_H
#include <QObject>
namespace BlackCore
{
//! Interface to an audio mixer
class IAudioMixer : public QObject
{
Q_OBJECT
public:
//! Audio mixer input ports
enum InputPort
{
InputMicrophone,
InputVoiceChannel1,
InputVoiceChannel2,
};
//! Audio mixer output ports
enum OutputPort
{
OutputOutputDevice1,
OutputVoiceChannel1,
OutputVoiceChannel2,
};
/*!
* \brief Default constructor with parent
* \param parent
*/
IAudioMixer(QObject *parent = nullptr);
//! Virtual destructor.
virtual ~IAudioMixer() {}
//! Connect mixer input to a mixer output. This causes audio to be routed from the input to output
virtual void makeMixerConnection(InputPort inputPort, OutputPort outputPort) = 0;
//! Remove the mixer connection from input to output
virtual void removeMixerConnection(InputPort inputPort, OutputPort outputPort) = 0;
//! Returns true if input port and output port are connected
virtual bool hasMixerConnection(InputPort inputPort, OutputPort outputPort) = 0;
};
} // namespace BlackCore
#endif // guard