|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.daap.DaapServer
public class DaapServer
This Service handles DAAP and DACP requests via a WebServer, and manages the announcement of this service via ZeroConf. It's used for streaming music to iTunes, or to allow a Player to be remotely controlled by the Remote app on an Apple iPhone. Only one DaapServer is required to service multiple simultaneous clients - one is required for sharing, and when playing the correct Player to control can be identified by the Remote that's in use.
Constructor Summary | |
---|---|
DaapServer()
|
Method Summary | |
---|---|
void |
addRemote(java.lang.String name,
Player player,
java.lang.String pin)
Add a new Remote pairing |
ServiceContext |
getContext()
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext) |
boolean |
isSharing()
Return true if this DaapServer is sharing it's collection to iTunes, as set by setSharing(boolean) |
void |
removeRemote(java.lang.String name,
Player player)
Unpair a previously paired Remote |
java.util.Map<java.lang.String,java.lang.Object> |
reportState()
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. |
void |
setSharing(boolean sharing)
Set whether this DaapServer is sharing it's collection to iTunes |
void |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DaapServer()
Method Detail |
---|
public boolean isSharing()
setSharing(boolean)
public void setSharing(boolean sharing)
public void startService(ServiceContext context)
Service
startService
in interface Service
context
- the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
stopService
in interface Service
context
- the ServiceContext for this Service (same as was passed into start)public ServiceContext getContext()
Service
Service.startService(org.qtunes.core.ServiceContext)
getContext
in interface Service
public java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
reportState
in interface Service
public void addRemote(java.lang.String name, Player player, java.lang.String pin)
name
- the name of the Remoteplayer
- the Player it's being paired withpin
- the 4-digit pin entered by the user to match that on the Remotepublic void removeRemote(java.lang.String name, Player player)
name
- the name of the Remoteplayer
- the Player it was paired with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |