audio-river/audio/river/io/NodePortAudio.h

52 lines
1.3 KiB
C
Raw Normal View History

2015-04-11 09:38:30 +02:00
/** @file
* @author Edouard DUPIN
* @copyright 2015, Edouard DUPIN, all right reserved
* @license APACHE v2.0 (see license file)
*/
#pragma once
2015-04-11 09:38:30 +02:00
#ifdef AUDIO_RIVER_BUILD_PORTAUDIO
#include <audio/river/Interface.h>
#include <audio/river/io/Node.h>
2015-10-14 21:21:03 +02:00
#include <portaudio/portaudio.h>
2015-04-11 09:38:30 +02:00
namespace audio {
namespace river {
namespace io {
class Manager;
2016-04-20 21:19:11 +02:00
//! @not_in_doc
2015-04-11 09:38:30 +02:00
class NodePortAudio : public Node {
protected:
/**
* @brief Constructor
*/
2016-04-20 21:19:11 +02:00
NodePortAudio(const std::string& _name, const ejson::Object& _config);
2015-04-11 09:38:30 +02:00
public:
2016-07-19 21:43:58 +02:00
static ememory::SharedPtr<NodePortAudio> create(const std::string& _name, const ejson::Object& _config);
2015-04-11 09:38:30 +02:00
/**
* @brief Destructor
*/
virtual ~NodePortAudio();
virtual bool isHarwareNode() {
return true;
};
protected:
PaStream* m_stream;
public:
int32_t duplexCallback(const void* _inputBuffer,
2015-04-13 21:49:48 +02:00
const audio::Time& _timeInput,
2015-04-11 09:38:30 +02:00
void* _outputBuffer,
2015-04-13 21:49:48 +02:00
const audio::Time& _timeOutput,
2015-04-11 09:38:30 +02:00
uint32_t _nbChunk,
PaStreamCallbackFlags _status);
protected:
virtual void start();
virtual void stop();
};
}
}
}
#endif