You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "zlMediaConnector.h"
  2. #define LOG( X ) m_pLog->Log( "ZLMEDIA_�", this, X )
  3. #define LOG_ERROR( X ) m_pLog->Log( "ZLMEDIA_�", this, _LOG_ERROR, X )
  4. ZL_MEDIA_Connector::ZL_MEDIA_Connector( config_setting_t * Settings ){
  5. //m_bIsConnected = false;
  6. m_pLog = basicLogCollection::getInstance();
  7. m_pSettings = basicSettingsProvider::getInstance()->getSubNode( Settings, "ZLMEDIA_SERVER" );
  8. if( m_pSettings != NULL ) {
  9. config_setting_t * tSetting = NULL;
  10. tSetting = config_setting_get_member( m_pSettings, "SERVER_HOST" );
  11. if( tSetting == NULL ){
  12. tSetting = config_setting_add(m_pSettings, "SERVER_HOST", CONFIG_TYPE_STRING );
  13. config_setting_set_string( tSetting, "localhost" );
  14. basicSettingsProvider::getInstance()->compromise();
  15. LOG("No MEDIA Host Setting! Using default!");
  16. };
  17. m_pProtocol = new protocolZLMEDIA( m_pSettings );
  18. };
  19. };
  20. ZL_MEDIA_Connector::~ZL_MEDIA_Connector(){
  21. if(m_pProtocol!=NULL) delete(m_pProtocol);
  22. };
  23. bool ZL_MEDIA_Connector::isConnected( void ){
  24. if(m_pProtocol == NULL) return false;
  25. return m_pProtocol->isOnline();
  26. };
  27. #undef LOG
  28. #undef LOG_ERROR