Android Open Source - AudioBook I Player Events






From Project

Back to project page AudioBook.

License

The source code is released under:

Creative Commons Legal Code Attribution-NonCommercial 3.0 Unported CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT C...

If you think the Android project AudioBook listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 *  This work is licensed under the Creative Commons Attribution-NonCommercial-
 *  NoDerivs 3.0 Unported License. To view a copy of this license, visit
 *  http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to 
 *  Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 
 *  94041, USA.//from  w  w w. jav a  2s  . co m
 * 
 *  Use of this work is permitted only in accordance with license rights granted.
 *  Materials provided "AS IS"; no representations or warranties provided.
 * 
 *  Copyright ? 2012 Marcus Parkkinen, Aki K?kel?, Fredrik ?hs.
 **/

package edu.chalmers.dat255.audiobookplayer.interfaces;

/**
 * Specifies the possible events coming from the Player, including user
 * interface controls and playback functionality.
 * 
 * @author Aki K?kel?
 * @version 0.6
 * 
 */
public interface IPlayerEvents {

  /**
   * Resumes playback if the player is already in a started state.
   * <p>
   * Does nothing if the player was already paused.
   */
  void resume();

  /**
   * Pauses playback if the player is already in a started state.
   * <p>
   * Does nothing if the player was already playing.
   */
  void pause();

  /**
   * Sets the selected track to the previous track.
   * <p>
   * If the selected track was zero, it will do nothing.
   * <p>
   * If there was no selected track, it will do nothing.
   */
  void previousTrack();

  /**
   * Sets the selected track to the next track.
   * <p>
   * If the selected track was the last track, it will deselect any track.
   * <p>
   * If there was no selected track, it will select the first track.
   */
  void nextTrack();

  /**
   * Seeks to the left (rewinds).
   * <p>
   * Note: in the future, 'seek' would have been used to determine a
   * stopped/started state to end/start seeking.
   * 
   * @param seek
   *            Starts or keeps seeking if true. Stops if false.
   */
  void seekLeft(boolean seek);

  /**
   * Seeks to the right (fast-forwards).
   * <p>
   * Note: in the future, 'seek' would have been used to determine a
   * stopped/started state to end/start seeking.
   * 
   * @param seek
   *            Starts or keeps seeking if true. Stops if false.
   */
  void seekRight(boolean seek);

  /**
   * Seeks to the given percentage in a track.
   * 
   * @param percentage
   *            0 <= percentage <= 1
   */
  void seekToPercentageInTrack(double percentage);

  /**
   * Seeks to the given percentage in a book.
   * 
   * @param percentage
   *            0 <= percentage <= 1
   */
  void seekToPercentageInBook(double percentage);

  /**
   * Checks whether audio is playing.
   * <p>
   * The difference between isPlaying() and isStarted() is that isPlaying() is
   * true only if audio is playing, while isStarted() is true if audio is
   * playing AND/OR audio HAS been started (i.e. is paused).
   * 
   * @return True if playing audio.
   */
  boolean isPlaying();

  /**
   * Checks whether audio has been started.
   * <p>
   * The difference between isPlaying() and isStarted() is that isPlaying() is
   * true only if audio is playing, while isStarted() is true if audio is
   * playing AND/OR audio HAS been started (i.e. is paused).
   * 
   * @return True if started (playing or paused).
   */
  boolean isStarted();

}




Java Source Code List

edu.chalmers.dat255.audiobookplayer.constants.Constants.java
edu.chalmers.dat255.audiobookplayer.constants.PlaybackStatus.java
edu.chalmers.dat255.audiobookplayer.ctrl.BookshelfControllerTest.java
edu.chalmers.dat255.audiobookplayer.ctrl.BookshelfController.java
edu.chalmers.dat255.audiobookplayer.ctrl.PlayerControllerTest.java
edu.chalmers.dat255.audiobookplayer.ctrl.PlayerController.java
edu.chalmers.dat255.audiobookplayer.instrumentation.AllTests.java
edu.chalmers.dat255.audiobookplayer.interfaces.IBookUpdates.java
edu.chalmers.dat255.audiobookplayer.interfaces.IBookshelfEvents.java
edu.chalmers.dat255.audiobookplayer.interfaces.IBookshelfGUIEvents.java
edu.chalmers.dat255.audiobookplayer.interfaces.IPlayerEvents.java
edu.chalmers.dat255.audiobookplayer.interfaces.ITrackUpdates.java
edu.chalmers.dat255.audiobookplayer.model.BookTest.java
edu.chalmers.dat255.audiobookplayer.model.Book.java
edu.chalmers.dat255.audiobookplayer.model.BookshelfTest.java
edu.chalmers.dat255.audiobookplayer.model.Bookshelf.java
edu.chalmers.dat255.audiobookplayer.model.TagTest.java
edu.chalmers.dat255.audiobookplayer.model.Tag.java
edu.chalmers.dat255.audiobookplayer.model.TrackTest.java
edu.chalmers.dat255.audiobookplayer.model.Track.java
edu.chalmers.dat255.audiobookplayer.util.BookCreatorTest.java
edu.chalmers.dat255.audiobookplayer.util.BookCreator.java
edu.chalmers.dat255.audiobookplayer.util.BookshelfHandlerTest.java
edu.chalmers.dat255.audiobookplayer.util.BookshelfHandler.java
edu.chalmers.dat255.audiobookplayer.util.FileParserTest.java
edu.chalmers.dat255.audiobookplayer.util.FileParser.java
edu.chalmers.dat255.audiobookplayer.util.JsonParserTest.java
edu.chalmers.dat255.audiobookplayer.util.JsonParser.java
edu.chalmers.dat255.audiobookplayer.util.TextFormatterTest.java
edu.chalmers.dat255.audiobookplayer.util.TextFormatter.java
edu.chalmers.dat255.audiobookplayer.util.TrackCreatorTest.java
edu.chalmers.dat255.audiobookplayer.util.TrackCreator.java
edu.chalmers.dat255.audiobookplayer.view.BookshelfFragment.java
edu.chalmers.dat255.audiobookplayer.view.BrowserActivityTest.java
edu.chalmers.dat255.audiobookplayer.view.BrowserActivity.java
edu.chalmers.dat255.audiobookplayer.view.MainActivity.java
edu.chalmers.dat255.audiobookplayer.view.PlayerFragment.java
edu.chalmers.dat255.audiobookplayer.view.ViewPagerAdapter.java