mmserv/tms/tmsserver/inc/tmsserver.h
changeset 0 71ca22bcf22a
child 3 4f62049db6ac
child 12 5a06f39ad45b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsserver.h	Tue Feb 02 01:08:46 2010 +0200
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Telephony Multimedia Service
+ *
+ */
+
+#ifndef __TMSSERVER_H
+#define __TMSSERVER_H
+
+#include <e32base.h>
+#include <mmcccodecinformation.h>
+#include <tms.h>
+#include "tmsshared.h"
+#include "tmsclientserver.h"
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSServerShutDown;
+class CStartAndMonitorTMSCallThread;
+class TMSCallProxyLocal;
+class GlobalEffectsSettings;
+class CTarEventHandler;
+class CSPCenRepListener;
+class CSPAudioHandler;
+
+// -----------------------------------------------------------------------------
+// TMSServer class
+// -----------------------------------------------------------------------------
+//
+class TMSServer : public CServer2
+    {
+public:
+    static TMSServer* NewL();
+    ~TMSServer();
+
+    void AddSession();
+    void DropSession();
+    TInt SessionCount();
+
+    void SetDnLinkSession(TBool aSession);
+    void SetUpLinkSession(TBool aSession);
+
+    TBool HasDnLinkSession() const;
+    TBool HasUpLinkSession() const;
+
+    void GetNewTMSCallSessionHandleL(RHandleBase& aHandle);
+    TInt SetOutput(CSession2* sid, TInt output);
+    TInt GetOutput(const RMessage2& aMessage);
+    TInt GetPreviousOutput(const RMessage2& aMessage);
+    TInt GetAvailableOutputs(const RMessage2& aMessage);
+
+    TInt GetMaxLevel(const RMessage2& aMessage);
+    TInt GetLevel(const RMessage2& aMessage);
+    TInt SetLevel(CSession2* sid, TBool tmsclient, TInt level);
+
+    TInt GetMaxGain(const RMessage2& aMessage);
+    TInt GetGain(const RMessage2& aMessage);
+    TInt SetGain(CSession2* sid, TInt level);
+    TInt GetSupportedCodecs(const TMSStreamType strmType,
+            RArray<TFourCC>*& aCodecs);
+
+    TInt NotifyTarClients(TRoutingMsgBufPckg routingpckg);
+
+    void StartRoutingNotifierL();
+    void CancelRoutingNotifier();
+    void StartCenRepHandlerL();
+    void CancelCenRepHandler();
+
+private:
+    TMSServer();
+    void ConstructL();
+    CSession2* NewSessionL(const TVersion& aVersion,
+            const RMessage2& aMessage) const;
+
+    TInt StartTMSCallServer(TMSCallProxyLocal& aHandle);
+    void GetAvailableOutputsL(const RMessage2& aMessage);
+    TInt SendMessageToCallServ(TInt func, TInt value);
+    TInt SendMessageToCallServ(TInt func, TIpcArgs args);
+
+private:
+    TInt iSession;
+    TMSServerShutDown *iShutdownTimer;
+
+    TBool iDnlinkSession;
+    TBool iUplinkSession;
+
+    mutable RPointerArray<CStartAndMonitorTMSCallThread> iTMSCallServList;
+    GlobalEffectsSettings* iEffectSettings;
+    CTarEventHandler* iTarHandler;
+    CSPAudioHandler* iAudioCenRepHandler;
+    TMSAudioOutput iCurrentRouting;
+
+    RArray<TFourCC> iDnlCodecs;
+    RArray<TFourCC> iUplCodecs;
+    };
+
+// -----------------------------------------------------------------------------
+// CStartAndMonitorTMSCallThread class
+// -----------------------------------------------------------------------------
+//
+class TMSCallProxyLocal : public RSessionBase
+    {
+public:
+    TInt Open(RServer2& aTMSCallServerHandle);
+    TInt SendToCallServer(TInt aFunc, TUint value);
+    TInt SendToCallServer(TInt aFunc, TIpcArgs args);
+    TInt ReceiveFromCallServer(TInt aFunc, TUint& value);
+    TInt ReceiveFromCallServer(TInt aFunc, TIpcArgs args);
+    };
+
+// -----------------------------------------------------------------------------
+// CStartAndMonitorTMSCallThread class
+// -----------------------------------------------------------------------------
+//
+class CStartAndMonitorTMSCallThread : public CActive
+    {
+public:
+    static CStartAndMonitorTMSCallThread* NewL(TMSServer* aServer);
+    ~CStartAndMonitorTMSCallThread();
+    TInt StartTMSCallServer(TMSCallProxyLocal& aHandle);
+
+private:
+    // Construct
+    CStartAndMonitorTMSCallThread(TMSServer* aServer);
+    void ConstructL();
+
+    // From CActive
+    void RunL();
+    void DoCancel();
+
+public:
+    RServer2 iCallSrvrHndl;
+    TMSCallProxyLocal iTMSCallProxyLocal;
+
+private:
+    TMSServer* iTMSServer;
+    RThread iServerThread;
+    };
+
+} //namespace TMS
+
+#endif //__TMSSERVER_H
+
+// End of file