[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", "pulse", "core", ...
interface:"alsa", interface:"alsa",
# name of the interface # name of the interface
name:"default", # name:"default",
name:"hw:0,0",
}, },
# frequency to open device # frequency to open device
frequency:48000, frequency:48000,
@ -26,7 +27,8 @@
io:"output", io:"output",
map-on:{ map-on:{
interface:"alsa", interface:"alsa",
name:"default", #name:"default",
name:"hw:0,0",
}, },
frequency:48000, frequency:48000,
channel-map:[ 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) { if (deviceId == -1) {
RIVER_ERROR("Can not find the " << streamName << " audio interface ... (use O default ...)"); RIVER_ERROR("Can not find the " << streamName << " audio interface ... (use O default ...)");
deviceId = 0; deviceId = 0;
} }
*/
// Open specific ID : // 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 : // display property :
{ {
RIVER_INFO("Device " << deviceId << " property :"); RIVER_INFO("Device " << deviceId << " - '" << streamName << "' property :");
m_info.display(); m_info.display();
if (etk::isIn(hardwareFormat.getFormat(), m_info.nativeFormats) == false) { 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: // open Audio device:
airtaudio::StreamParameters params; airtaudio::StreamParameters params;
params.deviceId = deviceId; params.deviceId = deviceId;
params.deviceName = streamName;
// TODO : Remove limit of 2 channels ...
if (m_isInput == true) { if (m_isInput == true) {
m_info.inputChannels = 2; m_info.inputChannels = 2;
params.nChannels = 2; params.nChannels = 2;