From rishimathew at helixcommunity.org  Mon Dec  5 17:33:08 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Mon Dec  5 20:03:02 2005
Subject: [Player-cvs] CVSROOT avail,1.29,1.30
Message-ID: 

Update of /cvsroot/player/CVSROOT
In directory cvs:/tmp/cvs-serv7829/CVSROOT

Modified Files:
	avail 
Log Message:
giving nhunshyal write access for the 'player' project

Index: avail
===================================================================
RCS file: /cvsroot/player/CVSROOT/avail,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- avail	3 Nov 2005 15:38:30 -0000	1.29
+++ avail	6 Dec 2005 01:33:06 -0000	1.30
@@ -116,6 +116,7 @@
 avail|mmorfa
 avail|murali
 avail|nhart
+avail|nhunshyal
 avail|nick
 avail|ottoreck
 avail|pankajgupta


From rishimathew at helixcommunity.org  Tue Dec  6 12:10:56 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Tue Dec  6 14:40:38 2005
Subject: [Player-cvs] CVSROOT avail,1.30,1.31
Message-ID: 

Update of /cvsroot/player/CVSROOT
In directory cvs:/tmp/cvs-serv30563/CVSROOT

Modified Files:
	avail 
Log Message:
giving jfouts write access for the 'player' project

Index: avail
===================================================================
RCS file: /cvsroot/player/CVSROOT/avail,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- avail	6 Dec 2005 01:33:06 -0000	1.30
+++ avail	6 Dec 2005 20:10:54 -0000	1.31
@@ -80,6 +80,7 @@
 avail|jengosnell
 avail|jfarr
 avail|jfosado
+avail|jfouts
 avail|jgoraya
 avail|jgordon
 avail|jhug


From cdunn at helixcommunity.org  Tue Dec  6 14:02:19 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Tue Dec  6 16:32:02 2005
Subject: [Player-cvs] jsr135kit/javax/microedition/media mmapiJNI.java, 1.3,
	1.4
Message-ID: 

Update of /cvsroot/player/jsr135kit/javax/microedition/media
In directory cvs:/tmp/cvs-serv29160/javax/microedition/media

Modified Files:
	mmapiJNI.java 
Log Message:
Changes for helix client state, etc.

Index: mmapiJNI.java
===================================================================
RCS file: /cvsroot/player/jsr135kit/javax/microedition/media/mmapiJNI.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mmapiJNI.java	19 Nov 2005 00:38:30 -0000	1.3
+++ mmapiJNI.java	6 Dec 2005 22:02:17 -0000	1.4
@@ -14,13 +14,20 @@
   public final static native void _Manager_playTone(int jarg1, int jarg2, int jarg3);
   public final static native long _Manager_createPlayer(String jarg1);
   public final static native void _Manager_StartEngineDriver();
+  public final static native int get_TransState_Idle();
   public final static native long new__MediaException__SWIG_0();
   public final static native long new__MediaException__SWIG_1(String jarg1);
   public final static native void delete__MediaException(long jarg1);
   public final static native long new__IllegalStateException__SWIG_0();
   public final static native long new__IllegalStateException__SWIG_1(String jarg1);
   public final static native void delete__IllegalStateException(long jarg1);
-  public final static native long new__Player(long jarg1, long jarg2, String jarg3);
+  public final static native void set_EventInfo_eventName(long jarg1, String jarg2);
+  public final static native String get_EventInfo_eventName(long jarg1);
+  public final static native void set_EventInfo_eventData(long jarg1, long jarg2);
+  public final static native long get_EventInfo_eventData(long jarg1);
+  public final static native long new_EventInfo();
+  public final static native void delete_EventInfo(long jarg1);
+  public final static native long new__Player(long jarg1, String jarg2);
   public final static native void delete__Player(long jarg1);
   public final static native int get__Player_UNREALIZED();
   public final static native int get__Player_REALIZED();


From cdunn at helixcommunity.org  Tue Dec  6 14:02:19 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Tue Dec  6 16:32:02 2005
Subject: [Player-cvs] jsr135kit/pub enginedriver.h, 1.2, 1.3 hxjcontext.h,
	1.2, 1.3 player.h, 1.3, 1.4
Message-ID: 

Update of /cvsroot/player/jsr135kit/pub
In directory cvs:/tmp/cvs-serv29160/pub

Modified Files:
	enginedriver.h hxjcontext.h player.h 
Log Message:
Changes for helix client state, etc.

Index: enginedriver.h
===================================================================
RCS file: /cvsroot/player/jsr135kit/pub/enginedriver.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- enginedriver.h	15 Nov 2005 19:15:01 -0000	1.2
+++ enginedriver.h	6 Dec 2005 22:02:17 -0000	1.3
@@ -1,7 +1,8 @@
 #ifndef _ENGINEDRIVER_H
 #define _ENGINEDRIVER_H
 
-#include "hxthread.h"
+class HXThread;
+class HXEvent;
 
 class HXEngineDriver
 {
@@ -9,80 +10,8 @@
 	HXEngineDriver () : m_pThread(NULL), m_pEvent(NULL) {}
 	void Start();
 
-	void Block()	{ if (m_pEvent) { m_pEvent->Wait(); } }
-	void Unblock()	{ if (m_pEvent) { m_pEvent->SignalEvent(); } }
-
 	HXThread* m_pThread;
 	HXEvent* m_pEvent;
-
-	// Player transition state 
-	enum TransState {
-	    TransState_Idle	    = 0,
-	    TransState_Realizing,
-	    TransState_Prefetching,
-	    TransState_Starting,
-	    TransState_Stopping,
-	    TransState_Deallocating,
-	    TransState_Closing
-	};
-
-	void Block( TransState s)
-	{
-		printf("Blocking: %d\n", (int) s);
-		switch (s) {
-			case TransState_Realizing :
-				m_pRealizedEvent->Wait();
-				break;
-			case TransState_Prefetching :
-				m_pPrefetchedEvent->Wait();
-				break;
-			case TransState_Starting :
-				m_pStartedEvent->Wait();
-				break;
-			case TransState_Stopping :
-				m_pStoppedEvent->Wait();
-				break;
-			case TransState_Deallocating :
-				m_pDeallocatedEvent->Wait();
-				break;
-			case TransState_Closing :
-				m_pClosedEvent->Wait();
-				break;
-		}
-	}
-
-	void Unblock( TransState s)
-	{
-		printf("Unblocking: %d\n", (int) s);
-		switch (s) {
-			case TransState_Realizing :
-				m_pRealizedEvent->SignalEvent();
-				break;
-			case TransState_Prefetching :
-				m_pPrefetchedEvent->SignalEvent();
-				break;
-			case TransState_Starting :
-				m_pStartedEvent->SignalEvent();
-				break;
-			case TransState_Stopping :
-				m_pStoppedEvent->SignalEvent();
-				break;
-			case TransState_Deallocating :
-				m_pDeallocatedEvent->SignalEvent();
-				break;
-			case TransState_Closing :
-				m_pClosedEvent->SignalEvent();
-				break;
-		}
-	}
-
-	HXEvent* m_pRealizedEvent;
-	HXEvent* m_pPrefetchedEvent;
-	HXEvent* m_pStartedEvent;
-	HXEvent* m_pStoppedEvent;
-	HXEvent* m_pDeallocatedEvent;
-	HXEvent* m_pClosedEvent;
-
 };
 
 #endif

Index: player.h
===================================================================
RCS file: /cvsroot/player/jsr135kit/pub/player.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- player.h	19 Nov 2005 00:38:30 -0000	1.3
+++ player.h	6 Dec 2005 22:02:17 -0000	1.4
@@ -16,14 +16,30 @@
 #include "hxengin.h"
 
 #include "hxjcontext.h"
-#include "enginedriver.h"
+//#include "enginedriver.h"
 
 struct IUnknown;
 class TimeBase;
 class PlayerListener;
 class HXJClientContext;
 class HXMutex;
+class HXEvent;
 struct IHXScheduler;
+struct IHXClientState;
+struct IHXClientStateAdviseSink;
+
+// Player transition state 
+typedef enum _TransState {
+	    TransState_Idle	    = 0,
+	    TransState_Realizing,
+	    TransState_Prefetching,
+	    TransState_Starting,
+	    TransState_Stopping,
+	    TransState_Deallocating,
+	    TransState_Deallocating2,
+	    TransState_Closing,
+	    TransState_Count
+} TransState;
 
 class _MediaException {
 public:
@@ -49,11 +65,18 @@
 	CHXString m_reason;
 };
 
+typedef struct _EventInfo {
+	char eventName[80];
+	void* eventData;
+} EventInfo;
 
 class _Player
+#ifndef SWIG
+	: public IHXClientStateAdviseSink
+#endif
 {
 public:
-    _Player(IHXClientEngine* pClientEngine, HXEngineDriver* pEngineDriver, char* locator);
+    _Player(IHXClientEngine* pClientEngine, char* locator);
     ~_Player();
 
     // Player state values according the the JSR135 spec
@@ -105,7 +128,27 @@
     char* getContentType() throw( _MediaException );
 
 #ifndef SWIG
-    bool getEvent(char** event, void** eventData);
+    HXBOOL getEvent(EventInfo* pInfo);
+    /*
+     *  IUnknown methods
+     */
+    STDMETHOD(QueryInterface) (THIS_
+                               REFIID riid,
+                               void** ppvObj);
+    
+    STDMETHOD_(ULONG32,AddRef) (THIS);
+
+    STDMETHOD_(ULONG32,Release) (THIS);
+    /************************************************************************
+     *  Method:
+     *      IHXClientStateAdviseSink::OnStateChange
+     *  Purpose:
+     *      Called by client engine to inform the client that the state changed
+     *
+     */
+    STDMETHOD (OnStateChange) (THIS_
+                             UINT16 uOldState,
+                             UINT16 uNewState);
 #endif
     /*
 
@@ -124,13 +167,15 @@
 
 private:
 
-    void TransitionToState(HXEngineDriver::TransState toState);
-    void gotoState(HXEngineDriver::TransState fromState,
-		   HXEngineDriver::TransState toState,
+    void TransitionToState(TransState toState);
+    void gotoState(TransState fromState,
+		   TransState toState,
 		   IHXCallback* pCallback,
 		   HXBOOL bWait);
+    void Unblock(TransState eState);
+    void Block(TransState eState);
 
-    HXEngineDriver::TransState m_eTransState;
+    TransState m_eTransState;
 
     void CreatePlayer();
     void realizeFunc();
@@ -149,7 +194,7 @@
 
     IHXClientEngine*	m_pClientEngine;
     IHXPlayer*		m_pPlayer;
-    HXEngineDriver*	m_pEngineDriver;
+    IHXClientState*	m_pClientState;
     PlayerState		m_state;
     CHXString		m_url;
     HXJClientContext*	m_pContext;
@@ -157,6 +202,18 @@
     HXMutex*		m_pMutex;
     LONG32		m_lRefCount;
 
+    HXEvent* m_pCreatePlayerEvent;
+    HXEvent* m_pEvents[TransState_Count];
+    /*
+    HXEvent* m_pRealizedEvent;
+    HXEvent* m_pPrefetchedEvent;
+    HXEvent* m_pStartedEvent;
+    HXEvent* m_pStoppedEvent;
+    HXEvent* m_pDeallocatedEvent;
+    HXEvent* m_pDeallocatedEvent2;
+    HXEvent* m_pClosedEvent;
+    */
+
     /////////// Callback classes
     // CreatePlayer
     class CreatePlayerCallback : public IHXCallback

Index: hxjcontext.h
===================================================================
RCS file: /cvsroot/player/jsr135kit/pub/hxjcontext.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hxjcontext.h	19 Nov 2005 00:38:30 -0000	1.2
+++ hxjcontext.h	6 Dec 2005 22:02:17 -0000	1.3
@@ -39,7 +39,6 @@
 struct IUnknown;
 struct IHXPreferences;
 class HXJClientAdviseSink;
-class HXJClientStateAdviseSink;
 class HXJErrorMessages;
 class HXJAuthenticationManager;
 class HXJPDStatusObserver;
@@ -58,9 +57,7 @@
     LONG32			m_lRefCount;
     LONG32                      m_lClientIndex;
 
-
     HXJClientAdviseSink*	m_pClientSink;
-    HXJClientStateAdviseSink*	m_pClientState;
     HXJErrorSink*		m_pErrorSink;
     HXJAuthenticationManager*	m_pAuthMgr;
     HXJSiteSupplier*		m_pSiteSupplier;


From cdunn at helixcommunity.org  Tue Dec  6 14:02:19 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Tue Dec  6 16:32:02 2005
Subject: [Player-cvs] jsr135kit PlayerCallback.cpp, 1.1.1.1, 1.2 Umakefil,
	1.2, 1.3 enginedriver.cpp, 1.2, 1.3 hxjadvsnk.cpp, 1.3,
	1.4 hxjcontext.cpp, 1.2, 1.3 manager.cpp, 1.2,
	1.3 manager_wrap.cpp, 1.3, 1.4 myplay.java, 1.3,
	1.4 player.cpp, 1.2, 1.3
Message-ID: 

Update of /cvsroot/player/jsr135kit
In directory cvs:/tmp/cvs-serv29160

Modified Files:
	PlayerCallback.cpp Umakefil enginedriver.cpp hxjadvsnk.cpp 
	hxjcontext.cpp manager.cpp manager_wrap.cpp myplay.java 
	player.cpp 
Log Message:
Changes for helix client state, etc.

Index: hxjcontext.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/hxjcontext.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- hxjcontext.cpp	19 Nov 2005 00:38:30 -0000	1.2
+++ hxjcontext.cpp	6 Dec 2005 22:02:16 -0000	1.3
@@ -45,13 +45,11 @@
 #include "hxmangle.h"
 
 #include "hxclsnk.h"
-//#include "hxclstate.h"
 #include "hxerror.h"
 #include "hxprefs.h"
 #include "hxstrutl.h"
 
 #include "hxjadvsnk.h"
-#include "hxjstate.h"
 #include "hxjerror.h"
 #include "hxjsitsup.h"
 #include "hxjaumgr.h"
@@ -67,7 +65,6 @@
     : m_lRefCount(0)
     , m_lClientIndex(lClientIndex)
     , m_pClientSink(NULL)
-    , m_pClientState(NULL)
     , m_pErrorSink(NULL)
     , m_pAuthMgr(NULL)
     , m_pSiteSupplier(NULL)
@@ -93,7 +90,6 @@
 
 	
     m_pClientSink	= new HXJClientAdviseSink(pUnknown, m_lClientIndex, this);
-    m_pClientState	= new HXJClientStateAdviseSink(pUnknown, this);
     m_pErrorSink	= new HXJErrorSink(pUnknown);
     m_pAuthMgr          = new HXJAuthenticationManager();
 #if defined(HELIX_FEATURE_VIDEO)
@@ -113,11 +109,6 @@
 	m_pClientSink->AddRef();
     }
     
-    //if (m_pClientState)
-    {
-	//m_pClientState->AddRef();
-    }
-    
     if (m_pErrorSink)
     {
 	m_pErrorSink->AddRef();
@@ -154,7 +145,6 @@
 void HXJClientContext::Close()
 {
     HX_RELEASE(m_pClientSink);
-    //HX_RELEASE(m_pClientState);
     HX_RELEASE(m_pErrorSink);
     HX_RELEASE(m_pAuthMgr);
     HX_RELEASE(m_pSiteSupplier);
@@ -194,11 +184,6 @@
     {
 	return HXR_OK;
     }
-    //else if (m_pClientState && 
-	     //m_pClientState->QueryInterface(riid, ppvObj) == HXR_OK)
-    //{
-	//return HXR_OK;
-    //}
     else if (m_pErrorSink && 
 	     m_pErrorSink->QueryInterface(riid, ppvObj) == HXR_OK)
     {

Index: manager_wrap.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/manager_wrap.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- manager_wrap.cpp	19 Nov 2005 00:38:30 -0000	1.3
+++ manager_wrap.cpp	6 Dec 2005 22:02:16 -0000	1.4
@@ -238,6 +238,19 @@
 }
 
 
+JNIEXPORT jint JNICALL Java_javax_microedition_media_mmapiJNI_get_1TransState_1Idle(JNIEnv *jenv, jclass jcls) {
+    jint jresult = 0 ;
+    _TransState result;
+    
+    (void)jenv;
+    (void)jcls;
+    result = (_TransState)TransState_Idle;
+    
+    jresult = (jint)result; 
+    return jresult;
+}
+
+
 JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1_1MediaException_1_1SWIG_10(JNIEnv *jenv, jclass jcls) {
     jlong jresult = 0 ;
     _MediaException *result;
@@ -334,29 +347,121 @@
 }
 
 
-JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1_1Player(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jstring jarg3) {
+JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1EventInfo_1eventName(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
+    EventInfo *arg1 = (EventInfo *) 0 ;
+    char *arg2 ;
+    
+    (void)jenv;
+    (void)jcls;
+    arg1 = *(EventInfo **)(void *)&jarg1; 
+    {
+        arg2 = 0;
+        if (jarg2) {
+            arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+            if (!arg2) return ;
+        }
+    }
+    {
+        if (arg2) strncpy(arg1->eventName,arg2,80);
+        else arg1->eventName[0] = 0;
+    }
+    
+    {
+        if (arg2) jenv->ReleaseStringUTFChars(jarg2, arg2); 
+    }
+}
+
+
+JNIEXPORT jstring JNICALL Java_javax_microedition_media_mmapiJNI_get_1EventInfo_1eventName(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+    jstring jresult = 0 ;
+    EventInfo *arg1 = (EventInfo *) 0 ;
+    char *result;
+    
+    (void)jenv;
+    (void)jcls;
+    arg1 = *(EventInfo **)(void *)&jarg1; 
+    result = (char *)(char *) ((arg1)->eventName);
+    
+    {
+        if(result) jresult = jenv->NewStringUTF(result); 
+    }
+    return jresult;
+}
+
+
+JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1EventInfo_1eventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
+    EventInfo *arg1 = (EventInfo *) 0 ;
+    void *arg2 = (void *) 0 ;
+    
+    (void)jenv;
+    (void)jcls;
+    arg1 = *(EventInfo **)(void *)&jarg1; 
+    arg2 = *(void **)(void *)&jarg2; 
+    if (arg1) (arg1)->eventData = arg2;
+    
+}
+
+
+JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_get_1EventInfo_1eventData(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+    jlong jresult = 0 ;
+    EventInfo *arg1 = (EventInfo *) 0 ;
+    void *result;
+    
+    (void)jenv;
+    (void)jcls;
+    arg1 = *(EventInfo **)(void *)&jarg1; 
+    result = (void *) ((arg1)->eventData);
+    
+    *(void **)(void *)&jresult = result; 
+    return jresult;
+}
+
+
+JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1EventInfo(JNIEnv *jenv, jclass jcls) {
+    jlong jresult = 0 ;
+    EventInfo *result;
+    
+    (void)jenv;
+    (void)jcls;
+    result = (EventInfo *)new EventInfo();
+    
+    *(EventInfo **)(void *)&jresult = result; 
+    return jresult;
+}
+
+
+JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_delete_1EventInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) {
+    EventInfo *arg1 = (EventInfo *) 0 ;
+    
+    (void)jenv;
+    (void)jcls;
+    arg1 = *(EventInfo **)(void *)&jarg1; 
+    delete arg1;
+    
+}
+
+
+JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1_1Player(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
     jlong jresult = 0 ;
     IHXClientEngine *arg1 = (IHXClientEngine *) 0 ;
-    HXEngineDriver *arg2 = (HXEngineDriver *) 0 ;
-    char *arg3 = (char *) 0 ;
+    char *arg2 = (char *) 0 ;
     _Player *result;
     
     (void)jenv;
     (void)jcls;
     arg1 = *(IHXClientEngine **)(void *)&jarg1; 
-    arg2 = *(HXEngineDriver **)(void *)&jarg2; 
     {
-        arg3 = 0;
-        if (jarg3) {
-            arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
-            if (!arg3) return 0;
+        arg2 = 0;
+        if (jarg2) {
+            arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+            if (!arg2) return 0;
         }
     }
-    result = (_Player *)new _Player(arg1,arg2,arg3);
+    result = (_Player *)new _Player(arg1,arg2);
     
     *(_Player **)(void *)&jresult = result; 
     {
-        if (arg3) jenv->ReleaseStringUTFChars(jarg3, arg3); 
+        if (arg2) jenv->ReleaseStringUTFChars(jarg2, arg2); 
     }
     return jresult;
 }

Index: PlayerCallback.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/PlayerCallback.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- PlayerCallback.cpp	10 Nov 2005 19:10:30 -0000	1.1.1.1
+++ PlayerCallback.cpp	6 Dec 2005 22:02:16 -0000	1.2
@@ -22,13 +22,13 @@
 
     _Player* pPlayer = *(_Player **)(void *)&cPtr;
 
-    char* event;
-    void* c_eventData;
+    EventInfo info;
 
-    while (pPlayer && pPlayer->getEvent(&event, &c_eventData))
+    while (pPlayer && pPlayer->getEvent(&info))
     {
-	eventName = pEnv->NewStringUTF(event);
-	pEnv->CallVoidMethod(obj, mid, eventName, eventData);
+	eventName = pEnv->NewStringUTF(info.eventName);
+	pEnv->CallVoidMethod(obj, mid, eventName, info.eventData);
     }
 
 }
+

Index: player.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/player.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- player.cpp	15 Nov 2005 19:14:58 -0000	1.2
+++ player.cpp	6 Dec 2005 22:02:16 -0000	1.3
@@ -16,29 +16,28 @@
 #include "hxauth.h"
 #include "hxprdnld.h"
 #include "hxplayvelocity.h"
+#include "chxpckts.h" // CHXHeader, IHXValues
 
 #include "hxtypes.h"
 #include "hxthread.h"
-#include "hxmsgs.h"  
-#include "millslp.h"
-#include "enginedriver.h"
-#include "manager.h"
 
 const long _Player::TIME_UNKNOWN = -1;
 
-_Player::_Player(IHXClientEngine* pClientEngine, HXEngineDriver* pEngineDriver, char* locator) :
+_Player::_Player(IHXClientEngine* pClientEngine, char* locator) :
 		m_pClientEngine(pClientEngine),
-		m_pEngineDriver(pEngineDriver),
 		m_pPlayer(NULL),
+		m_pClientState(NULL),
+		m_pContext(NULL),
 		m_state(UNREALIZED),
-		m_eTransState(HXEngineDriver::TransState_Idle),
+		m_eTransState(TransState_Idle),
 		m_pCreatePlayerCallback(NULL),
 		m_pRealizeCallback(NULL),
 		m_pPrefetchCallback(NULL),
 		m_pStartCallback(NULL),
 		m_pStopCallback(NULL),
 		m_pDeallocateCallback(NULL),
-		m_pCloseCallback(NULL)
+		m_pCloseCallback(NULL),
+		m_lRefCount(0)
 {
     printf("_Player:_Player(%s)\n", locator);
     m_url = (const char*)locator;
@@ -64,6 +63,15 @@
     m_pCreatePlayerCallback = new CreatePlayerCallback(this);
     m_pCreatePlayerCallback->AddRef();
 
+    // Create player events with manual reset
+    HXEvent::MakeEvent(m_pCreatePlayerEvent, NULL, TRUE);
+
+    for (int i=TransState_Realizing; iRelativeEnter(m_pCreatePlayerCallback, 0);
-	m_pEngineDriver->Block();
+	m_pCreatePlayerEvent->Wait();
     }
 
+    printf("Returning from createPlayer\n");
 }
 
 _Player::~_Player()
@@ -90,6 +99,15 @@
     HX_DELETE(m_pDeallocateCallback);
     HX_DELETE(m_pCloseCallback);
 
+    HX_RELEASE(m_pClientState);
+
+    HX_DELETE(m_pCreatePlayerEvent);
+
+    for (int i=0; iQueryInterface(IID_IHXClientState, (void**)&m_pClientState))
+		{
+		    // Tell the client to not automatically transition into the Prefetched state
+		    IHXValues* pValues = new CHXHeader;
+		    if (pValues)
+		    {
+			pValues->AddRef();
+			pValues->SetPropertyULONG32("HaltInConnected", TRUE);
+			m_pClientState->SetConfig(pValues);
+			HX_RELEASE(pValues);
+		    }
+		}
+		else
+		{
+		    m_pClientState = NULL;
+		}
+
+		IHXClientStateAdviseSinkControl* pControl;
+		if(HXR_OK == m_pPlayer->QueryInterface(IID_IHXClientStateAdviseSinkControl, (void**)&pControl))
+		{
+			pControl->AddClientStateAdviseSink(this);
+		}
+		HX_RELEASE(pControl);
+		
 	}
     }
 
-    m_pEngineDriver->Unblock();
+    m_pCreatePlayerEvent->SignalEvent();
+    m_pCreatePlayerEvent->ResetEvent();
 
     if (hr != HXR_OK)
     {
@@ -146,7 +190,8 @@
 void
 _Player::SetState(PlayerState state)
 {
-    //m_eTransState = HXEngineDriver::TransState_Idle;
+    printf("***********SetState: %s -> %s\n", StateString(m_state), StateString(state)); 
+    //m_eTransState = TransState_Idle;
 	// Check state transition ?
     m_state = state;
 }
@@ -190,6 +235,125 @@
         HX_RELEASE(pErrorSinkControl);
 }
 
