1 package iotcode.interfaces;
3 import java.rmi.Remote;
4 import java.rmi.RemoteException;
7 import iotchecker.qual.NonLocalRemote;
9 /** Speaker Interface Class
11 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
15 public interface Speaker extends Remote {
21 * @return [void] None.
23 public void init() throws RemoteException;
25 /** Method to start playback
29 * @return [boolean] True/false to start playback.
31 public boolean startPlayback() throws RemoteException;
33 /** Method to stop playback
37 * @return [boolean] True/false to stop playback.
39 public boolean stopPlayback() throws RemoteException;
42 /** Method to getPlaybackState
46 * @return [boolean] True/false of playback state
48 public boolean getPlaybackState() throws RemoteException;
50 /** Method to set volume
52 * @param [float] Volume percentage.
54 * @return [boolean] True/false to set volume.
56 public boolean setVolume(float _percent) throws RemoteException;
58 /** Method to get volume
62 * @return [float] Volume percentage.
64 public float getVolume() throws RemoteException;
66 /** Method to get position in the song
70 * @return [int] Position in the song when playing music.
72 public int getPosition()throws RemoteException;
74 /** Method to set position
76 * @param [int] Position to set (in milliseconds)
78 * @return [void] None.
80 public void setPosition(int _mSec) throws RemoteException;
82 /** Method to set position
84 * @param [short[]] Sample packets from music file
88 * @return [void] None.
90 public void loadData(short[] _samples, int _offs, int _len) throws RemoteException;
93 /** Method to clear all pcm data
97 * @return [void] None.
99 public void clearData() throws RemoteException;
102 /** Method to register callbacks
104 * @param [SpeakerCallback] Callback object
106 * @return [void] None.
108 public void registerCallback(@NonLocalRemote SpeakerCallback _cb) throws RemoteException;