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

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


    
     String COSName = client.getCOSName();

     if (COSName != null) {
                session.send(client,
                    new VoiceChatHoldMessage(group, myPresenceInfo, false, 1, COSName));
     }
  } else {
     CallAnimator.stopCallAnswerAnimation(client);
  }
    }
View Full Code Here


        showHoldPanel(true);

        float volume = holdPanel.getHoldVolume();

        try {
            session.send(client, new VoiceChatHoldMessage(group, myPresenceInfo,
                    true, volume, client.getCOSName()));
        } catch (IllegalStateException e) {
            leave();
        }
View Full Code Here

  CallAnimator.stopCallAnswerAnimation(client);
    }

    private void setHoldVolume(float volume) {
        try {
            session.send(client, new VoiceChatHoldMessage(group, myPresenceInfo,
    true, volume, client.getCOSName()));
        } catch (IllegalStateException e) {
            leave();
        }
    }
View Full Code Here

    }

    private void takeOffHold() {
        try {
            session.send(client,
                    new VoiceChatHoldMessage(group, myPresenceInfo, false, 1, client.getCOSName()));
            setMode(Mode.IN_PROGRESS);
        } catch (IllegalStateException e) {
            leave();
        }
    }
View Full Code Here

      sender.send(msg);
      return;
  }

  if (message instanceof VoiceChatHoldMessage) {
      VoiceChatHoldMessage msg = (VoiceChatHoldMessage) message;

      if (audioGroup == null) {
    logger.warning("Hold:  Audio group " + group + " no longer exists");
    return;
      }
 
      Player player = vm.getPlayer(msg.getCallee().getCallID());

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

      setCOSSpeaking(player, msg.getCOSName(), msg.isOnHold());

      AudioGroupPlayerInfo playerInfo = audioGroup.getPlayerInfo(player);

      if (playerInfo == null) {
    logger.warning("No player info for " + player);
    return;
      }
 
      if (msg.isOnHold()) {
    playerInfo.isSpeaking = false;
    playerInfo.listenAttenuation = msg.getVolume();
      } else {
    playerInfo.isSpeaking = true;
    playerInfo.speakingAttenuation = AudioGroup.DEFAULT_SPEAKING_ATTENUATION;
    playerInfo.listenAttenuation = AudioGroup.DEFAULT_LISTEN_ATTENUATION;
      }

      updateAttenuation(player);
      sender.send(clientID, msg);
      return;
  }

  if (message instanceof VoiceChatDialOutMessage) {
      VoiceChatPhoneMessageHandler.getInstance().dialOut(
    sender, clientID, (VoiceChatDialOutMessage) message);
      return;
  }

  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

            joinVoiceChat((VoiceChatJoinAcceptedMessage) message);
            return;
        }

        if (message instanceof VoiceChatHoldMessage) {
            VoiceChatHoldMessage msg = (VoiceChatHoldMessage) message;
            return;
        }

        if (message instanceof VoiceChatLeaveMessage) {
            leaveVoiceChat((VoiceChatLeaveMessage) message);
            return;
        }

        if (message instanceof VoiceChatCallEndedMessage) {
            VoiceChatCallEndedMessage msg = (VoiceChatCallEndedMessage) message;
            voiceChatCallEnded(msg);
            sendMessage(new VoiceChatLeaveMessage(msg.getGroup(), msg.getCallee(),
                    COSName));
            return;
        }

        if (message instanceof VoiceChatTransientMemberMessage) {
View Full Code Here

TOP

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

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.