+const char*
+ClientStateString(UINT16 eState)
+{
+	switch ((EHXClientState) eState) {
+		case HX_CLIENT_STATE_READY:	return "READY"; break;
+		case HX_CLIENT_STATE_CONNECTING:	return "CONNECTING"; break;
+		case HX_CLIENT_STATE_CONNECTED:	return "CONNECTED"; break;
+		case HX_CLIENT_STATE_OPENING:	return "OPENING"; break;
+		case HX_CLIENT_STATE_OPENED:	return "OPENED"; break;
+		case HX_CLIENT_STATE_PREFETCHING:return "PREFETCHING"; break;
+		case HX_CLIENT_STATE_PREFETCHED:	return "PREFETCHED"; break;
+		case HX_CLIENT_STATE_PLAYING:	return "PLAYING"; break;
+		case HX_CLIENT_STATE_PAUSED:	return "PAUSED"; break;
+		case HX_CLIENT_STATE_SEEKING:	return "SEEKING"; break;
+	}
+	return "UNKNOWN_STATE";
+}
+
+const char*
+TransStateString(TransState eState)
+{
+	switch (eState) {
+		case TransState_Idle : return "Idle"; break;
+		case TransState_Realizing : return "Realizing"; break;
+		case TransState_Prefetching : return "Prefetching"; break;
+		case TransState_Starting : return "Starting"; break;
+		case TransState_Stopping : return "Stopping"; break;
+		case TransState_Deallocating : return "Deallocating"; break;
+		case TransState_Deallocating2 : return "Deallocating2"; break;
+		case TransState_Closing : return "Closing"; break;
+	}
+	return "UNKNOWN_STATE";
+}
+/************************************************************************
+ *	Method:
+ *	    IHXClientStateAdviseSink::OnStateChange
+ *	Purpose:
+ *	    Called to advise the client that the player state changed
+ */
+STDMETHODIMP
+_Player::OnStateChange(UINT16 uOldState, UINT16 uNewState)
+{
+    // Map the Helix Client state to the JSR135 state
+    // Set the JSR135 state, unblock for that transition
+    printf("**********OnStateChange: HX_%s -> HX_%s\n", ClientStateString(uOldState), ClientStateString(uNewState));
+
+    switch (uNewState) {
+	case HX_CLIENT_STATE_READY :
+		if (m_eTransState == TransState_Closing)
+		{
+		    SetState(CLOSED);
+		    Unblock(TransState_Closing);
+		}
+		else if (m_eTransState == TransState_Deallocating)
+		{
+		    Unblock(TransState_Deallocating2);
+		}
+		else if (m_state == STARTED)
+		{
+			// end of media
+			SetState(CLOSED);
+		}
+		break;
+	case HX_CLIENT_STATE_CONNECTED :
+	    SetState(REALIZED);
+	    if (m_eTransState == TransState_Deallocating ||
+	    m_eTransState == TransState_Deallocating2)
+	    {
+		//Unblock(TransState_Deallocating2);
+		Unblock(m_eTransState);
+	    }
+	    else
+	    {
+		Unblock(TransState_Realizing);
+	    }
+	    break;
+	 case HX_CLIENT_STATE_PREFETCHED :
+    	    SetState(PREFETCHED);
+	    Unblock(TransState_Prefetching);
+	    break;
+	case HX_CLIENT_STATE_PLAYING :
+	    SetState(STARTED);
+	    Unblock(TransState_Starting);
+	    // Queue up a PlayerListener 'started' event
+	    if (m_pContext)
+	    {
+		m_pContext->queueCallback("started", NULL);
+	    }
+	    break;
+	case HX_CLIENT_STATE_PAUSED :
+	    SetState(PREFETCHED);
+	    Unblock(TransState_Stopping);
+	    break;
+    }
+    return HXR_OK;
+}
+
+
+void
+_Player::Block(TransState eState)
+{
+    //m_eTransState = TransState_eState;
+
+    printf("Blocking: %s\n", TransStateString(eState));
+    m_pEvents[eState]->Wait();
+}
+
+void
+_Player::Unblock(TransState eState)
+{
+    if (m_eTransState == eState)
+    {
+	m_eTransState = TransState_Idle;
+    }
+    printf("Unblocking: %s\n", TransStateString(eState));
+    m_pEvents[eState]->SignalEvent();
+    m_pEvents[eState]->ResetEvent();
+}
+
 // Constructs portions of the Player without acquiring the scarce and exclusive resources. 
 /*
 Constructs portions of the Player without acquiring the scarce and exclusive resources. This may include examining media data and may take some time to complete. 
@@ -213,6 +377,7 @@
 	m_state == STARTED)
     {
 	// ignore
+	printf("Ignoring realize, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
@@ -220,7 +385,8 @@
 	throw _IllegalStateException();
     }
 
-    TransitionToState(HXEngineDriver::TransState_Realizing);
+    TransitionToState(TransState_Realizing);
+    printf("XXXXXXXXXXXXXXReturned from REALIZING\n");
 }
 
 void
@@ -228,12 +394,12 @@
 {
     printf("_Player:realizeFunc()\n");
 
-    if (m_eTransState == HXEngineDriver::TransState_Deallocating)
+    if (m_eTransState == TransState_Deallocating)
     {
 	// deallocate called while realize is scheduled, 
 	// cancel realize, and go back to UNREALIZED state
 	// (This is the 'deallocate()' dotted line in the player state diagram)
-	m_eTransState = HXEngineDriver::TransState_Idle;
+	m_eTransState = TransState_Idle;
 	m_state = UNREALIZED;
 	return;
     }
@@ -243,6 +409,7 @@
 	m_state == STARTED)
     {
 	// ignore
+	printf("Ignoring realize, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
@@ -261,14 +428,13 @@
 
 	fprintf(stderr, "Opening URL: %s\n", (const char*) m_url);
 
-	if (m_pPlayer->OpenURL(m_url) == HXR_OK)
+	if (m_pPlayer->OpenURL(m_url) != HXR_OK)
 	{
-            SetState(REALIZED);
+	    // If there was an error unblock
+	    Unblock(TransState_Realizing);
 	}
     }
 
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Realizing);
 }
 
 /*
@@ -299,15 +465,22 @@
     if (m_state == STARTED)
     {
 	// ignore
+	printf("Ignoring prefetch, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
     {
 	throw _IllegalStateException();
     }
+    else if (m_state == UNREALIZED)
+    {
+	realize();
+    }
+
 
     // Call preftech in the REALIZED and PREFETCHED states
-    TransitionToState(HXEngineDriver::TransState_Prefetching);
+    TransitionToState(TransState_Prefetching);
+    printf("XXXXXXXXXXXXXXReturned from PREFETCHING\n");
 }
 
 void
@@ -315,21 +488,15 @@
 {
     printf("_Player:prefetchFunc()\n");
 
-    if (m_state == UNREALIZED)
-    {
-	realizeFunc();
-    }
-
     if (m_state == REALIZED ||
 	m_state == PREFETCHED)
     {
-    	//XXXctd TODO: allocate, check resources
-	// Do some prefetching, even in prefetched state
-    	SetState(PREFETCHED);
+	// Resume helix halted state, continue to prefetch
+	if (m_pClientState)
+	{
+	    m_pClientState->Resume();
+	}
     }
-
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Prefetching);
 }
 
 /*
@@ -357,13 +524,21 @@
     if (m_state == STARTED)
     {
 	// ignore
+	printf("Ignoring start, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
     {
 	throw _IllegalStateException();
     }
-    TransitionToState(HXEngineDriver::TransState_Starting);
+    else if (m_state == UNREALIZED ||
+	     m_state == REALIZED)
+    {
+	prefetch();
+    }
+    
+    TransitionToState(TransState_Starting);
+    printf("XXXXXXXXXXXXXXReturned from STARTING\n");
 }
 
 void
@@ -371,21 +546,14 @@
 {
     printf("_Player::startFunc()\n");
 
-    if (m_state == UNREALIZED ||
-	m_state == REALIZED)
-    {
-	prefetchFunc();
-    }
-
     // Must be in the prefetched state to start
-    if (m_state == PREFETCHED &&
-	m_pPlayer && m_pPlayer->Begin() == HXR_OK)
+    if (m_state == PREFETCHED)
     {
-	SetState(STARTED);
+	if (m_pPlayer->Begin() != HXR_OK)
+	{
+	    Unblock(TransState_Starting);
+	}
     }
-
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Starting);
 }
 
 /*
@@ -412,6 +580,7 @@
 	m_state == PREFETCHED)
     {
 	// ignore, if player is already stopped
+	printf("Ignoring stop, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
@@ -419,7 +588,8 @@
 	throw _IllegalStateException();
     }
 
-    TransitionToState(HXEngineDriver::TransState_Stopping);
+    TransitionToState(TransState_Stopping);
+    printf("XXXXXXXXXXXXXXReturned from STOPPING\n");
 }
 
 void
@@ -427,12 +597,10 @@
 {
     printf("_Player::stopFunc()\n");
     // Should only be in the started state
-    if (m_pPlayer && m_pPlayer->Pause() == HXR_OK)
+    if (m_pPlayer && m_pPlayer->Pause() != HXR_OK)
     {
-	SetState(PREFETCHED);
+	    Unblock(TransState_Stopping);
     }
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Stopping);
 }
 
 /*
@@ -453,11 +621,11 @@
 void
 _Player::deallocate()
 {
-    printf("_Player::deallocate\n");
+    printf("_Player::deallocate : %s\n", TransStateString(m_eTransState));
 
-    if (m_eTransState == HXEngineDriver::TransState_Realizing)
+    if (m_eTransState == TransState_Realizing)
     {
-        TransitionToState(HXEngineDriver::TransState_Deallocating);
+        TransitionToState(TransState_Deallocating);
 	return;
     }
 
@@ -465,14 +633,20 @@
 	m_state == REALIZED)
     {
 	// ignore
+	printf("Ignoring deallocate, state = %s\n", StateString(m_state));
 	return;
     }
     else if (m_state == CLOSED)
     {
 	throw _IllegalStateException();
     }
+    else if (m_state == STARTED)
+    {
+	stop(); // implicitly call stop/pause
+    }
 
-    TransitionToState(HXEngineDriver::TransState_Deallocating);
+    TransitionToState(TransState_Deallocating); // wait for READY
+    printf("XXXXXXXXXXXXXXReturned from DEALLOCATING\n");
 }
 
 void
@@ -480,21 +654,31 @@
 {
     printf("_Player::deallocateFunc()\n");
 
-    if (m_state == STARTED)
-    {
-	stopFunc(); // implicitly call stop
-    }
+    // Transition the player (PLAYING*) -> PAUSED -> READY -> CONNECTED
+    // * If the player is currently in the PLAYING state
 
     if (m_state == PREFETCHED)
     {
-        if (m_pPlayer && m_pPlayer->Stop() == HXR_OK &&
-			m_pPlayer->OpenURL(m_url) == HXR_OK)
+	// Transition player PAUSED -> READY
+        if (m_pClientState->GetState() == HX_CLIENT_STATE_PAUSED)
 	{
-	    SetState(REALIZED);
+	    m_pPlayer->Stop();
+	    m_pMutex->Lock();
+	    if (m_pClientState->GetState() != HX_CLIENT_STATE_READY)
+	    {
+		Block(TransState_Deallocating2);
+	    }
+	    m_pMutex->Unlock();
+	}
+	// Transition player READY -> CONNECTED
+	if (m_pClientState->GetState() == HX_CLIENT_STATE_READY)
+    	{
+	    if (m_pPlayer->OpenURL(m_url) != HXR_OK)
+	    {
+		Unblock(TransState_Deallocating);
+	    }
 	}
     }
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Deallocating);
 }
 
 /*
@@ -512,11 +696,13 @@
 
     if (m_state == CLOSED)
     {
-	    // ignore
-	    return;
+	// ignore
+	printf("Ignoring close, state = %s\n", StateString(m_state));
+	return;
     }
 
-    TransitionToState(HXEngineDriver::TransState_Closing);
+    TransitionToState(TransState_Closing);
+    printf("XXXXXXXXXXXXXXReturned from CLOSING\n");
 }
 
 void
@@ -526,16 +712,12 @@
     if (m_pPlayer == NULL || 
         (m_pPlayer->Stop() == HXR_OK && ClosePlayer() == HXR_OK))
     {
-	SetState(CLOSED);
 	// Queue up a PlayerListener 'closed' event
 	if (m_pContext)
 	{
 	    m_pContext->queueCallback("closed", NULL);
 	}
     }
-
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(HXEngineDriver::TransState_Closing);
 }
 
 /*
@@ -712,23 +894,79 @@
 	}
 }
 
-bool
-_Player::getEvent(char** event, void** eventData)
+
+HXBOOL
+_Player::getEvent(EventInfo* pInfo)
 {
     HXBOOL bIsValid = FALSE;
-    if (m_pContext)
+    if (m_pContext && pInfo)
     {
 	char* qData;
 	qData = (char*)m_pContext->DeQueuePtr(bIsValid);
 	if (bIsValid)
 	{
-	    *event = qData;
-	    *eventData = NULL;
+	    strcpy(pInfo->eventName, qData);
+	    pInfo->eventData = NULL;
+	}
+	else
+	{
+	    *(pInfo->eventName) = '\0';
+	    pInfo->eventData = NULL;
 	}
     }
     return (bool)bIsValid;
 }
 
+/////////////////////////////////////////////////////////////////////////
+//  Method:
+//	IUnknown::QueryInterface
+//  Purpose:
+//	Implement this to export the interfaces supported by your 
+//	object.
+//
+STDMETHODIMP _Player::QueryInterface(REFIID riid, void** ppvObj)
+{
+    if (IsEqualIID(riid, IID_IUnknown))
+    {
+	AddRef();
+	*ppvObj = (IUnknown*)(IHXClientStateAdviseSink*)this;
+	return HXR_OK;
+    }
+
+    *ppvObj = NULL;
+    return HXR_NOINTERFACE;
+}
+
+/////////////////////////////////////////////////////////////////////////
+//  Method:
+//	IUnknown::AddRef
+//  Purpose:
+//	Everyone usually implements this the same... feel free to use
+//	this implementation.
+//
+STDMETHODIMP_(ULONG32) _Player::AddRef()
+{
+    return InterlockedIncrement(&m_lRefCount);
+}
+
+/////////////////////////////////////////////////////////////////////////
+//  Method:
+//	IUnknown::Release
+//  Purpose:
+//	Everyone usually implements this the same... feel free to use
+//	this implementation.
+//
+STDMETHODIMP_(ULONG32) _Player::Release()
+{
+    if (InterlockedDecrement(&m_lRefCount) > 0)
+    {
+        return m_lRefCount;
+    }
+
+    delete this;
+    return 0;
+}
+
 ////////////// T2 callbacks
 // CreatePlayerCallback
 STDMETHODIMP
@@ -1010,15 +1248,6 @@
     return HXR_OK;
 }
 
-/*
-void
-_Player::Unblock(HXEngineDriver::TransState s)
-{
-    m_eTransState = HXEngineDriver::TransState_Idle;
-    m_pEngineDriver->Unblock(s);
-}
-*/
-
 /////////////////////////////////////////////////////////////////////
 // _Player::gotoState
 //
@@ -1027,39 +1256,39 @@
 // 3. Block on new state
 /////////////////////////////////////////////////////////////////////
 void
