mmserv/tms/tmsserver/inc/tmsserver.h
changeset 0 71ca22bcf22a
child 3 4f62049db6ac
child 12 5a06f39ad45b
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef __TMSSERVER_H
       
    19 #define __TMSSERVER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <mmcccodecinformation.h>
       
    23 #include <tms.h>
       
    24 #include "tmsshared.h"
       
    25 #include "tmsclientserver.h"
       
    26 
       
    27 namespace TMS {
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class TMSServerShutDown;
       
    31 class CStartAndMonitorTMSCallThread;
       
    32 class TMSCallProxyLocal;
       
    33 class GlobalEffectsSettings;
       
    34 class CTarEventHandler;
       
    35 class CSPCenRepListener;
       
    36 class CSPAudioHandler;
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // TMSServer class
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 class TMSServer : public CServer2
       
    43     {
       
    44 public:
       
    45     static TMSServer* NewL();
       
    46     ~TMSServer();
       
    47 
       
    48     void AddSession();
       
    49     void DropSession();
       
    50     TInt SessionCount();
       
    51 
       
    52     void SetDnLinkSession(TBool aSession);
       
    53     void SetUpLinkSession(TBool aSession);
       
    54 
       
    55     TBool HasDnLinkSession() const;
       
    56     TBool HasUpLinkSession() const;
       
    57 
       
    58     void GetNewTMSCallSessionHandleL(RHandleBase& aHandle);
       
    59     TInt SetOutput(CSession2* sid, TInt output);
       
    60     TInt GetOutput(const RMessage2& aMessage);
       
    61     TInt GetPreviousOutput(const RMessage2& aMessage);
       
    62     TInt GetAvailableOutputs(const RMessage2& aMessage);
       
    63 
       
    64     TInt GetMaxLevel(const RMessage2& aMessage);
       
    65     TInt GetLevel(const RMessage2& aMessage);
       
    66     TInt SetLevel(CSession2* sid, TBool tmsclient, TInt level);
       
    67 
       
    68     TInt GetMaxGain(const RMessage2& aMessage);
       
    69     TInt GetGain(const RMessage2& aMessage);
       
    70     TInt SetGain(CSession2* sid, TInt level);
       
    71     TInt GetSupportedCodecs(const TMSStreamType strmType,
       
    72             RArray<TFourCC>*& aCodecs);
       
    73 
       
    74     TInt NotifyTarClients(TRoutingMsgBufPckg routingpckg);
       
    75 
       
    76     void StartRoutingNotifierL();
       
    77     void CancelRoutingNotifier();
       
    78     void StartCenRepHandlerL();
       
    79     void CancelCenRepHandler();
       
    80 
       
    81 private:
       
    82     TMSServer();
       
    83     void ConstructL();
       
    84     CSession2* NewSessionL(const TVersion& aVersion,
       
    85             const RMessage2& aMessage) const;
       
    86 
       
    87     TInt StartTMSCallServer(TMSCallProxyLocal& aHandle);
       
    88     void GetAvailableOutputsL(const RMessage2& aMessage);
       
    89     TInt SendMessageToCallServ(TInt func, TInt value);
       
    90     TInt SendMessageToCallServ(TInt func, TIpcArgs args);
       
    91 
       
    92 private:
       
    93     TInt iSession;
       
    94     TMSServerShutDown *iShutdownTimer;
       
    95 
       
    96     TBool iDnlinkSession;
       
    97     TBool iUplinkSession;
       
    98 
       
    99     mutable RPointerArray<CStartAndMonitorTMSCallThread> iTMSCallServList;
       
   100     GlobalEffectsSettings* iEffectSettings;
       
   101     CTarEventHandler* iTarHandler;
       
   102     CSPAudioHandler* iAudioCenRepHandler;
       
   103     TMSAudioOutput iCurrentRouting;
       
   104 
       
   105     RArray<TFourCC> iDnlCodecs;
       
   106     RArray<TFourCC> iUplCodecs;
       
   107     };
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CStartAndMonitorTMSCallThread class
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 class TMSCallProxyLocal : public RSessionBase
       
   114     {
       
   115 public:
       
   116     TInt Open(RServer2& aTMSCallServerHandle);
       
   117     TInt SendToCallServer(TInt aFunc, TUint value);
       
   118     TInt SendToCallServer(TInt aFunc, TIpcArgs args);
       
   119     TInt ReceiveFromCallServer(TInt aFunc, TUint& value);
       
   120     TInt ReceiveFromCallServer(TInt aFunc, TIpcArgs args);
       
   121     };
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CStartAndMonitorTMSCallThread class
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 class CStartAndMonitorTMSCallThread : public CActive
       
   128     {
       
   129 public:
       
   130     static CStartAndMonitorTMSCallThread* NewL(TMSServer* aServer);
       
   131     ~CStartAndMonitorTMSCallThread();
       
   132     TInt StartTMSCallServer(TMSCallProxyLocal& aHandle);
       
   133 
       
   134 private:
       
   135     // Construct
       
   136     CStartAndMonitorTMSCallThread(TMSServer* aServer);
       
   137     void ConstructL();
       
   138 
       
   139     // From CActive
       
   140     void RunL();
       
   141     void DoCancel();
       
   142 
       
   143 public:
       
   144     RServer2 iCallSrvrHndl;
       
   145     TMSCallProxyLocal iTMSCallProxyLocal;
       
   146 
       
   147 private:
       
   148     TMSServer* iTMSServer;
       
   149     RThread iServerThread;
       
   150     };
       
   151 
       
   152 } //namespace TMS
       
   153 
       
   154 #endif //__TMSSERVER_H
       
   155 
       
   156 // End of file