Package com.sun.mpk20.voicelib.app

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


    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

    relock(sender);
      }

      logger.fine("Got place call message " + externalCallID);

      PlayerSetup playerSetup = new PlayerSetup();
      //playerSetup.x =  translation.x;
      //playerSetup.y =  translation.y;
      //playerSetup.z =  translation.z;
      playerSetup.isOutworlder = true;
      playerSetup.isLivePlayer = true;
View Full Code Here

                logger.info("Transferring call " + call
        + " to phone " + phoneInfo.phoneNumber);

    Vector3f location = getLocation(phone.phoneCellRef);

    PlayerSetup setup = new PlayerSetup();
    setup.x = location.getX();
    setup.y = location.getY();
    setup.z = location.getZ();
    setup.isOutworlder = true;
    setup.isLivePlayer = true;
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.