-_Player::gotoState(HXEngineDriver::TransState fromState,
-		   HXEngineDriver::TransState toState,
+_Player::gotoState(TransState fromState,
+		   TransState toState,
 		   IHXCallback* pCallback,
 		   HXBOOL bWait)
 {
     if (bWait)
     {
 	// Wait for current transition to finish
-	m_pEngineDriver->Block(fromState);
+	Block(fromState);
     }
-    else if (fromState != HXEngineDriver::TransState_Idle)
+    else if (fromState != TransState_Idle)
     {
 	// unblock any pending transition
-	m_pEngineDriver->Unblock(fromState);
+	Unblock(fromState);
     }
+
     m_pMutex->Lock();
     m_eTransState = toState;
-    printf("gotoState: scheduling %d\n", (int)toState);
     m_pScheduler->RelativeEnter(pCallback, 0);
     m_pMutex->Unlock();
-    m_pEngineDriver->Block(toState);
-
+    
+    Block(toState);
 }
 
 /////////////////////////////////////////////////////////////////////
 // TransitionToState
 /////////////////////////////////////////////////////////////////////
 void
-_Player::TransitionToState(HXEngineDriver::TransState toState)
+_Player::TransitionToState(TransState toState)
 {
-    printf("TransitionToState: %d -> %d\n", (int) m_eTransState, (int) toState);
+    printf("TransitionToState: %s -> %s\n", TransStateString(m_eTransState), TransStateString(toState));
 
-    if (toState == HXEngineDriver::TransState_Closing)
+    if (toState == TransState_Closing)
     {
 	// Trying to close, so unblock current transition, and close
 	gotoState(m_eTransState, toState, m_pCloseCallback, FALSE);
@@ -1068,7 +1297,7 @@
 
     switch (m_eTransState)
     {
-	case HXEngineDriver::TransState_Idle : 
+	case TransState_Idle : 
 	{
 	    // In the idle state, nothing pending, execute normally, with no extra pending events
 	    // - set the transition state
@@ -1076,47 +1305,48 @@
 	    // - block for that event to clear
 	    switch (toState)
 	    { 
-		    case HXEngineDriver::TransState_Realizing :
+		    case TransState_Realizing :
 			gotoState(m_eTransState, toState, m_pRealizeCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Prefetching :
+		    case TransState_Prefetching :
 			gotoState(m_eTransState, toState, m_pPrefetchCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Starting :
+		    case TransState_Starting :
 			gotoState(m_eTransState, toState, m_pStartCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Stopping :
+		    case TransState_Stopping :
 			gotoState(m_eTransState, toState, m_pStopCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Deallocating :
+		    case TransState_Deallocating :
+		    case TransState_Deallocating2 :
 			gotoState(m_eTransState, toState, m_pDeallocateCallback, FALSE);
 			break;
 	    }
 	}
 	break;
 
-	case HXEngineDriver::TransState_Realizing : 
+	case TransState_Realizing : 
 	{
 	    switch (toState)
 	    { 
-		    case HXEngineDriver::TransState_Realizing :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Realizing :
+			Block(toState);
 			break;
-		    case HXEngineDriver::TransState_Prefetching :
+		    case TransState_Prefetching :
 			gotoState(m_eTransState, toState, m_pPrefetchCallback, TRUE);
 			break;
-		    case HXEngineDriver::TransState_Starting :
+		    case TransState_Starting :
 			gotoState(m_eTransState, toState, m_pStartCallback, TRUE);
 			break;
-		    case HXEngineDriver::TransState_Stopping :
+		    case TransState_Stopping :
 			// This state should not be reachable
 			break;
-		    case HXEngineDriver::TransState_Deallocating :
+		    case TransState_Deallocating :
 			// deallocate called while realizing, unblock realize, 
 			// (dotted line in player state diagram)
 			// TODO figure out the best way to code this dotted line case
-			m_pEngineDriver->Unblock(m_eTransState);
-			m_eTransState = HXEngineDriver::TransState_Idle;
+			Unblock(m_eTransState);
+			m_eTransState = TransState_Idle;
 			//ASSERT(m_state == UNREALIZED);
 			m_state = UNREALIZED;
 			break;
@@ -1124,23 +1354,23 @@
 	}
 	break;
 
-	case HXEngineDriver::TransState_Prefetching : 
+	case TransState_Prefetching : 
 	{
 	    switch (toState)
 	    { 
-		    case HXEngineDriver::TransState_Realizing :
+		    case TransState_Realizing :
 			break;
-		    case HXEngineDriver::TransState_Prefetching :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Prefetching :
+			Block(toState);
 			break;
-		    case HXEngineDriver::TransState_Starting :
+		    case TransState_Starting :
 			gotoState(m_eTransState, toState, m_pStartCallback, TRUE);
 			break;
-		    case HXEngineDriver::TransState_Stopping :
+		    case TransState_Stopping :
 			// prefetch -> stop ? don't block just return
 			// should not be reachable
 			break;
-		    case HXEngineDriver::TransState_Deallocating :
+		    case TransState_Deallocating :
 			gotoState(m_eTransState, toState, m_pDeallocateCallback, FALSE);
 			break;
 	    }
@@ -1148,20 +1378,20 @@
 	}
 	break;
 
-	case HXEngineDriver::TransState_Starting : 
+	case TransState_Starting : 
 	{
 		switch (toState)
 		{ 
-		    case HXEngineDriver::TransState_Realizing :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Realizing :
+			Block(toState);
 			break;
-		    case HXEngineDriver::TransState_Prefetching :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Prefetching :
+			Block(toState);
 			break;
-		    case HXEngineDriver::TransState_Starting :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Starting :
+			Block(toState);
 			break;
-		    case HXEngineDriver::TransState_Deallocating :
+		    case TransState_Deallocating :
 			gotoState(m_eTransState, toState, m_pDeallocateCallback, FALSE);
 			break;
 		}
@@ -1169,11 +1399,32 @@
 	}
 	break;
 
-	case HXEngineDriver::TransState_Deallocating : 
+	case TransState_Stopping : 
 	{
 		switch (toState)
 		{ 
-		    case HXEngineDriver::TransState_Realizing :
+		    case TransState_Realizing :
+			Block(toState);
+			break;
+		    case TransState_Prefetching :
+			Block(toState);
+			break;
+		    case TransState_Starting :
+			Block(toState);
+			break;
+		    case TransState_Deallocating :
+			gotoState(m_eTransState, toState, m_pDeallocateCallback, TRUE);
+			break;
+		}
+	    
+	}
+	break;
+
+	case TransState_Deallocating : 
+	{
+		switch (toState)
+		{ 
+		    case TransState_Realizing :
 			// *** realize called while deallocating ?
 			if (m_state == UNREALIZED)
 			{
@@ -1185,35 +1436,38 @@
 			    // ASSERT(m_state == PREFETCHED);
 			    // called realize while deallocating from prefteched state
 			    // block on deallocate, which will put us in the realized state
-			    m_pEngineDriver->Block(m_eTransState);
+			    Block(m_eTransState);
 			}
 			break;
-		    case HXEngineDriver::TransState_Prefetching :
+		    case TransState_Prefetching :
 			// unblock, schedule prefetch
 			gotoState(m_eTransState, toState, m_pPrefetchCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Starting :
+		    case TransState_Starting :
 			// unblock, schedule start
 			gotoState(m_eTransState, toState, m_pStartCallback, FALSE);
 			break;
-		    case HXEngineDriver::TransState_Stopping :
+		    case TransState_Stopping :
 			if (m_state == STARTED) // block on stop event
 			{
-			     m_pEngineDriver->Block(toState);
+			     Block(toState);
 			}
 			break;
-		    case HXEngineDriver::TransState_Deallocating :
-			m_pEngineDriver->Block(toState);
+		    case TransState_Deallocating :
+			Block(toState);
+			break;
+		    case TransState_Deallocating2 :
+			gotoState(m_eTransState, toState, m_pDeallocateCallback, FALSE);
 			break;
 		}
 	    
 	}
 	break;
 
-	case HXEngineDriver::TransState_Closing : 
+	case TransState_Closing : 
 	{
 	    // just block on close event, regardless of toState
-	    m_pEngineDriver->Block(m_eTransState);
+	    Block(m_eTransState);
 	}
 	break;
 

Index: myplay.java
===================================================================
RCS file: /cvsroot/player/jsr135kit/myplay.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- myplay.java	19 Nov 2005 00:38:30 -0000	1.3
+++ myplay.java	6 Dec 2005 22:02:16 -0000	1.4
@@ -11,6 +11,8 @@
 	    if (args.length < 1) {
 		    System.out.println("Using default url..");
 		    new MyPlayer().playUrl("c:\\src\\music\\laika.mp3");
+		    //new MyPlayer().playUrl("rtsp://clientqa.dev.prognet.com/mp3/mario.mp3");
+		    //new MyPlayer().playUrl("rtsp://clientqa.dev.prognet.com/mp3/crystalmethod.mp3");
 		    return;
 	    }
 	    if (args.length < 1 || args[0].compareTo("-h") == 0) {
@@ -42,7 +44,7 @@
 	public void run() {
 		try {
 			System.out.println("*********************Before start in thread2 " +Thread.currentThread());
-			p.start();
+			p.deallocate();
 			System.out.println("********************* After start in thread2 " +Thread.currentThread());
 		} catch (Exception e) {
 		}
@@ -61,13 +63,15 @@
 	try {
 	    p = Manager.createPlayer(url);
 
+	    /*
+	    */
 	    System.out.println("*********************After createPlayer" +Thread.currentThread());
 
 	    MyThread2 t2 = new MyThread2(p);
 	    t2.start();
 
 	    System.out.println("*********************Before realize in thread1 " +Thread.currentThread());
-	    p.realize();
+	    p.start();
 	    System.out.println("********************* After realize in thread1 " +Thread.currentThread());
 
 	    //p.start();
@@ -78,6 +82,7 @@
 	    p.addPlayerListener(this);
 
 	    printUsage();
+	    System.out.print(">>> ");
 
 	    while ((line = in.readLine()) != null)
 	    {
@@ -131,16 +136,20 @@
 			System.out.println("Current media time: "+ p.setMediaTime(t));
 		}
 		else if (line.compareTo("getDuration") == 0 ||
-		        line.compareTo("d") == 0) {
+		        line.compareTo("dur") == 0) {
 			    System.out.println("Duration: " + p.getDuration());
 		}
 		else if (line.compareTo("") == 0) {
-			System.out.println("Current media time: "+ p.getMediaTime());
+			if (p.getState() != Player.CLOSED) {
+				System.out.println("Current media time: "+ p.getMediaTime());
+			}
 		}
 		else {
 			printUsage();
 		}
+
 		printStateString(p.getState());
+		System.out.print(">>> ");
 	    }
 
 
@@ -190,7 +199,7 @@
 		System.out.println("	getState, state		: get the player state");
 		System.out.println("	getMediaTime, t		: get the current media time");
 		System.out.println("	setMediaTime, seek	: set the media time (seek)");
-		System.out.println("	getDuration, d		: set the media duration (clip len)");
+		System.out.println("	getDuration, len	: set the media duration (clip len)");
 		System.out.println("	quit, q			: close the player, quit cmd loop");
     }
 
@@ -199,7 +208,7 @@
 	if (event.equals(PlayerListener.STARTED)) {
 		System.out.println("playerUpdate: "+event); 
 	} else if (event.equals( PlayerListener.BUFFERING_STARTED)) {
-		System.out.println("playerUpdate: "+event); 
+//		System.out.println("playerUpdate: "+event); 
 	} else if (event.equals( PlayerListener.BUFFERING_STOPPED)) {
 		System.out.println("playerUpdate: "+event); 
 	} else if (event.equals( PlayerListener.CLOSED)) {

Index: manager.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/manager.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- manager.cpp	19 Nov 2005 00:38:30 -0000	1.2
+++ manager.cpp	6 Dec 2005 22:02:16 -0000	1.3
@@ -1,7 +1,6 @@
 
 #include "manager.h"
 #include 
-#include "hxstring.h"
 
 #define INITGUID 1
 
@@ -13,18 +12,9 @@
 #include "hxcom.h"
 #include "hxcomm.h"
 #include "hxcore.h"
-#include "hxmon.h" // IHXReg
-#include "hxauth.h"
-#include "hxprdnld.h"
-#include "hxplayvelocity.h"
 #include "hxtick.h"
-
 #include "hxtypes.h"
-#include "hxthread.h"
-#include "hxmsgs.h"  
-#include "millslp.h"
 #include "enginedriver.h"
-#include "hxjcontext.h"
 
 
 #if defined (_UNIX) && defined (USE_XWINDOWS)
@@ -48,9 +38,6 @@
 
 HXBOOL		_Manager::m_bInitialized = false;
 IHXClientEngine* _Manager::m_pClientEngine = NULL;
-//HXThread* 	_Manager::m_pTLCThread = NULL;
-//HXEvent*	_Manager::m_pTLCEvent = NULL;
-//IHXScheduler*	_Manager::m_pScheduler = NULL;
 HXEngineDriver*	_Manager::m_pEngineDriver = NULL;
 
 
@@ -113,7 +100,7 @@
     {
 	    StartEngineDriver();
     }
-    return new _Player(m_pClientEngine, m_pEngineDriver, locator);
+    return new _Player(m_pClientEngine, locator);
 }
 
 /*

Index: Umakefil
===================================================================
RCS file: /cvsroot/player/jsr135kit/Umakefil,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Umakefil	19 Nov 2005 00:38:29 -0000	1.2
+++ Umakefil	6 Dec 2005 22:02:16 -0000	1.3
@@ -53,7 +53,6 @@
 		'manager_wrap.cpp',
 		'hxjabd.cpp',
 		'hxjadvsnk.cpp',
-		'hxjstate.cpp',
 		'hxjaumgr.cpp',
 		'hxjcontext.cpp',
 		'hxjerror.cpp',

Index: enginedriver.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/enginedriver.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- enginedriver.cpp	15 Nov 2005 19:14:58 -0000	1.2
+++ enginedriver.cpp	6 Dec 2005 22:02:16 -0000	1.3
@@ -4,43 +4,34 @@
 #include "hxmsgs.h"  
 #include "millslp.h"
 #include "enginedriver.h"
-#include "manager.h"
+#include "manager.h" // for _Manager::Init()
 
 void DoEvent();
 void* EngineDriverThreadProc(void* pData);
 
 ///////////////////////////////////
 void
-HXEngineDriver::Start() 
+HXEngineDriver::Start()
 {
     // Create the TLC thread
     HXThread::MakeThread(m_pThread);
-    HXEvent::MakeEvent(m_pEvent, NULL, TRUE);
-
-    HXEvent::MakeEvent(m_pRealizedEvent, NULL, TRUE);
-    HXEvent::MakeEvent(m_pPrefetchedEvent, NULL, TRUE);
-    HXEvent::MakeEvent(m_pStartedEvent, NULL, TRUE);
-    HXEvent::MakeEvent(m_pStoppedEvent, NULL, TRUE);
-    HXEvent::MakeEvent(m_pDeallocatedEvent, NULL, TRUE);
-    HXEvent::MakeEvent(m_pClosedEvent, NULL, TRUE);
+    HXEvent::MakeEvent(m_pEvent, NULL, FALSE);
 
     m_pThread->CreateThread(EngineDriverThreadProc, (void*)this);
     m_pEvent->Wait(); // Block until _Manager::HXInit is finished, engine created, etc.
-
 } 
 
 void* EngineDriverThreadProc(void* pData)
 {
     HXEngineDriver* e = (HXEngineDriver*)pData;
     HXThread* pThread = e->m_pThread;
-    HXEvent* pEvent = e->m_pEvent;
     HXThreadMessage msg;
     
     fprintf(stderr, "EngineDriverThreadProc: Entering message loop...\n");
 
     // Init the dll paths, create an engine
     _Manager::HXInit();
-    pEvent->SignalEvent();
+    e->m_pEvent->SignalEvent();
 
     while (pThread->GetMessage(&msg) == HXR_OK)
     {

Index: hxjadvsnk.cpp
===================================================================
RCS file: /cvsroot/player/jsr135kit/hxjadvsnk.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hxjadvsnk.cpp	19 Nov 2005 00:38:29 -0000	1.3
+++ hxjadvsnk.cpp	6 Dec 2005 22:02:16 -0000	1.4
@@ -1068,6 +1068,9 @@
 {
     bool bSendOnClipInfo = false;
 
+    printf("In SetClipInfo===================\n");
+    return;
+
     // Get HXSource and try to get clip infor. 
     UINT32 sourceCount = m_pRMAPlayer->GetSourceCount();	
     for (UINT16 sourceID = 0; sourceID < sourceCount; sourceID ++)


From margotm at helixcommunity.org  Fri Dec  9 22:18:27 2005
From: margotm at helixcommunity.org (margotm@helixcommunity.org)
Date: Sat Dec 10 00:47:18 2005
Subject: [Player-cvs] app/gtk commonapp.cpp,1.35.2.17,1.35.2.18
Message-ID: 

Update of /cvsroot/player/app/gtk
In directory cvs:/tmp/cvs-serv31891

Modified Files:
      Tag: bingo-beta
	commonapp.cpp 
Log Message:
Realplay binary core dumping with illegal options.  Bug 4685.

 Committing in .

Modified Files:
  Tag: bingo-beta
 	commonapp.cpp 


Index: commonapp.cpp
===================================================================
RCS file: /cvsroot/player/app/gtk/commonapp.cpp,v
retrieving revision 1.35.2.17
retrieving revision 1.35.2.18
diff -u -d -r1.35.2.17 -r1.35.2.18
--- commonapp.cpp	24 Nov 2004 23:00:23 -0000	1.35.2.17
+++ commonapp.cpp	10 Dec 2005 06:18:25 -0000	1.35.2.18
@@ -1890,9 +1890,9 @@
         if(argc > 2)
         {
             printf(_("Ignoring unknown options: "));
-            for(i = 0; i < argc; i++)
+            for(i = 1; i < argc; i++)
             {
-                printf("%s ", argv[optind++]);
+                printf("%s ", argv[i]);
             }
             printf("\n");
         }


From margotm at helixcommunity.org  Sat Dec 10 08:52:14 2005
From: margotm at helixcommunity.org (margotm@helixcommunity.org)
Date: Sat Dec 10 11:20:58 2005
Subject: [Player-cvs] app/gtk commonapp.cpp,1.35.2.18,1.35.2.19
Message-ID: 

Update of /cvsroot/player/app/gtk
In directory cvs:/tmp/cvs-serv21082

Modified Files:
      Tag: bingo-beta
	commonapp.cpp 
Log Message:
Get long options to work on Solaris.  Part of bug 4677.

Committing in .

 Modified Files:
  Tag: bingo-beta
 	commonapp.cpp 


Index: commonapp.cpp
===================================================================
RCS file: /cvsroot/player/app/gtk/commonapp.cpp,v
retrieving revision 1.35.2.18
retrieving revision 1.35.2.19
diff -u -d -r1.35.2.18 -r1.35.2.19
--- commonapp.cpp	10 Dec 2005 06:18:25 -0000	1.35.2.18
+++ commonapp.cpp	10 Dec 2005 16:52:11 -0000	1.35.2.19
@@ -1419,7 +1419,7 @@
 
     for(;;)
     {
-#ifdef _GNU_SOURCE
+#if (defined(_GNU_SOURCE) || defined(_SOLARIS))
 	static struct option long_options[] = {
 	    /* name          has_arg  flag    val */
 	    {  "embedded",   1,       0,      'e' }, // argument is xid


From gwright at helixcommunity.org  Mon Dec 12 11:16:27 2005
From: gwright at helixcommunity.org (gwright@helixcommunity.org)
Date: Mon Dec 12 13:44:40 2005
Subject: [Player-cvs] app/gtk commonapp.cpp,1.78,1.79
Message-ID: 

Update of /cvsroot/player/app/gtk
In directory cvs:/tmp/cvs-serv5676

Modified Files:
	commonapp.cpp 
Log Message:
merging a fix for Margot.


Index: commonapp.cpp
===================================================================
RCS file: /cvsroot/player/app/gtk/commonapp.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- commonapp.cpp	4 Oct 2005 16:54:03 -0000	1.78
+++ commonapp.cpp	12 Dec 2005 19:16:20 -0000	1.79
@@ -1888,9 +1888,9 @@
         if(argc > 2)
         {
             printf(_("Ignoring unknown options: "));
-            for(i = 0; i < argc; i++)
+            for(i = 1; i < argc; i++)
             {
-                printf("%s ", argv[optind++]);
+                printf("%s ", argv[i]);
             }
             printf("\n");
         }


From margotm at helixcommunity.org  Tue Dec 13 15:18:05 2005
From: margotm at helixcommunity.org (margotm@helixcommunity.org)
Date: Tue Dec 13 17:46:00 2005
Subject: [Player-cvs] app/gtk commonapp.cpp,1.79,1.80
Message-ID: 

Update of /cvsroot/player/app/gtk
In directory cvs:/tmp/cvs-serv27567

Modified Files:
	commonapp.cpp 
Log Message:
Long options working on Solaris.  Part of bug 4677 fix.

 Committing in .
 
 Modified Files:
 	commonapp.cpp 


Index: commonapp.cpp
===================================================================
RCS file: /cvsroot/player/app/gtk/commonapp.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- commonapp.cpp	12 Dec 2005 19:16:20 -0000	1.79
+++ commonapp.cpp	13 Dec 2005 23:18:02 -0000	1.80
@@ -1458,7 +1458,7 @@
 
     for(;;)
     {
-#ifdef _GNU_SOURCE
+#if (defined(_GNU_SOURCE) || defined(_SOLARIS))
 	static struct option long_options[] = {
 	    /* name          has_arg  flag    val */
 	    {  "embedded",   1,       0,      'e' }, // argument is xid


From cdunn at helixcommunity.org  Thu Dec 15 17:09:47 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:37:13 2005
Subject: [Player-cvs] kit/jsr135 - New directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135
In directory cvs:/tmp/cvs-serv17274/jsr135

Log Message:
Directory /cvsroot/player/kit/jsr135 added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 17:14:05 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:41:29 2005
Subject: [Player-cvs] kit/jsr135kit PlayerCallback.cpp, 1.1.1.1,
	NONE Umakefil, 1.1.1.1, NONE enginedriver.cpp, 1.1.1.1,
	NONE fivemmap.cpp, 1.1.1.1, NONE hxjabd.cpp, 1.1.1.1,
	NONE hxjadvsnk.cpp, 1.1.1.1, NONE hxjaumgr.cpp, 1.1.1.1,
	NONE hxjcontext.cpp, 1.1.1.1, NONE hxjerror.cpp, 1.1.1.1,
	NONE hxjprdnld.cpp, 1.1.1.1, NONE hxjsitsup.cpp, 1.1.1.1,
	NONE manager.cpp, 1.1.1.1, NONE manager_wrap.cpp, 1.1.1.1,
	NONE mmapi.i, 1.1.1.1, NONE myplay.java, 1.1.1.1,
	NONE player.cpp, 1.1.1.1, NONE win32.pcf, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/player/kit/jsr135kit
In directory cvs:/tmp/cvs-serv17985

Removed Files:
	PlayerCallback.cpp Umakefil enginedriver.cpp fivemmap.cpp 
	hxjabd.cpp hxjadvsnk.cpp hxjaumgr.cpp hxjcontext.cpp 
	hxjerror.cpp hxjprdnld.cpp hxjsitsup.cpp manager.cpp 
	manager_wrap.cpp mmapi.i myplay.java player.cpp win32.pcf 
Log Message:


--- mmapi.i DELETED ---

--- fivemmap.cpp DELETED ---

--- manager_wrap.cpp DELETED ---

--- hxjabd.cpp DELETED ---

--- PlayerCallback.cpp DELETED ---

--- hxjcontext.cpp DELETED ---

--- hxjprdnld.cpp DELETED ---

--- win32.pcf DELETED ---

--- hxjadvsnk.cpp DELETED ---

--- hxjsitsup.cpp DELETED ---

--- hxjaumgr.cpp DELETED ---

--- player.cpp DELETED ---

--- myplay.java DELETED ---

--- manager.cpp DELETED ---

--- Umakefil DELETED ---

--- enginedriver.cpp DELETED ---

--- hxjerror.cpp DELETED ---


From cdunn at helixcommunity.org  Thu Dec 15 17:14:06 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:41:31 2005
Subject: [Player-cvs] kit/jsr135kit/javax/microedition/media Control.java,
	1.1.1.1, NONE Controllable.java, 1.1.1.1, NONE Manager.java,
	1.1.1.1, NONE MediaException.java, 1.1.1.1, NONE Player.java,
	1.1.1.1, NONE PlayerCallback.java, 1.1.1.1,
	NONE PlayerEvent.java, 1.1.1.1, NONE PlayerImp.java, 1.1.1.1,
	NONE PlayerListener.java, 1.1.1.1, NONE TimeBase.java, 1.1.1.1,
	NONE mmapi.java, 1.1.1.1, NONE mmapiJNI.java, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/player/kit/jsr135kit/javax/microedition/media
In directory cvs:/tmp/cvs-serv17985/javax/microedition/media

Removed Files:
	Control.java Controllable.java Manager.java 
	MediaException.java Player.java PlayerCallback.java 
	PlayerEvent.java PlayerImp.java PlayerListener.java 
	TimeBase.java mmapi.java mmapiJNI.java 
Log Message:


--- MediaException.java DELETED ---

--- mmapi.java DELETED ---

--- Player.java DELETED ---

--- mmapiJNI.java DELETED ---

--- PlayerListener.java DELETED ---

--- TimeBase.java DELETED ---

--- Controllable.java DELETED ---

--- PlayerImp.java DELETED ---

--- Manager.java DELETED ---

--- PlayerEvent.java DELETED ---

--- PlayerCallback.java DELETED ---

--- Control.java DELETED ---


From cdunn at helixcommunity.org  Thu Dec 15 17:14:06 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:41:31 2005
Subject: [Player-cvs] kit/jsr135kit/javax/microedition/media/control
	GUIControl.java, 1.1.1.1, NONE MetaDataControl.java, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/player/kit/jsr135kit/javax/microedition/media/control
In directory cvs:/tmp/cvs-serv17985/javax/microedition/media/control

Removed Files:
	GUIControl.java MetaDataControl.java 
Log Message:


--- MetaDataControl.java DELETED ---

--- GUIControl.java DELETED ---


From cdunn at helixcommunity.org  Thu Dec 15 17:14:07 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:41:32 2005
Subject: [Player-cvs] kit/jsr135kit/javax/microedition/media/protocol
	ContentDescriptor.java, 1.1.1.1, NONE DataSource.java, 1.1.1.1,
	NONE SourceStream.java, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/player/kit/jsr135kit/javax/microedition/media/protocol
In directory cvs:/tmp/cvs-serv17985/javax/microedition/media/protocol

Removed Files:
	ContentDescriptor.java DataSource.java SourceStream.java 
Log Message:


--- ContentDescriptor.java DELETED ---

--- SourceStream.java DELETED ---

--- DataSource.java DELETED ---


From cdunn at helixcommunity.org  Thu Dec 15 17:14:07 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 19:41:33 2005
Subject: [Player-cvs] kit/jsr135kit/pub enginedriver.h, 1.1.1.1,
	NONE fivemmap.h, 1.1.1.1, NONE globals.h, 1.1.1.1,
	NONE hxjabd.h, 1.1.1.1, NONE hxjadvsnk.h, 1.1.1.1,
	NONE hxjaumgr.h, 1.1.1.1, NONE hxjcontext.h, 1.1.1.1,
	NONE hxjerror.h, 1.1.1.1, NONE hxjprdnld.h, 1.1.1.1,
	NONE hxjsitsup.h, 1.1.1.1,
	NONE javax_microedition_media_PlayerCallback.h, 1.1.1.1,
	NONE manager.h, 1.1.1.1, NONE player.h, 1.1.1.1, NONE
Message-ID: 

Update of /cvsroot/player/kit/jsr135kit/pub
In directory cvs:/tmp/cvs-serv17985/pub

Removed Files:
	enginedriver.h fivemmap.h globals.h hxjabd.h hxjadvsnk.h 
	hxjaumgr.h hxjcontext.h hxjerror.h hxjprdnld.h hxjsitsup.h 
	javax_microedition_media_PlayerCallback.h manager.h player.h 
Log Message:


--- hxjerror.h DELETED ---

--- player.h DELETED ---

--- hxjaumgr.h DELETED ---

--- hxjsitsup.h DELETED ---

--- fivemmap.h DELETED ---

--- hxjprdnld.h DELETED ---

--- javax_microedition_media_PlayerCallback.h DELETED ---

--- hxjabd.h DELETED ---

--- hxjcontext.h DELETED ---

--- manager.h DELETED ---

--- globals.h DELETED ---

--- hxjadvsnk.h DELETED ---

--- enginedriver.h DELETED ---


From cdunn at helixcommunity.org  Thu Dec 15 18:04:55 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:32:20 2005
Subject: [Player-cvs] kit/jsr135/javax - New directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax
In directory cvs:/tmp/cvs-serv30160/javax

Log Message:
Directory /cvsroot/player/kit/jsr135/javax added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 18:05:06 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:32:31 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition - New directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition
In directory cvs:/tmp/cvs-serv30419/microedition

Log Message:
Directory /cvsroot/player/kit/jsr135/javax/microedition added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 18:05:14 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:32:40 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media - New directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media
In directory cvs:/tmp/cvs-serv30630/media

Log Message:
Directory /cvsroot/player/kit/jsr135/javax/microedition/media added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 18:05:27 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:32:52 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media/protocol - New
	directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media/protocol
In directory cvs:/tmp/cvs-serv30922/protocol

Log Message:
Directory /cvsroot/player/kit/jsr135/javax/microedition/media/protocol added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 18:05:27 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:32:52 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media/control - New
	directory
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media/control
In directory cvs:/tmp/cvs-serv30922/control

Log Message:
Directory /cvsroot/player/kit/jsr135/javax/microedition/media/control added to the repository



From cdunn at helixcommunity.org  Thu Dec 15 18:06:16 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:33:52 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media/control
	GUIControl.java, NONE, 1.1 GUIControlImp.java, NONE,
	1.1 MetaDataControl.java, NONE, 1.1 VideoControl.java, NONE,
	1.1 VideoControlImp.java, NONE, 1.1 VolumeControl.java, NONE,
	1.1 VolumeControlImp.java, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media/control
In directory cvs:/tmp/cvs-serv31915/javax/microedition/media/control

Added Files:
	GUIControl.java GUIControlImp.java MetaDataControl.java 
	VideoControl.java VideoControlImp.java VolumeControl.java 
	VolumeControlImp.java 
Log Message:
Version 1

--- NEW FILE: VolumeControl.java ---

package javax.microedition.media.control;

public interface VolumeControl extends javax.microedition.media.Control {

    // Mute or unmute the Player associated with this VolumeControl. 
    public void setMute(boolean mute);

    // Get the mute state of the signal associated with this VolumeControl.
    public boolean isMuted();

    // Set the volume using a linear point scale with values between 0 and 100. 
    public int setLevel(int level);

    // Get the current volume level set. 
    public int getLevel();
	
}



--- NEW FILE: VideoControl.java ---

package javax.microedition.media.control;
import javax.microedition.media.MediaException;

public interface VideoControl extends javax.microedition.media.control.GUIControl {

    public static final int USE_DIRECT_VIDEO = 1;

    public java.lang.Object initDisplayMode(int mode, java.lang.Object arg);

    public void setDisplayLocation(int x, int y);

    public int getDisplayX();

    public int getDisplayY();

    public void setVisible(boolean visible);

    public void setDisplaySize(int width, int height) throws MediaException;

    public void setDisplayFullScreen(boolean fullScreenMode) throws MediaException;

    public int getSourceWidth();

    public int getSourceHeight();

    public int getDisplayWidth();

    public int getDisplayHeight();

    public byte[] getSnapshot(java.lang.String imageType) throws MediaException;

}



--- NEW FILE: MetaDataControl.java ---

package javax.microedition.media.control;

public interface MetaDataControl extends javax.microedition.media.Control {

    public static final java.lang.String AUTHOR_KEY = "author";
    public static final java.lang.String COPYRIGHT_KEY = "copyright";
    public static final java.lang.String DATE_KEY = "date";
    public static final java.lang.String TITLE_KEY = "title";

    public java.lang.String[] getKeys();
    // Return the list of keys for the available metadata values.
    // The returned array must be an array with at least one key.

    public java.lang.String getKeyValue(java.lang.String key);
    // Retrieve the value found in the metadata associated with the given key.
    // Only keys obtained from getKeys are valid and can be used to retrieve metadata values.
    // If null or an invalid key is used, an IllegalArgumentException will be thrown. 
}

--- NEW FILE: GUIControl.java ---

package javax.microedition.media.control;

// GUIControl extends Control and is defined for controls that provide GUI functionalities. 

// Controls that support a GUI component should implement this interface. 
public interface GUIControl extends javax.microedition.media.Control {

    // This defines a mode on how the GUI is displayed. 
    public static final int USE_GUI_PRIMITIVE = 0;

    // Initialize the mode on how the GUI is displayed. 
    public java.lang.Object initDisplayMode(int mode, java.lang.Object arg);
	
}



--- NEW FILE: GUIControlImp.java ---

package javax.microedition.media.control;
import javax.microedition.media.*;

//
// GUIControl extends Control and is defined for controls that provide GUI functionalities. 
//
public class GUIControlImp implements GUIControl {

    private _GUIControl gc;
    public GUIControlImp(_GUIControl gc) {
	    this.gc = gc;
    }

    // Initialize the mode on how the GUI is displayed. 
    public java.lang.Object initDisplayMode(int mode, java.lang.Object arg) {
	    //return (java.lang.Object)gc.initDisplayMode(mode, arg);
	    return null;
    }
	
}



--- NEW FILE: VideoControlImp.java ---

package javax.microedition.media.control;
import javax.microedition.media.*;

public class VideoControlImp implements VideoControl {

    private _VideoControl vc;
    public VideoControlImp(_VideoControl vc) {
	    this.vc = vc;
    }

    public java.lang.Object initDisplayMode(int mode, java.lang.Object arg) {
	vc.initDisplayMode(mode, null);
	return null;
    }

    public void setDisplayLocation(int x, int y) {
	vc.setDisplayLocation(x, y);
    }

    public int getDisplayX() {
	return vc.getDisplayX();
    }

    public int getDisplayY() {
	return vc.getDisplayY();
    }

    public void setVisible(boolean visible) {
	vc.setVisible(visible);
    }

    public void setDisplaySize(int width, int height) throws MediaException {
	vc.setDisplaySize(width, height);
    }

    public void setDisplayFullScreen(boolean fullScreenMode) throws MediaException {
	vc.setDisplayFullScreen(fullScreenMode);
    }

    public int getSourceWidth() {
	return vc.getSourceWidth();
    }

    public int getSourceHeight() {
	return vc.getSourceHeight();
    }

    public int getDisplayWidth() {
	return vc.getDisplayWidth();
    }

    public int getDisplayHeight() {
	return vc.getDisplayHeight();
    }

    public byte[] getSnapshot(java.lang.String imageType) throws MediaException {
	vc.getSnapshot(imageType);
	return null;
    }


}



--- NEW FILE: VolumeControlImp.java ---

package javax.microedition.media.control;
import javax.microedition.media.*;

public class VolumeControlImp implements VolumeControl {

    private _VolumeControl vc;
    public VolumeControlImp(_VolumeControl vc) {
	    this.vc = vc;
    }

    // Mute or unmute the Player associated with this VolumeControl. 
    public void setMute(boolean mute) {
	    vc.setMute(mute);
    }

    // Get the mute state of the signal associated with this VolumeControl.
    public boolean isMuted() {
	    return vc.isMuted();
    }

    // Set the volume using a linear point scale with values between 0 and 100. 
    public int setLevel(int level) {
	    return vc.setLevel(level);
    }

    // Get the current volume level set. 
    public int getLevel() {
	    return vc.getLevel();
    }
	
}




From cdunn at helixcommunity.org  Thu Dec 15 18:06:16 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:33:52 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media/protocol
	ContentDescriptor.java, NONE, 1.1 DataSource.java, NONE,
	1.1 SourceStream.java, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media/protocol
In directory cvs:/tmp/cvs-serv31915/javax/microedition/media/protocol

Added Files:
	ContentDescriptor.java DataSource.java SourceStream.java 
Log Message:
Version 1

--- NEW FILE: ContentDescriptor.java ---

package javax.microedition.media.protocol;

// A ContentDescriptor identifies media data containers. 
//
public class ContentDescriptor extends java.lang.Object {

    java.lang.String contentType;

    public ContentDescriptor(java.lang.String contentType) {
	// Create a content descriptor with the specified content type. 
	this.contentType = contentType;
    }

    public java.lang.String getContentType() {
        // Obtain a string that represents the content type for this descriptor. 
	return contentType;
    }
}


--- NEW FILE: SourceStream.java ---

package javax.microedition.media.protocol;

import javax.microedition.media.protocol.ContentDescriptor;

public interface SourceStream extends javax.microedition.media.Controllable {

    public static final int NOT_SEEKABLE = 0;
	    // The value returned by getSeekType indicating that this SourceStream is not seekable. 
    public static final int SEEKABLE_TO_START = 1;
	    // The value returned by getSeekType indicating that this SourceStream can be seeked 
	    // only to the beginning of the media stream. 
    public static final int RANDOM_ACCESSIBLE = 2;
    	// The value returned by getSeekType indicating that this SourceStream can be seeked anywhere within the media. 

    // Method Detail 

    // Get the content type for this stream.
    public ContentDescriptor getContentDescriptor();

    // Get the size in bytes of the content on this stream.
    public long getContentLength();

    // Reads up to len bytes of data from the input stream into an array of bytes.
    // An attempt is made to read as many as len bytes, but a smaller number may be read.
    // The number of bytes actually read is returned as an integer. 
    // This method blocks until input data is available, end of file is detected, or an exception is thrown. 
    public int read(byte[] b, int off, int len) throws java.io.IOException;

    public int getTransferSize();
    // Get the size of a "logical" chunk of media data from the source.
    // This method can be used to determine the minimum size of the buffer
    // to use in conjunction with the read method to read data from the source.

    public long seek(long where) throws java.io.IOException;
    // Seek to the specified point in the stream. The seek method may, for a variety of reasons, fail to seek to the specified position. For example, it may be asked to seek to a position beyond the size of the stream; or the stream may only be seekable to the beginning (getSeekType returns SEEKABLE_TO_START). The return value indicates whether the seeking is successful. If it is successful, the value returned will be the same as the given position. Otherwise, the return value will indicate what the new position is. 

    public long tell();
    // Obtain the current position in the stream.

    public int getSeekType();
    // Find out if the stream is seekable. The return value can be one of these three:
    // NOT_SEEKABLE, SEEKABLE_TO_START and RANDOM_ACCESSIBLE. If the return value is SEEKABLE_TO_START,
    // it means that the stream can only be repositioned to the beginning of the stream.
    // If the return value is RANDOM_ACCESSIBLE, the stream can be seeked anywhere within the stream.
}

--- NEW FILE: DataSource.java ---

package javax.microedition.media.protocol;

import javax.microedition.media.*;

public abstract class DataSource extends java.lang.Object implements Controllable {

    private java.lang.String locator;
    private Control controls[];

    // Construct a DataSource from a locator. 
    public DataSource(java.lang.String locator) {
	    this.locator = locator;
	    controls = new Control [5];
	    // allocate some controls ?
    }

    // Open a connection to the source described by the locator and initiate communication. 
    public abstract  void connect();

    // Close the connection to the source described by the locator and free resources used to maintain the connection. 
    public abstract void disconnect();

    // Get a string that describes the content-type of the media that the source is providing. 
    public abstract java.lang.String getContentType();

    //      Get the locator that describes this source. 
    public java.lang.String getLocator() {
	    return locator;
    }

    // Get the collection of streams that this source manages. 
    public abstract  SourceStream[] getStreams();

    // Initiate data-transfer. 
    public abstract  void start();

    // Stop the data-transfer. 
    public abstract  void stop();

    // Methods inherited from class java.lang.Object 
	//equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 

    // Methods inherited from interface javax.microedition.media.Controllable 

    // Obtain the object that implements the specified Control interface. 
    public Control getControl(java.lang.String controlType) {
	    return controls[0];
    }

    // Obtain the collection of Controls from the object that implements this interface. 
    public Control[] getControls() {
	    return controls;
    }
}



From cdunn at helixcommunity.org  Thu Dec 15 18:06:17 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:33:52 2005
Subject: [Player-cvs] kit/jsr135/pub enginedriver.h, NONE, 1.1 exceptions.h,
	NONE, 1.1 fivemmap.h, NONE, 1.1 globals.h, NONE,
	1.1 guicontrol.h, NONE, 1.1 hxjadvsnk.h, NONE,
	1.1 hxjcontext.h, NONE, 1.1 hxjerror.h, NONE, 1.1 hxjstate.h,
	NONE, 1.1 javax_microedition_media_PlayerCallback.h, NONE,
	1.1 jsr135interface.h, NONE, 1.1 manager.h, NONE, 1.1 player.h,
	NONE, 1.1 videocontrol.h, NONE, 1.1 volumecontrol.h, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135/pub
In directory cvs:/tmp/cvs-serv31915/pub

Added Files:
	enginedriver.h exceptions.h fivemmap.h globals.h guicontrol.h 
	hxjadvsnk.h hxjcontext.h hxjerror.h hxjstate.h 
	javax_microedition_media_PlayerCallback.h jsr135interface.h 
	manager.h player.h videocontrol.h volumecontrol.h 
Log Message:
Version 1

--- NEW FILE: hxjerror.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _HXJERROR_H_
#define _HXJERROR_H_

struct IUnknown;
struct IHXErrorMessages;
struct IHXPlayer;

#include "hxjadvsnk.h"

class HXJErrorSink : public IHXErrorSink
{
public:

    HXJErrorSink(IUnknown* pUnknown);
    ~HXJErrorSink();

    /*
     *  IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);

    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     *  IHXErrorSink methods
     */

    /************************************************************************
     *	Method:
     *	    IHXErrorSink::ErrorOccurred
     *	Purpose:
     *	    After you have registered your error sink with an IHXErrorSinkControl 
     *	    (either in the server or player core) this method will be called to 
     *	    report an error, event, or status message.
     *
     *	    The meaning of the arguments is exactly as described in
     *	    hxerror.h
     */
    STDMETHOD(ErrorOccurred)	(THIS_
				const UINT8	unSeverity,  
				const ULONG32	ulHXCode,
				const ULONG32	ulUserCode,
				const char*	pUserString,
				const char*	pMoreInfoURL
				);

    // Callback stuff


protected:
    LONG32 m_lRefCount;
    IHXPlayer* m_pPlayer;

    void   ConvertErrorToString (const ULONG32 ulHXCode, char* pszBuffer, UINT32 ulBufLen);

private:
    CHXString m_callbackProxy;
    CHXString m_callbackName;
};
#endif // _HXJERROR_H_ 


--- NEW FILE: player.h ---

#ifndef __PLAYER_H_
#define __PLAYER_H_

#include "hlxclib/stdio.h"
#include "hxresult.h"

#include "hxcom.h"
#include "hxcore.h"
#include "hxwintyp.h"
#include "dllacces.h"
#include "hxclsnk.h"
#include "hxerror.h"
#include "hxslist.h"
#include "hxvsrc.h"
#include "hxengin.h"
#include "jsr135interface.h"

#include "hxjcontext.h"

struct IUnknown;
class TimeBase;
class PlayerListener;
class _VolumeControl;
class _VideoControl;
class _GUIControl;
class HXJClientContext;
class HXMutex;
class HXEvent;
class _MediaException;
class _IllegalStateException;
struct IHXScheduler;
struct IHXClientState;
struct IHXClientStateAdviseSink;
struct IControllable;
struct IControl;

// Player transition state 
typedef enum _TransState {
	    TransState_Idle	    = 0,
	    TransState_Realizing,
	    TransState_Prefetching,
	    TransState_Starting,
	    TransState_Stopping,
	    TransState_Deallocating,
	    TransState_Deallocating2,
	    TransState_Closing,
	    TransState_Count
} TransState;

typedef struct _EventInfo {
	char eventName[80];
	void* eventData;
} EventInfo;

class _Player
#ifndef SWIG
	: public IHXClientStateAdviseSink
	, public IControllable
#endif
{
public:
    _Player(IHXClientEngine* pClientEngine, char* locator);
    ~_Player();

    // Player state values according the the JSR135 spec
    enum PlayerState {
	    UNREALIZED = 100,
	    REALIZED   = 200,
	    PREFETCHED = 300,
	    STARTED    = 400,
	    CLOSED     = 0
    };

    static const unsigned long TIME_UNKNOWN;

    // Constructs portions of the Player without acquiring the scarce and exclusive resources. 
    void realize();

    // Acquires the scarce and exclusive resources and processes as much data as necessary to
    // reduce the start latency. 
    void prefetch();

    // Starts the Player as soon as possible. 
    void start();

    // Stops the Player. 
    void stop();

    // Release the scarce or exclusive resources like the audio device acquired by the Player. 
    void deallocate();

    // Close the Player and release its resources. 
    void close();

    // Gets this Player's current media time. 
    long getMediaTime();

    // Sets the Player's media time. 
    long setMediaTime(long now);

    // Get the duration of the media. 
    long getDuration();

    // Gets the current state of this Player. 
    int getState();

    // Set the number of times the Player will loop and play the content. 
    void setLoopCount(int count);

    // Get the content type of the media that's being played back by this Player. 
    char* getContentType() throw( _MediaException );

    _VolumeControl* getVolumeControl();
    _VideoControl* getVideoControl();
    _GUIControl* getGUIControl();
#ifdef SWIG
    char** getControls();
#else
    // IControllable methods
    STDMETHOD_(IControl*, getControl)	(THIS_ char* contentType);
    STDMETHOD_(IControl**, getControls) (THIS);

    HXBOOL getEvent(EventInfo* pInfo);
    /*
     *  IUnknown methods
     */
    STDMETHOD(QueryInterface) (THIS_
                               REFIID riid,
                               void** ppvObj);
    
    STDMETHOD_(ULONG32,AddRef) (THIS);

    STDMETHOD_(ULONG32,Release) (THIS);
    /************************************************************************
     *  Method:
     *      IHXClientStateAdviseSink::OnStateChange
     *  Purpose:
     *      Called by client engine to inform the client that the state changed
     *
     */
    STDMETHOD (OnStateChange) (THIS_
                             UINT16 uOldState,
                             UINT16 uNewState);

#endif
    /*

    // Add a player listener for this player. 
    void addPlayerListener(PlayerListener playerListener);

    // Remove a player listener for this player. 
    void removePlayerListener(PlayerListener playerListener);

    // Gets the TimeBase that this Player is using. 
    TimeBase getTimeBase();

    // Sets the TimeBase for this Player. 
    void setTimeBase(TimeBase master);
    */
    HXJClientContext*	m_pContext;
    IHXPlayer*		m_pPlayer;
private:

    void TransitionToState(TransState toState);
    void gotoState(TransState fromState,
		   TransState toState,
		   IHXCallback* pCallback,
		   HXBOOL bWait);
    void Unblock(TransState eState);
    void Block(TransState eState);

    TransState m_eTransState;

    void CreatePlayer();
    void realizeFunc();
    void prefetchFunc();
    void startFunc();
    void stopFunc();
    void deallocateFunc();
    void closeFunc();

    void SetState(PlayerState state);
    void CallJava();

    HX_RESULT ClosePlayer();
    void SetClientContext(HXJClientContext* pContext);
    const char* StateString(int state);

    IHXClientEngine*	m_pClientEngine;
    IHXClientState*	m_pClientState;
    PlayerState		m_state;
    CHXString		m_url;

    IHXScheduler*	m_pScheduler;
    HXMutex*		m_pMutex;
    LONG32		m_lRefCount;
    UINT32		m_ulCachedSeekTime;

    HXEvent* m_pCreatePlayerEvent;
    HXEvent* m_pEvents[TransState_Count];

    /////////// Callback classes
    // CreatePlayer
    class CreatePlayerCallback : public IHXCallback
    {
    public:
        CreatePlayerCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~CreatePlayerCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class CreatePlayerCallback;
    CreatePlayerCallback* m_pCreatePlayerCallback;

    // realize
    class RealizeCallback : public IHXCallback
    {
    public:
        RealizeCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~RealizeCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class RealizeCallback;
    RealizeCallback* m_pRealizeCallback;

    // prefetch
    class PrefetchCallback : public IHXCallback
    {
    public:
        PrefetchCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~PrefetchCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class PrefetchCallback;
    PrefetchCallback* m_pPrefetchCallback;

    // start
    class StartCallback : public IHXCallback
    {
    public:
        StartCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~StartCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class StartCallback;
    StartCallback* m_pStartCallback;

    // stop
    class StopCallback : public IHXCallback
    {
    public:
        StopCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~StopCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class StopCallback;
    StopCallback* m_pStopCallback;

    // deallocate
    class DeallocateCallback : public IHXCallback
    {
    public:
        DeallocateCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~DeallocateCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class DeallocateCallback;
    DeallocateCallback* m_pDeallocateCallback;

    // close
    class CloseCallback : public IHXCallback
    {
    public:
        CloseCallback(_Player* pOwner) : m_pOwner(pOwner), m_lRefCount(0) {}
        ~CloseCallback() {}

	// IUnknown methods
        STDMETHOD(QueryInterface)       (THIS_ REFIID riid, void** ppvObj);
        STDMETHOD_(ULONG32,AddRef)      (THIS);
        STDMETHOD_(ULONG32,Release)     (THIS);
	// IHXCallback method
        STDMETHOD(Func)                 (THIS);

    private:
        LONG32                          m_lRefCount;
        _Player*			m_pOwner;
    };
    friend class CloseCallback;
    CloseCallback* m_pCloseCallback;

private:
    _VolumeControl* m_pVolumeControl;
    _GUIControl* m_pGUIControl;
    _VideoControl* m_pVideoControl;

};

#endif //__PLAYER_H_

--- NEW FILE: guicontrol.h ---

#ifndef __GUICONTROL_H_
#define __GUICONTROL_H_

#include "hlxclib/stdio.h"
#include "hxresult.h"
#include "hxcom.h"
#include "hxcore.h"
#include "hxwintyp.h"
#include "dllacces.h"
#include "hxclsnk.h"
#include "hxerror.h"
#include "hxslist.h"
#include "hxvsrc.h"
#include "hxengin.h"
#include "jsr135interface.h"

class _Player;

class _GUIControl : public IControl
{
public:
    _GUIControl(_Player* pPlayer);
    ~_GUIControl();

    static const int USE_GUI_PRIMITIVE;

    void* initDisplayMode(int mode, void* arg);

private:
    _Player* m_pPlayer;
};

#endif

--- NEW FILE: jsr135interface.h ---

#ifndef _JSR135INTERFACE_H_
#define _JSR135INTERFACE_H_

#include "hxcom.h"
//DEFINE_GUID_ENUM(IID_IControl, 0x9ba67314, 0x63ab, 0x417d, 0x8e, 0x3b, 0xc8, 0x87, 0x16, 0x4c, 0x7d, 0xb2)
//DEFINE_GUID_ENUM(IID_IControllable, 0xfd83a8b6, 0xc5ee, 0x4219, 0xad, 0x88, 0xa7, 0x58, 0x49, 0x12, 0x3f, 0x19)

typedef _INTERFACE   IControl		IControl;
//////////////////

DEFINE_GUID(IID_IControl, 0x9ba67314, 0x63ab, 0x417d, 0x8e, 0x3b, 0xc8, 0x87, 0x16, 0x4c, 0x7d, 0xb2);

#undef  INTERFACE
#define INTERFACE   IControl

DECLARE_INTERFACE(IControl)
{
};

//////////////////
/****************************************************************************
 * 
 *  Interface:
 * 
 *	IControllable
 * 
 *      IID_IControllable:	{FD83A8B6-C5EE-4219-AD88-A75849123F19}
 * 
 * 
 */

DEFINE_GUID(IID_IControllable, 0xfd83a8b6, 0xc5ee, 0x4219, 0xad, 0x88, 0xa7, 0x58, 0x49, 0x12, 0x3f, 0x19);

#undef  INTERFACE
#define INTERFACE   IControllable

DECLARE_INTERFACE(IControllable)
{
    STDMETHOD_(IControl*, getControl)	(THIS_ char* contentType) PURE;
    STDMETHOD_(IControl**, getControls) (THIS) PURE;
};


#endif

--- NEW FILE: videocontrol.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef __VIDEOCONTROL_H_
#define __VIDEOCONTROL_H_

#include "hlxclib/stdio.h"
#include "jsr135interface.h"
#include "fivemmap.h"
#include "hxsite2.h"

struct IHXCommonClassFactory;
struct IHXSiteSupplier;
struct IHXSite;
//struct IHXSite2;
struct IHXValues;
class FiveMinuteMap;
class _Player;
class _MediaException;

class _VideoControl 
#ifndef SWIG
	: public IHXSiteSupplier, public IControl
#endif
{
public:
    _VideoControl(IUnknown* pUnkPlayer);
    ~_VideoControl();

    static const int USE_DIRECT_VIDEO;

    void* initDisplayMode(int mode, void* arg);

    void setDisplayLocation(int x, int y);

    int getDisplayX();

    int getDisplayY();

    void setVisible(bool visible);

    void setDisplaySize(int width, int height); // throw( _MediaException );

    void setDisplayFullScreen(bool fullScreenMode); // throw( _MediaException );

    int getSourceWidth();

    int getSourceHeight();

    int getDisplayWidth();

    int getDisplayHeight();

    unsigned char* getSnapshot(char* imageType); // throw( _MediaException );

#ifndef SWIG
    /*
     * IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);

    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     * IHXSiteSupplier methods
     */

    /************************************************************************
     *	Method:
     *	    IHXSiteSupplier::SitesNeeded
     *	Purpose:
     *	  Called to inform the site supplier that a site with a particular
     *	  set of characteristics is needed. If the site supplier can 
     *	  fulfill the request it should call the site manager and add one
     *	  or more new sites.
     *    Note that the request for sites is associated with a Request ID
     *    the client core will inform the site supplier when this requested
     *    site is no longer needed.
     */
    STDMETHOD(SitesNeeded)	(THIS_
				UINT32			uRequestID,
				IHXValues*		pSiteProps);

    /************************************************************************
     *  Method:
     *    IHXSiteSupplier::SitesNotNeeded
     *  Purpose:
     *    Called to inform the site supplier that all sites from a previos
     *	  site request are no longer needed. If the site supplier had 
     *	  previously created non-persistant sites (like popup windows)
     *    to fulfill a request for sites it should call the site manager 
     *    and remove those sites.
     */
    STDMETHOD(SitesNotNeeded)
				(THIS_
				UINT32			uRequestID);


    /************************************************************************
     *  Method:
     *    IHXSiteSupplier::BeginChangeLayout
     *  Purpose:
     *    Called to inform the site supplier a layout change has beginning
     *	  it can expect to recieve SitesNeeded() and SitesNotNeeded() calls
     *	  while a layout change is in progress,
     */
    STDMETHOD(BeginChangeLayout) (THIS);

    /************************************************************************
     *  Method:
     *    IHXSiteSupplier::DoneChangeLayout
     *  Purpose:
     *    Called to inform the site supplier the layout change has been
     *	  completed.
     */
    STDMETHOD(DoneChangeLayout) (THIS);
#endif

private:
    int getSourceProperty(char* propName);

    IUnknown* m_pUnkPlayer;

    HXBOOL			m_bInitialized;
    LONG32			m_lRefCount;

    IHXSite*			m_pSite;
    IHXSite2*			m_pSite2;
    IHXSiteFullScreen*		m_pSiteFullScreen;
    IHXSiteManager*		m_pSiteManager;
    IHXCommonClassFactory*	m_pCCF;
    FiveMinuteMap		m_CreatedSites;
    UINT32			m_uRequestID;
    IHXValues*			m_pProps;
};

#endif






--- NEW FILE: fivemmap.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _FIVEMMAP_H_
#define _FIVEMMAP_H_

#ifndef _HXTYPES_H_
#error FiveMinuteMap assumes pntypes.h.
#endif

class FiveMinuteMap
{
    const int AllocationSize;

    void**  m_pKeyArray;
    void**  m_pValueArray;
    int	    m_nMapSize;
    int	    m_nAllocSize;
    int     m_nCursor;
public:
    FiveMinuteMap()
	: m_pKeyArray(NULL)
	, m_pValueArray(NULL)
	, m_nMapSize(0)
	, m_nAllocSize(0)
        , m_nCursor(0)
	, AllocationSize(10)
	{};

    ~FiveMinuteMap()
	{
	    delete [] m_pKeyArray;
	    delete [] m_pValueArray;
	};

    int  GetCount() {return m_nMapSize;}

    void* GetFirstValue();
    void* GetNextValue();

    HXBOOL Lookup(void* Key, void*& Value) const;
    void RemoveKey(void* Key);
    void RemoveValue(void* Value);
    void SetAt(void* Key, void* Value);
};

#endif /* _FIVEMMAP_H_ */

--- NEW FILE: exceptions.h ---

#ifndef _EXCEPTIONS_H_
#define _EXCEPTIONS_H_

#include "hxstring.h"

class _MediaException {
public:
	_MediaException() { 
		m_reason = (const char*) "MediaException";
	}
	_MediaException(char* reason) { 
		m_reason = (const char*) reason;
	}
private:
	CHXString m_reason;
};

class _IllegalStateException {
public:
	_IllegalStateException() { 
		m_reason = (const char*) "IllegalState";
	}
	_IllegalStateException(char* reason) { 
		m_reason = (const char*) reason;
	}
private:
	CHXString m_reason;
};

#endif

--- NEW FILE: javax_microedition_media_PlayerCallback.h ---
/* DO NOT EDIT THIS FILE - it is machine generated */
#include 
/* Header for class javax_microedition_media_PlayerCallback */

#ifndef _Included_javax_microedition_media_PlayerCallback
#define _Included_javax_microedition_media_PlayerCallback
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     javax_microedition_media_PlayerCallback
 * Method:    pollPlayerCallback
 * Signature: (J)V
 */
JNIEXPORT void JNICALL Java_javax_microedition_media_PlayerCallback_pollPlayerCallback
  (JNIEnv *, jobject, jlong);

#ifdef __cplusplus
}
#endif
#endif

--- NEW FILE: hxjcontext.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _HXJCONTEXT_H_
#define _HXJCONTEXT_H_

struct IUnknown;
struct IHXPreferences;
class HXJClientAdviseSink;
class HXJErrorMessages;
class HXJErrorSink;
class _VideoControl;
class HXQCallback;

#include "hxjadvsnk.h"
#include "hxjerror.h"
#include "cpqueue.h" // ptr queue
#include "videocontrol.h"


class HXJClientContext : public IHXPreferences, public HXQCallback
{
private:
    LONG32			m_lRefCount;
    LONG32                      m_lClientIndex;

    HXJClientAdviseSink*	m_pClientSink;
    HXJErrorSink*		m_pErrorSink;
    _VideoControl*		m_pSiteSupplier;
    IHXPreferences*		m_pDefaultPrefs;
    char			m_pszGUID[256]; /* Flawfinder: ignore */

public:

    HXJClientContext(LONG32 /*IN*/ lClientIndex);
    ~HXJClientContext();

    void Init(IUnknown*	       /*IN*/ pUnknown,
	      IHXPreferences* /*IN*/ pPreferences,
	      char*	       /*IN*/ pszGUID);
    void Close();

    _VideoControl* GetVideoControl() { return m_pSiteSupplier; }

    // From HXQCallback
    void queueCallback(const char* event, void* eventData);

    // Callback stuff


    HX_RESULT Schedule(UINT32 ulTimeout, UINT16 type)
    {
	return m_pClientSink->Schedule(ulTimeout, type);
    }

    void GetStat(char* strStatName, char* pszStatName, UINT32& ulValue)
    {
	m_pClientSink->GetStat(strStatName, pszStatName, ulValue);
    }

    /*
    HX_RESULT GetStats(const char* strRegKey, struct getStatsResponse& r, int& count )
    {
	return m_pClientSink->GetStats(strRegKey, r, count);
    }
    */

    void GetPresentationDuration(UINT32& ulPresentationDuration)
    {
	m_pClientSink->GetPresentationDuration(ulPresentationDuration);
    }

    /*
    CALLBACK_REC* GetCallbacks()
    {
	    return m_pClientSink->m_callbacks;
    }
    */

    /*
     * IUnknown methods
     */
    STDMETHOD(QueryInterface)	(THIS_
				REFIID riid,
				void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)	(THIS);
    STDMETHOD_(ULONG32,Release)	(THIS);

    /*
     * IHXPreferences methods
     */
    STDMETHOD(ReadPref)		(THIS_ const char* pref_key, 
				 IHXBuffer*& buffer);
    STDMETHOD(WritePref)	(THIS_ const char* pref_key,
				 IHXBuffer* buffer);

    HX_RESULT GetPreferenceEnumerator(IHXPreferenceEnumerator*& pPrefEnum);

    /////////////
    HX_RESULT EnQueuePtr(void* p)
    {
	return m_pQueue ? m_pQueue->EnQueuePtr(p) : HXR_FAIL;
    }
    void* DeQueuePtr(HXBOOL& bIsValid)
    {
	return m_pQueue ? m_pQueue->DeQueuePtr(bIsValid) : NULL;
    }
    void Clear() { m_pQueue->FlushQueue(); }
    UINT32 Count()
    {
	return m_pQueue ? m_pQueue->GetQueuedItemCount() : 0;
    }
private:
    CPtrQueue* m_pQueue;
    //////////////
};

#endif _HXJCONTEXT_H_


--- NEW FILE: manager.h ---

#ifndef _MANAGER_H_
#define _MANAGER_H_

#include "player.h"

#include "hxresult.h"
#include "hxcom.h"
#include "hxcore.h"
#include "hxwintyp.h"
#include "dllacces.h"
#include "hxclsnk.h"
#include "hxerror.h"
#include "hxslist.h"
#include "hxvsrc.h"

#include "hxjcontext.h"

class CHXString;
class CHXSimpleList;
class _Player;
class HXThread;
class HXEvent;
struct IHXScheduler;
class HXEngineDriver;

class _Manager
{
public:
    _Manager();
    ~_Manager();

    // Play back a tone as specified by a note and its duration. 
    static void playTone(int note, int duration, int volume);

    // Create a Player for a DataSource. 
    //static _Player createPlayer(DataSource source);

    // Create a Player to play back media from an InputStream. 
    //static _Player createPlayer(java.io.InputStream stream, java.lang.jstring type) ;

    // Create a Player from an input locator. 
    static _Player* createPlayer(char* locator);

    // Return the list of supported content types for the given protocol. 
    //static char* getSupportedContentTypes(char* protocol);

    // Return the list of supported protocols given the content type. 
    //static char* getSupportedProtocols(char* content_type);

    // Get the time-base object for the system. 
    //static TimeBase getSystemTimeBase();
    //
    static void StartEngineDriver();
	
#ifndef SWIG
    // Do not include these in the java interface
    static HX_RESULT HXInit();    
#endif

private:

    static void EventOccurred(HXxEvent* pEvent);
    static HX_RESULT InitDLLAccessPaths();
    //static void DoEvent();

// Client Core interface routines
    static HX_RESULT CreateEngine();
    static HX_RESULT CloseEngine();

    static HXBOOL		m_bInitialized;
    static DLLAccess		m_dllHXCore;
    static CHXString		m_pHelixLibsPath;
    static CHXString		m_pHelixPluginsPath;
    static CHXString		m_pHelixCodecsPath;
    static CHXString		m_pHelixEngineName;
    static IHXClientEngine*	m_pClientEngine;

    static HXEngineDriver*	m_pEngineDriver;
};
  

#endif // _MMAPI_H_


--- NEW FILE: hxjstate.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _HXJSTATE_H_
#define _HXJSTATE_H_

struct IHXClientStateAdviseSink;
struct IUnknown;
struct IHXScheduler;
struct IHXPlayer;
struct IHXClientState;
class HXQCallback;
#include "hxstring.h"


class HXJClientStateAdviseSink : public IHXClientStateAdviseSink
{
  private:
    LONG32          m_lRefCount;
    
    IUnknown*       m_pUnknown;
    IHXRegistry*    m_pRegistry;
    IHXScheduler*   m_pScheduler;
    IHXClientState* m_pClientState;
    
    ~HXJClientStateAdviseSink();

    HXQCallback* m_pCallback;

  public:

    HXJClientStateAdviseSink(IUnknown* pUnknown, HXQCallback* pCallback);

    /*
     *  IUnknown methods
     */
    STDMETHOD(QueryInterface) (THIS_
                               REFIID riid,
                               void** ppvObj);
    
    STDMETHOD_(ULONG32,AddRef) (THIS);

    STDMETHOD_(ULONG32,Release) (THIS);

    /*
     *  IHXClientStateAdviseSink methods
     */

    /************************************************************************
     *  Method:
     *      IHXClientStateAdviseSink::OnStateChange
     *  Purpose:
     *      Called by client engine to inform the client that the state changed
     *
     */
    STDMETHOD (OnStateChange) (THIS_
                             UINT16 uOldState,
                             UINT16 uNewState);
};

#endif // _HXJSTATE_H_

--- NEW FILE: globals.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

// Taken from splay

#ifndef _HXJENGINE_GLOBALS_H
#define _HXJENGINE_GLOBALS_H

#include "hxengin.h"
#include "hxcore.h"
#include "hxplayvelocity.h"

#define HX_COMMAND_BUFFER_SIZE 256
#define HX_MAX_NUM_MULTI_SEEKS 10

struct _stGlobals
{
    _stGlobals()
        : 
	  bEnableAdviseSink(FALSE),
          bEnableVerboseMode(FALSE),
          g_bEnableSlowStart(TRUE),
          g_bOnBeginOccurred(FALSE),
          g_pszUsername( NULL),
          g_pszPassword(NULL),
          g_pszGUIDFile(NULL),
          g_pszGUIDList(NULL),
          g_Error(HXR_OK),
	  g_ulNumSecondsPlayed(0),
          g_bNullRender(FALSE),
          g_bUserStop(FALSE),
          g_bInitVelocity(FALSE),
          g_bABD(FALSE),
          g_pVelocityCaps(NULL),
          g_ulNumMultiSeeks(0),
          g_ulMultiSeekIndex(0),
          g_bMultiSeek(FALSE)
    {
        memset(g_szCommandBuffer, 0, HX_COMMAND_BUFFER_SIZE);
    }

    BOOL                     bEnableAdviseSink;
    BOOL                     bEnableVerboseMode;
    BOOL                     g_bEnableSlowStart;
    BOOL                     g_bOnBeginOccurred;
    char*                    g_pszUsername;
    char*                    g_pszPassword;
    char*                    g_pszGUIDFile;
    char*                    g_pszGUIDList;
    HX_RESULT                g_Error;
    UINT32                   g_ulNumSecondsPlayed;
    BOOL                     g_bNullRender;
    BOOL                     g_bUserStop;
    BOOL                     g_bInitVelocity;
    BOOL                     g_bABD;
    IHXPlaybackVelocityCaps* g_pVelocityCaps;
    BOOL                     g_bMultiSeek;
    UINT32                   g_ulMultiSeekTime[HX_MAX_NUM_MULTI_SEEKS];
    UINT32                   g_ulNumMultiSeeks;
    UINT32                   g_ulMultiSeekIndex;
    char                     g_szCommandBuffer[HX_COMMAND_BUFFER_SIZE];
};


#endif // _HXJENGINE_GLOBALS_H

--- NEW FILE: hxjadvsnk.h ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#ifndef _HXJADVSNK_H_
#define _HXJADVSNK_H_

struct IHXClientAdviseSink;
struct IUnknown;
struct IHXRegistry;
struct IHXScheduler;
struct IHXCallback;
struct IHXPlayer;
//#include "hxengin.h"
#include "hxprefs.h" // IHXPreferences
#include "hxstring.h"
class HXQCallback;

class HXQCallback {
	public:
		virtual void queueCallback(const char* event, void* eventData) = 0;
};
#define JAVA_CALLBACK(func) void (func)(const char* event, const void* eventData)

class HXJClientAdviseSink : public IHXClientAdviseSink, public IHXCallback
{
  private:
    LONG32          m_lRefCount;
    LONG32          m_lClientIndex;
    
    IUnknown*       m_pUnknown;
    IHXRegistry*    m_pRegistry;
    IHXScheduler*   m_pScheduler;
    
    UINT32          m_ulStartTime;
    UINT32          m_ulStopTime;
    UINT32          m_ulPresentationDuration;
    
    UINT32    m_lCurrentBandwidth;
    UINT32    m_lAverageBandwidth;
    BOOL      m_bOnStop;

    IHXPlayer*	m_pPlayer;
    ULONG32	m_hCallback; // IHXCallback

    ~HXJClientAdviseSink();
    HX_RESULT DumpRegTree(const char* pszTreeName );

    void GetStatistics (char* /*IN*/ pszRegistryKey);
    void GetAllStatistics (void);
    void SetClipInfo( IHXPlayer* m_pRMAPlayer);
    void PrintPropName( IHXValues* pHeader );

    HXQCallback* m_pCallback;

  public:

    HXJClientAdviseSink(IUnknown* /*IN*/ pUnknown, LONG32 /*IN*/ lClientIndex, HXQCallback* pCallback);

    HX_RESULT Schedule(UINT32 ulTimeout, UINT16 type);

    void GetStat(char* pszRegistryKey, char* pszStatName, UINT32& ulValue);
    //HX_RESULT GetStats(const char* pszTreeName, struct getStatsResponse& r, int& count );

    void GetPresentationDuration(UINT32& ulPresentationDuration)
    { ulPresentationDuration = m_ulPresentationDuration; }

    /*
     *  IUnknown methods
     */
    STDMETHOD(QueryInterface) (THIS_
                               REFIID riid,
                               void** ppvObj);
    
    STDMETHOD_(ULONG32,AddRef) (THIS);

    STDMETHOD_(ULONG32,Release) (THIS);

    /*
     *  IHXClientAdviseSink methods
     */

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPosLength
     *  Purpose:
     *      Called to advise the client that the position or length of the
     *      current playback context has changed.
     */
    STDMETHOD(OnPosLength) (THIS_
                            UINT32    ulPosition,
                            UINT32    ulLength);
    
    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPresentationOpened
     *  Purpose:
     *      Called to advise the client a presentation has been opened.
     */
    STDMETHOD(OnPresentationOpened) (THIS);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPresentationClosed
     *  Purpose:
     *      Called to advise the client a presentation has been closed.
     */
    STDMETHOD(OnPresentationClosed) (THIS);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnStatisticsChanged
     *  Purpose:
     *      Called to advise the client that the presentation statistics
     *      have changed. 
     */
    STDMETHOD(OnStatisticsChanged) (THIS);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPreSeek
     *  Purpose:
     *      Called by client engine to inform the client that a seek is
     *      about to occur. The render is informed the last time for the 
     *      stream's time line before the seek, as well as the first new
     *      time for the stream's time line after the seek will be completed.
     *
     */
    STDMETHOD (OnPreSeek) (THIS_
                           ULONG32 ulOldTime,
                           ULONG32  ulNewTime);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPostSeek
     *  Purpose:
     *      Called by client engine to inform the client that a seek has
     *      just occured. The render is informed the last time for the 
     *      stream's time line before the seek, as well as the first new
     *      time for the stream's time line after the seek.
     *
     */
    STDMETHOD (OnPostSeek) (THIS_
                            ULONG32 ulOldTime,
                            ULONG32 ulNewTime);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnStop
     *  Purpose:
     *      Called by client engine to inform the client that a stop has
     *      just occured. 
     *
     */
    STDMETHOD (OnStop) (THIS);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnPause
     *  Purpose:
     *      Called by client engine to inform the client that a pause has
     *      just occured. The render is informed the last time for the 
     *      stream's time line before the pause.
     *
     */
    STDMETHOD (OnPause) (THIS_
                         ULONG32 ulTime);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnBegin
     *  Purpose:
     *      Called by client engine to inform the client that a begin or
     *      resume has just occured. The render is informed the first time 
     *      for the stream's time line after the resume.
     *
     */
    STDMETHOD (OnBegin) (THIS_
                         ULONG32 ulTime);

    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnBuffering
     *  Purpose:
     *      Called by client engine to inform the client that buffering
     *      of data is occuring. The render is informed of the reason for
     *      the buffering (start-up of stream, seek has occured, network
     *      congestion, etc.), as well as percentage complete of the 
     *      buffering process.
     *
     */
    STDMETHOD (OnBuffering) (THIS_
                             ULONG32 ulFlags,
                             UINT16 unPercentComplete);


    /************************************************************************
     *  Method:
     *      IHXClientAdviseSink::OnContacting
     *  Purpose:
     *      Called by client engine to inform the client is contacting
     *      hosts(s).
     *
     */
    STDMETHOD (OnContacting) (THIS_
                              const char* pHostName);

    // IHXCallback
    STDMETHOD(Func)            (THIS);

    // For authentication
    HX_RESULT OnAuthenticate();

};

#endif // _HXJADVSNK_H_

--- NEW FILE: volumecontrol.h ---

#ifndef __VOLUMECONTROL_H_
#define __VOLUMECONTROL_H_

#include "hlxclib/stdio.h"
#include "jsr135interface.h"

struct IHXVolume;

class _VolumeControl : public IControl
{
public:
    _VolumeControl(IHXVolume* pVolume);
    ~_VolumeControl();

    // Mute or unmute the Player associated with this VolumeControl. 
    void setMute(bool mute);

    // Get the mute state of the signal associated with this VolumeControl.
    bool isMuted();

    // Set the volume using a linear point scale with values between 0 and 100. 
    int setLevel(int level);

    // Get the current volume level set. 
    int getLevel();

private:
    IHXVolume* m_pVolume;
};

#endif

--- NEW FILE: enginedriver.h ---
#ifndef _ENGINEDRIVER_H
#define _ENGINEDRIVER_H

class HXThread;
class HXEvent;

class HXEngineDriver
{
public:
	HXEngineDriver () : m_pThread(NULL), m_pEvent(NULL) {}
	void Start();

	HXThread* m_pThread;
	HXEvent* m_pEvent;
};

#endif


From cdunn at helixcommunity.org  Thu Dec 15 18:06:15 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:33:53 2005
Subject: [Player-cvs] 
	kit/jsr135/javax/microedition/media Control.java, NONE,
	1.1 Controllable.java, NONE, 1.1 EventInfo.java, NONE,
	1.1 Manager.java, NONE, 1.1 MediaException.java, NONE,
	1.1 Player.java, NONE, 1.1 PlayerCallback.java, NONE,
	1.1 PlayerEvent.java, NONE, 1.1 PlayerImp.java, NONE,
	1.1 PlayerListener.java, NONE, 1.1 TimeBase.java, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media
In directory cvs:/tmp/cvs-serv31915/javax/microedition/media

Added Files:
	Control.java Controllable.java EventInfo.java Manager.java 
	MediaException.java Player.java PlayerCallback.java 
	PlayerEvent.java PlayerImp.java PlayerListener.java 
	TimeBase.java 
Log Message:
Version 1

--- NEW FILE: MediaException.java ---

package javax.microedition.media;

public class MediaException extends java.lang.Exception {

    private java.lang.String reason;

    public MediaException() {
	this.reason = null;
    }
    public MediaException(java.lang.String reason) {
	this.reason = reason;
    }

}

--- NEW FILE: Player.java ---

package javax.microedition.media;

import javax.microedition.media.MediaException;
import javax.microedition.media.TimeBase;

//////////////////////////////////////////////
public interface Player extends javax.microedition.media.Controllable {

    // UNREALIZED:   The state of the Player indicating that it has not acquired the required information and resources to function. 
    // REALIZED: The state of the Player indicating that it has acquired the required information but not the resources to function. 
    // PREFETCHED: The state of the Player indicating that it has acquired all the resources to begin playing. 
    // STARTED: The state of the Player indicating that the Player has already started. 
    // CLOSED: The state of the Player indicating that the Player is closed. 
    // TIME_UNKNOWN: The returned value indicating that the requested time is unknown. 
    public static final int UNREALIZED	= 100;
    public static final int REALIZED	= 200;
    public static final int PREFETCHED	= 300;
    public static final int STARTED	= 400;
    public static final int CLOSED	= 0;
    public static final long TIME_UNKNOWN = -1;

    public void realize() throws MediaException;
    public void prefetch() throws MediaException;
    public void start() throws MediaException;
    public void stop() throws MediaException;
    public void deallocate();
    public void close();

    public void setTimeBase(TimeBase master) throws MediaException;
    public TimeBase getTimeBase();
    public long setMediaTime(long now) throws MediaException;
    public long getMediaTime();
    public int getState();
    public long getDuration();
    public java.lang.String getContentType();
    public void setLoopCount(int count);

    public void addPlayerListener(PlayerListener playerListener);
    public void removePlayerListener(PlayerListener playerListener);

}

--- NEW FILE: PlayerListener.java ---

package javax.microedition.media;

/*
PlayerListener is the interface for receiving asynchronous events generated by Players. Applications may implement this interface and register their implementations with the addPlayerListener method in Player. 

A number of standard Player events are defined here in this interface. Event types are defined as strings to support extensibility as different implementations may introduce proprietary events by adding new event types. To avoid name conflicts, proprietary events should be named with the "reverse-domainname" convention. For example, a company named "mycompany" should name its proprietary event names with strings like "com.mycompany.myEvent" etc. 

Applications that rely on proprietary events may not function properly across different implementations. In order to make the applications that use those events to behave well in environments that don't implement them, String.equals() should be used to check the event. 

Code fragment for catching standard events in playerUpdate()
if (eventType == PlayerListener.STARTED) {...} 

Code fragment for catching proprietary events in playerUpdate()
if (eventType.equals("com.company.myEvent")) {...} 
*/

public interface PlayerListener {

    // This method is called to deliver an event to a registered listener when a Player event is observed. 
    public void playerUpdate(Player player, java.lang.String event, java.lang.Object eventData);

    public static final java.lang.String BUFFERING_STARTED	= "bufferingStarted";
    public static final java.lang.String BUFFERING_STOPPED	= "bufferingStopped";
    public static final java.lang.String CLOSED			= "closed";
    public static final java.lang.String DEVICE_AVAILABLE	= "deviceAvailable";
    public static final java.lang.String DEVICE_UNAVAILABLE	= "deviceUnavailable";
    public static final java.lang.String DURATION_UPDATED	= "durationUpdated";
    public static final java.lang.String END_OF_MEDIA		= "endOfMedia";
    public static final java.lang.String ERROR			= "error";
    public static final java.lang.String RECORD_ERROR		= "recordError";
    public static final java.lang.String RECORD_STARTED		= "recordStarted";
    public static final java.lang.String RECORD_STOPPED		= "recordStopped";
    public static final java.lang.String SIZE_CHANGED		= "sizeChanged";
    public static final java.lang.String STARTED		= "started";
    public static final java.lang.String STOPPED		= "stopped";
    public static final java.lang.String STOPPED_AT_TIME	= "stoppedAtTime";
    public static final java.lang.String VOLUME_CHANGED		= "volumeChanged";
}
  
	

--- NEW FILE: EventInfo.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class EventInfo {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected EventInfo(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(EventInfo obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete_EventInfo(swigCPtr);
    }
    swigCPtr = 0;
  }

  public void setEventName(String value) {
    mmapiJNI.set_EventInfo_eventName(swigCPtr, value);
  }

  public String getEventName() {
    return mmapiJNI.get_EventInfo_eventName(swigCPtr);
  }

  public void setEventData(SWIGTYPE_p_void value) {
    mmapiJNI.set_EventInfo_eventData(swigCPtr, SWIGTYPE_p_void.getCPtr(value));
  }

  public SWIGTYPE_p_void getEventData() {
    long cPtr = mmapiJNI.get_EventInfo_eventData(swigCPtr);
    return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
  }

  public EventInfo() {
    this(mmapiJNI.new_EventInfo(), true);
  }

}

--- NEW FILE: TimeBase.java ---

package javax.microedition.media;

/*
A TimeBase is a constantly ticking source of time. It measures the progress of time and provides the basic means for synchronizing media playback for Players. 

A TimeBase measures time in microseconds in order to provide the necessary resolution for synchronization. It is acknowledged that some implementations may not be able to support time resolution in the microseconds range. For such implementations, the internal representation of time can be done within their limits. But the time reported via the API must be scaled to the microseconds range. 

Manager.getSystemTimeBase provides the default TimeBase used by the system. 

*/ 

public interface TimeBase {

	public long getTime();

}

--- NEW FILE: Controllable.java ---

package javax.microedition.media;

import javax.microedition.media.Control;
//
//////////////////////////////////////////////
public interface Controllable {
    // Obtain the object that implements the specified Control interface. 
    public Control getControl(java.lang.String controlType);

    // Obtain the collection of Controls from the object that implements this interface. 
    public Control[] getControls();
}	

--- NEW FILE: PlayerImp.java ---

package javax.microedition.media;
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import java.util.*;

class PlayerImp implements Player, PlayerEvent {

	private _Player p;
    	private Vector listeners;
	private PlayerCallback pc;
	private int MAX_CONTROLS=12;
	private Control[] cs = new Control[MAX_CONTROLS];

	public PlayerImp(_Player p) {
		this.p = p;
		listeners = null;
		pc = null;

//		cs[0] = new VolumeControlImp(p);
	}

	protected void finalize() {
		if (pc != null) {
			pc.stop();
		}
	}

	public void realize() {
		p.realize(); // BLOCKING
	}

	public void prefetch() {
		p.prefetch(); // BLOCKING
	}

	public void start() {
		p.start(); // BLOCKING
	}

	public void stop() {
		p.stop(); // BLOCKING
	}

	public void deallocate() {
		p.deallocate(); // BLOCKING
	}

	public void close() {
		p.close(); // BLOCKING
		if (pc != null) {
			pc.stop(); // stop the callback loop
		}
	}

	public long getMediaTime() {
		return p.getMediaTime(); // NON_BLOCKING
	}

	public long setMediaTime(long now) {
		return p.setMediaTime((int)now); // NON_BLOCKING
	}

	public long getDuration() {
		return p.getDuration(); // NON_BLOCKING
	}

	public int getState() {
		// state is managed on the native side
		return p.getState();
	}

	public void setLoopCount(int count) {
		p.setLoopCount(count); // non-blocking
	}

	public String getContentType() {
		return p.getContentType(); // non-blocking
	}

	// From class Controllable

    // Obtain the object that implements the specified Control interface. 
    public Control getControl(java.lang.String controlType) {

	if (controlType == null) {
		// TODO throw IllegalArgumentException
		return null;
	}

	int i;
	for (i = 0; i < cs.length && cs[i] != null; i++) {
	    if (controlType == "VolumeControl" && 
		cs[i] instanceof VolumeControl) {
		return cs[i];
	    }
	    else if (controlType == "GUIControl" && 
		cs[i] instanceof GUIControl) {
		return cs[i];
	    }
	}

	if (i == MAX_CONTROLS) {
		// bad arg
		return null;
	}

	// Control does not exist yet, create a new one
	if (controlType == "VolumeControl") {
		_VolumeControl vc = p.getVolumeControl();
		cs[i] = new VolumeControlImp(vc);
	}
	else if (controlType == "GUIControl") {
		_GUIControl gc = p.getGUIControl();
		cs[i] = new GUIControlImp(gc);
	}
	else if (controlType == "VideoControl") {
		_VideoControl gc = p.getVideoControl();
		cs[i] = new VideoControlImp(gc);
	}
	return cs[i];
    }

    // Obtain the collection of Controls from the object that implements this interface. 
    public Control[] getControls() {
	    return cs;
    }

    public TimeBase getTimeBase() {
	    return null;
    }

    public void setTimeBase(TimeBase master) throws MediaException {
    }

    public synchronized void addPlayerListener(PlayerListener playerListener) {
	if (playerListener != null) {
		if (listeners == null) {
			listeners = new Vector();
			pc = new PlayerCallback(this, p);
			pc.start();	// Start the callback polling thread
		}

		listeners.addElement(playerListener);
	}
    } 

    public synchronized void removePlayerListener(PlayerListener playerListener) {
	if (playerListener != null && listeners != null) {
		listeners.removeElement(playerListener);
	}
    }

    // Implement PlayerEvent::firePlayerEvent
    public void firePlayerEvent(String event, java.lang.Object eventData) {
	if (listeners != null) {
		// dispatch event to listeners
		for (int i = 0; i < listeners.size(); i++) {
			PlayerListener playerListener = (PlayerListener) listeners.elementAt(i);
			playerListener.playerUpdate(this, event, eventData);
		}
	}
    }
}


--- NEW FILE: Manager.java ---

package javax.microedition.media;
import javax.microedition.media.*;
import javax.microedition.media.protocol.*;
import java.lang.*;

public final class Manager extends java.lang.Object {

    private static final String helixLibName = "jsr135";

    public Manager() {
	    initCore();
    }
	
    private static boolean initialized=false;
    // * initCore()
    // - Load the native library, jsr135kit
    // - initialize the helix environment, 
    // 		load the client core lib,
    //		create an engine,
    //		start the event loop
    private static void initCore() {
        try
        {
            System.loadLibrary (helixLibName);
	    initialized = true;
            System.out.println ("********** Manager::initCore");

	    _Manager.StartEngineDriver();
        }
        catch (UnsatisfiedLinkError e)
        {
            System.out.println ("ERROR: Native library '" + helixLibName + "' not found in 'java.library.path': "
            + System.getProperty ("java.library.path"));
            
            throw e; // re-throw
        }
    }

    public static Player createPlayer(java.lang.String locator) 
	throws java.io.IOException, MediaException {
	if (!initialized) {
		initCore();
	}

	_Player p = _Manager.createPlayer(locator);

	return new PlayerImp(p);
    }

    static void playTone(int note, int duration, int volume) {
	if (!initialized) {
		initCore();
	}
	// Create player
	// call player.playTone
	// destroy player
	System.out.println("Manager::playTone("+note+", "+duration+", "+volume);
	System.out.println("    NOT IMPLEMENTED");
    }

    // Create a Player for a DataSource. 
    static Player createPlayer(DataSource source) {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::createPlayer(DataSource source)");
	System.out.println("    NOT IMPLEMENTED");
	return null;
    }

    /*
    // Create a Player to play back media from an InputStream. 
    static Player createPlayer(java.io.InputStream stream, java.lang.jstring type) {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::createPlayer(");
	System.out.println("    NOT IMPLEMENTED");
    }
    */

    /*
    // Create a Player from an input locator. 
    static Player createPlayer(String locator) {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::createPlayer(");
	System.out.println("    NOT IMPLEMENTED");
    }
    */

    // Return the list of supported content types for the given protocol. 
    static String getSupportedContentTypes(String protocol) {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::getSupportedContentTypes("+protocol+")");
	System.out.println("    NOT IMPLEMENTED");
	return "not implemented";
    }

    // Return the list of supported protocols given the content type. 
    static String getSupportedProtocols(String content_type) {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::getSupportedProtocols("+content_type+")");
	System.out.println("    NOT IMPLEMENTED");
	return "not implemented";
    }

    /*
    // Get the time-base object for the system. 
    static TimeBase getSystemTimeBase() {
	if (!initialized) {
		initCore();
	}
	System.out.println("Manager::getSystemTimeBase()");
	System.out.println("    NOT IMPLEMENTED");
	return new TimeBase();
    }
    */
}


--- NEW FILE: PlayerEvent.java ---

package javax.microedition.media;

interface PlayerEvent {
    public void firePlayerEvent(java.lang.String event, java.lang.Object eventData);
}

--- NEW FILE: PlayerCallback.java ---

package javax.microedition.media;
import javax.microedition.media.*;
import java.util.*;
import java.lang.*;
import java.lang.Object.*;

public class PlayerCallback implements Runnable {

  private native void pollPlayerCallback(long p);

  private Thread t;
  private boolean done=false;
  private PlayerEvent pe;
  private _Player p;

  public PlayerCallback(PlayerEvent pe, _Player p) {
	  this.p = p;
	  this.pe = pe;
  }

  public void start() {
		done = false;
		t = new Thread(this);
		t.setName("PlayerCallback");
		t.start();
  }

  public void stop() {
	  done = true;
  }

  protected void finalize() {
	  done = true; // stop the thread
  }


  public void run() {
	  System.out.println("Starting to poll for Player events:"+Thread.currentThread());

	try {
	  while (!done) {
		  Thread.currentThread().sleep(20);
		  pollPlayerCallback(_Player.getCPtr(p)); // Send in _Player C++ object
	  }
	} catch (java.lang.InterruptedException ie) {
		System.out.println("Caught exception");
	}
  }

  private void firePlayerUpdate(String event, Object eventData) {
	  //System.out.println("Fired player update: "+event+ " thread: "+Thread.currentThread());
	  pe.firePlayerEvent(event, eventData); // Implemented in PlayerImp.java
  }

}


--- NEW FILE: Control.java ---

package javax.microedition.media;

//////////////////////////////////////////////
public interface Control {
	// ?
}	



From cdunn at helixcommunity.org  Thu Dec 15 18:06:15 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:33:53 2005
Subject: [Player-cvs] 
	kit/jsr135 PlayerCallback.cpp, NONE, 1.1 Umakefil, NONE,
	1.1 control.cpp, NONE, 1.1 enginedriver.cpp, NONE,
	1.1 fivemmap.cpp, NONE, 1.1 guicontrol.cpp, NONE,
	1.1 hxjadvsnk.cpp, NONE, 1.1 hxjcontext.cpp, NONE,
	1.1 hxjerror.cpp, NONE, 1.1 hxjstate.cpp, NONE,
	1.1 manager.cpp, NONE, 1.1 manager_wrap.cpp, NONE, 1.1 mmapi.i,
	NONE, 1.1 player.cpp, NONE, 1.1 videocontrol.cpp, NONE,
	1.1 volumecontrol.cpp, NONE, 1.1 win32.pcf, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135
In directory cvs:/tmp/cvs-serv31915

Added Files:
	PlayerCallback.cpp Umakefil control.cpp enginedriver.cpp 
	fivemmap.cpp guicontrol.cpp hxjadvsnk.cpp hxjcontext.cpp 
	hxjerror.cpp hxjstate.cpp manager.cpp manager_wrap.cpp mmapi.i 
	player.cpp videocontrol.cpp volumecontrol.cpp win32.pcf 
Log Message:
Version 1

--- NEW FILE: mmapi.i ---
 %module mmapi
 %{
 /* Includes the header in the wrapper code */
 #include "manager.h"
 #include "player.h"
 #include "volumecontrol.h"
 #include "videocontrol.h"
 #include "guicontrol.h"
 #include "exceptions.h"
 %}
 
 /* Parse the header file to generate wrappers */
 %include "pub/manager.h"
 %include "pub/player.h"
 %include "pub/volumecontrol.h"
 %include "pub/videocontrol.h"
 %include "pub/guicontrol.h"
 %include "pub/exceptions.h"
 
%javaexception("java.lang.Exception") getContentType {
  try {
     $action
  } catch (MediaException &me) {
    jclass clazz = jenv->FindClass("java/lang/Exception");
    jenv->ThrowNew(clazz, "Media error");
    return $null;
   }
}




--- NEW FILE: guicontrol.cpp ---

#include "guicontrol.h"
#include "player.h"
#include "hxtypes.h"

//#include "hxassert.h"
//#include "hxstring.h"
//#include "hlxclib/string.h"
//#include "hxstrutl.h"

#include "hxcom.h"
#include "hxcomm.h"
#include "hxcore.h"
#include "hxmon.h" // IHXReg
#include "hxausvc.h"

const int _GUIControl::USE_GUI_PRIMITIVE = 0;

_GUIControl::_GUIControl(_Player* pPlayer)
	: m_pPlayer(pPlayer)
{
}

_GUIControl::~_GUIControl()
{
}


void*
_GUIControl::initDisplayMode(int mode, void* arg)
{
    return NULL;
}


--- NEW FILE: fivemmap.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include 
#include "hxtypes.h"
#include "fivemmap.h"

void* FiveMinuteMap::GetFirstValue()
{
    m_nCursor = 0;

    if (m_nMapSize)
    {
       return m_pValueArray[m_nCursor];
    }
    else
    {
       return NULL;
    }
}

void* FiveMinuteMap::GetNextValue()
{
    m_nCursor++;

    if (m_nCursor < m_nMapSize)
    {
       return m_pValueArray[m_nCursor];
    }
    else
    {
       return NULL;
    }
}

HXBOOL FiveMinuteMap::Lookup(void* Key, void*& Value) const
{
    HXBOOL bFound = FALSE;
    int nIndex = 0;

    // If Key is alrady in the list, replace value
    for (; nIndex < m_nMapSize; nIndex++)
    {
	if (m_pKeyArray[nIndex] == Key)
	{
	    Value = m_pValueArray[nIndex];
	    bFound = TRUE;
	    goto exit;
	}
    }

exit:
    return bFound;    
}

void FiveMinuteMap::RemoveKey(void* Key)
{
    HXBOOL bFound = FALSE;
    int nIndex = 0;

    // If Key is alrady in the list, replace value
    for (; nIndex < m_nMapSize; nIndex++)
    {
	if (m_pKeyArray[nIndex] == Key)
	{
	    if (nIndex < (m_nMapSize-1))
	    {
		memmove(&(m_pKeyArray[nIndex]),&(m_pKeyArray[nIndex+1]),sizeof(void*)*(m_nMapSize-(nIndex+1)));
		memmove(&(m_pValueArray[nIndex]),&(m_pValueArray[nIndex+1]),sizeof(void*)*(m_nMapSize-(nIndex+1)));
	    }
	    m_nMapSize--;
	    goto exit;
	}
    }

exit:
    (NULL); // We're done!
}

void FiveMinuteMap::RemoveValue(void* Value)
{
    HXBOOL bFound = FALSE;
    int nIndex = 0;

    // If Value is alrady in the list, replace value
    for (; nIndex < m_nMapSize; nIndex++)
    {
	if (m_pValueArray[nIndex] == Value)
	{
	    if (nIndex < (m_nMapSize-1))
	    {
		memmove(&(m_pKeyArray[nIndex]),&(m_pKeyArray[nIndex+1]),sizeof(void*)*(m_nMapSize-(nIndex+1)));
		memmove(&(m_pValueArray[nIndex]),&(m_pValueArray[nIndex+1]),sizeof(void*)*(m_nMapSize-(nIndex+1)));
	    }
	    m_nMapSize--;
	    goto exit;
	}
    }

exit:
    (NULL); // We're done!
}


void FiveMinuteMap::SetAt(void* Key, void* Value)
{
    int nIndex = 0;

    // If Key is alrady in the list, replace value
    for (; nIndex < m_nMapSize; nIndex++)
    {
	if (m_pKeyArray[nIndex] == Key)
	{
	    m_pValueArray[nIndex] = Value;
	    goto exit;
	}
    }

    // If we have room, add it to the end!
    if (m_nAllocSize == m_nMapSize)
    {
	m_nAllocSize += AllocationSize;
	void** pNewKeys   = new void*[m_nAllocSize];
	void** pNewValues = new void*[m_nAllocSize];

	memcpy(pNewKeys,m_pKeyArray,sizeof(void*)*m_nMapSize); /* Flawfinder: ignore */
	memcpy(pNewValues,m_pValueArray,sizeof(void*)*m_nMapSize); /* Flawfinder: ignore */

	delete [] m_pKeyArray;
	delete [] m_pValueArray;

	m_pKeyArray = pNewKeys;
	m_pValueArray = pNewValues;
    }

    m_pKeyArray[m_nMapSize] = Key;
    m_pValueArray[m_nMapSize] = Value;
    m_nMapSize++;

exit:
    (NULL); // We're done!
}


--- NEW FILE: manager_wrap.cpp ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */


#ifdef __cplusplus
template class SwigValueWrapper {
    T *tt;
public:
    SwigValueWrapper() : tt(0) { }
    SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { }
    SwigValueWrapper(const T& t) : tt(new T(t)) { }
    ~SwigValueWrapper() { delete tt; } 
[...1207 lines suppressed...]
    }
    return jresult;
}


JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_delete_1_1IllegalStateException(JNIEnv *jenv, jclass jcls, jlong jarg1) {
    _IllegalStateException *arg1 = (_IllegalStateException *) 0 ;
    
    (void)jenv;
    (void)jcls;
    arg1 = *(_IllegalStateException **)(void *)&jarg1; 
    delete arg1;
    
}


#ifdef __cplusplus
}
#endif


--- NEW FILE: PlayerCallback.cpp ---

#include 
#include "javax_microedition_media_PlayerCallback.h"
#include "player.h"

JNIEXPORT void JNICALL Java_javax_microedition_media_PlayerCallback_pollPlayerCallback
	(JNIEnv *pEnv, jobject obj, jlong cPtr)
{
    jclass cls = pEnv->GetObjectClass(obj);
    if (cls == 0) {
	    return;
    }
    jmethodID mid = pEnv->GetMethodID(cls, "firePlayerUpdate", "(Ljava/lang/String;Ljava/lang/Object;)V");
    if (mid == 0) {
	return;
    }

    // get some events out of the queue, call the method if there are some events to report
    //
    jstring eventName;
    jobject eventData = NULL;

    _Player* pPlayer = *(_Player **)(void *)&cPtr;

    EventInfo info;

    while (pPlayer && pPlayer->getEvent(&info))
    {
	eventName = pEnv->NewStringUTF(info.eventName);
	pEnv->CallVoidMethod(obj, mid, eventName, info.eventData);
    }

}


--- NEW FILE: hxjcontext.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"

#include "hxwintyp.h"
#include "hxcom.h"
#include "hxcomm.h"
#include "hxwin.h"
#include "fivemmap.h"

#include "hxbuffer.h"
#include "hxmangle.h"

#include "hxclsnk.h"
#include "hxerror.h"
#include "hxprefs.h"
#include "hxstrutl.h"

#include "hxjadvsnk.h"
#include "hxjerror.h"
#include "hxprdnld.h"

#include "hxjcontext.h"

#include "videocontrol.h"
//#include "hxjsitsup.h"

//extern BOOL bEnableAdviseSink;


HXJClientContext::HXJClientContext(LONG32 lClientIndex)
    : m_lRefCount(0)
    , m_lClientIndex(lClientIndex)
    , m_pClientSink(NULL)
    , m_pErrorSink(NULL)
    , m_pSiteSupplier(NULL)
    , m_pDefaultPrefs(NULL)
{
	m_pQueue = new CPtrQueue(20);
}


HXJClientContext::~HXJClientContext()
{
    Close();
};

void HXJClientContext::Init(IUnknown*	 /*IN*/ pUnknown,
				IHXPreferences* /*IN*/ pPreferences,
				char*		 /*IN*/ pszGUID)
{
    char* pszCipher = NULL;

	
    m_pClientSink	= new HXJClientAdviseSink(pUnknown, m_lClientIndex, this);
    m_pErrorSink	= new HXJErrorSink(pUnknown);
#if defined(HELIX_FEATURE_VIDEO)
    m_pSiteSupplier	= new _VideoControl(pUnknown);
#endif 

    if (m_pClientSink)
    {
	m_pClientSink->AddRef();
    }
    
    if (m_pErrorSink)
    {
	m_pErrorSink->AddRef();
    }

    if(m_pSiteSupplier)
    {
	m_pSiteSupplier->AddRef();
    }

    if (pPreferences)
    {
	m_pDefaultPrefs = pPreferences;
	m_pDefaultPrefs->AddRef();
    }

    if (pszGUID && *pszGUID)
    {
	// Encode GUID
	pszCipher = Cipher(pszGUID);
	SafeStrCpy(m_pszGUID,  pszCipher, 256);
    }
    else
    {
	m_pszGUID[0] = '\0';
    }
}

void HXJClientContext::Close()
{
    HX_RELEASE(m_pClientSink);
    HX_RELEASE(m_pErrorSink);
    HX_RELEASE(m_pSiteSupplier);
    HX_RELEASE(m_pDefaultPrefs);
}



// *** IUnknown methods ***

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::QueryInterface
//  Purpose:
//	Implement this to export the interfaces supported by your 
//	object.
//
STDMETHODIMP HXJClientContext::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = this;
	return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXPreferences))
    {
	AddRef();
	*ppvObj = (IHXPreferences*)this;
	return HXR_OK;
    }
    else if (m_pClientSink && 
	     m_pClientSink->QueryInterface(riid, ppvObj) == HXR_OK)
    {
	return HXR_OK;
    }
    else if (m_pErrorSink && 
	     m_pErrorSink->QueryInterface(riid, ppvObj) == HXR_OK)
    {
	return HXR_OK;
    }
    else if(m_pSiteSupplier &&
	    m_pSiteSupplier->QueryInterface(riid, ppvObj) == HXR_OK)
    {
	return HXR_OK;
    }
    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::AddRef
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32) HXJClientContext::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::Release
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32) HXJClientContext::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}


// *** IUnknown methods ***

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IHXPreferences::ReadPref
//  Purpose:
//	Read a Preference from the registry.
//
STDMETHODIMP
HXJClientContext::ReadPref(const char* pref_key, IHXBuffer*& buffer)
{
    HX_RESULT hResult	= HXR_OK;
    char*     pszCipher = NULL;
    
    if ((stricmp(pref_key, CLIENT_GUID_REGNAME) == 0) &&
	(*m_pszGUID))
    {
	// Create a Buffer 
	buffer = new CHXBuffer();
	buffer->AddRef();

	// Copy the encoded GUID into the buffer
	buffer->Set((UCHAR*)m_pszGUID, strlen(m_pszGUID) + 1);
    }
    else if (m_pDefaultPrefs)
    {
	hResult = m_pDefaultPrefs->ReadPref(pref_key, buffer);
    }
    else
    {
	hResult = HXR_NOTIMPL;
    }

    return hResult;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IHXPreferences::WritePref
//  Purpose:
//	Write a Preference to the registry.
//
STDMETHODIMP
HXJClientContext::WritePref(const char* pref_key, IHXBuffer* buffer)
{
    if (m_pDefaultPrefs)
    {
	return m_pDefaultPrefs->WritePref(pref_key, buffer);
    }
    else	
    {
	return HXR_OK;
    }
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	GetPreferenceEnumerator
//  Purpose:
//	Get the enumerator for all prefs
//
HX_RESULT
HXJClientContext::GetPreferenceEnumerator(IHXPreferenceEnumerator*& pPrefEnum)
{
    HX_RESULT hResult	= HXR_NOTIMPL;

    if (m_pDefaultPrefs)
    {
	IHXPreferences2* pPref2;

	if (HXR_OK == m_pDefaultPrefs->QueryInterface(IID_IHXPreferences2, (void**) &pPref2))
	{
		hResult = pPref2->GetPreferenceEnumerator(pPrefEnum);
		pPref2->Release();
	}
    }

    return hResult;
}


void
HXJClientContext::queueCallback(const char* event, void* eventData)
{
	//TODO Create struct, to queue
	EnQueuePtr((void*)event);
}



--- NEW FILE: volumecontrol.cpp ---

#include "volumecontrol.h"
#include "hxtypes.h"
#include "hxausvc.h"

_VolumeControl::_VolumeControl(IHXVolume* pVolume) :
	m_pVolume(pVolume)
{
	m_pVolume->AddRef();
}

_VolumeControl::~_VolumeControl()
{
	HX_RELEASE(m_pVolume);
}


// Mute or unmute the Player associated with this VolumeControl. 
void
_VolumeControl::setMute(bool mute)
{
    m_pVolume->SetMute(mute);
}

// Get the mute state of the signal associated with this VolumeControl.
bool
_VolumeControl::isMuted()
{
    return m_pVolume->GetMute();
}

// Set the volume using a linear point scale with values between 0 and 100. 
int
_VolumeControl::setLevel(int level)
{
    return m_pVolume->SetVolume(level);
}

// Get the current volume level set. 
int
_VolumeControl::getLevel()
{
    return m_pVolume->GetVolume();
}

--- NEW FILE: enginedriver.cpp ---

#include "hxtypes.h"
#include "hxthread.h"
#include "hxmsgs.h"  
#include "millslp.h"
#include "enginedriver.h"
#include "manager.h" // for _Manager::Init()

void DoEvent();
void* EngineDriverThreadProc(void* pData);

///////////////////////////////////
void
HXEngineDriver::Start()
{
    // Create the TLC thread
    HXThread::MakeThread(m_pThread);
    HXEvent::MakeEvent(m_pEvent, NULL, FALSE);

    m_pThread->CreateThread(EngineDriverThreadProc, (void*)this);
    m_pEvent->Wait(); // Block until _Manager::HXInit is finished, engine created, etc.
} 

void* EngineDriverThreadProc(void* pData)
{
    HXEngineDriver* e = (HXEngineDriver*)pData;
    HXThread* pThread = e->m_pThread;
    HXThreadMessage msg;
    
    fprintf(stderr, "EngineDriverThreadProc: Entering message loop...\n");

    // Init the dll paths, create an engine
    _Manager::HXInit();
    e->m_pEvent->SignalEvent();

    while (pThread->GetMessage(&msg) == HXR_OK)
    {
	if (msg.m_ulMessage == HXMSG_QUIT)
	{
	    fprintf(stderr, "Engine driver thread got quit message.\n" ); 
	    break;
	}
        else
        {
#if defined(_WINDOWS)
            pThread->DispatchMessage(&msg);
#else
	    if (msg.m_ulMessage == HXMSG_ASYNC_TIMER)
	    {
		    DoEvent();
	    }
#endif
	}  
    }

    return (void*)0;
}


//
// Handle one event
//
void DoEvent()
{
#if defined (_UNIX) && !defined(_MAC_UNIX)

    struct _HXxEvent* pNothing = 0;

    _Manager::EventOccurred(pNothing);

    millis_sleep(SLEEP_TIME);

#elif defined (_MACINTOSH) || defined(_MAC_UNIX)

    EventRecord event;

    WaitNextEvent(everyEvent, &event, 1, nil);
    HXxEvent pHXxEvent;
    pHXxEvent.event  = ((EventRecord*)&event)->what;
    pHXxEvent.param1 = &event;
    pHXxEvent.param2 = NULL; // IMPORTANT! Must be NULL or a RgnHandle!
    _Manager::EventOccurred(&pHXxEvent);
#endif
}


--- NEW FILE: win32.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

project.AddSystemLibraries(
    'kernel32.lib',
    'user32.lib',
    'advapi32.lib',
    'ole32.lib',
    'uuid.lib'
)


--- NEW FILE: hxjadvsnk.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
[...1127 lines suppressed...]
	    SetClipInfo(m_pPlayer);

    return HXR_OK;
}

void PrintBuffer(const char* pszName,const unsigned char* pbBuf, unsigned int dwBytes)
{
	if(pszName == NULL || pbBuf == NULL)
		return;

	STDOUT("    ");
	for(unsigned int i= 0; i
#endif
*/

#include "hxcom.h"
#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxslist.h"
#include "hxwin.h"
#include "hxengin.h"
#include "hxsite2.h"


#include "hxcom.h"

#include "hxtypes.h"
#include "hxwintyp.h"
#include "hxwin.h"
#include "hxsite2.h"
#include "ihxpckts.h"
#include "hxcomm.h"
#include "fivemmap.h"

#include "videocontrol.h"
#include "exceptions.h"
#include "player.h"
#include "hxccf.h"
#include "hxcomm.h"
//#include "hxiids.h"


const int _VideoControl::USE_DIRECT_VIDEO = 1;

_VideoControl::_VideoControl(IUnknown* pUnkPlayer)
    : m_lRefCount(0)
    , m_pUnkPlayer(pUnkPlayer)
    , m_bInitialized(FALSE)
    , m_pCCF(NULL)
    , m_pSite(NULL)
    , m_pSite2(NULL)
    , m_pSiteFullScreen(NULL)
    , m_pSiteManager(NULL)
    , m_uRequestID(0)
    , m_pProps(NULL)
{
    if (m_pUnkPlayer)
    {
	m_pUnkPlayer->QueryInterface(IID_IHXSiteManager,
			(void**)&m_pSiteManager);

	m_pUnkPlayer->QueryInterface(IID_IHXCommonClassFactory,
			(void**)&m_pCCF);

	m_pUnkPlayer->AddRef();
    }
}

_VideoControl::~_VideoControl()
{
    HX_RELEASE(m_pSiteManager);
    HX_RELEASE(m_pSite);
    HX_RELEASE(m_pSite2);
    HX_RELEASE(m_pSiteFullScreen);
    HX_RELEASE(m_pCCF);
    HX_RELEASE(m_pUnkPlayer);
    HX_RELEASE(m_pProps);
}

/*
Initialize the mode on how the video is displayed. This method must be called before video can be displayed.

Two modes are defined:

    * USE_GUI_PRIMITIVE (inherited from GUIControl)
    * USE_DIRECT_VIDEO 
    * */
void*
_VideoControl::initDisplayMode(int mode, void* arg)
{
    if (m_bInitialized)
    {
	    throw _IllegalStateException();
	    return NULL;
    }
    /*
     * If there are no properties, then we can't really create a
     * site, because we have no idea what type of site is desired!
     */
    if (!m_pProps)
    {
	return NULL; //HXR_INVALID_PARAMETER;
    }

    HRESULT		hres		= HXR_OK;
    IHXValues*		pSiteProps	= NULL;
    IHXSiteWindowed*	pSiteWindowed	= NULL;
    IHXBuffer*		pValue		= NULL;

    // Just let the RMA client core create a windowed site for us.
    hres = m_pCCF->CreateInstance(CLSID_IHXSiteWindowed,(void**)&pSiteWindowed);
    if (HXR_OK != hres)
    {
	goto exit;
    }

    hres = pSiteWindowed->QueryInterface(IID_IHXSite,(void**)&m_pSite);
    if (HXR_OK != hres)
    {
	goto exit;
    }

    hres = m_pSite->QueryInterface(IID_IHXSite2, (void**) &m_pSite2);
    if (HXR_OK != hres)
    {
	goto exit;
    }
    // Set the site to not visible
    m_pSite2->ShowSite(false);
    //    pSite2->GetVideoSurface(pVideoSurface);

    hres = m_pSite->QueryInterface(IID_IHXSiteFullScreen, (void**) &m_pSiteFullScreen);
    if (HXR_OK != hres)
    {
	goto exit;
    }

    hres = pSiteWindowed->QueryInterface(IID_IHXValues,(void**)&pSiteProps);
    if (HXR_OK != hres)
    {
	goto exit;
    }

    /*
     * We need to figure out what type of site we are supposed to
     * to create. We need to "switch" between site user and site
     * properties. So look for the well known site user properties
     * that are mapped onto sites...
     */
    hres = m_pProps->GetPropertyCString("playto",pValue);
    if (HXR_OK == hres)
    {
	pSiteProps->SetPropertyCString("channel",pValue);
	HX_RELEASE(pValue);
    }
    else
    {
	hres = m_pProps->GetPropertyCString("name",pValue);
	if (HXR_OK == hres)
	{
	    pSiteProps->SetPropertyCString("LayoutGroup",pValue);
    	    HX_RELEASE(pValue);
	}
    }

    HX_RELEASE(pSiteProps);
  
    UINT32		style		= 0;
#ifdef _WINDOWS
    style = WS_OVERLAPPED | WS_VISIBLE | WS_CLIPCHILDREN;
#endif
    hres = pSiteWindowed->Create(NULL, style);

#ifdef _WINDOWS
    {
       HXxWindow* pWindow = pSiteWindowed->GetWindow();
       if (pWindow && pWindow->window)
       {
	       ::SetForegroundWindow( (HWND)(pWindow->window) );
       }
    }
#endif

    /*
     * We need to wait until we have set all the properties before
     * we add the site.
     */
    hres = m_pSiteManager->AddSite(m_pSite);
    if (HXR_OK != hres)
    {
	goto exit;
    }

    m_CreatedSites.SetAt((void*)m_uRequestID,m_pSite);
    m_pSite->AddRef();

    m_bInitialized = TRUE;

exit:

    return NULL;
}

void
_VideoControl::setDisplayLocation(int x, int y)
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return;
    }

    if (m_pSite)
    {
	HXxPoint point;
	point.x = x;
	point.y = y;
	m_pSite->SetPosition(point);
    }
}

int
_VideoControl::getDisplayX()
{
    if (!m_bInitialized)
    {
	return 0;
    }
    if (m_pSite)
    {
        HXxPoint point;
    	m_pSite->GetPosition(point);
	return point.x;
    }
    return 0;
}

int
_VideoControl::getDisplayY()
{
    if (!m_bInitialized)
    {
	return 0;
    }
    if (m_pSite)
    {
        HXxPoint point;
    	m_pSite->GetPosition(point);
	return point.y;
    }
    return 0;
}

void
_VideoControl::setVisible(bool visible)
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return;
    }
    if (m_pSite2)
    {
	m_pSite2->ShowSite(visible);
    }
}

void
_VideoControl::setDisplaySize(int width, int height)
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return;
    }

    if (width < 0 || height < 0)
    {
	//throw _IllegalArgumentException();
	return;
    }

    // if (!resizable)
	//throw _MediaException();

    if (m_pSite)
    {
	HXxSize size;
	size.cx = width;
	size.cy = height;
	m_pSite->SetSize(size);
    }
}

void
_VideoControl::setDisplayFullScreen(bool fullScreenMode)
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return;
    }

    // if (!fullScreenSupported)
	//throw _MediaException();

    if (m_pSiteFullScreen)
    {
	if (fullScreenMode)
	{
	    m_pSiteFullScreen->EnterFullScreen();
	}
	else
	{
	    m_pSiteFullScreen->ExitFullScreen();
	}
    }
}

int
_VideoControl::getSourceProperty(char* propName)
{
    if (!m_bInitialized)
    {
	return 0;
    }

    IUnknown*        pUnknown      = NULL;
    IHXStreamSource* pStreamSource = NULL;
    IHXStream*       pStream       = NULL;
    ULONG32	     ulProp	   = 0;
    IHXPlayer*	     pPlayer	   = (IHXPlayer*)m_pUnkPlayer;
    
    UINT16 uNumSources = pPlayer->GetSourceCount();

    for (UINT16 i=0; i < uNumSources; i++)
    {
        pPlayer->GetSource(i, pUnknown);
        pUnknown->QueryInterface(IID_IHXStreamSource,
                                 (void**) &pStreamSource);
        HX_RELEASE(pUnknown);
        HX_ASSERT(pStreamSource);

        UINT16 uNumStreams = pStreamSource->GetStreamCount();
        for (UINT16 j=0; j < uNumStreams; j++)
        {
            pStreamSource->GetStream(j, pUnknown);
            pUnknown->QueryInterface(IID_IHXStream,
                                     (void**) &pStream);
            HX_RELEASE(pUnknown);
            HX_ASSERT(pStream);

            IHXValues* pHeader = pStream->GetHeader();
            if (pHeader)
            {
		ULONG32 ulTmp=0;
		pHeader->GetPropertyULONG32(propName, ulTmp); 
		ulProp = MAX(ulProp, ulTmp);
                pHeader->Release();
            }
            pStream->Release();
        }

        HX_RELEASE(pStreamSource);
    }
    
    return ulProp;
}

int
_VideoControl::getSourceWidth()
{
    return getSourceProperty("FrameWidth");
}

int
_VideoControl::getSourceHeight()
{
    return getSourceProperty("FrameHeight");
}

int
_VideoControl::getDisplayWidth()
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return 0;
    }
    if (m_pSite)
    {
	HXxSize size;
	m_pSite->GetSize(size);
	return size.cx;
    }
    return 0;
}

int
_VideoControl::getDisplayHeight()
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return 0;
    }
    if (m_pSite)
    {
	HXxSize size;
	m_pSite->GetSize(size);
	return size.cy;
    }
    return 0;
}

unsigned char*
_VideoControl::getSnapshot(char* imageType)
{
    if (!m_bInitialized)
    {
	// throw _IllegalStateException();
	return NULL;
    }

    //XXXctd TODO implement
    /*
  IHXSiteCapture
	CanCapture
	GetOutputFormats
	SetOutputFormat
	SetCaptureSize
	GetNeededBufferSize
	Capture(UINT8* pDataBuffer)
*/
    //

    printf("_VideoControl::getSnapshot: not implemented\n");

    //if (NotSupported(imageType))
    // throw _MediaException();
    //if (!Permissions(imageType))
    // throw _SecurityException();
    return NULL;
}



/************************************************************************
 *  Method:
 *    IUnknown::QueryInterface
 */
STDMETHODIMP 
_VideoControl::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = (IUnknown*)(IHXSiteSupplier*)this;
	return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXSiteSupplier))
    {
	AddRef();
	*ppvObj = (IHXSiteSupplier*)this;
	return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/************************************************************************
 *  Method:
 *    IUnknown::AddRef
 */
STDMETHODIMP_(ULONG32) 
_VideoControl::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/************************************************************************
 *  Method:
 *    IUnknown::Release
 */
STDMETHODIMP_(ULONG32) 
_VideoControl::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

/************************************************************************
 *  Method:
 *    IHXSiteSupplier::SitesNeeded
 *  Purpose:
 *    Called to inform the site supplier that a site with a particular
 *    set of characteristics is needed. If the site supplier can 
 *    fulfill the request it should call the site manager and add one
 *    or more new sites.
 *    Note that the request for sites is associated with a Request ID
 *    the client core will inform the site supplier when this requested
 *    site is no longer needed.
 */
STDMETHODIMP 
_VideoControl::SitesNeeded
(
    UINT32	uRequestID,
    IHXValues*	pProps
)
{
    m_uRequestID = uRequestID;
   
    m_pProps = pProps;
    if (m_pProps)
    {
	m_pProps->AddRef();
    }
    return HXR_OK;
}

/************************************************************************
 *  Method:
 *    IHXSiteSupplier::SitesNotNeeded
 *  Purpose:
 *    Called to inform the site supplier that all sites from a previos
 *    site request are no longer needed. If the site supplier had 
 *    previously created non-persistant sites (like popup windows)
 *    to fulfill a request for sites it should call the site manager 
 *    and remove those sites.
 */
STDMETHODIMP 
_VideoControl::SitesNotNeeded(UINT32 uRequestID)
{
    IHXSite*		pSite = NULL;
    IHXSiteWindowed*	pSiteWindowed = NULL;
    void*		pVoid = NULL;

    if (!m_CreatedSites.Lookup((void*)uRequestID,pVoid))
    {
	return HXR_INVALID_PARAMETER;
    }
    pSite = (IHXSite*)pVoid;

    m_pSiteManager->RemoveSite(pSite);

    // Need to actually do the work on destroying the window
    // and all that jazz.
    pSite->QueryInterface(IID_IHXSiteWindowed,(void**)&pSiteWindowed);

    pSiteWindowed->Destroy();

    // ref count = 2
    pSiteWindowed->Release();

    // ref count = 1; deleted from this object's view!
    pSite->Release();

    m_CreatedSites.RemoveKey((void*)uRequestID);

    return HXR_OK;
}

/************************************************************************
 *  Method:
 *    IHXSiteSupplier::BeginChangeLayout
 *  Purpose:
 *    Called to inform the site supplier a layout change has beginning
 *    it can expect to recieve SitesNeeded() and SitesNotNeeded() calls
 *    while a layout change is in progress,
 */
STDMETHODIMP 
_VideoControl::BeginChangeLayout()
{
    return HXR_OK;
}

/************************************************************************
 *  Method:
 *    IHXSiteSupplier::DoneChangeLayout
 *  Purpose:
 *    Called to inform the site supplier the layout change has been
 *    completed.
 */
STDMETHODIMP 
_VideoControl::DoneChangeLayout()
{
    return HXR_OK;
}

--- NEW FILE: manager.cpp ---

#include "manager.h"
#include 

#define INITGUID 1

#include "hxassert.h"
#include "hxstring.h"
#include "hlxclib/string.h"
#include "hxstrutl.h"

#include "hxcom.h"
#include "hxcomm.h"
#include "hxcore.h"
#include "hxtick.h"
#include "hxtypes.h"
#include "enginedriver.h"


#if defined (_UNIX) && defined (USE_XWINDOWS)
#include 
#endif

#include "dllpath.h"
#ifndef MAX_PATH
#define MAX_PATH 1024
#endif

ENABLE_DLLACCESS_PATHS(g_HXJEngine);


// _Manager static variables
DLLAccess	_Manager::m_dllHXCore;
CHXString	_Manager::m_pHelixLibsPath;
CHXString	_Manager::m_pHelixPluginsPath;
CHXString	_Manager::m_pHelixCodecsPath;
CHXString	_Manager::m_pHelixEngineName;

HXBOOL		_Manager::m_bInitialized = false;
IHXClientEngine* _Manager::m_pClientEngine = NULL;
HXEngineDriver*	_Manager::m_pEngineDriver = NULL;


_Manager::_Manager()
{
	printf("_Manager::_Manager in constructor\n");
	StartEngineDriver();
}

_Manager::~_Manager()
{
	printf("_Manager::~_Manager in destructor\n");

	HX_DELETE(m_pEngineDriver);
	CloseEngine();
}

/////////////////////////////////////////////////////////////////////////
void
_Manager::StartEngineDriver() 
{
    if (m_pEngineDriver == NULL)
    {
	// Create player thread, call _Manager::HXInit, start the event loop
	// Blocks until the engine has been created
	m_pEngineDriver = new HXEngineDriver();
	m_pEngineDriver->Start();
    }
}
/////////////////////////////////////////////////////////////////////////

HX_RESULT
_Manager::HXInit()
{
    printf("_Manager::HXInit\n");
    HX_RESULT hr=HXR_OK;
    if (!m_bInitialized)
    {
	InitDLLAccessPaths();
	hr = CreateEngine();
    }
    return hr;
}



void
_Manager::playTone(int note, int duration, int volume)
{
	printf("in playTone\n");
	printf("values: %d %d %d\n", note, duration, volume);
}

// Create a Player from an input locator. 
_Player*
_Manager::createPlayer(char* locator)
{
    printf("_Manager::createPlayer(locator)\n");
    if (!m_bInitialized)
    {
	    StartEngineDriver();
    }
    return new _Player(m_pClientEngine, locator);
}

/*
char*
_Manager::getSupportedContentTypes(char* protocol)
{
    printf("in getSupportedContentTypes\n");
    return NULL;
}


// Return the list of supported protocols given the content type. 
char*
_Manager::getSupportedProtocols(char* content_type)
{
    printf("in getSupportedProtocols\n");
    return NULL;
}
*/

/*
 * Method: InitDLLAccessPaths()
 * Description: Initialize the client core dll
 */
HX_RESULT 
_Manager::InitDLLAccessPaths()
{
    HX_RESULT hr=HXR_OK;

    if (m_bInitialized)
	    return hr;

    m_bInitialized = true;
    printf("_Manager::InitDLLAccessPaths\n");

#ifdef _MACINTOSH
    char                    dllhome[MAX_PATH]       = {'\0'}; 
#elif defined(_SYMBIAN)
    char                    dllhome[MAX_PATH]       = "c:"; 
#else
    char                    dllhome[MAX_PATH]       = {'.','\0'};
#endif
    DLLAccess*              pDLLAccess              = NULL;
    char                    libPath[MAX_PATH] = {0}; 
#ifdef _WINDOWS
    HINSTANCE               hDll                    = NULL;
#endif


    //See if the user has set their HELIX_LIBS env var. 
    const char* pszHelixLibs = getenv("HELIX_LIBS");
    const char* pszHelixPlugins = getenv("HELIX_PLUGINS");
    const char* pszHelixCodecs = getenv("HELIX_CODECS"); 
    const char* pszHelixCore = getenv("HELIX_ENGINE"); 

    if (!m_pHelixEngineName.IsEmpty())
    {
	pszHelixCore = m_pHelixEngineName;
    }
    else if (pszHelixCore == NULL)
    {
	pszHelixCore = "clntcore";
    }

    if (!m_pHelixLibsPath.IsEmpty())
    {
        SafeStrCpy( dllhome,  m_pHelixLibsPath, MAX_PATH);
    }
    else if( pszHelixLibs )
    {
        SafeStrCpy( dllhome,  pszHelixLibs, MAX_PATH);
    }

    const char* pluginsPath;
    if (!m_pHelixPluginsPath.IsEmpty())
        pluginsPath = m_pHelixPluginsPath;
    else if (pszHelixPlugins)
	pluginsPath = pszHelixPlugins;
    else
	pluginsPath = dllhome;

    const char* codecsPath;
    if (!m_pHelixCodecsPath.IsEmpty())
        codecsPath = m_pHelixCodecsPath;
    else if (pszHelixCodecs)
	codecsPath = pszHelixCodecs;
    else
	codecsPath = dllhome;

    GetDLLAccessPath()->SetPath(DLLTYPE_PLUGIN, pluginsPath);
    GetDLLAccessPath()->SetPath(DLLTYPE_CODEC, codecsPath);

    printf("Looking for plugins at: %s\n", pluginsPath);
    printf("Looking for codecs at : %s\n", codecsPath);

#  if defined(_MAC_UNIX)
    SafeSprintf(libPath, MAX_PATH, "%s/%s.bundle", dllhome, pszHelixCore);
#  elif defined(_UNIX)
    SafeSprintf(libPath, MAX_PATH, "%s/%s.so", dllhome, pszHelixCore);
#  elif defined(_WINDOWS) || defined(_SYMBIAN)
    SafeSprintf(libPath, MAX_PATH, "%s\\%s.dll", dllhome, pszHelixCore);
#  elif defined(_MACINTOSH)
#ifdef _MAC_MACHO
    SafeSprintf(libPath, MAX_PATH, "%s.bundle", pszHelixCore);
#else
    if (strlen(dllhome) > 0 )
    {
        SafeSprintf(libPath, MAX_PATH, "%s:%s.shlib", dllhome, pszHelixCore);
    }
    else
    {
        SafeSprintf(libPath, MAX_PATH, "%s.shlib", pszHelixCore);
    }
#endif
#  endif
    
    printf("Looking for the client core at %s\n", libPath );

    if (DLLAccess::DLL_OK != m_dllHXCore.open(libPath))
    {
        const char* pErrorString = NULL;
        pErrorString = m_dllHXCore.getErrorString();
        printf("eng: %s\n\n", pErrorString);
	hr = HXR_COULDNOTINITCORE;
    }

    printf ("Status: %x.\n", hr);

    return hr;
	
}

//------------------------------------------------------------------------------
// Method      : _Manager::CreateEngine
// Description : Create a client engine, initialize the client core library
// 	Create the client environment object, which stores the players
// Returns     : HX_RESULT & nEngineID
//------------------------------------------------------------------------------
HX_RESULT 
_Manager::CreateEngine()
{
	if (m_pClientEngine != NULL)
		return HXR_OK;

	printf("_Manager::CreateEngine()\n");
    	HX_RESULT hr = HXR_OK;

	if (!m_bInitialized) // || !m_dllHXCore.IsOpen()
	{
		hr = InitDLLAccessPaths();
		if (!SUCCEEDED(hr))
			return hr;
	}

	FPRMCREATEENGINE pCreateEngine = (FPRMCREATEENGINE)m_dllHXCore.getSymbol("CreateEngine");
	if (pCreateEngine)
	{
		IHXClientEngine* pClientEngine;
		hr = pCreateEngine(&pClientEngine);
		// If engine was not created, we should receive a reason.
		HX_ASSERT((NULL != pClientEngine) || (FAILED(hr)));

		if (SUCCEEDED(hr) && pClientEngine)
		{
		    printf("Created engine.\n");
		    m_pClientEngine = pClientEngine;
		    IHXClientEngineSetup* pSetup;
		    m_pClientEngine->QueryInterface(IID_IHXClientEngineSetup, (void**)&pSetup);
		    if (pSetup)
		    {
		        // Start the scheduler 
		    	pSetup->Setup(NULL);
			HX_RELEASE(pSetup);
		    }
		}
	}
	else
	{
		hr = HXR_COULDNOTINITCORE;
	}

	return hr;
}

//------------------------------------------------------------------------------
// Method    : _Manager::CloseEngine
// Description : Close the engine and all of its players
// Returns     : HX_RESULT
//------------------------------------------------------------------------------
HX_RESULT
_Manager::CloseEngine()
{
	printf("_Manager::CloseEngine()\n");
	HX_RESULT hr = HXR_OK;
	FPRMCLOSEENGINE pCloseEngine = (FPRMCLOSEENGINE)m_dllHXCore.getSymbol("CloseEngine");
	if (m_pClientEngine)
	{
		//pEngineEnv->ClosePlayers();
		pCloseEngine(m_pClientEngine);
		m_pClientEngine = NULL;
	}
	
	return hr;
}

void
_Manager::EventOccurred(HXxEvent* pEvent)
{
	if (m_pClientEngine)
	{
		m_pClientEngine->EventOccurred(pEvent);
	}
}



--- NEW FILE: Umakefil ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
#      
# The contents of this file, and the files included with this file, are 
# subject to the current version of the RealNetworks Public Source License 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
# in which case the RCSL will apply. You may also obtain the license terms 
# directly from RealNetworks.  You may not use this file except in 
# compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
# applicable to this file, the RCSL.  Please see the applicable RPSL or 
# RCSL for the rights, obligations and limitations governing use of the 
# contents of the file.  
#  
# This file is part of the Helix DNA Technology. RealNetworks is the 
# developer of the Original Code and owns the copyrights in the portions 
# it created. 
#  
# This file, and the files included with this file, is distributed and made 
# available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
# EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
# FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
# 
# Technology Compatibility Kit Test Suite(s) Location: 
#    http://www.helixcommunity.org/content/tck 
# 
# Contributor(s): 
#  
# ***** END LICENSE BLOCK ***** 
# 

UmakefileVersion(2,2)

project.AddModuleIncludes('common/include', 
			  'common/container/pub',
			  'common/dbgtool/pub',
                          'common/runtime/pub',
                          'common/system/pub',
                          'common/util/pub',
                          'client/include')

project.AddIncludes('pub')

project.AddSources(
		'manager.cpp',
		'player.cpp',
		'volumecontrol.cpp',
		'guicontrol.cpp',
		'videocontrol.cpp',
		'manager_wrap.cpp',
		'hxjadvsnk.cpp',
		'hxjcontext.cpp',
		'hxjerror.cpp',
		'fivemmap.cpp',
		'enginedriver.cpp',
		'PlayerCallback.cpp',
)

project.AddModuleLibraries("common/dbgtool[debuglib]",
                           "common/util[utillib]",
                           "common/container[contlib]",
                           "common/system[syslib]",
                           "common/runtime[runtlib]",
                           "common/fileio[fileiolib]",
                           "common/log/logutil[logutillib]",
                           "client/common/system[sysclntlib]",
                           "client/common/container[contclntlib]",
                           "client/common/util[utlclntlib]",
                           "client/core[clntcorelib]",
)

DLLTarget("jsr135")

DependTarget()

# Generate wrapper source
project.writeln("MKDIR = mkdir")
project.writeln("SWIG=swig")
project.writeln('PACKAGEDIR="javax/microedition/media"')
project.writeln("PACKAGENAME=javax.microedition.media")
project.writeln("SWIGFLAGS=-java -c++")
project.writeln("mmapi.i: pub/manager.h pub/player.h")
project.writeln("manager_wrap.cpp: mmapi.i $(PACKAGEDIR)")
project.writeln("	$(SWIG) $(SWIGFLAGS) -outdir $(PACKAGEDIR) -package $(PACKAGENAME) -o manager_wrap.cpp mmapi.i")
project.writeln("$(PACKAGEDIR):")
project.writeln("	-@if NOT exist javax $(MKDIR) javax")
project.writeln('	-@if NOT exist "javax/microedition" $(MKDIR) "javax/microedition"')
project.writeln('	-@if NOT exist $(PACKAGEDIR) $(MKDIR) $(PACKAGEDIR)')
project.writeln('	-@if NOT exist $(PACKAGEDIR)/control $(MKDIR) $(PACKAGEDIR)/control')

project.writeln("javatest: myplay.java ")
project.writeln("	rm -f javax/microedition/media/*.class")
project.writeln("	rm -f javax/microedition/media/control/*.class")
project.writeln("	javac myplay.java")


--- NEW FILE: hxjstate.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 
#include "hlxclib/stdio.h"
#include "hxtypes.h"
#include "hxcom.h"
#include "hxcomm.h"
#include "hxmon.h"
#include "hxcore.h"
#include "hxengin.h"
//#include "hxclstate.h"

#include "hxstrutl.h"
#include "hxstring.h"
#include "print.h"
#include "hxclsnk.h"
#include "hxjadvsnk.h"
#include "hxjstate.h"

const char* PLAYER_LISTENER_STARTED		= "started";

HXJClientStateAdviseSink::HXJClientStateAdviseSink(IUnknown* pUnknown, HXQCallback* pCallback)
    : m_lRefCount (0)
    , m_pUnknown (NULL)
    , m_pScheduler(NULL)
    , m_pClientState(NULL)
    , m_pCallback(pCallback)
{
    if (pUnknown)
    {
	m_pUnknown = pUnknown;
	m_pUnknown->AddRef();

	if (HXR_OK != m_pUnknown->QueryInterface(IID_IHXScheduler, (void**)&m_pScheduler))
	{
	    m_pScheduler = NULL;
	}

	if (HXR_OK != m_pUnknown->QueryInterface(IID_IHXClientState, (void**)&m_pClientState))
	{
	    m_pClientState = NULL;
	}

	IHXClientStateAdviseSinkControl* pControl;
	if(HXR_OK == m_pUnknown->QueryInterface(IID_IHXClientStateAdviseSinkControl, (void**)&pControl))
	{
	        pControl->AddClientStateAdviseSink(this);
	}
	HX_RELEASE(pControl);
    }

}

HXJClientStateAdviseSink::~HXJClientStateAdviseSink(void)
{
    HX_RELEASE(m_pScheduler);
    HX_RELEASE(m_pClientState);
    HX_RELEASE(m_pUnknown);
}


// *** IUnknown methods ***

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::QueryInterface
//  Purpose:
//	Implement this to export the interfaces supported by your 
//	object.
//
STDMETHODIMP HXJClientStateAdviseSink::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
	AddRef();
	*ppvObj = (IUnknown*)(IHXClientStateAdviseSink*)this;
	return HXR_OK;
    }
    /*
    else if (IsEqualIID(riid, IID_IHXClientStateAdviseSink))
    {
	AddRef();
	*ppvObj = (IHXClientStateAdviseSink*)this;
	return HXR_OK;
    }
    */

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::AddRef
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32) HXJClientStateAdviseSink::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//	IUnknown::Release
//  Purpose:
//	Everyone usually implements this the same... feel free to use
//	this implementation.
//
STDMETHODIMP_(ULONG32) HXJClientStateAdviseSink::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

