| 306 | } |
| 307 | |
| 308 | int Port::getNumOutputs() { |
| 309 | if (!device) |
| 310 | return 0; |
| 311 | try { |
| 312 | return math::clamp(device->getNumOutputs() - outputOffset, 0, maxOutputs); |
| 313 | } |
| 314 | catch (Exception& e) { |
| 315 | WARN("Audio port could not get device number of outputs: %s", e.what()); |
| 316 | return 0; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | json_t* Port::toJson() { |
| 321 | json_t* rootJ = json_object(); |