qtms/src/qtmsclientsourceimpl.cpp
changeset 40 4a1905d205a2
parent 27 cbb1bfb7ebfb
child 50 762d760dcfdf
equal deleted inserted replaced
39:1d92fd018dd4 40:4a1905d205a2
    14  * Description: QT Bindings for TMS
    14  * Description: QT Bindings for TMS
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <qtms.h>
    18 #include <qtms.h>
       
    19 #include <qtmsbuffer.h>
    19 #include <tmsbuffer.h>
    20 #include <tmsbuffer.h>
    20 #include <tmsclientsource.h>
    21 #include <tmsclientsource.h>
    21 #include "qtmsclientsourceimpl.h"
    22 #include "qtmsclientsourceimpl.h"
    22 
    23 
    23 using namespace QTMS;
    24 using namespace QTMS;
    30 QTMSClientSourceImpl::~QTMSClientSourceImpl()
    31 QTMSClientSourceImpl::~QTMSClientSourceImpl()
    31     {
    32     {
    32     RemoveObserver(*this);
    33     RemoveObserver(*this);
    33     }
    34     }
    34 
    35 
    35 gint QTMSClientSourceImpl::Create(QTMSSource*& qsource,
    36 gint QTMSClientSourceImpl::Create(QTMSSource*& qsource, TMSSource*& tmssource)
    36         TMS::TMSSource*& tmssource)
       
    37     {
    37     {
    38     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    38     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    39     QTMSClientSourceImpl* self = new QTMSClientSourceImpl();
    39     QTMSClientSourceImpl* self = new QTMSClientSourceImpl();
    40     if (self)
    40     if (self)
    41         {
    41         {
    68                 user_data);
    68                 user_data);
    69         }
    69         }
    70     return ret;
    70     return ret;
    71     }
    71     }
    72 
    72 
    73 gint QTMSClientSourceImpl::RemoveObserver(TMS::TMSClientSourceObserver& obsrvr)
    73 gint QTMSClientSourceImpl::RemoveObserver(
       
    74         TMS::TMSClientSourceObserver& obsrvr)
    74     {
    75     {
    75     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    76     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    76     if (iSource)
    77     if (iSource)
    77         {
    78         {
    78         ret = static_cast<TMSClientSource*> (iSource)->RemoveObserver(obsrvr);
    79         ret = static_cast<TMSClientSource*> (iSource)->RemoveObserver(obsrvr);
    92     return ret;
    93     return ret;
    93     }
    94     }
    94 
    95 
    95 void QTMSClientSourceImpl::FillBuffer(TMS::TMSBuffer& buffer)
    96 void QTMSClientSourceImpl::FillBuffer(TMS::TMSBuffer& buffer)
    96     {
    97     {
    97     emit QTMS::QTMSClientSource::FillBuffer(buffer);
    98     emit QTMSClientSource::FillBuffer(reinterpret_cast<QTMSBuffer&> (buffer));
    98     }
    99     }
    99 
   100 
   100 void QTMSClientSourceImpl::BufferProcessed(const TMS::TMSBuffer* buffer,
   101 void QTMSClientSourceImpl::BufferProcessed(const TMS::TMSBuffer* buffer,
   101         gint reason)
   102         gint reason)
   102     {
   103     {
   103     emit QTMS::QTMSClientSource::BufferProcessed(buffer, reason);
   104     TMSBuffer* buf(const_cast<TMSBuffer*> (buffer));
       
   105     emit QTMSClientSource::BufferProcessed(
       
   106             reinterpret_cast<QTMSBuffer*> (buf), reason);
   104     }
   107     }
   105 
   108 
   106 // End of file
   109 // End of file