Package com.sun.mpk20.voicelib.app

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


    }

    public static void updateAttenuation(Player player) {
  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  AudioGroup livePlayerAudioGroup = vm.getVoiceManagerParameters().livePlayerAudioGroup;

  AudioGroup stationaryPlayerAudioGroup = vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;

  AudioGroup[] audioGroups = player.getAudioGroups();

  AudioGroup nonPublicAudioGroup = null;

  AudioGroupPlayerInfo playerInfo;

  for (int i = 0; i < audioGroups.length; i++) {
      AudioGroup audioGroup = audioGroups[i];

      playerInfo = audioGroup.getPlayerInfo(player);

      if (playerInfo != null && playerInfo.isSpeaking &&
        playerInfo.chatType.equals(AudioGroupPlayerInfo.ChatType.PUBLIC) == false) {

    nonPublicAudioGroup = audioGroup;
    break;
      }
  }

  playerInfo = livePlayerAudioGroup.getPlayerInfo(player);

  if (playerInfo != null) {
      if (nonPublicAudioGroup != null && playerInfo.isTransientMember == false) {
          livePlayerAudioGroup.setSpeaking(player, false);
          livePlayerAudioGroup.setListenAttenuation(player, AudioGroup.MINIMAL_LISTEN_ATTENUATION);
      } else {
                livePlayerAudioGroup.setSpeaking(player, true);
                livePlayerAudioGroup.setSpeakingAttenuation(player, AudioGroup.DEFAULT_SPEAKING_ATTENUATION);
                livePlayerAudioGroup.setListenAttenuation(player, AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      }
  }

  if (stationaryPlayerAudioGroup.getPlayerInfo(player) != null) {
      if (nonPublicAudioGroup != null) {
          stationaryPlayerAudioGroup.setListenAttenuation(player, AudioGroup.MINIMAL_LISTEN_ATTENUATION);
      } else {
                stationaryPlayerAudioGroup.setListenAttenuation(player, AudioGroup.DEFAULT_LISTEN_ATTENUATION);
      }
  }

  /*
   * If we're in a nonPublicAudioGroup, we also have to attenuate the other groups we're listening to.
   */
  double attenuation;

  if (nonPublicAudioGroup != null) {
      attenuation = AudioGroup.MINIMAL_LISTEN_ATTENUATION;
  } else {
      attenuation = AudioGroup.DEFAULT_LISTEN_ATTENUATION;
  }

  for (int i = 0; i < audioGroups.length; i++) {
      AudioGroup audioGroup = audioGroups[i];

      if (audioGroup.equals(livePlayerAudioGroup) || audioGroup.equals(stationaryPlayerAudioGroup)) {
    continue;
      }

      playerInfo = audioGroup.getPlayerInfo(player);

      if (playerInfo.chatType.equals(ChatType.PUBLIC) && playerInfo.listenAttenuation != 0) {
    audioGroup.setListenAttenuation(player, attenuation);
      }
  }

  player.setPrivateMixes(true);
    }
View Full Code Here


  ProximityComponentMO component = cellMO.getComponent(ProximityComponentMO.class);

        BoundingVolume[] bounds = new BoundingVolume[1];

  AudioGroup ag = AppContext.getManager(VoiceManager.class).getVoiceManagerParameters().livePlayerAudioGroup;

  DefaultSpatializer spatializer = (DefaultSpatializer) ag.getSetup().spatializer;

        bounds[0] = new BoundingSphere((float) spatializer.getZeroVolumeRadius(), new Vector3f());

  logger.warning("Bounds for " + info.getCellID() + " " + bounds[0]);
View Full Code Here

      logger.fine("In range player is already in group " + group.getId() + ": " + playerInRange.getId());
      return;
  }

  addTransientMember(group, player, playerInRange);
  AudioGroup ag = AppContext.getManager(VoiceManager.class).getVoiceManagerParameters().livePlayerAudioGroup;

  DefaultSpatializer spatializer = (DefaultSpatializer) ag.getSetup().spatializer;
   
  playerInRange.setPrivateSpatializer(player, new FullVolumeSpatializer(spatializer.getZeroVolumeRadius()));
    }
View Full Code Here

      return;
  }

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

  AudioGroup livePlayerAudioGroup = vm.getVoiceManagerParameters().livePlayerAudioGroup;

  AudioGroup stationaryPlayerAudioGroup = vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;

  if (group.equals(livePlayerAudioGroup.getId()) || group.equals(stationaryPlayerAudioGroup.getId())) {
      return;
  }

  CommsManager cm = CommsManagerFactory.getCommsManager();
     
