Examples of MPDPlayer


Examples of org.bff.javampd.MPDPlayer

   
    if (daemon != null) {
      PlayerCommandTypeMapping pCommand = null;     
      try {
        pCommand = PlayerCommandTypeMapping.fromString(playerCommand);
        MPDPlayer player = daemon.getMPDPlayer();
       
        switch (pCommand) {
          case PAUSE: player.pause(); break;
          case PLAY: player.play(); break;
          case STOP: player.stop(); break;
          case VOLUME_INCREASE: player.setVolume(player.getVolume() + VOLUME_CHANGE_SIZE); break;
          case VOLUME_DECREASE: player.setVolume(player.getVolume() - VOLUME_CHANGE_SIZE); break;
          case NEXT: player.playNext(); break;
          case PREV: player.playPrev(); break;
          case ENABLE:
          case DISABLE:
            Integer outputId = Integer.valueOf((String) commandParams);
            MPDAdmin admin = daemon.getMPDAdmin();
            MPDOutput output = new MPDOutput(outputId - 1); // internally mpd uses 0-based indexing
            if (pCommand == PlayerCommandTypeMapping.ENABLE) {
              admin.enableOutput(output);
            } else {
              admin.disableOutput(output);
            }
            break;
          case VOLUME:
            logger.debug("Volume adjustment received: '{}' '{}'", pCommand, commandParams);
            player.setVolume(((PercentType) commandParams).intValue());
            break;

        }
      }
      catch (MPDPlayerException pe) {
View Full Code Here

Examples of org.bff.javampd.MPDPlayer

      // we give that player another chance -> try to reconnect
      reconnect(playerId);
    }
    if (daemon != null) {
      try {
        MPDPlayer player = daemon.getMPDPlayer();
       
        // get the song object here
        PlayerStatus ps = player.getStatus();
       
        PlayerStatus curPs = playerStatusCache.get(playerId);
        if (curPs != null) {
          if (ps != curPs) {
            logger.debug("Play state of '{}' changed", playerId);
View Full Code Here

Examples of org.bff.javampd.MPDPlayer

      // we give that player another chance -> try to reconnect
      reconnect(playerId);
    }
    if (daemon != null) {
      try {
        MPDPlayer player = daemon.getMPDPlayer();
       
        // get the song object here
        MPDSong curSong = player.getCurrentSong();       
       
        MPDSong curSongCache = songInfoCache.get(playerId);
        if (curSongCache != null) {
          // we have some info
          if (curSong.getId() != curSongCache.getId()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.