YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | List of all members
de.yaacc.upnp.UpnpClient Class Reference

A client facade to the upnp lookup and access framework. More...

Inheritance diagram for de.yaacc.upnp.UpnpClient:
Inheritance graph
Collaboration diagram for de.yaacc.upnp.UpnpClient:
Collaboration graph

Classes

class  LocalDummyDevice
 

Public Member Functions

 UpnpClient (Context context)
 
boolean initialize (Context context)
 Initialize the Object.
 
boolean startService ()
 
void onServiceConnected (ComponentName className, IBinder service)
 
void onServiceDisconnected (ComponentName componentName)
 
void remoteDeviceDiscoveryStarted (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceDiscoveryFailed (Registry registry, RemoteDevice remotedevice, Exception exception)
 
void remoteDeviceAdded (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceUpdated (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceRemoved (Registry registry, RemoteDevice remotedevice)
 
void localDeviceAdded (Registry registry, LocalDevice localdevice)
 
void localDeviceRemoved (Registry registry, LocalDevice localdevice)
 
void beforeShutdown (Registry registry)
 
void afterShutdown ()
 
Service<?, ?> getAVTransportService (Device<?, ?, ?> device)
 Returns a Service of type AVTransport.
 
Service<?, ?> getRenderingControlService (Device<?, ?, ?> device)
 Returns a Service of type RenderingControl.
 
void addUpnpClientListener (UpnpClientListener listener)
 Add an listener.
 
Collection< Device<?, ?, ?> > getDevices ()
 Returns all registered UpnpDevices.
 
Collection< Device<?, ?, ?> > getDevicesProvidingContentDirectoryService ()
 Returns all registered UpnpDevices with a ContentDirectory Service.
 
Collection< Device<?, ?, ?> > getDevicesProvidingAvTransportService ()
 Returns all registered UpnpDevices with an AVTransport Service.
 
Device<?, ?, ?> getDevice (String identifier)
 Returns a registered UpnpDevice.
 
boolean isInitialized ()
 True if the client is initialized.
 
ControlPoint getControlPoint ()
 returns the upnp control point
 
Registry getRegistry ()
 Returns the upnp registry.
 
Context getContext ()
 
ContentDirectoryBrowseResult browseSync (Position pos)
 Browse ContenDirctory synchronous.
 
ContentDirectoryBrowseResult browseSync (Position pos, Long firstResult, Long maxResult)
 
ContentDirectoryBrowseResult browseSync (Device<?, ?, ?> device, String objectID, BrowseFlag flag, String filter, long firstResult, Long maxResults, SortCriterion... orderBy)
 Browse ContenDirctory synchronous.
 
void searchDevices ()
 Search asynchronously for all devices.
 
List< Player > initializePlayers (DIDLObject didlObject)
 Returns all player instances initialized with the given didl object.
 
List< Player > initializePlayers (List< Item > items)
 Returns all player instances initialized with the given didl object.
 
List< Player > initializePlayers (AvTransport transport)
 Returns all player instances initialized with the given transport object.
 
Collection< Player > getCurrentPlayers ()
 Returns all current player instances.
 
List< Player > getCurrentPlayers (AvTransport transport)
 Returns all current player instances for the given transport object.
 
List< Item > toItemList (DIDLContent didlContent)
 returns a list of all items including items in containers for the given didlContent
 
List< Item > toItemList (DIDLObject didlObject)
 Converts the content of a didlObject into a list of cling items.
 
Set< String > getReceiverDeviceIds ()
 Gets the receiver IDs, if none is defined the local device will be returned.
 
void setReceiverDeviceIds (Set< String > receiverDeviceIds)
 Set the list of receiver device ids.
 
Collection< Device<?, ?, ?> > getReceiverDevices ()
 Returns the receiverIds stored in the preferences.
 
int getReceiverDevicesReadyCount ()
 
void setReceiverDevices (Collection< Device<?, ?, ?> > receiverDevices)
 set the receiverDevices to the devices in the given collection.
 
void addReceiverDevice (Device<?, ?, ?> receiverDevice)
 add a receiver device
 
void removeReceiverDevice (Device<?, ?, ?> receiverDevice)
 remove a receiver device
 
String getProviderDeviceId ()
 
Device<?, ?, ?> getProviderDevice ()
 
void setProviderDevice (Device<?, ?, ?> provider)
 
void shutdown ()
 Shutdown the upnp client and all players.
 
int getDefaultDuration ()
 Return the configured default duration.
 
int getSilenceDuration ()
 Return the configured silence duration.
 
boolean isMute ()
 returns the mute state
 
void setMute (boolean mute)
 set the mute state
 
int getVolume ()
 returns the current volume level
 
void setVolume (int desired)
 set the volume in the range of 0-100
 
void downloadItem (DIDLObject selectedDIDLObject)
 
List< Player > initializePlayersWithPlayableItems (List< PlayableItem > items)
 
boolean getMute (Device<?, ?, ?> device)
 
boolean hasActionGetMute (Device<?, ?, ?> device)
 
void setMute (Device<?, ?, ?> device, boolean mute)
 
int getVolume (Device<?, ?, ?> device)
 
boolean hasActionGetVolume (Device<?, ?, ?> device)
 
void setVolume (Device<?, ?, ?> device, int volume)
 
boolean hasActionSetVolume (Service<?, ?> service)
 
Optional< Player > getPlayer (int id)
 
void addToPlaylist (DIDLObject item)
 
PlayableItem createPlayableItem (Uri uri)
 
boolean isPlayerServiceInitialized ()
 

Static Public Attributes

static String LOCAL_UID = "LOCAL_UID"
 

Detailed Description

A client facade to the upnp lookup and access framework.

This class provides all services to manage devices.

Author
Tobias Schoene (TheOpenBit)

Member Function Documentation

◆ addReceiverDevice()

void de.yaacc.upnp.UpnpClient.addReceiverDevice ( Device<?, ?, ?>  receiverDevice)

add a receiver device

Parameters
receiverDevicereceiverDevice
Here is the call graph for this function:

◆ addUpnpClientListener()

void de.yaacc.upnp.UpnpClient.addUpnpClientListener ( UpnpClientListener  listener)

Add an listener.

Parameters
listenerthe listener to be added

◆ browseSync() [1/2]

ContentDirectoryBrowseResult de.yaacc.upnp.UpnpClient.browseSync ( Device<?, ?, ?>  device,
String  objectID,
BrowseFlag  flag,
String  filter,
long  firstResult,
Long  maxResults,
SortCriterion...  orderBy 
)

Browse ContenDirctory synchronous.

Parameters
devicethe device to be browsed
objectIDthe browsing root
flagkind of browsing
See also
BrowseFlag
Parameters
filtera filter
firstResultfirst result
maxResultsmax result count
orderBysorting criteria
See also
SortCriterion
Returns
the browsing result
Here is the call graph for this function:

◆ browseSync() [2/2]

ContentDirectoryBrowseResult de.yaacc.upnp.UpnpClient.browseSync ( Position  pos)

Browse ContenDirctory synchronous.

Parameters
posPosition the device and object to be browsed
Returns
the browsing result

◆ getAVTransportService()

Service<?, ?> de.yaacc.upnp.UpnpClient.getAVTransportService ( Device<?, ?, ?>  device)

Returns a Service of type AVTransport.

Parameters
devicethe device which provides the service
Returns
the service of null

◆ getContext()

Context de.yaacc.upnp.UpnpClient.getContext ( )

◆ getControlPoint()

ControlPoint de.yaacc.upnp.UpnpClient.getControlPoint ( )

returns the upnp control point

Returns
the control point

Referenced by de.yaacc.upnp.UpnpClient.browseSync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentPlayers() [1/2]

Collection< Player > de.yaacc.upnp.UpnpClient.getCurrentPlayers ( )

Returns all current player instances.

Returns
the player

◆ getCurrentPlayers() [2/2]

List< Player > de.yaacc.upnp.UpnpClient.getCurrentPlayers ( AvTransport  transport)

Returns all current player instances for the given transport object.

Parameters
transportthe object which describes the content to be played
Returns
the player
Here is the call graph for this function:

◆ getDefaultDuration()

int de.yaacc.upnp.UpnpClient.getDefaultDuration ( )

Return the configured default duration.

Returns
the duration

Referenced by de.yaacc.upnp.UpnpClient.getCurrentPlayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDevice()

Device<?, ?, ?> de.yaacc.upnp.UpnpClient.getDevice ( String  identifier)

Returns a registered UpnpDevice.

Returns
the upnpDevice null if not found

Referenced by de.yaacc.upnp.UpnpClient.getProviderDevice(), and de.yaacc.upnp.UpnpClient.getReceiverDevices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDevices()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevices ( )

Returns all registered UpnpDevices.

Returns
the upnpDevices

Referenced by de.yaacc.upnp.UpnpClient.getDevices(), de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService(), and de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDevicesProvidingAvTransportService()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService ( )

Returns all registered UpnpDevices with an AVTransport Service.

Returns
the upnpDevices
Here is the call graph for this function:

◆ getDevicesProvidingContentDirectoryService()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService ( )

Returns all registered UpnpDevices with a ContentDirectory Service.

Returns
the upnpDevices
Here is the call graph for this function:

◆ getProviderDevice()

Device<?, ?, ?> de.yaacc.upnp.UpnpClient.getProviderDevice ( )
Returns
the provider device
Here is the call graph for this function:

◆ getProviderDeviceId()

String de.yaacc.upnp.UpnpClient.getProviderDeviceId ( )
Returns
the providerDeviceId

Referenced by de.yaacc.upnp.UpnpClient.getProviderDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReceiverDeviceIds()

Set< String > de.yaacc.upnp.UpnpClient.getReceiverDeviceIds ( )

Gets the receiver IDs, if none is defined the local device will be returned.

Returns
the receiverDeviceIds

Referenced by de.yaacc.upnp.UpnpClient.getReceiverDevices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReceiverDevices()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getReceiverDevices ( )

Returns the receiverIds stored in the preferences.

If an receiver id is unknown it will be removed.

Returns
the receiverDevices

Referenced by de.yaacc.upnp.UpnpClient.addReceiverDevice(), and de.yaacc.upnp.UpnpClient.removeReceiverDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRegistry()

Registry de.yaacc.upnp.UpnpClient.getRegistry ( )

Returns the upnp registry.

Returns
the registry

Referenced by de.yaacc.upnp.UpnpClient.getDevice(), de.yaacc.upnp.UpnpClient.getDevices(), de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService(), and de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRenderingControlService()

Service<?, ?> de.yaacc.upnp.UpnpClient.getRenderingControlService ( Device<?, ?, ?>  device)

Returns a Service of type RenderingControl.

Parameters
devicethe device which provides the service
Returns
the service of null

◆ getSilenceDuration()

int de.yaacc.upnp.UpnpClient.getSilenceDuration ( )

Return the configured silence duration.

Returns
the duration
Here is the call graph for this function:

◆ getVolume()

int de.yaacc.upnp.UpnpClient.getVolume ( )

returns the current volume level

Returns
the value in the range of 0-100
Here is the call graph for this function:

◆ initialize()

boolean de.yaacc.upnp.UpnpClient.initialize ( Context  context)

Initialize the Object.

Parameters
contextthe context
Returns
true if initialization completes correctly

◆ initializePlayers() [1/3]

List< Player > de.yaacc.upnp.UpnpClient.initializePlayers ( AvTransport  transport)

Returns all player instances initialized with the given transport object.

Parameters
transportthe object which describes the content to be played
Returns
the player

◆ initializePlayers() [2/3]

List< Player > de.yaacc.upnp.UpnpClient.initializePlayers ( DIDLObject  didlObject)

Returns all player instances initialized with the given didl object.

Parameters
didlObjectthe object which describes the content to be played
Returns
the player

Referenced by de.yaacc.upnp.UpnpClient.initializePlayers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializePlayers() [3/3]

List< Player > de.yaacc.upnp.UpnpClient.initializePlayers ( List< Item >  items)

Returns all player instances initialized with the given didl object.

Parameters
itemsthe items to be played
Returns
the player
Here is the call graph for this function:

◆ isInitialized()

boolean de.yaacc.upnp.UpnpClient.isInitialized ( )

◆ isMute()

boolean de.yaacc.upnp.UpnpClient.isMute ( )

returns the mute state

Returns
the state
Here is the call graph for this function:

◆ removeReceiverDevice()

void de.yaacc.upnp.UpnpClient.removeReceiverDevice ( Device<?, ?, ?>  receiverDevice)

remove a receiver device

Parameters
receiverDevicereceiverDevice
Here is the call graph for this function:

◆ setMute()

void de.yaacc.upnp.UpnpClient.setMute ( boolean  mute)

set the mute state

Parameters
mutethe state
Here is the call graph for this function:

◆ setReceiverDeviceIds()

void de.yaacc.upnp.UpnpClient.setReceiverDeviceIds ( Set< String >  receiverDeviceIds)

Set the list of receiver device ids.

Parameters
receiverDeviceIdsthe device ids.

Referenced by de.yaacc.upnp.UpnpClient.getReceiverDevices(), and de.yaacc.upnp.UpnpClient.setReceiverDevices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setReceiverDevices()

void de.yaacc.upnp.UpnpClient.setReceiverDevices ( Collection< Device<?, ?, ?> >  receiverDevices)

set the receiverDevices to the devices in the given collection.

Parameters
receiverDevicesthe devices

Referenced by de.yaacc.upnp.UpnpClient.addReceiverDevice(), and de.yaacc.upnp.UpnpClient.removeReceiverDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVolume()

void de.yaacc.upnp.UpnpClient.setVolume ( int  desired)

set the volume in the range of 0-100

Parameters
desiredvolume
Here is the call graph for this function:

◆ toItemList() [1/2]

List< Item > de.yaacc.upnp.UpnpClient.toItemList ( DIDLContent  didlContent)

returns a list of all items including items in containers for the given didlContent

Parameters
didlContentthe content
Returns
all items included in the content

Referenced by de.yaacc.upnp.UpnpClient.initializePlayers(), de.yaacc.upnp.UpnpClient.toItemList(), and de.yaacc.upnp.UpnpClient.toItemList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toItemList() [2/2]

List< Item > de.yaacc.upnp.UpnpClient.toItemList ( DIDLObject  didlObject)

Converts the content of a didlObject into a list of cling items.

Parameters
didlObjectthe content
Returns
the list of cling items
Here is the call graph for this function:

The documentation for this class was generated from the following file: