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

Examples of org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState


    public String getDisplayName() {
        return BUNDLE.getString("Audio_Capabilities");
    }

    public <T extends CellComponentServerState> T getDefaultCellComponentServerState() {
        AudioTreatmentComponentServerState state =
                new AudioTreatmentComponentServerState();
        return (T) state;
    }
View Full Code Here


  if (isLive()) {
      cleanup();
  }

        AudioTreatmentComponentServerState state = (AudioTreatmentComponentServerState) serverState;

        groupId = state.getGroupId();

  //if (groupId == null || groupId.length() == 0) {
  //    groupId = CallID.getCallID(cellID);
  //}

  treatmentType = state.getTreatmentType();

        treatments = state.getTreatments();

  volume = state.getVolume();

  playWhen = state.getPlayWhen();

  playOnce = state.getPlayOnce();

  extent = state.getExtent();

  useCellBounds = state.getUseCellBounds();

  fullVolumeAreaPercent = state.getFullVolumeAreaPercent();

   distanceAttenuated = state.getDistanceAttenuated();

  falloff = state.getFalloff();

  showBounds = state.getShowBounds();

  if (isLive()) {
      initialize();
  }
    }
View Full Code Here

  return volume;
    }

    @Override
    public CellComponentServerState getServerState(CellComponentServerState serverState) {
        AudioTreatmentComponentServerState state = (AudioTreatmentComponentServerState) serverState;

        if (state == null) {
            state = new AudioTreatmentComponentServerState();

      //if (groupId == null || groupId.length() == 0) {
      //    groupId = CallID.getCallID(cellID);
      //}

            state.setGroupId(groupId);
      state.setTreatmentType(treatmentType);
            state.setTreatments(treatments);
      state.setVolume(volume);
      state.setPlayWhen(playWhen);
      state.setPlayOnce(playOnce);
      state.setExtent(extent);
      state.setUseCellBounds(useCellBounds);
      state.setFullVolumeAreaPercent(fullVolumeAreaPercent);
      state.setDistanceAttenuated(distanceAttenuated);
      state.setFalloff(falloff);
      state.setShowBounds(showBounds);
        }

        return super.getServerState(state);
    }
View Full Code Here

     * @{inheritDoc}
     */
    public void open() {
        CellServerState state = editor.getCellServerState();

        AudioTreatmentComponentServerState compState =
                (AudioTreatmentComponentServerState) state.getComponentServerState(
                AudioTreatmentComponentServerState.class);

        if (state == null || compState == null) {
            return;
        }

        originalGroupId = compState.getGroupId();

        String[] treatmentList = compState.getTreatments();

  originalTreatmentType = compState.getTreatmentType();

  treatmentType = originalTreatmentType;

        originalTreatments = "";

  /*
   * XXX We only allow a single treatment to be specified
   */
        for (int i = 0; i < treatmentList.length; i++) {
            String treatment = treatmentList[i];

      if (treatment.length() == 0) {
    break;
      }

            originalTreatments += treatment;
      break// XXX we only allow a single treatment for now
        }

        originalTreatments = originalTreatments.trim();

        originalVolume = volumeConverter.getVolume((float) compState.getVolume());

        originalPlayWhen = compState.getPlayWhen();
        playWhen = originalPlayWhen;

        originalPlayOnce = compState.getPlayOnce();
  playOnce = originalPlayOnce;

        originalExtentRadius = (float) compState.getExtent();
        extentRadius = originalExtentRadius;

        originalFullVolumeAreaPercent = (float) compState.getFullVolumeAreaPercent();

        originalDistanceAttenuated = compState.getDistanceAttenuated();
        distanceAttenuated = originalDistanceAttenuated;

        originalFalloff = (int) compState.getFalloff();

  originalUseCellBounds = compState.getUseCellBounds();

  BoundingVolume bounds = editor.getCell().getLocalBounds();

  if (originalUseCellBounds == true && bounds instanceof BoundingBox) {
      originalDistanceAttenuated = false;
      distanceAttenuated = false;
  }

        if (bounds instanceof BoundingSphere) {
            float radius = ((BoundingSphere) bounds).getRadius();

            String text = BUNDLE.getString("Sphere_With_Radius");
            text = MessageFormat.format(text, (Math.round(radius * 10) / 10f));
            boundsLabel.setText(text);
        } else {
            Vector3f extent = new Vector3f();
            extent = ((BoundingBox) bounds).getExtent(extent);
            float x = Math.round(extent.getX() * 10) / 10f;
            float y = Math.round(extent.getY() * 10) / 10f;
            float z = Math.round(extent.getZ() * 10) / 10f;

            String text = BUNDLE.getString("BOX");
            text = MessageFormat.format(text, x, y, z);
            boundsLabel.setText(text);
        }

  originalShowBounds = compState.getShowBounds();

  restore();

  if (currentCell == null) {
      currentCell = editor.getCell();
View Full Code Here

    public void apply() {
        // Figure out whether there already exists a server state for the
        // component.
        CellServerState state = editor.getCellServerState();

        AudioTreatmentComponentServerState compState =
                (AudioTreatmentComponentServerState) state.getComponentServerState(
                AudioTreatmentComponentServerState.class);

        if (state == null) {
            return;
        }

        compState.setGroupId(audioGroupIdTextField.getText().trim());

        String treatments = treatmentTextField.getText().trim();

        // Update the component state, add to the list of updated states
  compState.setTreatmentType(treatmentType);
        compState.setTreatments(treatments.split(";"));
  compState.setVolume(volumeConverter.getVolume(volumeSlider.getValue()));
        compState.setPlayWhen(playWhen);
        compState.setPlayOnce(playOnce);
        compState.setExtent((Float) extentRadiusModel.getValue());
  compState.setUseCellBounds(useCellBounds);
        compState.setFullVolumeAreaPercent(
                (Float) fullVolumeAreaPercentModel.getValue());
        compState.setDistanceAttenuated(distanceAttenuated);
        compState.setFalloff(falloffSlider.getValue());
        editor.addToUpdateList(compState);

  if (currentCell != null && currentCell.getCellID().equals(editor.getCell().getCellID()) == false) {
      statusLabel.setText("");
  }

  if (treatments != null && treatments.length() > 0) {
      switch (treatmentType) {
      case FILE:
    lastFileTreatment = treatments;
    try {
                    String text = BUNDLE.getString("Uploading_Treatment");
                    text = MessageFormat.format(text, treatments);
        statusLabel.setText(text);
        uploadFileTreatments();
    } catch (Exception e) {
                    String text = BUNDLE.getString("Upload_Failed");
                    text = MessageFormat.format(text, treatments);
        statusLabel.setText(text);
        break
    }

          ServerSessionManager serverSessionManager = LoginManager.getPrimary();

    contentRepositoryRadioButton.doClick();

    compState.setTreatmentType(TreatmentType.CONTENT_REPOSITORY);

    int ix = treatments.lastIndexOf(File.separator);

    if (ix >= 0) {
        treatments = treatments.substring(ix + 1);
    }

    String contentRepositoryTreatment =
        "wlcontent://users/" + serverSessionManager.getUsername() + "/audio/" + treatments;

          compState.setTreatments(new String[] { contentRepositoryTreatment });
    treatmentTextField.setText(contentRepositoryTreatment);
          lastContentRepositoryTreatment = treatmentTextField.getText();
          break;

      case CONTENT_REPOSITORY:
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.audiomanager.common.AudioTreatmentComponentServerState

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.