Logo Search packages:      
Sourcecode: akode version File versions  Download package

void aKode::Player::stop (  ) 

Stop playing and release any resources allocated while playing.

State: Playing -> Loaded Paused -> Loaded

Definition at line 501 of file player.cpp.

References resume(), and state().

Referenced by load(), and unload().

                  {
    if (state() == Closed || state() == Open) return;
    if (state() == Loaded) return;

    // Needs to set halt first to avoid the paused thread playing a soundbite
    d->halt = true;
    if (state() == Paused) resume();

    assert(state() == Playing);

    d->buffered_decoder.stop();

    if (d->running) {
        pthread_join(d->player_thread, 0);
        d->running = false;
    }

    d->buffered_decoder.closeDecoder();

    setState(Loaded);
}


Generated by  Doxygen 1.6.0   Back to index