view src/portaudio_20140130/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 7ddb4fc30dac
children
line wrap: on
line source
#ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX
#define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX

// ---------------------------------------------------------------------------------------

#include <cstddef>

#include "portaudio.h"

#include "portaudiocpp/System.hxx"
#include "portaudiocpp/SampleDataFormat.hxx"

// ---------------------------------------------------------------------------------------

// Forward declaration(s):
namespace portaudio
{
	class Device;
}

// ---------------------------------------------------------------------------------------

// Declaration(s):
namespace portaudio
{

	//////
	/// @brief All parameters for one direction (either in or out) of a Stream. Together with 
	/// parameters common to both directions, two DirectionSpecificStreamParameters can make up 
	/// a StreamParameters object which contains all parameters for a Stream.
	//////
	class DirectionSpecificStreamParameters
	{
	public:
		static DirectionSpecificStreamParameters null();

		DirectionSpecificStreamParameters();
		DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format, 
			bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo);

		// Set up methods:
		void setDevice(const Device &device);
		void setNumChannels(int numChannels);

		void setSampleFormat(SampleDataFormat format, bool interleaved = true);
		void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);

		void setSuggestedLatency(PaTime latency);

		void setHostApiSpecificStreamInfo(void *streamInfo);

		// Accessor methods:
		PaStreamParameters *paStreamParameters();
		const PaStreamParameters *paStreamParameters() const;

		Device &device() const;
		int numChannels() const;

		SampleDataFormat sampleFormat() const;
		bool isSampleFormatInterleaved() const;
		bool isSampleFormatHostApiSpecific() const;
		PaSampleFormat hostApiSpecificSampleFormat() const;

		PaTime suggestedLatency() const;

		void *hostApiSpecificStreamInfo() const;
	
	private:
		PaStreamParameters paStreamParameters_;
	};


} // namespace portaudio

// ---------------------------------------------------------------------------------------

#endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX