You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
amarok/amarok/src/engine/helix/helix-sp/hspcontext.h

102 lines
2.6 KiB

/*
*
* This software is released under the provisions of the GPL version 2.
* see file "COPYING". If that file is not available, the full statement
* of the license can be found at
*
* http://www.fsf.org/licensing/licenses/gpl.txt
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
* Portions (c) Paul Cifarelli 2005
*
*/
#ifndef _HSPCONTEXT_
#define _HSPCONTEXT_
struct IUnknown;
struct IHXPreferences;
struct IHXVolume;
class IHXCommonClassFactory;
class HSPClientAdviceSink;
class HSPErrorMessages;
class HSPAuthenticationManager;
class HelixSimplePlayer;
class HSPEngineContext : public IHXPreferences
{
public:
HSPEngineContext(HelixSimplePlayer *splayer, IHXCommonClassFactory *pCommonClassFactory);
virtual ~HSPEngineContext();
void Init(IUnknown* /*IN*/ pUnknown);
void Close();
/*
* IUnknown methods
*/
STDTQT_METHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj);
STDMETHOD_(ULONG32,AddRef) (THIS);
STDMETHOD_(ULONG32,Release) (THIS);
/*
* IHXPreferences methods
*/
STDTQT_METHOD(ReadPref) (THIS_ const char* pref_key,
IHXBuffer*& buffer);
STDTQT_METHOD(WritePref) (THIS_ const char* pref_key,
IHXBuffer* buffer);
private:
LONG32 m_lRefCount;
IHXCommonClassFactory *m_CommonClassFactory;
HelixSimplePlayer *m_splayer;
};
class HSPClientContext : public IHXPreferences
{
private:
LONG32 m_lRefCount;
LONG32 m_lClientIndex;
HSPClientAdviceSink* m_pClientSink;
HSPErrorSink* m_pErrorSink;
HSPAuthenticationManager* m_pAuthMgr;
IHXPreferences* m_pDefaultPrefs;
char m_pszGUID[256];
HelixSimplePlayer *m_splayer;
public:
HSPClientContext(LONG32 lClientIndex, HelixSimplePlayer *pSplay);
virtual ~HSPClientContext();
unsigned long position() { return m_pClientSink ? m_pClientSink->position() : 0; }
unsigned long duration() { return m_pClientSink ? m_pClientSink->duration() : 0; }
void Init(IUnknown* /*IN*/ pUnknown,
IHXPreferences* /*IN*/ pPreferences,
char* /*IN*/ pszGUID);
void Close();
/*
* IUnknown methods
*/
STDTQT_METHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj);
STDMETHOD_(ULONG32,AddRef) (THIS);
STDMETHOD_(ULONG32,Release) (THIS);
/*
* IHXPreferences methods
*/
STDTQT_METHOD(ReadPref) (THIS_ const char* pref_key,
IHXBuffer*& buffer);
STDTQT_METHOD(WritePref) (THIS_ const char* pref_key,
IHXBuffer* buffer);
};
#endif