Package com.sun.mpk20.voicelib.app

Examples of com.sun.mpk20.voicelib.app.CallSetup


         * Set a private spatializer for the given fullVolume radius
         * for all the other avatars in the cell.
         * For each cell already in the cell, set a private spatializer
         * for this cell.
         */
        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        Player player = vm.getPlayer(callId);

        logger.warning(callId + " entered cone " + name + " player " + player);

        if (player == null) {
            logger.warning("Can't find player for " + callId);
            return;
        }

        AudioGroup audioGroup = vm.getAudioGroup(name);

        if (audioGroup == null) {
      AudioGroupSetup setup = new AudioGroupSetup();

      setup.audioGroupListener = this;

      setup.spatializer = new FullVolumeSpatializer();

            setup.spatializer.setAttenuator(Spatializer.DEFAULT_MAXIMUM_VOLUME);

      //System.out.println("Creating audio group for " + name);

      audioGroup = vm.createAudioGroup(name, setup);
        }

  //System.out.println("CONE PROX Player:  " + player);

  boolean isSpeaking = (inPrivateChat(audioGroup, player) == false);
View Full Code Here


    }

    private void cellExited(String callId) {
        logger.warning(callId + " exited cone " + name + " avatar cell ID " + callId);

        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        AudioGroup audioGroup = vm.getAudioGroup(name);

        if (audioGroup == null) {
            logger.warning("No audio group " + name);
            return;
        }

        Player player = vm.getPlayer(callId);

        if (player == null) {
            logger.warning("Can't find player for " + callId);
            return;
        }
View Full Code Here

      sender.send(new ConeOfSilenceEnterExitMessage(name, player.getId(), false));
  }
    }

    public void remove() {
        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        AudioGroup audioGroup = vm.getAudioGroup(name);

  logger.warning("Remove " + audioGroup + " name " + name);

  if (audioGroup == null) {
      return;
  }

  vm.removeAudioGroup(audioGroup);
    }
View Full Code Here

                                                     1000);

            return;
        }

        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        TreatmentGroup group = null;

  if (groupId != null && groupId.length() > 0) {
      group = vm.createTreatmentGroup(groupId);
  }
 
        for (int i = 0; i < treatments.length; i++) {
            TreatmentSetup setup = new TreatmentSetup();

      setup.treatmentCreatedListener = new TreatmentCreatedListenerImpl(cellID);

      setup.spatializer = getSpatializer(false);

            String treatment = treatments[i];

            String treatmentId = CallID.getCallID(cellID);

      String pattern = "wlcontent://";

            if (treatment.startsWith(pattern)) {
                /*
                 * We need to create a URL
                 */
                String path = treatment.substring(pattern.length());

                URL url;

                try {
                    path = path.replaceAll(" ", "%20");

                    url = new URL(new URL(serverURL), "webdav/content/" + path);

                    treatment = url.toString();
                } catch (MalformedURLException e) {
                    logger.warning("bad url:  " + e.getMessage());
                    return;
    }
      } else {
          pattern = "wls://";

          if (treatment.startsWith(pattern)) {
                    /*
                     * We need to create a URL from wls:<module>/path
                     */
                    treatment = treatment.substring(pattern.length())// skip past wls://

                    int ix = treatment.indexOf("/");

                    if (ix < 0) {
                        logger.warning("Bad treatment:  " + treatments[i]);
                        continue;
                    }

                    String moduleName = treatment.substring(0, ix);

                    String path = treatment.substring(ix + 1);

                    logger.fine("Module:  " + moduleName + " treatment " + treatment);

                    URL url;

                    try {
      path = path.replaceAll(" ", "%20");

                        url = new URL(new URL(serverURL),
                            "webdav/content/modules/installed/" + moduleName + "/audio/" + path);

                        treatment = url.toString();
                        logger.fine("Treatment: " + treatment);
                    } catch (MalformedURLException e) {
                        logger.warning("bad url:  " + e.getMessage());
                        continue;
                    }
                }
      }

            setup.treatment = treatment;

      vm.addCallStatusListener(this, treatmentId);

            if (setup.treatment == null || setup.treatment.length() == 0) {
                logger.warning("Invalid treatment '" + setup.treatment + "'");
                continue;
            }

            // OWL issue #60: make sure to use world location, not local
            // location
            Vector3f location = cellRef.get().getWorldTransform(null).getTranslation(null);

            setup.x = location.getX();
            setup.y = location.getY();
            setup.z = location.getZ();

            // do we need to start paused?
            if (playWhen.equals(PlayWhen.ALWAYS) == false) {
                setup.startPaused = true;
            }
           
            logger.info("Starting treatment " + setup.treatment + " at (" + setup.x
    + ":" + setup.y + ":" + setup.z + ")");

            System.out.println("Starting treatment " + setup.treatment + " at (" + setup.x
    + ":" + setup.y + ":" + setup.z + ")");
 
            try {
    Treatment t = vm.createTreatment(treatmentId, setup);

    if (group != null) {
                    group.addTreatment(t);
    }

View Full Code Here

      }

      parent = parent.getParent();
  }

        VoiceManager vm = AppContext.getManager(VoiceManager.class);

        TreatmentGroup group = null;

  if (groupId != null) {
      group = vm.getTreatmentGroup(groupId);
  }

  if (group == null) {
      Treatment treatment = vm.getTreatment(CallID.getCallID(cellID));

      if (treatment == null) {
      //System.out.println("No treatment for " + CallID.getCallID(cellID));
    return;
      }

      endTreatment(treatment);
      return;
  }

  Treatment[] treatments = group.getTreatments().values().toArray(new Treatment[0]);

  for (int i = 0; i < treatments.length; i++) {
      //System.out.println("Ending treatment:  " + treatments[i]);
      endTreatment(treatments[i]);
      group.removeTreatment(treatments[i]);
  }

  try {
      vm.removeTreatmentGroup(group);
  } catch (IOException e) {
      logger.warning("Unable to remove treatment group " + group);
  }

  vm.dump("all");
    }
