Now Playing Overview

Select a track to play immediately, or add a track to the "Now Playing" playlist.

Purpose

Now Playing provides functionality to select the track to play now or to add a track to the Now Playing playlist.

Now Playing library details

The DLL that provides the functionality and the library to which your code must link is identified below.

DLL LIB Short description

remconnowplaying.dll

remconnowplaying.lib

Used by an application to receive Now Playing track requests.

Architecture

An application that wants to support Now Playing commands must provide implementations of the commands in the CRemConDatabaseAwareNowPlayingTarget class.

Description

This library allows applications to receive commands for setting the currently playing track or to add a track to the Now Playing playlist.

Note: a media item (such as a song) is identified by a UID. Media Player Controller allows the UID to either be persistent, where the media player supports a database of all UIDs/Track IDs, or to transient where the media player does not support a database.

Key classes

The key classes required for Now Playing are as follows:

  • MRemConDatabaseAwareNowPlayingTargetObserver

    An object of this class must be implemented to interface with the media player. It supports requests to play a specified media item and to add an item to the Now Playing playlist. MRemConDatabaseAwareNowPlayingTargetObserver, adds the concept of a database state. Every item has a unique Item UID, so when the database state changes the UIDs may change. When the database changes state then the UIDs may change and a request to play a particular item UID may be rejected. There is a database state cookie which gets a new value each time the database changes.

  • CRemConDatabaseAwareNowPlayingTarget

    The object used by an application to reply to the command received by the observer class above. The object also informs RemCon about updates to the Now Playing playlist.

  • CRemConInterfaceSelector

    A handle to the remote control server application. This handles the connection for sending and receiving commands and notifications.

Note: for each of the Database aware classes above, there are matching Database unware classes.

Using Now Playing

The Media Player should register the observer classes with the RemCon Interface Selector. When a command arrives for this Media Player, the observer receives the command and the application should use the NowPlayingTarget to send back the results.

Related concepts