Package com.sun.mpk20.voicelib.app

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


    }

    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


        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

    VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

                AudioGroup defaultLivePlayerAudioGroup = parameters.livePlayerAudioGroup;

                AudioGroupPlayerInfo groupInfo = new AudioGroupPlayerInfo(true,
                    AudioGroupPlayerInfo.ChatType.PUBLIC);

    groupInfo.defaultListenAttenuation = 1.0;

                defaultLivePlayerAudioGroup.addPlayer(externalPlayer, groupInfo);

    AudioGroup defaultStationaryPlayerAudioGroup = parameters.stationaryPlayerAudioGroup;

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

                call.mute(false);

    call.transferToConference(parameters.conferenceId);
View Full Code Here

        call.setPlayer(player);
        player.setCall(call);

        vm.getVoiceManagerParameters().livePlayerAudioGroup.addPlayer(player,
                new AudioGroupPlayerInfo(true, AudioGroupPlayerInfo.ChatType.PUBLIC));

        AudioGroupPlayerInfo info =
                new AudioGroupPlayerInfo(false, AudioGroupPlayerInfo.ChatType.PUBLIC);

        info.defaultSpeakingAttenuation = 0;

        vm.getVoiceManagerParameters().stationaryPlayerAudioGroup.addPlayer(player, info);
    }
View Full Code Here

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

  boolean isSpeaking = (inPrivateChat(audioGroup, player) == false);

        audioGroup.addPlayer(player, new AudioGroupPlayerInfo(isSpeaking,
                AudioGroupPlayerInfo.ChatType.PRIVATE));
       
  WonderlandClientSender sender =
            WonderlandContext.getCommsManager().getSender(AudioManagerConnectionType.CONNECTION_TYPE);
View Full Code Here

    private boolean inPrivateChat(AudioGroup audioGroup, Player player) {
  AudioGroup[] audioGroups = player.getAudioGroups();

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

      if (info == null || info.chatType.equals(AudioGroupPlayerInfo.ChatType.PUBLIC) == false) {
    return true;
      }
  }
View Full Code Here

                if (listing.isPrivate()) {
        /*
         * Allow caller and callee to hear each other
         */
        AudioGroupSetup audioGroupSetup = new AudioGroupSetup();
        audioGroupSetup.spatializer = new FullVolumeSpatializer();

        audioGroup = vm.createAudioGroup(audioGroupId, audioGroupSetup);
        audioGroup.addPlayer(externalPlayer,
            new AudioGroupPlayerInfo(true,
View Full Code Here

  ManagedReference<CellMO> phoneCellRef =
      AppContext.getDataManager().createReference(
      CellManagerMO.getCell(phoneCellID));

  AudioGroupSetup setup = new AudioGroupSetup();

  /*
   * Provide Outworlder with full volume for an
   * extended radius.
   */
 
View Full Code Here

TOP

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

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.