Package org.newdawn.slick

Examples of org.newdawn.slick.Music


   * @param filename file to load
   * @return the music piece
   */
  public SoundHandle loadMusic(final SoundSystem soundSystem, final String filename) {
    try {
      return new SlickMusicHandle(soundSystem, new Music(filename, true));
    } catch (SlickException e) {
      log.warning("loading of '" + filename + "' failed" + e);
    }
    return null;
  }
View Full Code Here


  private static Music music = null;
  private static void playOpenALMusic() {
    try {
      musicType = "openal";
      if(music==null) music = new Music(musicfile,true);
      music.loop();
    } catch (SlickException e) {
      e.printStackTrace();
    }   
  }
View Full Code Here

    exit = new Image("data/menu/quit.png");
    exitWidth = exit.getWidth();
    exitHeight = exit.getHeight();
    exitX = 400-(exitWidth/2);
   
    song = new Music("data/song.ogg");
  }
View Full Code Here

  private void loadMusic(Element element) throws SlickException {
    checkRequiredAttributes(element, "key", "file");
    String key = element.getAttribute("key");
    String file = element.getAttribute("file");
    Log.debug(formatLoadMsg("music", key, file));
    ResourceManager.addMusic(key, new Music(baseDir + file));
  }
View Full Code Here

    public static String getMap(String name) {
        return getResourceFolder() + "maps" + FILE_SEPARATOR + name + ".tmx";
    }

    public static Music getMusic(String name) throws SlickException {
        return new Music(getResourceFolder() + "music" + FILE_SEPARATOR + name + ".ogg");
    }
View Full Code Here

  public static MusicManager getInstance() {
    return INSTANCE;
  }

  public void playMusic(String key) {
    Music m;
    try {
      m = new Music(key + EXT, true);
      // m.setVolume(0.1F);
      m.loop();
      playingMusic = key;
    } catch (SlickException e) {
      System.out.println("Could not play sound : " + key + EXT);
      e.printStackTrace();
    }
View Full Code Here

    lyhye = new Sound("snd/lyhye.ogg");
    intro = new Sound("snd/oleni.ogg");
    outro = new Sound("snd/gover.ogg");

    polka = new Music("snd/msc/SpazzmaticaPolka.ogg");

    isIntrd1 = false;
    xScale = gc.getWidth()/320f;

    scrWi =  gc.getWidth();
View Full Code Here

   */
  public void init(GameContainer container) throws SlickException {
    SoundStore.get().setMaxSources(32);
   
    myContainer = container;
    music = new Music("testdata/kirby.ogg", true);
    music.play();
  }
View Full Code Here

    try {
      engine = AudioLoader.getAudio("WAV", ResourceLoader.getResourceAsStream("testdata/engine.wav"));
    } catch (IOException e) {
      throw new SlickException("Failed to load engine", e);
    }
    music = musica = new Music("testdata/SMB-X.XM");
    //music = musica = new Music("testdata/theme.ogg", true);
    musicb = new Music("testdata/kirby.ogg", true);
    burp = new Sound("testdata/burp.aif");
   
    music.play();
  }
View Full Code Here

  public void init(GameContainer container) throws SlickException {
    sound = new Sound(ResourceLoader.getResource("testdata/restart.ogg"));
    charlie = new Sound(ResourceLoader.getResource("testdata/cbrown01.wav"));
    engine = new Sound(ResourceLoader.getResource("testdata/engine.wav"));
    //music = musica = new Music("testdata/SMB-X.XM");
    music = musica = new Music(ResourceLoader.getResource("testdata/restart.ogg"), false);
    musicb = new Music(ResourceLoader.getResource("testdata/kirby.ogg"), false);
    burp = new Sound(ResourceLoader.getResource("testdata/burp.aif"));
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.Music

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.