qtms/src/qtmsg711impl.cpp
changeset 51 e61a04404bdf
parent 32 edd273b3192a
equal deleted inserted replaced
44:d141fc1ad77b 51:e61a04404bdf
    21 
    21 
    22 using namespace QTMS;
    22 using namespace QTMS;
    23 using namespace TMS;
    23 using namespace TMS;
    24 
    24 
    25 QTMSG711FormatImpl::QTMSG711FormatImpl()
    25 QTMSG711FormatImpl::QTMSG711FormatImpl()
    26     {
    26 {
    27     }
    27 }
    28 
    28 
    29 QTMSG711FormatImpl::~QTMSG711FormatImpl()
    29 QTMSG711FormatImpl::~QTMSG711FormatImpl()
    30     {
    30 {
    31     }
    31 }
    32 
    32 
    33 gint QTMSG711FormatImpl::Create(QTMSFormat*& qformat,
    33 gint QTMSG711FormatImpl::Create(QTMSFormat*& qformat, TMS::TMSFormat*& tmsformat)
    34         TMS::TMSFormat*& tmsformat)
    34 {
    35     {
       
    36     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    35     gint ret(QTMS_RESULT_INSUFFICIENT_MEMORY);
    37     QTMSG711FormatImpl* self = new QTMSG711FormatImpl();
    36     QTMSG711FormatImpl* self = new QTMSG711FormatImpl();
    38     if (self)
    37     if (self) {
    39         {
       
    40         ret = self->PostConstruct();
    38         ret = self->PostConstruct();
    41         if (ret != QTMS_RESULT_SUCCESS)
    39         if (ret != QTMS_RESULT_SUCCESS) {
    42             {
       
    43             delete self;
    40             delete self;
    44             self = NULL;
    41             self = NULL;
    45             }
    42         }
    46         self->iFormat = tmsformat;
    43         self->iFormat = tmsformat;
    47         }
    44     }
    48     qformat = self;
    45     qformat = self;
    49     return ret;
    46     return ret;
    50     }
    47 }
    51 
    48 
    52 gint QTMSG711FormatImpl::PostConstruct()
    49 gint QTMSG711FormatImpl::PostConstruct()
    53     {
    50 {
    54     gint ret(QTMS_RESULT_SUCCESS);
    51     gint ret(QTMS_RESULT_SUCCESS);
    55     return ret;
    52     return ret;
    56     }
    53 }
    57 
    54 
    58 gint QTMSG711FormatImpl::GetFormat(TMS::TMSFormat*& fmt)
    55 gint QTMSG711FormatImpl::GetFormat(TMS::TMSFormat*& fmt)
    59     {
    56 {
    60     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    57     gint ret(QTMS_RESULT_UNINITIALIZED_OBJECT);
    61 
    58 
    62     if (iFormat)
    59     if (iFormat) {
    63         {
       
    64         fmt = iFormat;
    60         fmt = iFormat;
    65         ret = QTMS_RESULT_SUCCESS;
    61         ret = QTMS_RESULT_SUCCESS;
    66         }
    62     }
    67     return ret;
    63     return ret;
    68     }
    64 }
    69 
    65 
    70 gint QTMSG711FormatImpl::GetType(QTMSFormatType& fmttype)
    66 gint QTMSG711FormatImpl::GetType(QTMSFormatType& fmttype)
    71     {
    67 {
    72     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    68     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    73     if (iFormat)
    69     if (iFormat) {
    74         {
       
    75         status = iFormat->GetType(fmttype);
    70         status = iFormat->GetType(fmttype);
    76         }
    71     }
    77     return status;
    72     return status;
    78     }
    73 }
    79 
    74 
    80 // End of file
    75 // End of file