rsked/vlcplayer.cc
/// Does a check to verify VLC  is playing (or completed
/// playing) the resource named in src.
/// Returns false if:
/// -- player is playing something else
/// -- player is in the wrong state (e.g. stopped, paused)
/// -- cannot communicate successfully with VLC
///
/// It is up to the caller to rectify the problem if false is
/// returned.
///
/// * May THROW a Player_exception if there is something basically
///   wrong with the player.  Player should have marked itself unusable.
///
Does a check to verify VLC  is playing (or completed
playing) the resource named in src.
Returns false if:
player is playing something else
player is in the wrong state
cannot communicate successfully with VLC

It is up to the caller to rectify the problem if false is
returned.

May THROW a Player_exception if there is something basically
wrong with the player.  Player should have marked itself unusable.
Does a check to verify VLC is playing ( or completed playing ) the resource named in src . Returns false if : player is playing something else player is in the wrong state cannot communicate successfully with VLC It is up to the caller to rectify the problem if false is returned . May THROW a Player_exception if there is something basically wrong with the player . Player should have marked itself unusable .
bool Vlc_player::currently_playing( spSource src )
{
    if (!src or !m_src) { return false; }
    assure_running();     
    if (m_src->name() != src->name()) { 
        return false;
    }
    if (not m_usable) return false;
    switch (m_state) {
    case PlayerState::Stopped:
        if (src->repeatp()) {
            LOG_WARNING(Lgr) << m_name
                             << " observed stopped but should be repeating";
            return false;
        }
        break;
    case PlayerState::Playing:
        check_not_stalled();
        return true;
        break;
    case PlayerState::Paused:
        if (PlayerState::Playing == m_state) {
            resume();           
            return true;        
        }
        break;
    default:
        LOG_WARNING(Lgr) << "Vlc player in an unknown state";
        return false;
    }
    if ((src->medium() == Medium::playlist) or
        (src->medium() == Medium::directory) or
        (src->medium() == Medium::radio)) {
        return true;
    }
    return verify_playing_uri( src->resource() );
}
bool Vlc_player :: currently_playing ( spSource src ) { if ( ! src or ! m_src ) { return false ; } assure_running ( ) ; if ( m_src -> name ( ) != src -> name ( ) ) { return false ; } if ( not m_usable ) return false ; switch ( m_state ) { case PlayerState :: Stopped : if ( src -> repeatp ( ) ) { LOG_WARNING ( Lgr ) << m_name << " " ; return false ; } break ; case PlayerState :: Playing : check_not_stalled ( ) ; return true ; break ; case PlayerState :: Paused : if ( PlayerState :: Playing == m_state ) { resume ( ) ; return true ; } break ; default : LOG_WARNING ( Lgr ) << " " ; return false ; } if ( ( src -> medium ( ) == Medium :: playlist ) or ( src -> medium ( ) == Medium :: directory ) or ( src -> medium ( ) == Medium :: radio ) ) { return true ; } return verify_playing_uri ( src -> resource ( ) ) ; }
Does a check to verify VLC  is playing (or completed
playing) the resource named in src.
Does a check to verify VLC is playing ( or completed playing ) the resource named in src .
// This sets m_state and m_obsuri // had been on a different source // remote elapsed_secs() and obs_state() have been updated. // Verify that state is play, or pause, or stopped with no-repeat // If playing, check whether elapsed time is different than last check; // and if the same, increment the stall counter, up to STALLS_MAX. // If it should be playing but is paused, resume it (generically) // there will be a second or so of latency // so assume its okay for this check // Includes Broken state // If we get here, it may be playing, rightly paused, or stopped // (perhaps because it completed playing in a non-repeat mode). // Verify the resource, if possible.  Note: it's not possible to // easily check that a particular playlist or directory is playing, and // radio should never appear!