/*
 *	IHXClientStateAdviseSink methods
 */

/************************************************************************
 *	Method:
 *	    IHXClientStateAdviseSink::OnStateChange
 *	Purpose:
 *	    Called to advise the client that the player state changed
 */
STDMETHODIMP
HXJClientStateAdviseSink::OnStateChange(UINT16	  uOldState,
				   UINT16	  uNewState)
{
    printf("OnStateChange: %d -> %d\n", uOldState, uNewState);

    return HXR_OK;
}


--- NEW FILE: hxjerror.cpp ---
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxtypes.h"

#include "hxcom.h"
#include "hxcomm.h"
#include "hxerror.h"
#include "hxstrutl.h"
#include "hxcore.h"
#include "hxassert.h"
#include "hxbuffer.h"

#ifdef __TCS__
#include "hxresult.h"
#endif

#include "hxclsnk.h"
#include "HXErrorCodeStrings.h"
#include "hxjerror.h"

#include 
#include "print.h"

#include "globals.h"
struct _stGlobals*& GetGlobal(); //in main.cpp

#ifdef __TCS__
#if defined(__cplusplus)
extern "C" {
#endif

void hookRealAudio_ReportError(int err, long errVal);

#ifdef __cplusplus
}
#endif
#endif

HXJErrorSink::HXJErrorSink(IUnknown* pUnknown) 
    : m_lRefCount(0),
      m_pPlayer(NULL)
{
    IHXClientEngine* pEngine = NULL;
    pUnknown->QueryInterface(IID_IHXClientEngine, (void**)&pEngine );
    if( pEngine )
    {
        IUnknown* pTmp = NULL;
        pEngine->GetPlayer(0, pTmp);
        m_pPlayer = (IHXPlayer*)pTmp;
    }
    
    HX_RELEASE( pEngine );
    HX_ASSERT(m_pPlayer);
}

