コード例 #1
0
bool Event::LoadConfig( ConfigBase &config )
{
  config.ReadConfig( "EventID",     id );
  config.ReadConfig( "Start",       start );
  config.ReadConfig( "Duration",    duration );
  config.ReadConfig( "Name",        name );
  config.ReadConfig( "Description", description );
  config.ReadConfig( "Language",    language );
}
コード例 #2
0
ファイル: Service.cpp プロジェクト: neolynx/tvdaemon
bool Service::LoadConfig( ConfigBase &config )
{
  config.ReadConfig( "ServiceID", service_id );
  config.ReadConfig( "PID", pid );
  config.ReadConfig( "Type", (int &) type );
  std::string t;
  config.ReadConfig( "Name", t );
  SetName( t );
  config.ReadConfig( "Provider", provider );
  int channel_id;
  config.ReadConfig( "Channel", channel_id );
  if( channel_id != -1 )
  {
    channel = TVDaemon::Instance( )->GetChannel( channel_id );
    if( channel )
    {
      channel->AddService( this );
      transponder.HasChannels( true );
    }
    else
    {
      LogError( "Service '%s': channel %d not found", name.c_str( ), channel_id );
      channel_id == -1;
    }
  }

  Setting &n = config.ConfigList( "Streams" );
  for( int i = 0; i < n.getLength( ); i++ )
  {
    ConfigBase c2( n[i] );
    Stream *s = new Stream( *this );
    s->LoadConfig( c2 );
    streams[s->GetKey( )] = s;
  }

  Setting &n2 = config.ConfigList( "CA" );
  for( int i = 0; i < n2.getLength( ); i++ )
  {
    ConfigBase c3( n2[i] );
    uint16_t ca_id, ca_pid;
    c3.ReadConfig( "CA_id", ca_id );
    c3.ReadConfig( "CA_pid", ca_pid );
    SetCA(ca_id, ca_pid);
  }

  return true;
}