コード例 #1
0
  /**
   * @param args
   * @throws URISyntaxException
   */
  public static void main(String[] args) throws URISyntaxException {
    // Create plugin manager
    JSPFProperties props = new JSPFProperties();

    final PluginManager pluginManager = PluginManagerFactory.createPluginManager(props);
    pluginManager.addPluginsFrom(new URI("classpath://*"));

    RemoteAPILipe lipe = pluginManager.getPlugin(RemoteAPILipe.class);

    SpeechRecognizer plugin =
        lipe.getRemoteProxy(new URI("discover://youngest"), SpeechRecognizer.class);
    SpeechSynthesis synthesis =
        lipe.getRemoteProxy(new URI("discover://youngest"), SpeechSynthesis.class);

    synthesis.speakText("Hello World");

    plugin.addSpeechRecognitionListener(
        new SimpleSpeechRecognitionListener() {

          @Override
          public void newSpeechSimpleCommandId(long code) {
            System.out.println(code);
          }
        });

    pluginManager.shutdown();
  }
コード例 #2
0
  /**
   * @param args
   * @throws URISyntaxException
   */
  public static void main(final String[] args) throws URISyntaxException {

    PluginManager pm = PluginManagerFactory.createPluginManager();
    pm.addPluginsFrom(new URI("classpath://*"));

    final GazeEvaluatorManager gem = pm.getPlugin(GazeEvaluatorManager.class);
    final GazeEvaluator ge = gem.createEvaluator(null);

    ge.addEvaluationListener(
        new FixationListener() {

          @Override
          public void newEvaluationEvent(FixationEvent event) {
            System.out.println("You will never see me ...");
          }
        },
        new OptionRequestVersion(FixationListener.class, "Ralf Biedert", 130));

    pm.shutdown();
  }
コード例 #3
0
ファイル: Drivers.java プロジェクト: Abayima/OpenSIMKit-Java
  public Drivers() {
    pm = PluginManagerFactory.createPluginManager();
    pm.addPluginsFrom(new File(OpenSIMKit.bootstrap.getDriversFolder()).toURI());

    PluginManagerUtil pmu = new PluginManagerUtil(pm);
    availablePlugins = (ArrayList<DriverInterface>) pmu.getPlugins(DriverInterface.class);

    int numDrivers = availablePlugins.size();

    for (int driverLoop = 0; driverLoop < numDrivers; driverLoop++) {
      DriverDetails newDriver = new DriverDetails();

      newDriver.setManufacturer(availablePlugins.get(driverLoop).getManufacturer());
      newDriver.setModel(availablePlugins.get(driverLoop).getModel());
      newDriver.setRevision(availablePlugins.get(driverLoop).getRevision());
      newDriver.setDriverClass(availablePlugins.get(driverLoop).getClass().toString());
      newDriver.setDelimiter(availablePlugins.get(driverLoop).getDelimiter());
      newDriver.setGenericConnection(availablePlugins.get(driverLoop).isGenericConnection());
      newDriver.setDriverInterface(availablePlugins.get(driverLoop));

      driverDetails.add(newDriver);
    }
  }
コード例 #4
0
 /** @throws Exception */
 @Before
 public void setUp() throws Exception {
   this.pm = PluginManagerFactory.createPluginManager();
   this.pm.addPluginsFrom(new URI("classpath://*"));
 }