Exemple #1
0
bool Player::SetToDevice(DW device) const
{
    if (stream != NULL)
        return BASS_ChannelSetDevice(stream, device);
    else
        return false;
}
Exemple #2
0
bool BassPlayer::setOutputDevice(const QString & device_name) {
    int curr_device = BASS_GetDevice();

    int new_device = outputDeviceList().value(device_name, default_device).toInt();

    if (curr_device == new_device)
        return true;

    bool res = false;

    if ((res = initOutputDevice(new_device))) {
        //INFO: we cant close here old device // we must close it later
        res = BASS_SetDevice(new_device);
        if (isPlayed() || isPaused())
            res &= BASS_ChannelSetDevice(chan, new_device);
    }

    return res;
}