HXJErrorSink::~HXJErrorSink()
{
    HX_RELEASE(m_pPlayer);
}

// *** IUnknown methods ***

/////////////////////////////////////////////////////////////////////////
//  Method:
//  IUnknown::QueryInterface
//  Purpose:
//  Implement this to export the interfaces supported by your 
//  object.
//
STDMETHODIMP HXJErrorSink::QueryInterface(REFIID riid, void** ppvObj)
{
    if (IsEqualIID(riid, IID_IUnknown))
    {
        AddRef();
        *ppvObj = (IUnknown*)(IHXErrorSink*)this;
        return HXR_OK;
    }
    else if (IsEqualIID(riid, IID_IHXErrorSink))
    {
        AddRef();
        *ppvObj = (IHXErrorSink*) this;
        return HXR_OK;
    }

    *ppvObj = NULL;
    return HXR_NOINTERFACE;
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//  IUnknown::AddRef
//  Purpose:
//  Everyone usually implements this the same... feel free to use
//  this implementation.
//
STDMETHODIMP_(ULONG32) HXJErrorSink::AddRef()
{
    return InterlockedIncrement(&m_lRefCount);
}

/////////////////////////////////////////////////////////////////////////
//  Method:
//  IUnknown::Release
//  Purpose:
//  Everyone usually implements this the same... feel free to use
//  this implementation.
//
STDMETHODIMP_(ULONG32) HXJErrorSink::Release()
{
    if (InterlockedDecrement(&m_lRefCount) > 0)
    {
        return m_lRefCount;
    }

    delete this;
    return 0;
}

/*
 *  IHXErrorSink methods
 */

STDMETHODIMP 
HXJErrorSink::ErrorOccurred(const UINT8 unSeverity,  
                                const ULONG32   ulHXCode,
                                const ULONG32   ulUserCode,
                                const char* pUserString,
                                const char* pMoreInfoURL
                                )
{
    char HXDefine[256]; /* Flawfinder: ignore */

    // Store the code, so we can return it from main()
    GetGlobal()->g_Error = ulHXCode;

    ConvertErrorToString(ulHXCode, HXDefine, 256);

#ifdef __TCS__
    hookRealAudio_ReportError(ulHXCode,ulUserCode);
#else
    STDOUT("Report(%d, %ld, \"%s\", %ld, \"%s\", \"%s\")\n",
           unSeverity,
           ulHXCode,
           (pUserString && *pUserString) ? pUserString : "(NULL)",
           ulUserCode,
           (pMoreInfoURL && *pMoreInfoURL) ? pMoreInfoURL : "(NULL)",
           HXDefine);
#endif

	//(*m_pCallback)( "error", NULL);

    return HXR_OK;
}

void
HXJErrorSink::ConvertErrorToString(const ULONG32 ulHXCode, char* pszBuffer, UINT32 ulBufLen)
{
    IHXErrorMessages* pErrMsg = NULL;

    if( !pszBuffer)
        return;
    
    pszBuffer[0]='\0';

    HX_ASSERT(m_pPlayer);
    if( m_pPlayer)
    {
        m_pPlayer->QueryInterface(IID_IHXErrorMessages, (void**)&pErrMsg);
        if( pErrMsg )
        {
            IHXBuffer* pMessage = pErrMsg->GetErrorText(ulHXCode);
            if( pMessage )
            {
                SafeStrCpy( pszBuffer, (const char*)pMessage->GetBuffer(), ulBufLen);
                pMessage->Release();
            }
        }
        HX_RELEASE(pErrMsg);
    }
 
    if( strlen(pszBuffer)==0 && ulHXCode != 0)
    {
	const char* pszHXCodeString = HXErrorCodeToString(ulHXCode);
        if (pszHXCodeString)
        {   
            SafeSprintf( pszBuffer, ulBufLen, "%s", pszHXCodeString);
        }
        else
        {
            HX_ASSERT(FALSE);
            SafeSprintf( pszBuffer, ulBufLen, "Can't convert error code %p - make sure it's defined in common/util/HXErrorCodeStrings.c", ulHXCode );
        }
    }
}



From cdunn at helixcommunity.org  Thu Dec 15 18:21:41 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 20:49:06 2005
Subject: [Player-cvs] kit/jsr135 myplay.java,NONE,1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135
In directory cvs:/tmp/cvs-serv3798

Added Files:
	myplay.java 
Log Message:


--- NEW FILE: myplay.java ---

import java.util.*;
import java.lang.*;
import java.lang.Object.*;
import java.io.*;
import javax.microedition.media.*;
import javax.microedition.media.control.*;

class play {

    public static void main(String[] args) {
	    if (args.length < 1) {
		    System.out.println("Using default url..");
		    new MyPlayer().playUrl("rtsp://clientqa.dev.prognet.com/alice.rm");
		    //new MyPlayer().playUrl("c:\\src\\music\\laika.mp3");
		    //new MyPlayer().playUrl("rtsp://clientqa.dev.prognet.com/mp3/mario.mp3");
		    //new MyPlayer().playUrl("rtsp://clientqa.dev.prognet.com/mp3/crystalmethod.mp3");
		    return;
	    }
	    if (args.length < 1 || args[0].compareTo("-h") == 0) {
		    System.out.println("Usage: play [-volume] [[...]]");
		    return;
	    }
	    else if (args.length > 0 && args[0].compareTo("-volume") == 0) {
		    if (args.length > 1) {
		    	new MyPlayer().playUrlVolume(args[1]);
		    } else {
		    	new MyPlayer().playUrlVolume("c:\\src\\music\\laika.mp3");
		    }
		    return;
	    }
	    else if (args.length > 0 && args[0].compareTo("-video") == 0) {
		    if (args.length > 1) {
		    	new MyPlayer().playUrlVideo(args[1]);
		    } else {
		    	new MyPlayer().playUrlVideo("c:\\src\\music\\buena1.rm");
		    }
		    return;
	    }

	    MyPlayer mp = new MyPlayer();
	    for (int i=0; i>> ");

	    while ((line = in.readLine()) != null)
	    {
		if (line.compareTo("realize") == 0 ||
		    line.compareTo("r") == 0) {
			    p.realize();
		}
		else if (line.compareTo("prefetch") == 0 ||
		    line.compareTo("f") == 0) {
			    p.prefetch();
		}
		else if (line.compareTo("start") == 0 ||
		    line.compareTo("play") == 0 ||
		    line.compareTo("s") == 0) {
			    p.start();
		}
		else if (line.compareTo("stop") == 0 ||
		        line.compareTo("pause") == 0 ||
		        line.compareTo("p") == 0) {
			    p.stop();
		}
		else if (line.compareTo("deallocate") == 0 ||
		    line.compareTo("d") == 0) {
			    p.deallocate();
		}
		else if (line.compareTo("close") == 0 ||
		        line.compareTo("c") == 0) {
			    p.close();
		}
		else if (line.compareTo("q") == 0 ||
		        line.compareTo("quit") == 0) {
			    System.out.println("Qutting command loop, calling close...");
			    p.close();
			    break;
		}
		else if (line.compareTo("state") == 0 ||
		        line.compareTo("getState") == 0) {
			    System.out.println("Calling getState ...");
			    printStateString(p.getState());
		}
		else if (line.compareTo("getMediaTime") == 0 ||
		        line.compareTo("t") == 0) {
			System.out.println("Current media time: "+ p.getMediaTime());
		}
		else if (line.compareTo("setMediaTime") == 0 ||
		        line.compareTo("seek") == 0) {
			System.out.print("Enter seek time: ");
	    		line = in.readLine();
			int t = Integer.parseInt(line);
			System.out.println("Seeking: "+ t);
			System.out.println("Current media time: "+ p.setMediaTime(t));
		}
		else if (line.compareTo("getDuration") == 0 ||
		        line.compareTo("dur") == 0) {
			    System.out.println("Duration: " + p.getDuration());
		}
		else if (line.compareTo("getVolume") == 0) {
	    		volume = (VolumeControl)p.getControl("VolumeControl");
	    		System.out.println("Volume = " + volume.getLevel() + " muted=" + volume.isMuted());
		}
		else if (line.compareTo("getVideo") == 0) {
			if (p.getState() < Player.PREFETCHED) {
			    printStateString(p.getState());
				System.out.println("WARNING: player must be in the prefetched state.");
			}
		    	video = (VideoControl)p.getControl("VideoControl");
		    	video.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, null);
		    	video.setVisible(true);
			System.out.println("getDisplayX: "+ video.getDisplayX());
			System.out.println("getDisplayY: "+ video.getDisplayY());
			System.out.println("getSourceWidth: " + video.getSourceWidth());
			System.out.println("getSourceHeight: " + video.getSourceHeight());
			System.out.println("getDisplayWidth: " + video.getDisplayWidth());
			System.out.println("getDisplayHeight: " + video.getDisplayHeight());
		}
		else if (line.compareTo("volume") == 0 ||
		        line.compareTo("vol") == 0) {
		    if (volume != null) {
	    		System.out.println("Volume = " + volume.getLevel() + " muted=" + volume.isMuted());
		    }
		}
		else if (line.compareTo("mute") == 0) {
		    if (volume != null) {
			volume.setMute(!volume.isMuted());
	    		System.out.println("Volume = " + volume.getLevel() + " muted=" + volume.isMuted());
		    }
		}
		else if (line.compareTo("setLevel") == 0) {
		    if (volume != null) {
			System.out.print("Enter volume level (0-100): ");
	    		line = in.readLine();
			int t = Integer.parseInt(line);
			volume.setLevel(t); 
	    		System.out.println("Volume = " + volume.getLevel() + " muted=" + volume.isMuted());
		    }
		}
		else if (line.compareTo("video") == 0) {
		    if (video != null) {
			System.out.println("getDisplayX: "+ video.getDisplayX());
			System.out.println("getDisplayY: "+ video.getDisplayY());
			System.out.println("getSourceWidth: " + video.getSourceWidth());
			System.out.println("getSourceHeight: " + video.getSourceHeight());
			System.out.println("getDisplayWidth: " + video.getDisplayWidth());
			System.out.println("getDisplayHeight: " + video.getDisplayHeight());
		    }
		}
		else if (line.compareTo("setVisible") == 0) {
		    if (video != null) {
			visible = !visible;
			System.out.println("Setting visiblity: " + visible);
			video.setVisible(visible);
		    }
		}
		else if (line.compareTo("setDisplayLocation") == 0) {
		    if (video != null) {
			System.out.print("Enter (x, y): ");
	    		line = in.readLine();
			int x = Integer.parseInt(line);
			int y = Integer.parseInt(line);
	    		System.out.println("setDisplayLocation: " + x + "," + y);
	    		video.setDisplayLocation(x, y);
		    }
		}
		else if (line.compareTo("setDisplaySize") == 0) {
		    if (video != null) {
			System.out.print("Enter (w, h): ");
			int w, h;
	    		line = in.readLine();
			if (line.compareTo("d") == 0) {
	    			w = video.getDisplayWidth() * 2;
				h = video.getDisplayHeight() * 2;
			} else {
			    w = Integer.parseInt(line);
			    h = Integer.parseInt(line);
			}
				
	    		System.out.println("setDisplaySize: " + w + "," + h);
	    		video.setDisplaySize(w, h);
		    }
		}
		else if (line.compareTo("setDisplayFullScreen") == 0) {
		    if (video != null) {
			fullscreen = !fullscreen;
	    		System.out.println("setDisplayFullScreen: " + fullscreen);
			video.setDisplayFullScreen(fullscreen);
		    }
		}
		else if (line.compareTo("") == 0) {
			if (p.getState() != Player.CLOSED) {
				System.out.println("Current media time: "+ p.getMediaTime());
			}
		}
		else {
			printUsage();
		}

		printStateString(p.getState());
		System.out.print(">>> ");
	    }


	} 
//	catch (Exception e) {
//		System.out.println("Caught io exception");
//	}//catch (InterruptedException ie) {
	//	System.out.println("Caught io exception");
	//}
	catch (MediaException me) {
		System.out.println("Media Exception " + me);
	}
	catch (IllegalStateException ie) {
		System.out.println("Illegal State Exception " + ie);
	}
	catch (IOException ioe) {
		System.out.println("IO Exception " + ioe);
	}
    }

    private void printStateString(long state) {
	    System.out.print("Player state ("+state+") = ");
	    switch ((int)state) {
		    case Player.UNREALIZED :
			    System.out.println("UNREALIZED"); break;
		    case Player.REALIZED :
			    System.out.println("REALIZED"); break;
		    case Player.PREFETCHED :
			    System.out.println("PREFETCHED"); break;
		    case Player.STARTED :
			    System.out.println("STARTED"); break;
		    case Player.CLOSED :
			    System.out.println("CLOSED"); break;
		    default:
			    System.out.println("unknown state"); break;
	    }
    }

    private static void printUsage() {
		System.out.println("Enter a command:");
		System.out.println("	realize, r		: open url");
		System.out.println("	prefetch, f		: prefetch");
		System.out.println("	start, play, s		: start/play");
		System.out.println("	stop, pause, p		: stop/pause");
		System.out.println("	deallocate, d		: deallocate");
		System.out.println("	close, c		: close the player");
		System.out.println("	getState, state		: get the player state");
		System.out.println("	getMediaTime, t		: get the current media time");
		System.out.println("	setMediaTime, seek	: set the media time (seek)");
		System.out.println("	getDuration, len	: set the media duration (clip len)");
		System.out.println("	getVolume		: Get the volume control");
		System.out.println("	volume, vol		: Print volume info");
		System.out.println("	setMute, mute		: Toggle mute");
		System.out.println("	setLevel		: Set the volume level");
		System.out.println("	getVideo		: Get the video control and initialize");
		System.out.println("	video			: Print video info");
		System.out.println("	setVisible		: Toggle video visiblity");
		System.out.println("	setDisplayLocation	: Set the video display location");
		System.out.println("	setDisplaySize		: Set the video display size, enter 'd' to double");
		System.out.println("	setDisplayFullScreen	: Toggle fullscreen mode");
		System.out.println("	quit, q			: close the player, quit cmd loop");
    }

    public synchronized void playerUpdate(Player player, java.lang.String event, java.lang.Object eventData) {

	if (event.equals(PlayerListener.STARTED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.BUFFERING_STARTED)) {
//		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.BUFFERING_STOPPED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.CLOSED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.DEVICE_AVAILABLE)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.DEVICE_UNAVAILABLE)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.DURATION_UPDATED)) {
		//System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.END_OF_MEDIA)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.ERROR)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.RECORD_ERROR)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.RECORD_STARTED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.RECORD_STOPPED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.SIZE_CHANGED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.STARTED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.STOPPED)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.STOPPED_AT_TIME)) {
		System.out.println("playerUpdate: "+event); 
	} else if (event.equals( PlayerListener.VOLUME_CHANGED)) {
		System.out.println("playerUpdate: "+event); 
	} else {
		System.out.println("ERROR: unknown event: "+event);
	}
    }

}

