mmserv/voipaudioservices/VoIPIntfc/inc/VoIPDtmfTonePlayerImpl.h
changeset 53 eabc8c503852
parent 0 71ca22bcf22a
equal deleted inserted replaced
48:a493a607b5bf 53:eabc8c503852
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  VOIP Audio Services
    14  * Description:  VOIP Audio Services
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 
    18 #ifndef VOIPDTMFTONEPLAYERIMPL_H
    19 #ifndef __VOIPDTMFTONEPLAYERIMPL_H
    19 #define VOIPDTMFTONEPLAYERIMPL_H
    20 #define __VOIPDTMFTONEPLAYERIMPL_H
       
    21 
    20 
    22 // INCLUDES
    21 // INCLUDES
    23 #include <voipdtmftoneplayer.h>
    22 #include <voipdtmftoneplayer.h>
    24 #include "VoIPQueueHandler.h"
    23 #include "VoIPQueueHandler.h"
    25 
    24 
    29 class CVoIPAudioUplinkStream;
    28 class CVoIPAudioUplinkStream;
    30 class CVoIPAudioDownlinkStream;
    29 class CVoIPAudioDownlinkStream;
    31 class CVoIPDataBuffer;
    30 class CVoIPDataBuffer;
    32 class RVoIPAudioSession;
    31 class RVoIPAudioSession;
    33 
    32 
    34 
       
    35 /**
    33 /**
    36  *  CDTMFTonePlayerImpl class
    34  *  CDTMFTonePlayerImpl class
    37  *
    35  *
    38  *  DTMF Tone Player class
    36  *  DTMF Tone Player class
    39  *
    37  *
    40  *  @lib VoIPAudioIntfc.dll
    38  *  @lib VoIPAudioIntfc.dll
    41  *  @since S60 v5.0
       
    42  */
    39  */
    43 NONSHARABLE_CLASS(CDTMFTonePlayerImpl) : public CBase,
    40 NONSHARABLE_CLASS(CDTMFTonePlayerImpl) : public CBase,
    44                                          public CDTMFTonePlayer,
    41         public CDTMFTonePlayer,
    45                                          public MQueueHandlerObserver
    42         public MQueueHandlerObserver
    46     {
    43     {
    47     enum TStreamType
    44     enum TStreamType
    48         {
    45         {
    49         EDownlink,
    46         EDownlink,
    50         EUplink
    47         EUplink
    53 public:
    50 public:
    54 
    51 
    55     /**
    52     /**
    56      * 2-phase constructor
    53      * 2-phase constructor
    57      *
    54      *
    58      * @since S60 v5.0
    55      *
    59      * @param none
    56      * @param none
    60      * @return CDTMFTonePlayerImpl* -
    57      * @return CDTMFTonePlayerImpl* -
    61      */
    58      */
    62     static CDTMFTonePlayerImpl* NewL();
    59     static CDTMFTonePlayerImpl* NewL();
    63 
    60 
    64     /**
    61     /**
    65      * Destructor
    62      * Destructor
    66      *
    63      *
    67      * @since S60 v5.0
    64      *
    68      * @param none
    65      * @param none
    69      * @return none
    66      * @return none
    70      */
    67      */
    71     virtual ~CDTMFTonePlayerImpl();
    68     virtual ~CDTMFTonePlayerImpl();
    72 
    69 
    73     /**
    70     /**
    74      * ?description
    71      * ?description
    75      *
    72      *
    76      * @since S60 v5.0
    73      *
    77      * @param none
    74      * @param none
    78      * @return TInt
    75      * @return TInt
    79      */
    76      */
    80     TInt Open(MDTMFToneObserver& aObserver);
    77     TInt Open(MDTMFToneObserver& aObserver);
    81 
    78 
    82     /**
    79     /**
    83      * ?description
    80      * ?description
    84      *
    81      *
    85      * @since S60 v5.0
    82      *
    86      * @param TPtr -
    83      * @param TPtr -
    87      * @return TInt -
    84      * @return TInt -
    88      */
    85      */
    89     TInt Play(const TPtr aTones);
    86     TInt Play(const TPtr aTones);
    90 
    87 
    91     /**
    88     /**
    92      * ?description
    89      * ?description
    93      *
    90      *
    94      * @since S60 v5.0
    91      *
    95      * @param none
    92      * @param none
    96      * @return TInt
    93      * @return TInt
    97      */
    94      */
    98     TInt Stop();
    95     TInt Stop();
    99 
    96 
   100     /**
    97     /**
   101      * ?description
    98      * ?description
   102      *
    99      *
   103      * @since S60 v5.0
   100      *
   104      * @param none
   101      * @param none
   105      * @return void
   102      * @return void
   106      */
   103      */
   107     void Close();
   104     void Close();
   108 
   105 
   109     /**
   106     /**
   110      * ?description
   107      * ?description
   111      *
   108      *
   112      * @since S60 v5.0
   109      *
   113      * @param CVoIPAudioUplinkStream& -
   110      * @param CVoIPAudioUplinkStream& -
   114      * @return TInt
   111      * @return TInt
   115      */
   112      */
   116     TInt AddVoIPAudioUplinkStream(CVoIPAudioUplinkStream& aStream,
   113     TInt AddVoIPAudioUplinkStream(CVoIPAudioUplinkStream& aStream,
   117                                   RVoIPAudioSession* aSession);
   114             RVoIPAudioSession* aSession);
   118 
   115 
   119     /**
   116     /**
   120      * ?description
   117      * ?description
   121      *
   118      *
   122      * @since S60 v5.0
   119      *
   123      * @param CVoIPAudioUplinkStream&
   120      * @param CVoIPAudioUplinkStream&
   124      * @return TInt
   121      * @return TInt
   125      */
   122      */
   126     TInt RemoveVoIPAudioUplinkStream(CVoIPAudioUplinkStream& aStream);
   123     TInt RemoveVoIPAudioUplinkStream(CVoIPAudioUplinkStream& aStream);
   127 
   124 
   128     /**
   125     /**
   129      * ?description
   126      * ?description
   130      *
   127      *
   131      * @since S60 v5.0
   128      *
   132      * @param CVoIPAudioDownlinkStream& -
   129      * @param CVoIPAudioDownlinkStream& -
   133      * @return TInt
   130      * @return TInt
   134      */
   131      */
   135     TInt AddVoIPAudioDownlinkStream(CVoIPAudioDownlinkStream& aStream,
   132     TInt AddVoIPAudioDownlinkStream(CVoIPAudioDownlinkStream& aStream,
   136                                     RVoIPAudioSession* aSession);
   133             RVoIPAudioSession* aSession);
   137 
   134 
   138     /**
   135     /**
   139      * ?description
   136      * ?description
   140      *
   137      *
   141      * @since S60 v5.0
   138      *
   142      * @param CVoIPAudioDownlinkStream& -
   139      * @param CVoIPAudioDownlinkStream& -
   143      * @return TInt
   140      * @return TInt
   144      */
   141      */
   145     TInt RemoveVoIPAudioDownlinkStream(CVoIPAudioDownlinkStream& aStream);
   142     TInt RemoveVoIPAudioDownlinkStream(CVoIPAudioDownlinkStream& aStream);
   146 
   143 
   147 // From MQueueHandlerObserver
   144     // From MQueueHandlerObserver
   148 
   145 
   149     /**
   146     /**
   150      * ?description
   147      * ?description
   151      *
   148      *
   152      * @since S60 v5.0
   149      *
   153      * @param TPtr8
   150      * @param TPtr8
   154      * @return void
   151      * @return void
   155      */
   152      */
   156     virtual void FillBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   153     virtual void FillBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   157 
   154 
   158     /**
   155     /**
   159      * ?description
   156      * ?description
   160      *
   157      *
   161      * @since S60 v5.0
   158      *
   162      * @param TPtr8
   159      * @param TPtr8
   163      * @return void
   160      * @return void
   164      */
   161      */
   165     virtual void EmptyBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   162     virtual void EmptyBuffer(CVoIPDataBuffer* /*aBuffer*/) {}
   166 
   163 
   167     /**
   164     /**
   168      * ?description
   165      * ?description
   169      *
   166      *
   170      * @since S60 v5.0
   167      *
   171      * @param TInt
   168      * @param TInt
   172      * @param TInt
   169      * @param TInt
   173      * @return void
   170      * @return void
   174      */
   171      */
   175     virtual void Event(TInt aEventType, TInt aError);
   172     virtual void Event(TInt aEventType, TInt aError);
   177 private:
   174 private:
   178 
   175 
   179     /**
   176     /**
   180      * Constructor
   177      * Constructor
   181      *
   178      *
   182      * @since S60 v5.0
   179      *
   183      * @param none
   180      * @param none
   184      * @return none
   181      * @return none
   185      */
   182      */
   186     CDTMFTonePlayerImpl();
   183     CDTMFTonePlayerImpl();
   187 
   184 
   188     /**
   185     /**
   189      * Symbian constructor
   186      * Symbian constructor
   190      *
   187      *
   191      * @since S60 v5.0
   188      *
   192      * @param none
   189      * @param none
   193      * @return void
   190      * @return void
   194      */
   191      */
   195     void ConstructL();
   192     void ConstructL();
   196 
   193 
   197     /**
   194     /**
   198      * @since S60 v5.0
   195      *
   199      * @param none
   196      * @param none
   200      * @return void
   197      * @return void
   201      */
   198      */
   202     void StartMsgQueueL();
   199     void StartMsgQueueL();
   203 
   200 
   204     /**
   201     /**
   205      * @since S60 v5.0
   202      *
   206      * @param none
   203      * @param none
   207      * @return void
   204      * @return void
   208      */
   205      */
   209     void ReceiveMsgQComHandlerEventsL();
   206     void ReceiveMsgQComHandlerEventsL();
   210 
   207 
   211 private:
   208 private:
   212 // Communication queue
   209     // Communication queue
   213     RMsgQueue<TVoIPMsgBuf> iMsgComQueue;
   210     RMsgQueue<TVoIPMsgBuf> iMsgComQueue;
   214     CQueueHandler*         iMsgQComHandler;
   211     CQueueHandler* iMsgQComHandler;
   215 
   212 
   216     MDTMFToneObserver*     iObserver;
   213     MDTMFToneObserver* iObserver;
   217     RVoIPAudioSession*     iVoIPAudioSession;
   214     RVoIPAudioSession* iVoIPAudioSession;
   218 
   215 
   219     TStreamType            iStreamType;
   216     TStreamType iStreamType;
   220 
       
   221     };
   217     };
   222 
   218 
   223 #endif //__VOIPDTMFTONEPLAYERIMPL_H
   219 #endif //VOIPDTMFTONEPLAYERIMPL_H
   224 
       
   225 
   220 
   226 // End of file
   221 // End of file