sk.baka.ambient.playerservice
Interface IPlayer

All Superinterfaces:
IInterface
All Known Implementing Classes:
IPlayer.Stub

public interface IPlayer
extends IInterface

The player service command packet.

Author:
Martin Vysny

Nested Class Summary
static class IPlayer.Stub
          Local-side IPC implementation stub class.
 
Method Summary
 int getPlaybackState()
          Returns the playback state.
 int getPosition()
          Returns current position in millis of the playback.
 void pause()
          Pauses the player, or resumes playback if the player was paused.
 void play(String file, int origin, int initialSeekMillis)
          Plays given file.
 boolean seek(int position)
          Seeks to given position.
 void stop()
          Stops playback.
 
Methods inherited from interface android.os.IInterface
asBinder
 

Method Detail

pause

void pause()
           throws RemoteException
Pauses the player, or resumes playback if the player was paused. Does nothing if the player is stopped.

Throws:
RemoteException

play

void play(String file,
          int origin,
          int initialSeekMillis)
          throws RemoteException
Plays given file.

Parameters:
file - Absolute file name which to play.
origin - the origin, ordinal of the TrackOriginEnum enum.
initialSeekMills - start playback here. Ignored when the stream is not seekable.
Throws:
RemoteException

stop

void stop()
          throws RemoteException
Stops playback. Does nothing if the playback is not started.

Throws:
RemoteException

seek

boolean seek(int position)
             throws RemoteException
Seeks to given position. If the position is invalid then the result is undefined. Does nothing if the playback is stopped. Does not unpause the playback.

Parameters:
position - Seek to this position in milliseconds.
Returns:
true if the playback position changed, false otherwise. false can be returned for example when the playback is stopped or the stream is not seekable.
Throws:
RemoteException

getPlaybackState

int getPlaybackState()
                     throws RemoteException
Returns the playback state.

Throws:
RemoteException

getPosition

int getPosition()
                throws RemoteException
Returns current position in millis of the playback. Returns 0 if the playback is stopped.

Returns:
current player position in millis.
Throws:
RemoteException


Copyright © 2007-2008. All Rights Reserved.