View Full Code Here

    }

    private PresenceInfo[] getChatters(String group, ChatType chatType) {
  VoiceManager vm = AppContext.getManager(VoiceManager.class);

  AudioGroup audioGroup = vm.getAudioGroup(group);

  if (audioGroup == null) {
      logger.fine("Can't find audio group " + group);
      return null;
  }

  AudioGroup livePlayerAudioGroup = vm.getVoiceManagerParameters().livePlayerAudioGroup;

        AudioGroup stationaryPlayerAudioGroup = vm.getVoiceManagerParameters().stationaryPlayerAudioGroup;

  if (audioGroup.equals(livePlayerAudioGroup) || audioGroup.equals(stationaryPlayerAudioGroup)) {
      return null;
  }
View Full Code Here

  }

  AudioGroup[] groups = player.getAudioGroups();

  for (int i = 0; i < groups.length; i++) {
      AudioGroup group = groups[i];

      AudioGroupPlayerInfo playerInfo = group.getPlayerInfo(player);

      if (playerInfo == null || playerInfo.chatType.equals(AudioGroupPlayerInfo.ChatType.PUBLIC) == false) {
    logger.fine("player not chatting publicly in " + group.getId() + " "
        + player.getId() + " info " + playerInfo);
    continue;
      }

      if (isInRange) {
View Full Code Here

            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "No voice bridge available!"));
      return;
  }

  AudioGroup audioGroup = vm.getAudioGroup(group);

  if (audioGroup == null) {
      logger.warning("No audio group " + group);
            sender.send(clientID, new VoiceChatCallEndedMessage(
          group, callee, "Audio group not found!"));
View Full Code Here

        AudioGroupSetup audioGroupSetup = new AudioGroupSetup();
        audioGroupSetup.spatializer = new FullVolumeSpatializer();

        audioGroup = vm.createAudioGroup(audioGroupId, audioGroupSetup);
        audioGroup.addPlayer(externalPlayer,
            new AudioGroupPlayerInfo(true,
            AudioGroupPlayerInfo.ChatType.EXCLUSIVE));
        audioGroup.addPlayer(softphonePlayer,
            new AudioGroupPlayerInfo(true,
            AudioGroupPlayerInfo.ChatType.EXCLUSIVE));
    } else {
        AudioGroup defaultLivePlayerAudioGroup =
            parameters.livePlayerAudioGroup;

        defaultLivePlayerAudioGroup.addPlayer(externalPlayer,
            new AudioGroupPlayerInfo(true,
            AudioGroupPlayerInfo.ChatType.PUBLIC));

        AudioGroup defaultStationaryPlayerAudioGroup =
            parameters.stationaryPlayerAudioGroup;

        defaultStationaryPlayerAudioGroup.addPlayer(externalPlayer,
            new AudioGroupPlayerInfo(false,
            AudioGroupPlayerInfo.ChatType.PUBLIC));
    }

    logger.fine("done with audio groups");
            }
           
      if (externalCall != null) {
          externalCallID = externalCall.getId();
      }

      logger.fine("Setting actual call id to " + externalCallID);

      listing.setExternalCallID(externalCallID)// set actual call Id

            //Check implicit privacy settings
            if (listing.isPrivate()) {
                /** HARRISNOTE: We need our client name later in order to
                 * setup private spatializers. But because we didn't know
                 * our proper client name in the PhoneCell, we update the
                 * callListing now that we do.
                 **/
    listing.setPrivateClientName(externalCallID);

                /*
     * Set the call audio to whisper mode until the caller
     * chooses to join the call.
     */
                if (listing.simulateCalls() == false) {
                    //Mute the two participants to the outside world
                    logger.fine("attenuate other groups");
        softphonePlayer.attenuateOtherGroups(audioGroup, 0, 0);
                    logger.fine("back from attenuate other groups");
                }
            } else {
    Vector3f center = new Vector3f();

    phoneCellMO.getWorldBounds().getCenter(center);

          center.setY((float).5);

                new Orb(listing.getContactName(), listing.getContactName(),
        externalCallID, center, .1, listing.simulateCalls());
      }

            if (listing.simulateCalls() == false) {
                //Place the calls audio at the phones position
             Vector3f location = new Vector3f();

                location = phoneCellMO.getWorldTransform(null).getTranslation(location);

                externalPlayer.moved(location.x, location.y, location.z, 0);
            }
         
            /*
       * Send PLACE_CALL_RESPONSE message back to all the clients
       * to signal success.
       */
            sender.send(clientID, new PlaceCallResponseMessage(
    phoneCellMO.getCellID(), listing, true));

      logger.fine("back from notifying user");
      return;
  }

  if (msg instanceof JoinCallMessage) {
            //Our phone cell wants us to join the call into the world.
           
            if (listing.simulateCalls() == false) {
                //Stop any current ringing.
          try {
                    softphoneCall.stopTreatment("ring_tone.au");
          } catch (IOException e) {
        logger.fine("Unable to stop treatment to " + softphoneCall + ":  "
            + e.getMessage());
          }

    AudioGroup defaultLivePlayerAudioGroup = parameters.livePlayerAudioGroup;

    defaultLivePlayerAudioGroup.addPlayer(externalPlayer,
        new AudioGroupPlayerInfo(true,
        AudioGroupPlayerInfo.ChatType.PUBLIC));

    AudioGroup defaultStationaryPlayerAudioGroup = parameters.stationaryPlayerAudioGroup;

    defaultStationaryPlayerAudioGroup.addPlayer(externalPlayer,
        new AudioGroupPlayerInfo(false,
        AudioGroupPlayerInfo.ChatType.PUBLIC));

          softphonePlayer.attenuateOtherGroups(audioGroup,
        AudioGroup.DEFAULT_SPEAKING_ATTENUATION,
        AudioGroup.DEFAULT_LISTEN_ATTENUATION);
View Full Code Here

        private boolean isInSecretAudioGroup(Player player) {
            AudioGroup[] audioGroups = player.getAudioGroups();

            for (int i = 0; i < audioGroups.length; i++) {
                AudioGroupPlayerInfo info = audioGroups[i].getPlayerInfo(player);

                if (info.chatType == AudioGroupPlayerInfo.ChatType.SECRET) {
                    return true;
                }
            }
View Full Code Here

    private AudioGroup getSecretAudioGroup(Player player) {
  AudioGroup[] audioGroups = player.getAudioGroups();

  for (int i = 0; i < audioGroups.length; i++) {
            AudioGroupPlayerInfo info = audioGroups[i].getPlayerInfo(player);

            if (info.chatType == AudioGroupPlayerInfo.ChatType.SECRET) {
    return audioGroups[i];
      }
  }
View Full Code Here

TOP

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

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.