MythTV  0.26-pre
encoder.h
Go to the documentation of this file.
00001 
00002 // Program Name: encoder.h
00003 // Created     : Jan. 15, 2010
00004 //
00005 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
00006 //                                          
00007 // Licensed under the GPL v2 or later, see COPYING for details
00008 //
00010 
00011 #ifndef ENCODER_H_
00012 #define ENCODER_H_
00013 
00014 #include <QString>
00015 
00016 #include "serviceexp.h" 
00017 #include "datacontracthelper.h"
00018 
00019 #include "programAndChannel.h"
00020 
00021 namespace DTC
00022 {
00023 
00025 
00026 class SERVICE_PUBLIC Encoder : public QObject
00027 {
00028     Q_OBJECT
00029     Q_CLASSINFO( "version"    , "1.0" );
00030 
00031     Q_PROPERTY( int             Id              READ Id               WRITE setId             )
00032     Q_PROPERTY( QString         HostName        READ HostName         WRITE setHostName       )
00033     Q_PROPERTY( bool            Local           READ Local            WRITE setLocal          )
00034     Q_PROPERTY( bool            Connected       READ Connected        WRITE setConnected      )
00035     Q_PROPERTY( int             State           READ State            WRITE setState          )
00036     Q_PROPERTY( int             SleepStatus     READ SleepStatus      WRITE setSleepStatus    )
00037     Q_PROPERTY( bool            LowOnFreeSpace  READ LowOnFreeSpace   WRITE setLowOnFreeSpace )
00038 
00039     Q_PROPERTY( QObject*        Recording       READ Recording  )
00040 
00041     PROPERTYIMP    ( int        , Id             )
00042     PROPERTYIMP    ( QString    , HostName       )
00043     PROPERTYIMP    ( bool       , Local          )
00044     PROPERTYIMP    ( bool       , Connected      )
00045     PROPERTYIMP    ( int        , State          )
00046     PROPERTYIMP    ( int        , SleepStatus    )
00047     PROPERTYIMP    ( bool       , LowOnFreeSpace )
00048 
00049     PROPERTYIMP_PTR( Program    , Recording      )
00050 
00051     public:
00052 
00053         static void InitializeCustomTypes()
00054         {
00055             qRegisterMetaType< Encoder  >();
00056             qRegisterMetaType< Encoder* >();
00057 
00058             Program::InitializeCustomTypes();
00059         }
00060 
00061     public:
00062 
00063         Encoder(QObject *parent = 0) 
00064             : QObject         ( parent ),
00065               m_Id            ( 0      ),
00066               m_Local         ( true   ),
00067               m_Connected     ( false  ),
00068               m_State         ( 0      ),
00069               m_SleepStatus   ( 0      ),
00070               m_LowOnFreeSpace( false  ),
00071               m_Recording     ( NULL   )  
00072         { 
00073         }
00074         
00075         Encoder( const Encoder &src )
00076         {
00077             Copy( src );
00078         }
00079 
00080         void Copy( const Encoder &src )
00081         {
00082             m_Id            = src.m_Id            ;
00083             m_HostName      = src.m_HostName      ;
00084             m_Local         = src.m_Local         ;
00085             m_Connected     = src.m_Connected     ;
00086             m_State         = src.m_State         ;
00087             m_SleepStatus   = src.m_SleepStatus   ;
00088             m_LowOnFreeSpace= src.m_LowOnFreeSpace;
00089             m_Recording     = NULL                ;
00090         
00091             if ( src.m_Recording != NULL)
00092                 Recording()->Copy( *(src.m_Recording) );
00093 
00094         }
00095 };
00096 
00097 } // namespace DTC
00098 
00099 Q_DECLARE_METATYPE( DTC::Encoder  )
00100 Q_DECLARE_METATYPE( DTC::Encoder* )
00101 
00102 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends