3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
|
* Copyright (C) 2005 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
75 |
} |
} |
76 |
|
|
77 |
void AudioOutputDeviceJack::AudioChannelJack::ParameterJackBindings::OnSetValue(std::vector<String> vS) { |
void AudioOutputDeviceJack::AudioChannelJack::ParameterJackBindings::OnSetValue(std::vector<String> vS) { |
|
// TODO: we should remove all existing bindings before we connect new ones here |
|
78 |
String src_name = ((DeviceCreationParameterString*)pChannel->pDevice->Parameters["NAME"])->ValueAsString() + ":" + |
String src_name = ((DeviceCreationParameterString*)pChannel->pDevice->Parameters["NAME"])->ValueAsString() + ":" + |
79 |
((DeviceRuntimeParameterString*)pChannel->Parameters["NAME"])->ValueAsString(); |
((DeviceRuntimeParameterString*)pChannel->Parameters["NAME"])->ValueAsString(); |
80 |
|
// disconnect all current bindings first |
81 |
|
for (int i = 0; i < Bindings.size(); i++) { |
82 |
|
String dst_name = Bindings[i]; |
83 |
|
int res = jack_disconnect(pChannel->pDevice->hJackClient, src_name.c_str(), dst_name.c_str()); |
84 |
|
} |
85 |
|
// connect new bindings |
86 |
for (int i = 0; i < vS.size(); i++) { |
for (int i = 0; i < vS.size(); i++) { |
87 |
String dst_name = vS[i]; |
String dst_name = vS[i]; |
88 |
int res = jack_connect(pChannel->pDevice->hJackClient, src_name.c_str(), dst_name.c_str()); |
int res = jack_connect(pChannel->pDevice->hJackClient, src_name.c_str(), dst_name.c_str()); |
89 |
if (res == EEXIST) throw AudioOutputException("Jack: Connection to port '" + dst_name + "' already established"); |
if (res == EEXIST) throw AudioOutputException("Jack: Connection to port '" + dst_name + "' already established"); |
90 |
else if (res) throw AudioOutputException("Jack: Cannot connect port '" + src_name + "' to port '" + dst_name + "'"); |
else if (res) throw AudioOutputException("Jack: Cannot connect port '" + src_name + "' to port '" + dst_name + "'"); |
91 |
} |
} |
92 |
|
// remember bindings |
93 |
|
Bindings = vS; |
94 |
} |
} |
95 |
|
|
96 |
String AudioOutputDeviceJack::AudioChannelJack::ParameterJackBindings::Name() { |
String AudioOutputDeviceJack::AudioChannelJack::ParameterJackBindings::Name() { |
257 |
} |
} |
258 |
|
|
259 |
String AudioOutputDeviceJack::Version() { |
String AudioOutputDeviceJack::Version() { |
260 |
String s = "$Revision: 1.17 $"; |
String s = "$Revision: 1.18 $"; |
261 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
262 |
} |
} |
263 |
|
|