Package games.stendhal.client.sound

Examples of games.stendhal.client.sound.SoundGroup


  private HashMap<String, ArrayList<String>> mCategorys = new HashMap<String, ArrayList<String>>();
  private long mWaitTime = 0;

  protected void addSounds(String groupName, String categoryName, String... soundNames) {
    ArrayList<String> soundNameList = mCategorys.get(categoryName);
    SoundGroup group = ClientSingletonRepository.getSound().getGroup(groupName);

    if (soundNameList == null) {
      soundNameList = new ArrayList<String>();
    }

    for (String name : soundNames) {
      if (group.loadSound(name, "audio:/" + name + ".ogg", Type.OGG, false)) {
        soundNameList.add(name);
      }
    }

    if (soundNameList.size() > 0) {
View Full Code Here


    mAudibleArea.setPosition(Algebra.vecf((float) x, (float) y));
    ClientSingletonRepository.getSound().update();
  }

  protected void playSound(String groupName, String soundName) {
    SoundGroup group = ClientSingletonRepository.getSound().getGroup(groupName);
    group.play(soundName, 0, mAudibleArea, new Time(), false, true);
  }
View Full Code Here

    SoundGroup group = ClientSingletonRepository.getSound().getGroup(groupName);
    group.play(soundName, 0, mAudibleArea, new Time(), false, true);
  }

  protected void playRandomSoundFromCategory(String groupName, String categoryName) {
    SoundGroup group = ClientSingletonRepository.getSound().getGroup(groupName);
    group.play(getRandomSoundFromCategory(categoryName), 0, mAudibleArea, new Time(), false, true);
  }
View Full Code Here

    int fps = 0;
    final GameObjects gameObjects = client.getGameObjects();
    final StaticGameLayers gameLayers = client.getStaticGameLayers();

    try {
      SoundGroup group = initSoundSystem();
      group.play("harp-1", 0, null, null, false, true);
    } catch (RuntimeException e) {
      logger.error(e, e);
    }

    // keep looping until the game ends
View Full Code Here

      }
    }
    }

  private SoundGroup initSoundSystem() {
    SoundGroup group = getSoundSystemFacade().getGroup(SoundLayer.USER_INTERFACE.groupName);
    group.loadSound("harp-1", "audio:/harp-1.ogg", Type.OGG, false);
    group.loadSound("click-4", "audio:/click-4.ogg", Type.OGG, false);
    group.loadSound("click-5", "audio:/click-5.ogg", Type.OGG, false);
    group.loadSound("click-6", "audio:/click-6.ogg", Type.OGG, false);
    group.loadSound("click-8", "audio:/click-8.ogg", Type.OGG, false);
    group.loadSound("click-10", "audio:/click-10.ogg", Type.OGG, false);
    return group;
  }
View Full Code Here

        }
      }

      if (groupExists) {
        int volume = Integer.parseInt(volumeString);
        SoundGroup group = ClientSingletonRepository.getSound().getGroup(groupName);
        group.changeVolume(Numeric.intToFloat(volume, 100.0f));
        WtWindowManager.getInstance().setProperty("sound.volume." + groupName, Integer.toString(volume));
      } else {
        if (groupName.equals("master")) {
          int volume = Integer.parseInt(volumeString);
          ClientSingletonRepository.getSound().changeVolume(Numeric.intToFloat(volume, 100.0f));
View Full Code Here

   * @param channel
   * @return volume slider for the channel
   */
  private JSlider createVolumeSlider(String channel) {
    JSlider slider = new JSlider(0, 100);
    SoundGroup group = ClientSingletonRepository.getSound().getGroup(channel);
    slider.setValue(Numeric.floatToInt(group.getVolume(), 100f));
    slider.addChangeListener(new ChannelChangeListener(channel, group));
   
    return slider;
  }
View Full Code Here

    int radius = 100000;
    if (event.has("radius")) {
      radius = event.getInt("radius");
    }

    SoundGroup group = ClientSingletonRepository.getSound().getGroup(layer.groupName);
    String soundName = event.get("sound");
    AudibleCircleArea area = new AudibleCircleArea(Algebra.vecf((float)entity.getX(), (float)entity.getY()), radius/4.0f, radius);
    group.loadSound(soundName, "audio:/" + soundName + ".ogg", Type.OGG, false);
    group.play(soundName, volume, 0, area, null, false, true);
  }
View Full Code Here

TOP

Related Classes of games.stendhal.client.sound.SoundGroup

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.