rsked/source.cc
/// Load Source from JSON value.  May throw a Schedule_error.
/// This checks syntax, but does not do resource validation.
/// *  May throw Schedule_error
///
Load Source from JSON value.  May throw a Schedule_error.
This checks syntax, but does not do resource validation.
Load Source from JSON value . May throw a Schedule_error . This checks syntax but does not do resource validation .
void Source::load( const Json::Value &slot )
{
    m_repeatp = get_bool_option( slot["repeat"], false );
    m_dynamic = get_bool_option( slot["dynamic"], false );
    m_announcementp = get_bool_option( slot["announcement"], false );
    extract_required_props(slot);
     A local recording that does *not* repeat might be silent for a
     while if play completes before the next program is scheduled to
     start. We force the m_quiet_okay flag to true in this case.
    m_quiet_okay = get_bool_option( slot["quiet"], false );
    if (((Medium::file == m_medium) or (Medium::directory == m_medium)
         or (Medium::playlist == m_medium))
        and not m_repeatp) {
        m_quiet_okay = true;
    }
     alternate - we cannot check these until all sources are loaded
     The implicit default alternate source is OFF.
    const Json::Value &astr = slot["alternate"];
    if (!astr.isNull()) {
        m_alternate = astr.asString();
    } else {
        m_alternate = OFF_SOURCE;
    }
     duration
    const Json::Value &durval = slot["duration"];
    if (! durval.isNull()) {
        m_duration = durval.asDouble();
    }
}
void Source :: load ( const Json :: Value & slot ) { m_repeatp = get_bool_option ( slot [ " " ] , false ) ; m_dynamic = get_bool_option ( slot [ " " ] , false ) ; m_announcementp = get_bool_option ( slot [ " " ] , false ) ; extract_required_props ( slot ) ; m_quiet_okay = get_bool_option ( slot [ " " ] , false ) ; if ( ( ( Medium :: file == m_medium ) or ( Medium :: directory == m_medium ) or ( Medium :: playlist == m_medium ) ) and not m_repeatp ) { m_quiet_okay = true ; } const Json :: Value & astr = slot [ " " ] ; if ( ! astr . isNull ( ) ) { m_alternate = astr . asString ( ) ; } else { m_alternate = OFF_SOURCE ; } const Json :: Value & durval = slot [ " " ] ; if ( ! durval . isNull ( ) ) { m_duration = durval . asDouble ( ) ; } }
Load Source from JSON value.
Load Source from JSON value .
// // A local recording that does *not* repeat might be silent for a // while if play completes before the next program is scheduled to // start. We force the m_quiet_okay flag to true in this case. // // alternate - we cannot check these until all sources are loaded // The implicit default alternate source is OFF. // duration