qtms/src/qtmsclientsource.cpp
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 #include <tmsclientsource.h>
       
    19 #include <tmsbuffer.h>
       
    20 #include <qtmsclientsource.h>
       
    21 
       
    22 using namespace QTMS;
       
    23 using namespace TMS;
       
    24 
       
    25 QTMSClientSource::QTMSClientSource() :
       
    26     iSource(NULL)
       
    27 {
       
    28 }
       
    29 
       
    30 QTMSClientSource::~QTMSClientSource()
       
    31 {
       
    32     delete iSource;
       
    33 }
       
    34 
       
    35 gint QTMSClientSource::SetEnqueueMode(const gboolean enable)
       
    36 {
       
    37     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    38     if (iSource) {
       
    39         status = static_cast<TMSClientSource*> (iSource)->SetEnqueueMode(enable);
       
    40     }
       
    41     return status;
       
    42 }
       
    43 
       
    44 gint QTMSClientSource::GetEnqueueMode(gboolean& enable)
       
    45 {
       
    46     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    47     if (iSource) {
       
    48         status = static_cast<TMSClientSource*> (iSource)->GetEnqueueMode(enable);
       
    49     }
       
    50     return status;
       
    51 }
       
    52 
       
    53 gint QTMSClientSource::Flush()
       
    54 {
       
    55     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    56     if (iSource) {
       
    57         status = static_cast<TMSClientSource*> (iSource)->Flush();
       
    58     }
       
    59     return status;
       
    60 }
       
    61 
       
    62 gint QTMSClientSource::GetType(QTMSSourceType& sourcetype)
       
    63 {
       
    64     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    65     if (iSource) {
       
    66         status = static_cast<TMSClientSource*> (iSource)->GetType(sourcetype);
       
    67     }
       
    68     return status;
       
    69 }
       
    70 
       
    71 gint QTMSClientSource::BufferFilled(QTMSBuffer& buffer)
       
    72 {
       
    73     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    74     if (iSource) {
       
    75         TMSBuffer& buf(reinterpret_cast<TMSBuffer&> (buffer));
       
    76         status = static_cast<TMSClientSource*> (iSource)->BufferFilled(buf);
       
    77     }
       
    78     return status;
       
    79 }
       
    80 
       
    81 // Push mode
       
    82 gint QTMSClientSource::ProcessBuffer(QTMSBuffer* buffer)
       
    83 {
       
    84     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
       
    85     if (iSource) {
       
    86         TMSBuffer* buf(reinterpret_cast<TMSBuffer*> (buffer));
       
    87         status = static_cast<TMSClientSource*> (iSource)->ProcessBuffer(buf);
       
    88     }
       
    89     return status;
       
    90 }
       
    91 
       
    92 // End of file