openshot-audio  0.1.7
Public Member Functions | Public Attributes | List of all members
WasapiClasses::WASAPIAudioIODevice Class Reference
Inheritance diagram for WasapiClasses::WASAPIAudioIODevice:
AudioIODevice Thread AsyncUpdater

Public Member Functions

 WASAPIAudioIODevice (const String &deviceName, const String &typeName, const String &outputDeviceID, const String &inputDeviceID, const bool exclusiveMode)
 
 ~WASAPIAudioIODevice ()
 
bool initialise ()
 
StringArray getOutputChannelNames () override
 
StringArray getInputChannelNames () override
 
Array< double > getAvailableSampleRates () override
 
Array< int > getAvailableBufferSizes () override
 
int getDefaultBufferSize () override
 
int getCurrentBufferSizeSamples () override
 
double getCurrentSampleRate () override
 
int getCurrentBitDepth () override
 
int getOutputLatencyInSamples () override
 
int getInputLatencyInSamples () override
 
BigInteger getActiveOutputChannels () const override
 
BigInteger getActiveInputChannels () const override
 
String getLastError () override
 
String open (const BigInteger &inputChannels, const BigInteger &outputChannels, double sampleRate, int bufferSizeSamples) override
 
void close () override
 
bool isOpen () override
 
bool isPlaying () override
 
void start (AudioIODeviceCallback *call) override
 
void stop () override
 
void setMMThreadPriority ()
 
void run () override
 
- Public Member Functions inherited from AudioIODevice
virtual ~AudioIODevice ()
 
const StringgetName () const noexcept
 
const StringgetTypeName () const noexcept
 
virtual bool hasControlPanel () const
 
virtual bool showControlPanel ()
 
virtual bool setAudioPreprocessingEnabled (bool shouldBeEnabled)
 
- Public Member Functions inherited from Thread
 Thread (const String &threadName)
 
virtual ~Thread ()
 
void startThread ()
 
void startThread (int priority)
 
bool stopThread (int timeOutMilliseconds)
 
bool isThreadRunning () const
 
void signalThreadShouldExit ()
 
bool threadShouldExit () const
 
bool waitForThreadToExit (int timeOutMilliseconds) const
 
bool setPriority (int priority)
 
void setAffinityMask (uint32 affinityMask)
 
bool wait (int timeOutMilliseconds) const
 
void notify () const
 
ThreadID getThreadId () const noexcept
 
const StringgetThreadName () const
 

Public Attributes

String outputDeviceId
 
String inputDeviceId
 
String lastError
 

Additional Inherited Members

- Public Types inherited from Thread
typedef void * ThreadID
 
- Static Public Member Functions inherited from Thread
static bool setCurrentThreadPriority (int priority)
 
static void JUCE_CALLTYPE setCurrentThreadAffinityMask (uint32 affinityMask)
 
static void JUCE_CALLTYPE sleep (int milliseconds)
 
static void JUCE_CALLTYPE yield ()
 
static ThreadID JUCE_CALLTYPE getCurrentThreadId ()
 
static Thread *JUCE_CALLTYPE getCurrentThread ()
 
static void JUCE_CALLTYPE setCurrentThreadName (const String &newThreadName)
 
- Protected Member Functions inherited from AudioIODevice
 AudioIODevice (const String &deviceName, const String &typeName)
 
- Protected Attributes inherited from AudioIODevice
String name
 
String typeName
 

Constructor & Destructor Documentation

◆ WASAPIAudioIODevice()

WasapiClasses::WASAPIAudioIODevice::WASAPIAudioIODevice ( const String deviceName,
const String typeName,
const String outputDeviceID,
const String inputDeviceID,
const bool  exclusiveMode 
)
inline

◆ ~WASAPIAudioIODevice()

WasapiClasses::WASAPIAudioIODevice::~WASAPIAudioIODevice ( )
inline

Member Function Documentation

◆ close()

void WasapiClasses::WASAPIAudioIODevice::close ( )
inlineoverridevirtual

Closes and releases the device if it's open.

Implements AudioIODevice.

◆ getActiveInputChannels()

BigInteger WasapiClasses::WASAPIAudioIODevice::getActiveInputChannels ( ) const
inlineoverridevirtual

Returns a mask showing which of the available input channels are currently enabled.

See also
getInputChannelNames

Implements AudioIODevice.

◆ getActiveOutputChannels()

BigInteger WasapiClasses::WASAPIAudioIODevice::getActiveOutputChannels ( ) const
inlineoverridevirtual

Returns a mask showing which of the available output channels are currently enabled.

See also
getOutputChannelNames

Implements AudioIODevice.

◆ getAvailableBufferSizes()

Array<int> WasapiClasses::WASAPIAudioIODevice::getAvailableBufferSizes ( )
inlineoverridevirtual

Returns the set of buffer sizes that are available.

See also
getCurrentBufferSizeSamples, getDefaultBufferSize

Implements AudioIODevice.

◆ getAvailableSampleRates()

Array<double> WasapiClasses::WASAPIAudioIODevice::getAvailableSampleRates ( )
inlineoverridevirtual

Returns the set of sample-rates this device supports.

See also
getCurrentSampleRate

Implements AudioIODevice.

◆ getCurrentBitDepth()