View Full Code Here

            double volume = msg.getVolume();

            logger.fine("GOT Volume message:  call " + softphoneCallID
          + " volume " + volume + " other callID " + otherCallID);

            VoiceManager vm = AppContext.getManager(VoiceManager.class);

            Player softphonePlayer = vm.getPlayer(softphoneCallID);

            if (softphonePlayer == null) {
                logger.warning("Can't find softphone player, callID "
        + softphoneCallID);
                return;
            }

            Player player = vm.getPlayer(otherCallID);

       if (player == null) {
                logger.warning("Can't find player for callID " + otherCallID);
          return;
            }

      if (msg.isSetVolume() == false) {
                AudioTreatmentComponentMO audioTreatmentComponentMO =
        cellMO.getComponent(AudioTreatmentComponentMO.class);

    msg.setVolume(audioTreatmentComponentMO.getVolume());
                sender.send(clientID, msg);
                logger.fine("Sending vol message " + msg.getVolume());
                return;
            }

      if (volume == 1.0) {
          softphonePlayer.removePrivateSpatializer(player);
          return;
      }

      VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

            Spatializer spatializer;

      spatializer = player.getPublicSpatializer();
View Full Code Here

  AudioGroup audioGroup = null;

  String audioGroupId = null;

  VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

  if (softphoneCallID != null) {
      softphoneCall = vm.getCall(softphoneCallID);

      if (softphoneCall != null) {
View Full Code Here

    }

    private boolean playerIsChatting(Player player) {
  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

  AudioGroup[] audioGroups = player.getAudioGroups();

  for (int i = 0; i < audioGroups.length; i++) {
      if (audioGroups[i].equals(parameters.livePlayerAudioGroup) == false &&
View Full Code Here

    Player externalPlayer = vm.createPlayer(call.getId(), setup);

    call.setPlayer(externalPlayer);
    externalPlayer.setCall(call);

    VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

                AudioGroup defaultLivePlayerAudioGroup = parameters.livePlayerAudioGroup;

                AudioGroupPlayerInfo groupInfo = new AudioGroupPlayerInfo(true,
                    AudioGroupPlayerInfo.ChatType.PUBLIC);
View Full Code Here

      if (volume == 1.0) {
          softphonePlayer.removePrivateSpatializer(player);
          return;
      }

      VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

            Spatializer spatializer;

      spatializer = player.getPublicSpatializer();
View Full Code Here

TOP

Related Classes of com.sun.mpk20.voicelib.app.CallSetup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.