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

bool aKode::Player::open ( const char *  sinkname  ) 

Opens a player that outputs to the sink sinkname (the "auto"-sink is recommended). Returns false if the device cannot be opened.

State: Closed -> Open

Definition at line 220 of file player.cpp.

References close(), and state().

                                      {
    if (state() != Closed)
        close();

    assert(state() == Closed);

    d->sink_handler.load(sinkname);
    if (!d->sink_handler.isLoaded()) {
        AKODE_DEBUG("Could not load " << sinkname << "-sink");
        return false;
    }
    d->sink = d->sink_handler.openSink();
    if (!d->sink) {
        AKODE_DEBUG("Could not create " << sinkname << "-sink");
        return false;
    }
    if (!d->sink->open()) {
        AKODE_DEBUG("Could not open " << sinkname << "-sink");
        delete d->sink;
        d->sink = 0;
        return false;
    }
    setState(Open);
    return true;
}


Generated by  Doxygen 1.6.0   Back to index