int WasapiClasses::WASAPIAudioIODevice::getCurrentBitDepth ( )
inlineoverridevirtual

Returns the device's current physical bit-depth.

If the device isn't actually open, this value doesn't really mean much.

Implements AudioIODevice.

◆ getCurrentBufferSizeSamples()

int WasapiClasses::WASAPIAudioIODevice::getCurrentBufferSizeSamples ( )
inlineoverridevirtual

Returns the buffer size that the device is currently using.

If the device isn't actually open, this value doesn't really mean much.

Implements AudioIODevice.

◆ getCurrentSampleRate()

double WasapiClasses::WASAPIAudioIODevice::getCurrentSampleRate ( )
inlineoverridevirtual

Returns the sample rate that the device is currently using.

If the device isn't actually open, this value doesn't really mean much.

Implements AudioIODevice.

◆ getDefaultBufferSize()

int WasapiClasses::WASAPIAudioIODevice::getDefaultBufferSize ( )
inlineoverridevirtual

Returns the default buffer-size to use.

Returns
a number of samples
See also
getAvailableBufferSizes

Implements AudioIODevice.

◆ getInputChannelNames()

StringArray WasapiClasses::WASAPIAudioIODevice::getInputChannelNames ( )
inlineoverridevirtual

Returns the names of all the available input channels on this device. To find out which of these are currently in use, call getActiveInputChannels().

Implements AudioIODevice.

◆ getInputLatencyInSamples()

int WasapiClasses::WASAPIAudioIODevice::getInputLatencyInSamples ( )
inlineoverridevirtual

Returns the device's input latency.

This is the delay in samples between some audio actually arriving at the soundcard, and the callback getting passed this block of data.

Implements AudioIODevice.

◆ getLastError()

String WasapiClasses::WASAPIAudioIODevice::getLastError ( )
inlineoverridevirtual

Returns the last error that happened if anything went wrong.

Implements AudioIODevice.

◆ getOutputChannelNames()

StringArray WasapiClasses::WASAPIAudioIODevice::getOutputChannelNames ( )
inlineoverridevirtual

Returns the names of all the available output channels on this device. To find out which of these are currently in use, call getActiveOutputChannels().

Implements AudioIODevice.

◆ getOutputLatencyInSamples()

int WasapiClasses::WASAPIAudioIODevice::getOutputLatencyInSamples ( )
inlineoverridevirtual

Returns the device's output latency.

This is the delay in samples between a callback getting a block of data, and that data actually getting played.

Implements AudioIODevice.

◆ initialise()

bool WasapiClasses::WASAPIAudioIODevice::initialise ( )
inline

◆ isOpen()

bool WasapiClasses::WASAPIAudioIODevice::isOpen ( )
inlineoverridevirtual

Returns true if the device is still open.

A device might spontaneously close itself if something goes wrong, so this checks if it's still open.

Implements AudioIODevice.

◆ isPlaying()

bool WasapiClasses::WASAPIAudioIODevice::isPlaying ( )
inlineoverridevirtual

Returns true if the device is still calling back.

The device might mysteriously stop, so this checks whether it's still playing.

Implements AudioIODevice.

◆ open()

String WasapiClasses::WASAPIAudioIODevice::open ( const BigInteger inputChannels,
const BigInteger outputChannels,
double  sampleRate,
int  bufferSizeSamples 
)
inlineoverridevirtual

Tries to open the device ready to play.

Parameters
inputChannelsa BigInteger in which a set bit indicates that the corresponding input channel should be enabled
outputChannelsa BigInteger in which a set bit indicates that the corresponding output channel should be enabled
sampleRatethe sample rate to try to use - to find out which rates are available, see getAvailableSampleRates()
bufferSizeSamplesthe size of i/o buffer to use - to find out the available buffer sizes, see getAvailableBufferSizes()
Returns
an error description if there's a problem, or an empty string if it succeeds in opening the device
See also
close

Implements AudioIODevice.

◆ run()

void WasapiClasses::WASAPIAudioIODevice::run ( )
inlineoverridevirtual

Must be implemented to perform the thread's actual code.

Remember that the thread must regularly check the threadShouldExit() method whilst running, and if this returns true it should return from the run() method as soon as possible to avoid being forcibly killed.

See also
threadShouldExit, startThread

Implements Thread.

◆ setMMThreadPriority()

void WasapiClasses::WASAPIAudioIODevice::setMMThreadPriority ( )
inline

◆ start()

void WasapiClasses::WASAPIAudioIODevice::start ( AudioIODeviceCallback callback)
inlineoverridevirtual

Starts the device actually playing.

This must be called after the device has been opened.

Parameters
callbackthe callback to use for streaming the data.
See also
AudioIODeviceCallback, open

Implements AudioIODevice.

◆ stop()

void WasapiClasses::WASAPIAudioIODevice::stop ( )
inlineoverridevirtual

Stops the device playing.

Once a device has been started, this will stop it. Any pending calls to the callback class will be flushed before this method returns.

Implements AudioIODevice.

Member Data Documentation

◆ inputDeviceId

String WasapiClasses::WASAPIAudioIODevice::inputDeviceId

◆ lastError

String WasapiClasses::WASAPIAudioIODevice::lastError

◆ outputDeviceId

String WasapiClasses::WASAPIAudioIODevice::outputDeviceId

The documentation for this class was generated from the following file: