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
35 lines
1.2 KiB
#include "zlMediaConnector.h"
|
|
|
|
#define LOG( X ) m_pLog->Log( "ZLMEDIA_Ñ", this, X )
|
|
#define LOG_ERROR( X ) m_pLog->Log( "ZLMEDIA_Ñ", this, _LOG_ERROR, X )
|
|
|
|
ZL_MEDIA_Connector::ZL_MEDIA_Connector( config_setting_t * Settings ){
|
|
//m_bIsConnected = false;
|
|
m_pLog = basicLogCollection::getInstance();
|
|
m_pSettings = basicSettingsProvider::getInstance()->getSubNode( Settings, "ZLMEDIA_SERVER" );
|
|
if( m_pSettings != NULL ) {
|
|
config_setting_t * tSetting = NULL;
|
|
tSetting = config_setting_get_member( m_pSettings, "SERVER_HOST" );
|
|
if( tSetting == NULL ){
|
|
tSetting = config_setting_add(m_pSettings, "SERVER_HOST", CONFIG_TYPE_STRING );
|
|
config_setting_set_string( tSetting, "localhost" );
|
|
basicSettingsProvider::getInstance()->compromise();
|
|
LOG("No MEDIA Host Setting! Using default!");
|
|
};
|
|
m_pProtocol = new protocolZLMEDIA( m_pSettings );
|
|
};
|
|
};
|
|
|
|
ZL_MEDIA_Connector::~ZL_MEDIA_Connector(){
|
|
if(m_pProtocol!=NULL) delete(m_pProtocol);
|
|
};
|
|
|
|
bool ZL_MEDIA_Connector::isConnected( void ){
|
|
if(m_pProtocol == NULL) return false;
|
|
return m_pProtocol->isOnline();
|
|
};
|
|
|
|
#undef LOG
|
|
#undef LOG_ERROR
|
|
|
|
|