rsked/vlcplayer.cc
/// Extract configuration values.  The first call to play will
/// actually start the child.  If not enabled, the child manager
/// is not touched and the binary path is not checked.
///
/// * May throw.
///
Extract configuration values.  The first call to play will
actually start the child.  If not enabled, the child manager
is not touched and the binary path is not checked.

May throw.
Extract configuration values . The first call to play will actually start the child . If not enabled the child manager is not touched and the binary path is not checked . May throw .
void Vlc_player::initialize( Config &cfg, bool testp )
{
    m_testmode = testp;
    cfg.get_bool(m_name.c_str(),"enabled",m_enabled);
    if (not m_enabled) {
        LOG_INFO(Lgr) <<"Vlc_player '" << m_name << "' (disabled)";
    }
    m_library_path = Main::rsked->get_respathspec()->get_libpath();
    cfg.get_unsigned(m_name.c_str(),"volume",m_volume);
    if (m_volume > 100) {
        LOG_WARNING(Lgr) << "Vlc volume > 100: possible distortion";
    }
    cfg.get_bool(m_name.c_str(),"debug", m_debug);
     Optional wait_us sets the time we are willing to wait for vlc I/O
    long lwait = m_iowait_us;
    cfg.get_long(m_name.c_str(),"wait_us",lwait);
    if ((lwait > 0) and (lwait < 5'000'000)) {
        m_iowait_us = lwait;
        set_pty_timeout();
    } else {
        LOG_WARNING(Lgr) << m_name << " wait_us:=" << lwait
                         << " is implausible, using " << m_iowait_us;
    }
    m_bin_path = Default_vlc_bin;
    if (m_enabled) {
        cfg.get_pathname(m_name.c_str(),"bin_path",
                         FileCond::MustExist, m_bin_path);
        m_cm->set_binary( m_bin_path );
        m_cm->set_name( m_name );
    }
    if (m_enabled) {
        LOG_INFO(Lgr) << "Vlc_player '" << m_name << "' initialized";
    }
}
void Vlc_player :: initialize ( Config & cfg , bool testp ) { m_testmode = testp ; cfg . get_bool ( m_name . c_str ( ) , " " , m_enabled ) ; if ( not m_enabled ) { LOG_INFO ( Lgr ) << " " << m_name << " " ; } m_library_path = Main :: rsked -> get_respathspec ( ) -> get_libpath ( ) ; cfg . get_unsigned ( m_name . c_str ( ) , " " , m_volume ) ; if ( m_volume > 100 ) { LOG_WARNING ( Lgr ) << " " ; } cfg . get_bool ( m_name . c_str ( ) , " " , m_debug ) ; long lwait = m_iowait_us ; cfg . get_long ( m_name . c_str ( ) , " " , lwait ) ; if ( ( lwait > 0 ) and ( lwait < 5'000'000 ) ) { m_iowait_us = lwait ; set_pty_timeout ( ) ; } else { LOG_WARNING ( Lgr ) << m_name << " " << lwait << " " << m_iowait_us ; } m_bin_path = Default_vlc_bin ; if ( m_enabled ) { cfg . get_pathname ( m_name . c_str ( ) , " " , FileCond :: MustExist , m_bin_path ) ; m_cm -> set_binary ( m_bin_path ) ; m_cm -> set_name ( m_name ) ; } if ( m_enabled ) { LOG_INFO ( Lgr ) << " " << m_name << " " ; } }
Extract configuration values.
Extract configuration values .
// Note: next will fail if no global rsked instance exists, so you // must fake one for unit testing. // m_volume = 100;  // allow > 100% at user's risk // // Optional wait_us sets the time we are willing to wait for vlc I/O // //