mmserv/tms/inc/tmsproxy.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 TMS_PROXY_H
       
    19 #define TMS_PROXY_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <mmfbase.h>
       
    23 #include <mmfutilities.h> //for TFourCC
       
    24 #include <tms.h>
       
    25 #include "tmsqueuehandler.h"
       
    26 #include "tmsclientserver.h"
       
    27 
       
    28 namespace TMS {
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class TMSEffect;
       
    32 class TMSEffectObserver;
       
    33 class TMSGlobalRouting;
       
    34 class TMSGlobalRoutingObserver;
       
    35 
       
    36 // TMSProxy class
       
    37 class TMSProxy : public RSessionBase,
       
    38                  public MQueueHandlerObserver
       
    39     {
       
    40 public:
       
    41     IMPORT_C TMSProxy();
       
    42     IMPORT_C virtual ~TMSProxy();
       
    43     /**
       
    44      * Opens a connection to the server.
       
    45      * @return KErrNone if successful connection created
       
    46      */
       
    47     IMPORT_C gint Connect();
       
    48 
       
    49     /**
       
    50      * @return The server version this session can connct to
       
    51      */
       
    52     IMPORT_C TVersion Version() const;
       
    53 
       
    54     /**
       
    55      * Close the session to the server
       
    56      */
       
    57     IMPORT_C void Close();
       
    58 
       
    59     IMPORT_C gint GetTMSCallSessionHandle();
       
    60 
       
    61     IMPORT_C gint GetSupportedDecoders(RArray<TUint32>& aDecoders,
       
    62             gint& aFrameSize);
       
    63     IMPORT_C gint GetSupportedEncoders(RArray<TUint32>& aEncoders,
       
    64             gint& aFrameSize);
       
    65 
       
    66     // TMSGlobalRouting
       
    67     IMPORT_C gint SetOutput(TMSAudioOutput output);
       
    68     IMPORT_C gint GetOutput(TMSAudioOutput& output);
       
    69     IMPORT_C gint GetPreviousOutput(TMSAudioOutput& output);
       
    70     IMPORT_C gint GetAvailableOutputs(OutputVector& outputs);
       
    71 
       
    72     // TMSGlobal Volume & Gain
       
    73     IMPORT_C gint GetLevel(guint& level);
       
    74     IMPORT_C gint GetMaxLevel(guint& level);
       
    75     IMPORT_C gint SetLevel(guint level);
       
    76     IMPORT_C gint GetGain(guint& level);
       
    77     IMPORT_C gint GetMaxGain(guint& level);
       
    78     IMPORT_C gint SetGain(guint level);
       
    79 
       
    80     // Global notifiers
       
    81     IMPORT_C gint StartDTMFNotifier();
       
    82     IMPORT_C gint CancelDTMFNotifier();
       
    83     IMPORT_C gint StartGlobalEffectNotifier();
       
    84     IMPORT_C gint CancelGlobalEffectNotifier();
       
    85     IMPORT_C gint StartRoutingNotifier();
       
    86     IMPORT_C gint CancelRoutingNotifier();
       
    87 
       
    88     // Message queue
       
    89     IMPORT_C gint SetMsgQueueNotifier(TMSMsgQueueNotifierType type,
       
    90             gpointer obsrvr, gpointer parent, gint clientid);
       
    91     IMPORT_C gint RemoveMsgQueueNotifier(TMSMsgQueueNotifierType type,
       
    92             gpointer obsrvr);
       
    93 
       
    94     // From MQueueHandlerObserver
       
    95     virtual void QueueEvent(gint aEventType, gint aError, void* user_data);
       
    96 
       
    97 private:
       
    98     void PopulateArrayL(TMSClientServerRequest aRequest,
       
    99             RArray<TUint32>& aDecoders, gint aCount);
       
   100     void GetAvailableOutputsL(OutputVector& outputs);
       
   101 
       
   102     gint AddGlobalEffectObserver(TMSEffectObserver& obsrvr,
       
   103             TMSEffect& parent, gint clientid);
       
   104     gint RemoveGlobalEffectObserver(TMSEffectObserver& obsrvr);
       
   105     gint AddRoutingObserver(TMSGlobalRoutingObserver& obsrvr,
       
   106             TMSGlobalRouting& parent, gint clientid);
       
   107     gint RemoveRoutingObserver(TMSGlobalRoutingObserver& obsrvr);
       
   108 
       
   109     gint CreateQueue(const gint aNumSlots);
       
   110     void ReceiveMsgQHandlerEventsL();
       
   111 
       
   112 private:
       
   113     TRoutingMsgBufPckg ipckg;
       
   114     RPointerArray<TMSEffectObserver> iEffectsObsrvrList;
       
   115     RPointerArray<TMSEffect> iEffectsParentList;
       
   116     RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
       
   117     RPointerArray<TMSGlobalRouting> iRoutingParentList;
       
   118 
       
   119     // Message queue and the handler
       
   120     RMsgQueue<TmsMsgBuf> iMsgQueue;
       
   121     CQueueHandler* iMsgQHandler;
       
   122     };
       
   123 
       
   124 } //namespace TMS
       
   125 
       
   126 #endif // TMS_PROXY_H
       
   127 
       
   128 // End of file