[BUILD] update new lutin 0.5.3

This commit is contained in:
Edouard DUPIN 2015-05-08 22:36:02 +02:00
parent 4ba07ac087
commit f2f57d4081
7 changed files with 32 additions and 58 deletions

View File

@ -9,20 +9,12 @@
#include <audio/river/io/NodePortAudio.h> #include <audio/river/io/NodePortAudio.h>
#include <audio/river/debug.h> #include <audio/river/debug.h>
#include <etk/memory.h> #include <etk/memory.h>
#include <audio/Time.h>
#include <audio/Duration.h>
#undef __class__ #undef __class__
#define __class__ "io::NodePortAudio" #define __class__ "io::NodePortAudio"
static std::string asString(const audio::Time& tp) {
// convert to system time:
std::time_t t = std11::chrono::system_clock::to_time_t(tp);
// convert in human string
std::string ts = std::ctime(&t);
// remove \n
ts.resize(ts.size()-1);
return ts;
}
static int portAudioStreamCallback(const void *_input, static int portAudioStreamCallback(const void *_input,
void *_output, void *_output,
unsigned long _frameCount, unsigned long _frameCount,
@ -32,10 +24,10 @@ static int portAudioStreamCallback(const void *_input,
audio::river::io::NodePortAudio* myClass = reinterpret_cast<audio::river::io::NodePortAudio*>(_userData); audio::river::io::NodePortAudio* myClass = reinterpret_cast<audio::river::io::NodePortAudio*>(_userData);
int64_t sec = int64_t(_timeInfo->inputBufferAdcTime); int64_t sec = int64_t(_timeInfo->inputBufferAdcTime);
int64_t nsec = (_timeInfo->inputBufferAdcTime-double(sec))*1000000000LL; int64_t nsec = (_timeInfo->inputBufferAdcTime-double(sec))*1000000000LL;
audio::Time timeInput = std11::chrono::system_clock::from_time_t(sec) + audio::Duration(nsec); audio::Time timeInput(sec, nsec);
sec = int64_t(_timeInfo->outputBufferDacTime); sec = int64_t(_timeInfo->outputBufferDacTime);
nsec = (_timeInfo->outputBufferDacTime-double(sec))*1000000000LL; nsec = (_timeInfo->outputBufferDacTime-double(sec))*1000000000LL;
audio::Time timeOutput = std11::chrono::system_clock::from_time_t(sec) + audio::Duration(nsec); audio::Time timeOutput(sec, nsec);
return myClass->duplexCallback(_input, return myClass->duplexCallback(_input,
timeInput, timeInput,
_output, _output,

View File

@ -1,7 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule as module import lutin.module as module
import lutinTools as tools import lutin.tools as tools
import lutinDebug as debug
def get_desc(): def get_desc():
return "audio_river : Multi-nodal audio interface" return "audio_river : Multi-nodal audio interface"
@ -23,8 +22,8 @@ def create(target):
'audio/river/io/NodeMuxer.cpp', 'audio/river/io/NodeMuxer.cpp',
'audio/river/io/Manager.cpp' 'audio/river/io/Manager.cpp'
]) ])
myModule.add_optionnal_module_depend('audio_orchestra', "AUDIO_RIVER_BUILD_ORCHESTRA") myModule.add_optionnal_module_depend('audio_orchestra', ["c++", "-DAUDIO_RIVER_BUILD_ORCHESTRA"])
myModule.add_optionnal_module_depend('portaudio', "AUDIO_RIVER_BUILD_PORTAUDIO") myModule.add_optionnal_module_depend('portaudio', ["c++", "-DAUDIO_RIVER_BUILD_PORTAUDIO"])
myModule.add_module_depend(['audio', 'audio_drain', 'ejson']) myModule.add_module_depend(['audio', 'audio_drain', 'ejson'])
myModule.add_export_path(tools.get_current_path(__file__)) myModule.add_export_path(tools.get_current_path(__file__))

View File

@ -1,7 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule as module import lutin.module as module
import lutinTools as tools import lutin.tools as tools
import lutinDebug as debug
def get_desc(): def get_desc():
return "river_test : Multi-nodal audio interface test" return "river_test : Multi-nodal audio interface test"
@ -9,21 +8,11 @@ def get_desc():
def create(target): def create(target):
myModule = module.Module(__file__, 'audio_river_test', 'BINARY') myModule = module.Module(__file__, 'audio_river_test', 'BINARY')
myModule.add_src_file([ myModule.add_src_file([
'test/main.cpp', 'test/main.cpp',
'test/debug.cpp' 'test/debug.cpp'
]) ])
myModule.add_module_depend(['audio_river', 'gtest', 'etk']) myModule.add_module_depend(['audio_river', 'gtest', 'etk'])
return myModule return myModule

View File

@ -1,7 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule as module import lutin.module as module
import lutinTools as tools import lutin.tools as tools
import lutinDebug as debug
def get_desc(): def get_desc():
return "river_sample_read : Read some data" return "river_sample_read : Read some data"
@ -9,12 +8,10 @@ def get_desc():
def create(target): def create(target):
myModule = module.Module(__file__, 'river_sample_read', 'BINARY') myModule = module.Module(__file__, 'river_sample_read', 'BINARY')
myModule.add_src_file([ myModule.add_src_file([
'main.cpp', 'main.cpp',
]) ])
myModule.add_module_depend(['river', 'etk']) myModule.add_module_depend(['audio_river', 'etk'])
return myModule return myModule

View File

@ -4,9 +4,9 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#include <river/river.h> #include <audio/river/river.h>
#include <river/Manager.h> #include <audio/river/Manager.h>
#include <river/Interface.h> #include <audio/river/Interface.h>
#include <etk/etk.h> #include <etk/etk.h>
#include <unistd.h> #include <unistd.h>
@ -27,7 +27,7 @@ static const std::string configurationRiver =
"}\n"; "}\n";
void onDataReceived(const void* _data, void onDataReceived(const void* _data,
const std11::chrono::system_clock::time_point& _time, const audio::Time& _time,
size_t _nbChunk, size_t _nbChunk,
enum audio::format _format, enum audio::format _format,
uint32_t _frequency, uint32_t _frequency,
@ -44,7 +44,7 @@ void onDataReceived(const void* _data,
std::cout << "Get data ... average=" << int32_t(value) << std::endl; std::cout << "Get data ... average=" << int32_t(value) << std::endl;
} }
int main(int _argc, char **_argv) { int main(int _argc, const char **_argv) {
// the only one init for etk: // the only one init for etk:
etk::init(_argc, _argv); etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) { for (int32_t iii=0; iii<_argc ; ++iii) {
@ -57,11 +57,11 @@ int main(int _argc, char **_argv) {
} }
} }
// initialize river interface // initialize river interface
river::initString(configurationRiver); audio::river::initString(configurationRiver);
// Create the River manager for tha application or part of the application. // Create the River manager for tha application or part of the application.
std11::shared_ptr<river::Manager> manager = river::Manager::create("river_sample_read"); std11::shared_ptr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
// create interface: // create interface:
std11::shared_ptr<river::Interface> interface; std11::shared_ptr<audio::river::Interface> interface;
//Get the generic input: //Get the generic input:
interface = manager->createInput(48000, interface = manager->createInput(48000,
std::vector<audio::channel>(), std::vector<audio::channel>(),

View File

@ -1,7 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule as module import lutin.module as module
import lutinTools as tools import lutin.tools as tools
import lutinDebug as debug
def get_desc(): def get_desc():
return "river_sample_write : Write some data" return "river_sample_write : Write some data"
@ -9,12 +8,10 @@ def get_desc():
def create(target): def create(target):
myModule = module.Module(__file__, 'river_sample_write', 'BINARY') myModule = module.Module(__file__, 'river_sample_write', 'BINARY')
myModule.add_src_file([ myModule.add_src_file([
'main.cpp', 'main.cpp',
]) ])
myModule.add_module_depend(['river', 'etk']) myModule.add_module_depend(['audio_river', 'etk'])
return myModule return myModule

View File

@ -4,9 +4,9 @@
* @license APACHE v2.0 (see license file) * @license APACHE v2.0 (see license file)
*/ */
#include <river/river.h> #include <audio/river/river.h>
#include <river/Manager.h> #include <audio/river/Manager.h>
#include <river/Interface.h> #include <audio/river/Interface.h>
#include <etk/etk.h> #include <etk/etk.h>
#include <unistd.h> #include <unistd.h>
@ -28,7 +28,7 @@ static const std::string configurationRiver =
"}\n"; "}\n";
void onDataNeeded(void* _data, void onDataNeeded(void* _data,
const std11::chrono::system_clock::time_point& _time, const audio::Time& _time,
size_t _nbChunk, size_t _nbChunk,
enum audio::format _format, enum audio::format _format,
uint32_t _frequency, uint32_t _frequency,
@ -50,7 +50,7 @@ void onDataNeeded(void* _data,
} }
} }
int main(int _argc, char **_argv) { int main(int _argc, const char **_argv) {
// the only one init for etk: // the only one init for etk:
etk::init(_argc, _argv); etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) { for (int32_t iii=0; iii<_argc ; ++iii) {
@ -63,11 +63,11 @@ int main(int _argc, char **_argv) {
} }
} }
// initialize river interface // initialize river interface
river::initString(configurationRiver); audio::river::initString(configurationRiver);
// Create the River manager for tha application or part of the application. // Create the River manager for tha application or part of the application.
std11::shared_ptr<river::Manager> manager = river::Manager::create("river_sample_read"); std11::shared_ptr<audio::river::Manager> manager = audio::river::Manager::create("river_sample_read");
// create interface: // create interface:
std11::shared_ptr<river::Interface> interface; std11::shared_ptr<audio::river::Interface> interface;
//Get the generic input: //Get the generic input:
interface = manager->createOutput(48000, interface = manager->createOutput(48000,
std::vector<audio::channel>(), std::vector<audio::channel>(),