Package com.sun.mpk20.voicelib.app

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


      }
      return;
  }

  if (dtmfKey.equals("#")) {
      Player p = vm.getPlayer(callID);

      if (p == null) {
    logger.warning("No Player for " + callID);
    return;
      }

      int n = p.getPlayersInRange().length;

      try {
                if (n == 0) {
                    call.playTreatment("tts:There is no one in range.");
                } else if (n == 1) {
View Full Code Here


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

  Call call = null;

  Player player = null;

  if (simulateCalls == false) {
      call = vm.getCall(callID);

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

      player = vm.getPlayer(callID);
  }

  if (message instanceof OrbEndCallMessage) {
      if (call != null) {
          try {
              vm.endCall(call, true);
          } catch (IOException e) {
        logger.warning("Unable to end call " + call + ": "
            + e.getMessage());
          }
       } else {
    orbStatusListenerRef.get().endCall(callID);
      }

      sender.send(message);
      return;
  }

  if (message instanceof OrbMuteCallMessage) {
      if (call != null) {
          try {
              call.mute(((OrbMuteCallMessage)message).isMuted());
          } catch (IOException e) {
        logger.warning("Unable to mute call " + call + ": "
            + e.getMessage());
        return;
          }
      }

      sender.send(message);
      return;
  }

  if (message instanceof OrbChangeNameMessage) {
      username = ((OrbChangeNameMessage) message).getName();
      sender.send(message);
      return;
  }

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

      if (player == null) {
    return;
      }

      Vector3f position = msg.getPosition();

      player.moved(position.getX(), position.getY(), position.getZ(),
    player.getOrientation());
      return;
  }

  if (message instanceof OrbSetVolumeMessage) {
      if (player == null) {
    logger.warning("no player for " + callID);
    return;
      }

      OrbSetVolumeMessage msg = (OrbSetVolumeMessage) message;

      String softphoneCallID = msg.getSoftphoneCallID();

      Player softphonePlayer = vm.getPlayer(softphoneCallID);

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

      DefaultSpatializer spatializer = (DefaultSpatializer)
    vm.getVoiceManagerParameters().livePlayerSpatializer.clone();

      double volume = msg.getVolume();

      spatializer.setAttenuator(volume);

      if (volume == 1) {
          softphonePlayer.removePrivateSpatializer(player);
      } else {
          softphonePlayer.setPrivateSpatializer(player, spatializer);
      }

      logger.fine("player " + player + " sp " + spatializer + " v " + volume);
      return;
   }
View Full Code Here

    setup.isOutworlder = true;
    setup.isLivePlayer = true;

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

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

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

    VoiceManagerParameters parameters = vm.getVoiceManagerParameters();

                AudioGroup defaultLivePlayerAudioGroup = parameters.livePlayerAudioGroup;
View Full Code Here

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

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

      Player player = vm.getPlayer(msg.getPlayerID());

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

      }

      Player[] playersInRange = player.getPlayersInRange();

      String[] playerIDList = new String[playersInRange.length];

      for (int i = 0; i < playersInRange.length; i++) {
    playerIDList[i] = playersInRange[i].getId();   
      }
 
      sender.send(clientID, new GetPlayersInRangeResponseMessage(msg.getPlayerID(),
    playerIDList));

      return;
  }

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

      try {
          vm.testUDPPort(msg.getHost(), msg.getPort(), msg.getDuration());
      } catch (IOException e) {
    logger.warning("Unable to test udp port " + msg.getPort()
        + ": " + e.getMessage());
      }

      return;
  }

        if (message instanceof GetVoiceBridgeRequestMessage) {
            logger.fine("Got GetVoiceBridgeMessage");

      String callID = ((GetVoiceBridgeRequestMessage) message).getCallID();

      if (callID != null) {
    logger.info("Ending existing call " + callID);

    Call call = vm.getCall(callID);

    if (call != null) {
        try {
            call.end(false);
        } catch (IOException e) {
      logger.info("Unable to end call " + call
         + " " + e.getMessage());
        }
    } else {
        logger.info("Can't find call for " + callID);
    }
      }

            BridgeInfo bridgeInfo;

            try {
                bridgeInfo = vm.getVoiceBridge();

                logger.info("Sending voice bridge info '" + bridgeInfo + "'");
            } catch (IOException e) {
                logger.warning("unable to get voice bridge:  " + e.getMessage());
                return;
            }

            sender.send(clientID, new GetVoiceBridgeResponseMessage(bridgeInfo.toString()));
            return;
        }

        if (message instanceof PlaceCallRequestMessage) {
            logger.fine("Got PlaceCallMessage from " + clientID);

            placeCall(clientID, (PlaceCallRequestMessage) message);
            return;
        }

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

            String callID = msg.getCallID();

            Call call = vm.getCall(callID);

            if (call == null) {
                logger.fine("Unable to end call " + callID);
                return;
            }

      try {
    vm.endCall(call, true);
            } catch (IOException e) {
                logger.warning(
                    "Unable to end call " + call + ":  " + e.getMessage());
            }

      sender.send(new CallEndedMessage(msg.getCallID(), msg.getReason()));
      return;
  }

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

            String callID = msg.getCallID();

            Call call = vm.getCall(callID);

            if (call == null) {
                logger.info("Unable to mute/unmute call " + callID);
                return;
            }

            try {
                call.mute(msg.isMuted());
            } catch (IOException e) {
                logger.warning("Unable to mute/unmute call " + callID + ": " + e.getMessage());
                return;
            }

            return;
        }

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

            String callID = msg.getPresenceInfo().getCallID();

            Call call = vm.getCall(callID);

            if (call == null) {
                if (msg.getCancel() == true) {
                    return;
                }

                double x = 0;
                double y = 0;
                double z = 0;
                double orientation = 0;

                Player player = vm.getPlayer(callID);

                if (player != null) {
                    x = -player.getX();
                    y = player.getY();
                    z = player.getZ();
                    orientation = player.getOrientation();
                }

                placeCall(clientID, new PlaceCallRequestMessage(msg.getPresenceInfo(),
        msg.getPhoneNumber(), x, y, z, orientation, true));
                return;
View Full Code Here

    public static void setupCall(String callID, CallSetup setup, double x,
            double y, double z, double direction) throws IOException {

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

        Player p = vm.getPlayer(callID);

        Call call;

        call = vm.createCall(callID, setup);

        callID = call.getId();

        PlayerSetup ps = new PlayerSetup();

        if (p == null) {
            ps.x = x;
            ps.y = y;
            ps.z = z;
        } else {
            ps.x = p.getSetup().x;
            ps.y = p.getSetup().y;
            ps.z = p.getSetup().z;
        }

        ps.orientation = direction;
        ps.isLivePlayer = true;

        Player player = null;
        if(p==null) {
            player = vm.createPlayer(callID, ps);
        } else {
            player = p;
        }

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

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

        AudioGroupPlayerInfo info =
View Full Code Here

         * 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);
View Full Code Here

  logger.fine("Attenuate other groups to " + outsideAudioVolume + " name " + name);

  //System.out.println("Attenuate other groups to " + outsideAudioVolume + " name " + name);

  Player p = AppContext.getManager(VoiceManager.class).getPlayer(player.getId());

  if (player.toString().equals(p.toString()) == false) {
      System.out.println("WRONG player!");
      player = p;
  }

  player.attenuateOtherGroups(audioGroup, 0, outsideAudioVolume);
View Full Code Here

        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

    }

    public void setSpatializer(boolean inConeOfSilence) {
  String callID = CallID.getCallID(cellID);

  Player player = AppContext.getManager(VoiceManager.class).getPlayer(callID);
   
  if (player == null) {
      logger.warning("no player for " + callID);
      return;
  }

  player.setPublicSpatializer(getSpatializer(inConeOfSilence));
    }
View Full Code Here

        public void playerInRange(Player player, Player playerInRange,
                                  boolean isInRange)
        {
            // look up the binding in the data store
            try {
                PlayerInRangeListener listener =
                        (PlayerInRangeListener) AppContext.getDataManager().getBinding(bindingName);
                listener.playerInRange(player, playerInRange, isInRange);
            } catch (ObjectNotFoundException onfe) {
                logger.log(Level.WARNING, "Object not found for binding " +
                           bindingName);
                player.removePlayerInRangeListener(this);
            } catch (NameNotBoundException nnbe) {
View Full Code Here

TOP

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

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.