225 | | |
---|
226 | | Device::EAP::Mixer m = Device::EAP::Mixer(eap); |
---|
227 | | m.init(); |
---|
228 | | m.show(); |
---|
| 235 | eap.lockControl(); |
---|
| 236 | Control::Element *e = eap.getElementByName("MatrixMixer"); |
---|
| 237 | if(e == NULL) { |
---|
| 238 | printMessage("Could not get MatrixMixer control element\n"); |
---|
| 239 | } else { |
---|
| 240 | Control::MatrixMixer *m = dynamic_cast<Control::MatrixMixer *>(e); |
---|
| 241 | if(m == NULL) { |
---|
| 242 | printMessage("Element is not a MatrixMixer control element\n"); |
---|
| 243 | } else { |
---|
| 244 | for(int row=0; row < 16; row++) { |
---|
| 245 | for(int col=0; col < 18; col++) { |
---|
| 246 | // m->setValue(row, col, 0); |
---|
| 247 | } |
---|
| 248 | } |
---|
| 249 | } |
---|
| 250 | } |
---|
| 251 | // after unlocking, these should not be used anymore |
---|
| 252 | e = NULL; |
---|
| 253 | eap.unlockControl(); |
---|
| 254 | |
---|
| 255 | int cnt = 0; |
---|
| 256 | |
---|
| 257 | while(run) { |
---|
| 258 | eap.lockControl(); |
---|
| 259 | Control::Element *e = eap.getElementByName("Router"); |
---|
| 260 | if(e == NULL) { |
---|
| 261 | printMessage("Could not get CrossbarRouter control element\n"); |
---|
| 262 | } else { |
---|
| 263 | Control::CrossbarRouter *c = dynamic_cast<Control::CrossbarRouter *>(e); |
---|
| 264 | if(c == NULL) { |
---|
| 265 | printMessage("Element is not a CrossbarRouter control element\n"); |
---|
| 266 | } else { |
---|
| 267 | // if(cnt == 0) { |
---|
| 268 | // Control::CrossbarRouter::NameVector n; |
---|
| 269 | // n = c->getSourceNames(); |
---|
| 270 | // for(int i=0; i<n.size(); i++) { |
---|
| 271 | // printMessage("Src %02d: %s\n", i, n.at(i).c_str()); |
---|
| 272 | // } |
---|
| 273 | // n = c->getDestinationNames(); |
---|
| 274 | // for(int i=0; i<n.size(); i++) { |
---|
| 275 | // printMessage("Dest %02d: %s\n", i, n.at(i).c_str()); |
---|
| 276 | // } |
---|
| 277 | // } |
---|
| 278 | #define NELEMS 10 |
---|
| 279 | double peaks[NELEMS]; |
---|
| 280 | int srcids[NELEMS]; |
---|
| 281 | int dstidx = c->getDestinationIndex("MixerIn:00"); |
---|
| 282 | for(int i=0; i<NELEMS; i++) { |
---|
| 283 | srcids[i] = c->getSourceForDestination(dstidx + i); |
---|
| 284 | peaks[i] = c->getPeakValue(srcids[i], dstidx + i); |
---|
| 285 | } |
---|
| 286 | for(int i=0; i<NELEMS; i++) { |
---|
| 287 | std::string srcname = c->getSourceName(srcids[i]); |
---|
| 288 | std::string dstname = c->getDestinationName(dstidx + i); |
---|
| 289 | printMessage("Peak %3d (%10s => %10s): %f\n", i, srcname.c_str(), dstname.c_str(), peaks[i]); |
---|
| 290 | } |
---|
| 291 | } |
---|
| 292 | } |
---|
| 293 | // after unlocking, these should not be used anymore |
---|
| 294 | e = NULL; |
---|
| 295 | eap.unlockControl(); |
---|
| 296 | sleep(1); |
---|
| 297 | } |
---|