| 1473 | |
| 1474 | |
| 1475 | int RemoteVstPlugin::updateInOutCount() |
| 1476 | { |
| 1477 | if( inputCount() == RemotePluginClient::inputCount() && |
| 1478 | outputCount() == RemotePluginClient::outputCount() ) |
| 1479 | { |
| 1480 | return 1; |
| 1481 | } |
| 1482 | |
| 1483 | if( GetCurrentThreadId() == __processingThreadId ) |
| 1484 | { |
| 1485 | debugMessage( "Plugin requested I/O change from processing " |
| 1486 | "thread. Request denied; stability may suffer.\n" ); |
| 1487 | return 0; |
| 1488 | } |
| 1489 | |
| 1490 | lockShm(); |
| 1491 | |
| 1492 | setShmIsValid( false ); |
| 1493 | |
| 1494 | unlockShm(); |
| 1495 | |
| 1496 | delete[] m_inputs; |
| 1497 | delete[] m_outputs; |
| 1498 | |
| 1499 | m_inputs = NULL; |
| 1500 | m_outputs = NULL; |
| 1501 | |
| 1502 | setInputOutputCount( inputCount(), outputCount() ); |
| 1503 | |
| 1504 | char buf[64]; |
| 1505 | sprintf( buf, "inputs: %d output: %d\n", inputCount(), outputCount() ); |
| 1506 | debugMessage( buf ); |
| 1507 | |
| 1508 | if( inputCount() > 0 ) |
| 1509 | { |
| 1510 | m_inputs = new float * [inputCount()]; |
| 1511 | } |
| 1512 | |
| 1513 | if( outputCount() > 0 ) |
| 1514 | { |
| 1515 | m_outputs = new float * [outputCount()]; |
| 1516 | } |
| 1517 | |
| 1518 | return 1; |
| 1519 | } |
| 1520 | |
| 1521 | |
| 1522 | |