[DEV] add open stream with his name

This commit is contained in:
Edouard DUPIN 2015-02-26 22:06:31 +01:00
parent ec75a59720
commit 7a75911770
2 changed files with 16 additions and 4 deletions

View File

@ -8,7 +8,8 @@
# interface : "alsa", "pulse", "core", ...
interface:"alsa",
# name of the interface
name:"default",
# name:"default",
name:"hw:0,0",
},
# frequency to open device
frequency:48000,
@ -26,7 +27,8 @@
io:"output",
map-on:{
interface:"alsa",
name:"default",
#name:"default",
name:"hw:0,0",
},
frequency:48000,
channel-map:[

View File

@ -133,15 +133,23 @@ river::io::NodeAirTAudio::NodeAirTAudio(const std::string& _name, const std11::s
}
}
}
// TODO : Check if the devace with the specific name exist ...
/*
if (deviceId == -1) {
RIVER_ERROR("Can not find the " << streamName << " audio interface ... (use O default ...)");
deviceId = 0;
}
*/
// Open specific ID :
m_info = m_adac.getDeviceInfo(deviceId);
if (deviceId == -1) {
m_info = m_adac.getDeviceInfo(streamName);
} else {
m_info = m_adac.getDeviceInfo(deviceId);
}
// display property :
{
RIVER_INFO("Device " << deviceId << " property :");
RIVER_INFO("Device " << deviceId << " - '" << streamName << "' property :");
m_info.display();
if (etk::isIn(hardwareFormat.getFormat(), m_info.nativeFormats) == false) {
@ -200,6 +208,8 @@ river::io::NodeAirTAudio::NodeAirTAudio(const std::string& _name, const std11::s
// open Audio device:
airtaudio::StreamParameters params;
params.deviceId = deviceId;
params.deviceName = streamName;
// TODO : Remove limit of 2 channels ...
if (m_isInput == true) {
m_info.inputChannels = 2;
params.nChannels = 2;