class MyThread2 implements Runnable {
  private Player p;
  private Thread t;

  public void start() {
		t = new Thread(this);
		t.setName("MyThread2");
		t.start();
  }
	public MyThread2(Player p) {
		this.p = p;
	}

	public void run() {
		try {
			System.out.println("Before deallocate in thread2 " +Thread.currentThread());
			p.deallocate();
			System.out.println("After deallocate in thread2 " +Thread.currentThread());
		} catch (Exception e) {
		}
	}
}




From cdunn at helixcommunity.org  Thu Dec 15 18:42:49 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 21:10:13 2005
Subject: [Player-cvs] kit/jsr135 manager_wrap.cpp, 1.1, 1.2 player.cpp, 1.1,
	1.2
Message-ID: 

Update of /cvsroot/player/kit/jsr135
In directory cvs:/tmp/cvs-serv5952

Modified Files:
	manager_wrap.cpp player.cpp 
Log Message:
update

Index: player.cpp
===================================================================
RCS file: /cvsroot/player/kit/jsr135/player.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- player.cpp	16 Dec 2005 02:06:13 -0000	1.1
+++ player.cpp	16 Dec 2005 02:42:47 -0000	1.2
@@ -977,7 +977,6 @@
     {
 	if (m_pVideoControl == NULL)
 	{
-		//m_pVideoControl = new _VideoControl(m_pPlayer);
 	    m_pVideoControl = m_pContext->GetVideoControl();
 	}
 	return m_pVideoControl;

Index: manager_wrap.cpp
===================================================================
RCS file: /cvsroot/player/kit/jsr135/manager_wrap.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- manager_wrap.cpp	16 Dec 2005 02:06:13 -0000	1.1
+++ manager_wrap.cpp	16 Dec 2005 02:42:47 -0000	1.2
@@ -242,113 +242,6 @@
 }
 
 
