qtms/inc/tmsutility.h
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
child 59 666f9a5a90a9
equal deleted inserted replaced
55:6c1dfe4da5dd 56:63223d4fd956
     1 /*
       
     2  * Copyright (c) 2010 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: QT Bindings for TMS
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef __TMSUTILITY_H__
       
    19 #define __TMSUTILITY_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <tms.h>
       
    23 #include <TelephonyAudioRouting.h>
       
    24 #ifdef _DEBUG
       
    25 #include <e32debug.h>
       
    26 #endif
       
    27 
       
    28 namespace TMS {
       
    29 
       
    30 // DEBUG TRACE DEFINITIONS
       
    31 #ifdef _DEBUG
       
    32 #define TRACE_PRN_FN_ENT        RDebug::Printf("%s>ENTER", __PRETTY_FUNCTION__)
       
    33 #define TRACE_PRN_FN_EXT        RDebug::Printf("%s>EXIT", __PRETTY_FUNCTION__)
       
    34 #define TRACE_PRN_IF_ERR(err) if (err != KErrNone) RDebug::Printf( "%s>BREAK[%d]", __PRETTY_FUNCTION__, err )
       
    35 
       
    36 #define TRACE_PRN_0(str)              RDebug::Print(str, this)
       
    37 #define TRACE_PRN_1(str, val1)        RDebug::Print(str, this, val1)
       
    38 #define TRACE_PRN_2(str, val1, val2)  RDebug::Print(str, this, val1, val2)
       
    39 
       
    40 #define TRACE_PRN_N(str)              RDebug::Print(str)
       
    41 #define TRACE_PRN_N1(str, val1)       RDebug::Print(str, val1)
       
    42 #define TRACE_PRN_N2(str, val1, val2) RDebug::Print(str, val1, val2)
       
    43 #else
       
    44 #define TRACE_PRN_FN_ENT
       
    45 #define TRACE_PRN_FN_EXT
       
    46 #define TRACE_PRN_IF_ERR(err)
       
    47 #define TRACE_PRN_0(str)
       
    48 #define TRACE_PRN_1(str, val1)
       
    49 #define TRACE_PRN_2(str, val1, val2)
       
    50 #define TRACE_PRN_N(str)
       
    51 #define TRACE_PRN_N1(str, val1)
       
    52 #define TRACE_PRN_N2(str, val1, val2)
       
    53 #endif //_DEBUG
       
    54 
       
    55 
       
    56 // MACRO DEFINITIONS
       
    57 #define RET_ERR_IF_ERR(err) if ( err != 0) return err;
       
    58 #define RET_REASON_IF_ERR(s) if(s!=0) return s
       
    59 
       
    60 #define TMSRESULT(result) TMSUtility::TMSResult(result)
       
    61 #define TOTMSOUTPUT(output) TMSUtility::ToTMSOutput(output)
       
    62 #define TOTAROUTPUT(output) TMSUtility::ToTAROutput(output)
       
    63 #define TOFOURCC(format) TMSUtility::ToFourCC(format)
       
    64 #define TOTMSFORMAT(fourcc) TMSUtility::FourCCToTMSFormat(fourcc)
       
    65 
       
    66 _LIT(KQTMSPanic, "QTMS Panic!" );
       
    67 #define PANIC(reason) User::Panic(KQTMSPanic, reason)
       
    68 
       
    69 // TMSUtility class
       
    70 class TMSUtility
       
    71     {
       
    72 public:
       
    73     IMPORT_C static gint TMSResult(const gint error);
       
    74     IMPORT_C static gint EtelToTMSResult(const gint error);
       
    75     IMPORT_C static TMSAudioOutput ToTMSOutput(
       
    76             CTelephonyAudioRouting::TAudioOutput taroutput);
       
    77     IMPORT_C static CTelephonyAudioRouting::TAudioOutput ToTAROutput(
       
    78             TMSAudioOutput output);
       
    79     IMPORT_C static TUint32 ToFourCC(TMSFormatType frmtType);
       
    80     IMPORT_C static TMSFormatType FourCCToTMSFormat(TUint32 fourcc);
       
    81     };
       
    82 
       
    83 } //namespace TMS
       
    84 
       
    85 #endif //__TMSUTILITY_H__
       
    86