Package org.jdesktop.wonderland.modules.audiomanager.common.messages.voicechat

Examples of org.jdesktop.wonderland.modules.audiomanager.common.messages.voicechat.VoiceChatJoinMessage


  if (message instanceof VoiceChatJoinMessage == false) {
      logger.warning("Invalid message type " + message);
      return;
  }

  VoiceChatJoinMessage msg = (VoiceChatJoinMessage) message;

  if (audioGroup == null) {
      AudioGroupSetup setup = new AudioGroupSetup();
      setup.spatializer = new FullVolumeSpatializer();
      setup.spatializer.setAttenuator(Spatializer.DEFAULT_MAXIMUM_VOLUME);
      setup.virtualPlayerListener = this;
      setup.audioGroupListener = this;
      audioGroup = vm.createAudioGroup(group, setup);
  }

  PresenceInfo[] calleeList = msg.getCalleeList();

  PresenceInfo caller = msg.getCaller();

  if (msg.getChatType() != null) {
      Player player = vm.getPlayer(caller.getCallID());

      if (player == null) {
    logger.warning("No Player for " + caller.getCallID());
    return;
      }

      boolean added = addPlayerToAudioGroup(audioGroup, player, caller, msg.getChatType());

      if (added) {
          sender.send(new VoiceChatJoinAcceptedMessage(group, caller, msg.getChatType()));
      }

      if (added == false && (calleeList == null || calleeList.length == 0)) {
          endVoiceChat(vm, audioGroup);
          return;
      }
  }

  logger.info("Request to join AudioGroup " + group + " caller " + caller);

  if (calleeList == null || calleeList.length == 0) {
      return;
  }

  for (int i = 0; i < calleeList.length; i++) {
      PresenceInfo info = calleeList[i];

      String callID = info.getCallID();

      Player player = vm.getPlayer(callID);

      if (player == null) {
    logger.warning("No player for callID " + callID);
    continue;
      }

      if (info.getClientID() == null) {
    /*
     * This is an outworlder.  We automatically join them to the group
      * The InCallDialog can be used to change the privacy setting
     * and to remove the outworlder from the chat.
     */
          addPlayerToAudioGroup(audioGroup, player, info, msg.getChatType());
          sender.send(new VoiceChatJoinAcceptedMessage(group, info, msg.getChatType()));
        continue;
      }

      AudioGroupPlayerInfo playerInfo = audioGroup.getPlayerInfo(player);

      if (playerInfo != null && sameChatType(playerInfo.chatType, msg.getChatType())) {
    logger.fine("Player " + info
        + " is already in audio group " + audioGroup);

    if (playerInfo.isTransientMember == false) {
        continue;
    }
      }

            WonderlandClientID id =
         CommsManagerFactory.getCommsManager().getWonderlandClientID(info.getClientID());

      if (id == null) {
    logger.warning("No WonderlandClientID for " + info);
    continue;
      }

      Call call = player.getCall();

      if (call != null) {
    try {
        call.playTreatment("audioGroupInvite.au");
    } catch (IOException e) {
        logger.warning("Unable to play audioGroupInvite.au:  "
      + e.getMessage());
    }
      }

      logger.warning("Asking " + info + " to join audio group "
    + group + " chatType " + msg.getChatType());

      requestPlayerJoinAudioGroup(sender, id, group, caller,
    calleeList, msg.getChatType());
  }
    }
View Full Code Here


  ArrayList<PresenceInfo> users = getSelectedValues();

  animateCallAnswer();

        if (users.contains(myPresenceInfo) == false) {
            session.send(client, new VoiceChatJoinMessage(group, myPresenceInfo,
    new PresenceInfo[0], chatType));
        }

        for (PresenceInfo info : users) {
            /*
             * You can only select yourself or outworlders
             */
            if (info.getClientID() != null) {
                continue;
            }

            session.send(client, new VoiceChatJoinMessage(group, info,
    new PresenceInfo[0], chatType));
        }

  Cell cell = client.getCell();
  ProximityComponent prox = cell.getComponent(ProximityComponent.class);
View Full Code Here

    public void callUser(String name, String number) {
        personalPhone = true;

  animateCallAnswer();

        session.send(client, new VoiceChatJoinMessage(group, myPresenceInfo,
            new PresenceInfo[0], chatType));

        SoftphoneControl sc = SoftphoneControlImpl.getInstance();

        String callID = sc.getCallID();
View Full Code Here

      }
  }

  updateUserList();

        session.send(client, new VoiceChatJoinMessage(group, myPresenceInfo,
            usersToInvite.toArray(new PresenceInfo[0]), chatType));
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.audiomanager.common.messages.voicechat.VoiceChatJoinMessage

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.