-JNIEXPORT jint JNICALL Java_javax_microedition_media_mmapiJNI_get_1TransState_1Idle(JNIEnv *jenv, jclass jcls) {
-    jint jresult = 0 ;
-    _TransState result;
-    
-    (void)jenv;
-    (void)jcls;
-    result = (_TransState)TransState_Idle;
-    
-    jresult = (jint)result; 
-    return jresult;
-}
-
-
-JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1EventInfo_1eventName(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
-    EventInfo *arg1 = (EventInfo *) 0 ;
-    char *arg2 ;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(EventInfo **)(void *)&jarg1; 
-    {
-        arg2 = 0;
-        if (jarg2) {
-            arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
-            if (!arg2) return ;
-        }
-    }
-    {
-        if (arg2) strncpy(arg1->eventName,arg2,80);
-        else arg1->eventName[0] = 0;
-    }
-    
-    {
-        if (arg2) jenv->ReleaseStringUTFChars(jarg2, arg2); 
-    }
-}
-
-
-JNIEXPORT jstring JNICALL Java_javax_microedition_media_mmapiJNI_get_1EventInfo_1eventName(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-    jstring jresult = 0 ;
-    EventInfo *arg1 = (EventInfo *) 0 ;
-    char *result;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(EventInfo **)(void *)&jarg1; 
-    result = (char *)(char *) ((arg1)->eventName);
-    
-    {
-        if(result) jresult = jenv->NewStringUTF(result); 
-    }
-    return jresult;
-}
-
-
-JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1EventInfo_1eventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
-    EventInfo *arg1 = (EventInfo *) 0 ;
-    void *arg2 = (void *) 0 ;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(EventInfo **)(void *)&jarg1; 
-    arg2 = *(void **)(void *)&jarg2; 
-    if (arg1) (arg1)->eventData = arg2;
-    
-}
-
-
-JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_get_1EventInfo_1eventData(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-    jlong jresult = 0 ;
-    EventInfo *arg1 = (EventInfo *) 0 ;
-    void *result;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(EventInfo **)(void *)&jarg1; 
-    result = (void *) ((arg1)->eventData);
-    
-    *(void **)(void *)&jresult = result; 
-    return jresult;
-}
-
-
-JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1EventInfo(JNIEnv *jenv, jclass jcls) {
-    jlong jresult = 0 ;
-    EventInfo *result;
-    
-    (void)jenv;
-    (void)jcls;
-    result = (EventInfo *)new EventInfo();
-    
-    *(EventInfo **)(void *)&jresult = result; 
-    return jresult;
-}
-
-
-JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_delete_1EventInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-    EventInfo *arg1 = (EventInfo *) 0 ;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(EventInfo **)(void *)&jarg1; 
-    delete arg1;
-    
-}
-
-
 JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1_1Player(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2) {
     jlong jresult = 0 ;
     IHXClientEngine *arg1 = (IHXClientEngine *) 0 ;
@@ -690,62 +583,6 @@
 }
 
 
-JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1_1Player_1m_1pContext(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
-    _Player *arg1 = (_Player *) 0 ;
-    HXJClientContext *arg2 = (HXJClientContext *) 0 ;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(_Player **)(void *)&jarg1; 
-    arg2 = *(HXJClientContext **)(void *)&jarg2; 
-    if (arg1) (arg1)->m_pContext = arg2;
-    
-}
-
-
-JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_get_1_1Player_1m_1pContext(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-    jlong jresult = 0 ;
-    _Player *arg1 = (_Player *) 0 ;
-    HXJClientContext *result;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(_Player **)(void *)&jarg1; 
-    result = (HXJClientContext *) ((arg1)->m_pContext);
-    
-    *(HXJClientContext **)(void *)&jresult = result; 
-    return jresult;
-}
-
-
-JNIEXPORT void JNICALL Java_javax_microedition_media_mmapiJNI_set_1_1Player_1m_1pPlayer(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
-    _Player *arg1 = (_Player *) 0 ;
-    IHXPlayer *arg2 = (IHXPlayer *) 0 ;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(_Player **)(void *)&jarg1; 
-    arg2 = *(IHXPlayer **)(void *)&jarg2; 
-    if (arg1) (arg1)->m_pPlayer = arg2;
-    
-}
-
-
-JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_get_1_1Player_1m_1pPlayer(JNIEnv *jenv, jclass jcls, jlong jarg1) {
-    jlong jresult = 0 ;
-    _Player *arg1 = (_Player *) 0 ;
-    IHXPlayer *result;
-    
-    (void)jenv;
-    (void)jcls;
-    arg1 = *(_Player **)(void *)&jarg1; 
-    result = (IHXPlayer *) ((arg1)->m_pPlayer);
-    
-    *(IHXPlayer **)(void *)&jresult = result; 
-    return jresult;
-}
-
-
 JNIEXPORT jlong JNICALL Java_javax_microedition_media_mmapiJNI_new_1_1VolumeControl(JNIEnv *jenv, jclass jcls, jlong jarg1) {
     jlong jresult = 0 ;
     IHXVolume *arg1 = (IHXVolume *) 0 ;
@@ -958,15 +795,7 @@
     arg1 = *(_VideoControl **)(void *)&jarg1; 
     arg2 = (int)jarg2; 
     arg3 = (int)jarg3; 
-    try {
-        (arg1)->setDisplaySize(arg2,arg3);
-    }
-    catch(_MediaException &_e) {
-        (void)_e;
-        SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ _MediaException exception thrown");
-        return ;
-        
-    }
+    (arg1)->setDisplaySize(arg2,arg3);
     
 }
 
@@ -979,15 +808,7 @@
     (void)jcls;
     arg1 = *(_VideoControl **)(void *)&jarg1; 
     arg2 = jarg2 ? true : false; 
-    try {
-        (arg1)->setDisplayFullScreen(arg2);
-    }
-    catch(_MediaException &_e) {
-        (void)_e;
-        SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ _MediaException exception thrown");
-        return ;
-        
-    }
+    (arg1)->setDisplayFullScreen(arg2);
     
 }
 
@@ -1068,15 +889,7 @@
             if (!arg2) return 0;
         }
     }
-    try {
-        result = (unsigned char *)(arg1)->getSnapshot(arg2);
-    }
-    catch(_MediaException &_e) {
-        (void)_e;
-        SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ _MediaException exception thrown");
-        return 0;
-        
-    }
+    result = (unsigned char *)(arg1)->getSnapshot(arg2);
     
     *(unsigned char **)(void *)&jresult = result; 
     {


From cdunn at helixcommunity.org  Thu Dec 15 18:42:50 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 21:10:13 2005
Subject: [Player-cvs] kit/jsr135/pub player.h,1.1,1.2
Message-ID: 

Update of /cvsroot/player/kit/jsr135/pub
In directory cvs:/tmp/cvs-serv5952/pub

Modified Files:
	player.h 
Log Message:
update

Index: player.h
===================================================================
RCS file: /cvsroot/player/kit/jsr135/pub/player.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- player.h	16 Dec 2005 02:06:14 -0000	1.1
+++ player.h	16 Dec 2005 02:42:47 -0000	1.2
@@ -35,6 +35,7 @@
 struct IControllable;
 struct IControl;
 
+#ifndef SWIG
 // Player transition state 
 typedef enum _TransState {
 	    TransState_Idle	    = 0,
@@ -52,6 +53,7 @@
 	char eventName[80];
 	void* eventData;
 } EventInfo;
+#endif
 
 class _Player
 #ifndef SWIG
@@ -158,8 +160,6 @@
     // Sets the TimeBase for this Player. 
     void setTimeBase(TimeBase master);
     */
-    HXJClientContext*	m_pContext;
-    IHXPlayer*		m_pPlayer;
 private:
 
     void TransitionToState(TransState toState);
@@ -187,8 +187,11 @@
     void SetClientContext(HXJClientContext* pContext);
     const char* StateString(int state);
 
+
+    IHXPlayer*		m_pPlayer;
     IHXClientEngine*	m_pClientEngine;
     IHXClientState*	m_pClientState;
+    HXJClientContext*	m_pContext;
     PlayerState		m_state;
     CHXString		m_url;
 


From cdunn at helixcommunity.org  Thu Dec 15 18:42:49 2005
From: cdunn at helixcommunity.org (cdunn@helixcommunity.org)
Date: Thu Dec 15 21:10:21 2005
Subject: [Player-cvs] kit/jsr135/javax/microedition/media
	SWIGTYPE_p_IHXClientEngine.java, NONE,
	1.1 SWIGTYPE_p_IHXVolume.java, NONE,
	1.1 SWIGTYPE_p_IUnknown.java, NONE, 1.1 SWIGTYPE_p_p_char.java,
	NONE, 1.1 SWIGTYPE_p_unsigned_char.java, NONE,
	1.1 SWIGTYPE_p_void.java, NONE, 1.1 _GUIControl.java, NONE,
	1.1 _IllegalStateException.java, NONE, 1.1 _Manager.java, NONE,
	1.1 _MediaException.java, NONE, 1.1 _Player.java, NONE,
	1.1 _VideoControl.java, NONE, 1.1 _VolumeControl.java, NONE,
	1.1 mmapi.java, NONE, 1.1 mmapiJNI.java, NONE, 1.1
Message-ID: 

Update of /cvsroot/player/kit/jsr135/javax/microedition/media
In directory cvs:/tmp/cvs-serv5952/javax/microedition/media

Added Files:
	SWIGTYPE_p_IHXClientEngine.java SWIGTYPE_p_IHXVolume.java 
	SWIGTYPE_p_IUnknown.java SWIGTYPE_p_p_char.java 
	SWIGTYPE_p_unsigned_char.java SWIGTYPE_p_void.java 
	_GUIControl.java _IllegalStateException.java _Manager.java 
	_MediaException.java _Player.java _VideoControl.java 
	_VolumeControl.java mmapi.java mmapiJNI.java 
Log Message:
update

--- NEW FILE: SWIGTYPE_p_IHXVolume.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_IHXVolume {
  private long swigCPtr;

  protected SWIGTYPE_p_IHXVolume(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_IHXVolume() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_IHXVolume obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


--- NEW FILE: SWIGTYPE_p_void.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_void {
  private long swigCPtr;

  protected SWIGTYPE_p_void(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_void() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_void obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


--- NEW FILE: _VideoControl.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _VideoControl {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _VideoControl(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_VideoControl obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__VideoControl(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _VideoControl(SWIGTYPE_p_IUnknown pUnkPlayer) {
    this(mmapiJNI.new__VideoControl(SWIGTYPE_p_IUnknown.getCPtr(pUnkPlayer)), true);
  }

  public static int getUSE_DIRECT_VIDEO() {
    return mmapiJNI.get__VideoControl_USE_DIRECT_VIDEO();
  }

  public SWIGTYPE_p_void initDisplayMode(int mode, SWIGTYPE_p_void arg) {
    long cPtr = mmapiJNI._VideoControl_initDisplayMode(swigCPtr, mode, SWIGTYPE_p_void.getCPtr(arg));
    return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
  }

  public void setDisplayLocation(int x, int y) {
    mmapiJNI._VideoControl_setDisplayLocation(swigCPtr, x, y);
  }

  public int getDisplayX() {
    return mmapiJNI._VideoControl_getDisplayX(swigCPtr);
  }

  public int getDisplayY() {
    return mmapiJNI._VideoControl_getDisplayY(swigCPtr);
  }

  public void setVisible(boolean visible) {
    mmapiJNI._VideoControl_setVisible(swigCPtr, visible);
  }

  public void setDisplaySize(int width, int height) {
    mmapiJNI._VideoControl_setDisplaySize(swigCPtr, width, height);
  }

  public void setDisplayFullScreen(boolean fullScreenMode) {
    mmapiJNI._VideoControl_setDisplayFullScreen(swigCPtr, fullScreenMode);
  }

  public int getSourceWidth() {
    return mmapiJNI._VideoControl_getSourceWidth(swigCPtr);
  }

  public int getSourceHeight() {
    return mmapiJNI._VideoControl_getSourceHeight(swigCPtr);
  }

  public int getDisplayWidth() {
    return mmapiJNI._VideoControl_getDisplayWidth(swigCPtr);
  }

  public int getDisplayHeight() {
    return mmapiJNI._VideoControl_getDisplayHeight(swigCPtr);
  }

  public SWIGTYPE_p_unsigned_char getSnapshot(String imageType) {
    long cPtr = mmapiJNI._VideoControl_getSnapshot(swigCPtr, imageType);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
  }

}

--- NEW FILE: mmapi.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class mmapi {
}

--- NEW FILE: SWIGTYPE_p_unsigned_char.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_unsigned_char {
  private long swigCPtr;

  protected SWIGTYPE_p_unsigned_char(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_unsigned_char() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_unsigned_char obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


--- NEW FILE: _Player.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _Player {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _Player(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_Player obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__Player(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _Player(SWIGTYPE_p_IHXClientEngine pClientEngine, String locator) {
    this(mmapiJNI.new__Player(SWIGTYPE_p_IHXClientEngine.getCPtr(pClientEngine), locator), true);
  }

  public static long getTIME_UNKNOWN() {
    return mmapiJNI.get__Player_TIME_UNKNOWN();
  }

  public void realize() {
    mmapiJNI._Player_realize(swigCPtr);
  }

  public void prefetch() {
    mmapiJNI._Player_prefetch(swigCPtr);
  }

  public void start() {
    mmapiJNI._Player_start(swigCPtr);
  }

  public void stop() {
    mmapiJNI._Player_stop(swigCPtr);
  }

  public void deallocate() {
    mmapiJNI._Player_deallocate(swigCPtr);
  }

  public void close() {
    mmapiJNI._Player_close(swigCPtr);
  }

  public int getMediaTime() {
    return mmapiJNI._Player_getMediaTime(swigCPtr);
  }

  public int setMediaTime(int now) {
    return mmapiJNI._Player_setMediaTime(swigCPtr, now);
  }

  public int getDuration() {
    return mmapiJNI._Player_getDuration(swigCPtr);
  }

  public int getState() {
    return mmapiJNI._Player_getState(swigCPtr);
  }

  public void setLoopCount(int count) {
    mmapiJNI._Player_setLoopCount(swigCPtr, count);
  }

  public String getContentType() {
    return mmapiJNI._Player_getContentType(swigCPtr);
  }

  public _VolumeControl getVolumeControl() {
    long cPtr = mmapiJNI._Player_getVolumeControl(swigCPtr);
    return (cPtr == 0) ? null : new _VolumeControl(cPtr, false);
  }

  public _VideoControl getVideoControl() {
    long cPtr = mmapiJNI._Player_getVideoControl(swigCPtr);
    return (cPtr == 0) ? null : new _VideoControl(cPtr, false);
  }

  public _GUIControl getGUIControl() {
    long cPtr = mmapiJNI._Player_getGUIControl(swigCPtr);
    return (cPtr == 0) ? null : new _GUIControl(cPtr, false);
  }

  public SWIGTYPE_p_p_char getControls() {
    long cPtr = mmapiJNI._Player_getControls(swigCPtr);
    return (cPtr == 0) ? null : new SWIGTYPE_p_p_char(cPtr, false);
  }

  public final static class PlayerState {
    public final static PlayerState UNREALIZED = new PlayerState("UNREALIZED", mmapiJNI.get__Player_UNREALIZED());
    public final static PlayerState REALIZED = new PlayerState("REALIZED", mmapiJNI.get__Player_REALIZED());
    public final static PlayerState PREFETCHED = new PlayerState("PREFETCHED", mmapiJNI.get__Player_PREFETCHED());
    public final static PlayerState STARTED = new PlayerState("STARTED", mmapiJNI.get__Player_STARTED());
    public final static PlayerState CLOSED = new PlayerState("CLOSED", mmapiJNI.get__Player_CLOSED());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static PlayerState swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + PlayerState.class + " with value " + swigValue);
    }

    private PlayerState(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private PlayerState(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private static PlayerState[] swigValues = { UNREALIZED, REALIZED, PREFETCHED, STARTED, CLOSED };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}

--- NEW FILE: _Manager.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _Manager {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _Manager(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_Manager obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__Manager(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _Manager() {
    this(mmapiJNI.new__Manager(), true);
  }

  public static void playTone(int note, int duration, int volume) {
    mmapiJNI._Manager_playTone(note, duration, volume);
  }

  public static _Player createPlayer(String locator) {
    long cPtr = mmapiJNI._Manager_createPlayer(locator);
    return (cPtr == 0) ? null : new _Player(cPtr, false);
  }

  public static void StartEngineDriver() {
    mmapiJNI._Manager_StartEngineDriver();
  }

}

--- NEW FILE: SWIGTYPE_p_p_char.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_p_char {
  private long swigCPtr;

  protected SWIGTYPE_p_p_char(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_p_char() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_p_char obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


--- NEW FILE: _VolumeControl.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _VolumeControl {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _VolumeControl(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_VolumeControl obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__VolumeControl(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _VolumeControl(SWIGTYPE_p_IHXVolume pVolume) {
    this(mmapiJNI.new__VolumeControl(SWIGTYPE_p_IHXVolume.getCPtr(pVolume)), true);
  }

  public void setMute(boolean mute) {
    mmapiJNI._VolumeControl_setMute(swigCPtr, mute);
  }

  public boolean isMuted() {
    return mmapiJNI._VolumeControl_isMuted(swigCPtr);
  }

  public int setLevel(int level) {
    return mmapiJNI._VolumeControl_setLevel(swigCPtr, level);
  }

  public int getLevel() {
    return mmapiJNI._VolumeControl_getLevel(swigCPtr);
  }

}

--- NEW FILE: _MediaException.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _MediaException {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _MediaException(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_MediaException obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__MediaException(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _MediaException() {
    this(mmapiJNI.new__MediaException__SWIG_0(), true);
  }

  public _MediaException(String reason) {
    this(mmapiJNI.new__MediaException__SWIG_1(reason), true);
  }

}

--- NEW FILE: SWIGTYPE_p_IUnknown.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_IUnknown {
  private long swigCPtr;

  protected SWIGTYPE_p_IUnknown(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_IUnknown() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_IUnknown obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}


--- NEW FILE: _GUIControl.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _GUIControl {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _GUIControl(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_GUIControl obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__GUIControl(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _GUIControl(_Player pPlayer) {
    this(mmapiJNI.new__GUIControl(_Player.getCPtr(pPlayer)), true);
  }

  public static int getUSE_GUI_PRIMITIVE() {
    return mmapiJNI.get__GUIControl_USE_GUI_PRIMITIVE();
  }

  public SWIGTYPE_p_void initDisplayMode(int mode, SWIGTYPE_p_void arg) {
    long cPtr = mmapiJNI._GUIControl_initDisplayMode(swigCPtr, mode, SWIGTYPE_p_void.getCPtr(arg));
    return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
  }

}

--- NEW FILE: mmapiJNI.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

class mmapiJNI {
  public final static native long new__Manager();
  public final static native void delete__Manager(long jarg1);
  public final static native void _Manager_playTone(int jarg1, int jarg2, int jarg3);
  public final static native long _Manager_createPlayer(String jarg1);
  public final static native void _Manager_StartEngineDriver();
  public final static native long new__Player(long jarg1, String jarg2);
  public final static native void delete__Player(long jarg1);
  public final static native int get__Player_UNREALIZED();
  public final static native int get__Player_REALIZED();
  public final static native int get__Player_PREFETCHED();
  public final static native int get__Player_STARTED();
  public final static native int get__Player_CLOSED();
  public final static native long get__Player_TIME_UNKNOWN();
  public final static native void _Player_realize(long jarg1);
  public final static native void _Player_prefetch(long jarg1);
  public final static native void _Player_start(long jarg1);
  public final static native void _Player_stop(long jarg1);
  public final static native void _Player_deallocate(long jarg1);
  public final static native void _Player_close(long jarg1);
  public final static native int _Player_getMediaTime(long jarg1);
  public final static native int _Player_setMediaTime(long jarg1, int jarg2);
  public final static native int _Player_getDuration(long jarg1);
  public final static native int _Player_getState(long jarg1);
  public final static native void _Player_setLoopCount(long jarg1, int jarg2);
  public final static native String _Player_getContentType(long jarg1);
  public final static native long _Player_getVolumeControl(long jarg1);
  public final static native long _Player_getVideoControl(long jarg1);
  public final static native long _Player_getGUIControl(long jarg1);
  public final static native long _Player_getControls(long jarg1);
  public final static native long new__VolumeControl(long jarg1);
  public final static native void delete__VolumeControl(long jarg1);
  public final static native void _VolumeControl_setMute(long jarg1, boolean jarg2);
  public final static native boolean _VolumeControl_isMuted(long jarg1);
  public final static native int _VolumeControl_setLevel(long jarg1, int jarg2);
  public final static native int _VolumeControl_getLevel(long jarg1);
  public final static native long new__VideoControl(long jarg1);
  public final static native void delete__VideoControl(long jarg1);
  public final static native int get__VideoControl_USE_DIRECT_VIDEO();
  public final static native long _VideoControl_initDisplayMode(long jarg1, int jarg2, long jarg3);
  public final static native void _VideoControl_setDisplayLocation(long jarg1, int jarg2, int jarg3);
  public final static native int _VideoControl_getDisplayX(long jarg1);
  public final static native int _VideoControl_getDisplayY(long jarg1);
  public final static native void _VideoControl_setVisible(long jarg1, boolean jarg2);
  public final static native void _VideoControl_setDisplaySize(long jarg1, int jarg2, int jarg3);
  public final static native void _VideoControl_setDisplayFullScreen(long jarg1, boolean jarg2);
  public final static native int _VideoControl_getSourceWidth(long jarg1);
  public final static native int _VideoControl_getSourceHeight(long jarg1);
  public final static native int _VideoControl_getDisplayWidth(long jarg1);
  public final static native int _VideoControl_getDisplayHeight(long jarg1);
  public final static native long _VideoControl_getSnapshot(long jarg1, String jarg2);
  public final static native long new__GUIControl(long jarg1);
  public final static native void delete__GUIControl(long jarg1);
  public final static native int get__GUIControl_USE_GUI_PRIMITIVE();
  public final static native long _GUIControl_initDisplayMode(long jarg1, int jarg2, long jarg3);
  public final static native long new__MediaException__SWIG_0();
  public final static native long new__MediaException__SWIG_1(String jarg1);
  public final static native void delete__MediaException(long jarg1);
  public final static native long new__IllegalStateException__SWIG_0();
  public final static native long new__IllegalStateException__SWIG_1(String jarg1);
  public final static native void delete__IllegalStateException(long jarg1);
}

--- NEW FILE: _IllegalStateException.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class _IllegalStateException {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected _IllegalStateException(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(_IllegalStateException obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      mmapiJNI.delete__IllegalStateException(swigCPtr);
    }
    swigCPtr = 0;
  }

  public _IllegalStateException() {
    this(mmapiJNI.new__IllegalStateException__SWIG_0(), true);
  }

  public _IllegalStateException(String reason) {
    this(mmapiJNI.new__IllegalStateException__SWIG_1(reason), true);
  }

}

--- NEW FILE: SWIGTYPE_p_IHXClientEngine.java ---
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package javax.microedition.media;

public class SWIGTYPE_p_IHXClientEngine {
  private long swigCPtr;

  protected SWIGTYPE_p_IHXClientEngine(long cPtr, boolean futureUse) {
    swigCPtr = cPtr;
  }

  protected SWIGTYPE_p_IHXClientEngine() {
    swigCPtr = 0;
  }

  protected static long getCPtr(SWIGTYPE_p_IHXClientEngine obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}



From rishimathew at helixcommunity.org  Tue Dec 20 14:40:11 2005
From: rishimathew at helixcommunity.org (rishimathew@helixcommunity.org)
Date: Tue Dec 20 17:06:23 2005
Subject: [Player-cvs] CVSROOT avail,1.31,1.32
Message-ID: 

Update of /cvsroot/player/CVSROOT
In directory cvs:/tmp/cvs-serv11903/CVSROOT

Modified Files:
	avail 
Log Message:
giving chinmaypatil write access for the 'player' project

Index: avail
===================================================================
RCS file: /cvsroot/player/CVSROOT/avail,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- avail	6 Dec 2005 20:10:54 -0000	1.31
+++ avail	20 Dec 2005 22:40:09 -0000	1.32
@@ -24,6 +24,7 @@
 avail|bway
 avail|cconover
 avail|cdunn
+avail|chinmaypatil
 avail|chrismd
 avail|cnoel
 avail|crobinson


 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.