IWMSPlaylist::get_CurrentPlaylistEntry

banner art

Previous Next

IWMSPlaylist::get_CurrentPlaylistEntry

The get_CurrentPlaylistEntry method retrieves the active playlist element.

Syntax

  HRESULT get_CurrentPlaylistEntry(
  
  IXMLDOMElement**
  
  ppPlaylistEntry
  
  );

Parameters

ppPlaylistEntry

[out] Pointer to a pointer to an IXMLDOMElement interface. This method calls AddRef internally. To avoid memory leaks, you must call Release when you are finished using the interface.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Meaning
E_INVALIDARG 0x80070057 ppPlaylistEntry is a NULL pointer argument.

Remarks

There are no restrictions on what element the server's position can be changed to. When CurrentPlaylistEntry is used to make an element not currently on the call stack the current element, all items above its parent element are removed from the call stack.

Unlike the FireEvent method, when this property is used to change the server's current position in the playlist, there are no restrictions on what element the server's current position can be changed to.

When this property is used to set the position of the server in the playlist and the element is currently on the call stack, the server removes all elements above the element on the call stack. If the element is not currently on the call stack, the server removes all elements above its parent element.

  • Note   The CallerEntry property can be used to discover which items are on the playlist call stack.

Example Code

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer      *pServer;
IWMSPlayers     *pPlayers;
IWMSPlayer      *pPlayer;
IWMSPlaylist    *pPlaylist;
IXMLDOMElement  *pPlaylistEntry;

HRESULT         hr;
CComVariant     varIndex;
long            lCount;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlayers interface
// and retrieve the total count of current connections.
hr = pServer->get_Players(&pPlayers);
if (FAILED(hr)) goto EXIT;
hr = pPlayers->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;

// Retrieve information about each requested playlist.
for (long x = 0; x < lCount; x++)
{
    varIndex = x;
    hr = pPlayers->get_Item(varIndex, &pPlayer);
    if (FAILED(hr)) goto EXIT;

    // Retrieve the playlist that is requested 
    // by the client if one exists.
    hr = pPlayer->get_RequestedPlaylist(&pPlaylist);
    if (FAILED(hr)) goto EXIT;

    // Retrieve information about the current playlist entry.
    hr = pPlaylist->get_CurrentPlaylistEntry(&pPlaylistEntry);
    if (FAILED(hr)) goto EXIT;

    // Release temporary COM objects.
    pPlayer->Release();
    pPlaylist->Release();
    pPlaylistEntry->Release();
}



Requirements

Header: wmsserver.h

Library: WMSServerTypeLib.dll

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next