Search in sources :

Example 1 with RealtimeRenderServiceFactory

use of blue.services.render.RealtimeRenderServiceFactory in project blue by kunstmusik.

the class RealtimeRenderSettings method findRealtimeRenderServiceFactory.

private static RealtimeRenderServiceFactory findRealtimeRenderServiceFactory(String renderServiceName) {
    RealtimeRenderServiceFactory[] services = getAvailableRealtimeRenderServices();
    RealtimeRenderServiceFactory foundService = null;
    if (renderServiceName == null || renderServiceName.isEmpty()) {
        foundService = services[0];
    } else {
        for (RealtimeRenderServiceFactory service : services) {
            if (service.toString().equals(renderServiceName)) {
                foundService = service;
                break;
            }
        }
        if (foundService == null) {
            foundService = services[0];
        }
    }
    return foundService;
}
Also used : RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory)

Example 2 with RealtimeRenderServiceFactory

use of blue.services.render.RealtimeRenderServiceFactory in project blue by kunstmusik.

the class RealtimeRenderSettings method getAvailableRealtimeRenderServices.

public static RealtimeRenderServiceFactory[] getAvailableRealtimeRenderServices() {
    Collection<? extends RealtimeRenderServiceFactory> services = Lookup.getDefault().lookupAll(RealtimeRenderServiceFactory.class);
    ArrayList<RealtimeRenderServiceFactory> results = new ArrayList<>();
    for (RealtimeRenderServiceFactory factory : services) {
        if (factory.isAvailable()) {
            results.add(factory);
        }
    }
    return results.toArray(new RealtimeRenderServiceFactory[0]);
}
Also used : ArrayList(java.util.ArrayList) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory)

Example 3 with RealtimeRenderServiceFactory

use of blue.services.render.RealtimeRenderServiceFactory in project blue by kunstmusik.

the class RealtimeRenderSettingsPanel method midiOutButtonActionPerformed.

// GEN-LAST:event_midiInButtonActionPerformed
private void midiOutButtonActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_midiOutButtonActionPerformed
    String driver = null;
    if (midiDriverCBox.isSelected()) {
        driver = (String) midiDriverCombo.getSelectedItem();
    }
    String command = csoundExecText.getText();
    RealtimeRenderServiceFactory factory = (RealtimeRenderServiceFactory) renderServiceComboBox.getSelectedItem();
    DiskRenderService service = factory.createDiskRenderService();
    List<DeviceInfo> vals = DriverUtilities.getMidiDevices(command, driver, service, false);
    Object val = chooseDriver(vals);
    if (val != null) {
        DeviceInfo info = (DeviceInfo) val;
        midiOutText.setText(info.getDeviceId());
        fireUpdate();
    }
}
Also used : DeviceInfo(blue.services.render.DeviceInfo) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory) DiskRenderService(blue.services.render.DiskRenderService)

Example 4 with RealtimeRenderServiceFactory

use of blue.services.render.RealtimeRenderServiceFactory in project blue by kunstmusik.

the class RealtimeRenderSettingsPanel method audioInButtonActionPerformed.

// GEN-LAST:event_audioOutButtonActionPerformed
private void audioInButtonActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_audioInButtonActionPerformed
    String driver = null;
    if (audioDriverCBox.isSelected()) {
        driver = (String) audioDriverCombo.getSelectedItem();
    }
    String command = csoundExecText.getText();
    RealtimeRenderServiceFactory factory = (RealtimeRenderServiceFactory) renderServiceComboBox.getSelectedItem();
    DiskRenderService service = factory.createDiskRenderService();
    List<DeviceInfo> vals = DriverUtilities.getAudioDevices(command, driver, service, true);
    Object val = chooseDriver(vals);
    if (val != null) {
        DeviceInfo info = (DeviceInfo) val;
        audioInText.setText(info.getDeviceId());
        fireUpdate();
    }
}
Also used : DeviceInfo(blue.services.render.DeviceInfo) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory) DiskRenderService(blue.services.render.DiskRenderService)

Example 5 with RealtimeRenderServiceFactory

use of blue.services.render.RealtimeRenderServiceFactory in project blue by kunstmusik.

the class RealtimeRenderSettingsPanel method midiInButtonActionPerformed.

// GEN-LAST:event_audioInButtonActionPerformed
private void midiInButtonActionPerformed(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_midiInButtonActionPerformed
    String driver = null;
    if (midiDriverCBox.isSelected()) {
        driver = (String) midiDriverCombo.getSelectedItem();
    }
    String command = csoundExecText.getText();
    RealtimeRenderServiceFactory factory = (RealtimeRenderServiceFactory) renderServiceComboBox.getSelectedItem();
    DiskRenderService service = factory.createDiskRenderService();
    List<DeviceInfo> vals = DriverUtilities.getMidiDevices(command, driver, service, true);
    Object val = chooseDriver(vals);
    if (val != null) {
        DeviceInfo info = (DeviceInfo) val;
        midiInText.setText(info.getDeviceId());
        fireUpdate();
    }
}
Also used : DeviceInfo(blue.services.render.DeviceInfo) RealtimeRenderServiceFactory(blue.services.render.RealtimeRenderServiceFactory) DiskRenderService(blue.services.render.DiskRenderService)

Aggregations

RealtimeRenderServiceFactory (blue.services.render.RealtimeRenderServiceFactory)8 DeviceInfo (blue.services.render.DeviceInfo)4 DiskRenderService (blue.services.render.DiskRenderService)4 SoundObjectException (blue.soundObject.SoundObjectException)2 ArrayList (java.util.ArrayList)1