Esempio n. 1
0
void RealPaintWidget::setFrame( qreal f , bool played)
{
	for(int i=0; i<layers.size(); i++)
		layers[i]->setCurrentFrameForLayer((int)(f),played);

	if(currentFrame != int(f) && !played)
	{
		currentFrame = int(f);
		emit frameChanged( qreal(currentFrame) );
		selection.reset();
	}

	update();

	if(played)
	{
		this->setEnabled(false);
		emit isPlayed();
		return;
	}

	if( !layers[currentLayer]->isContainsFrame( currentFrame ))
	{
		this->setEnabled(false);
		emit isFrame(false);
	}
	else
	{
		this->setEnabled(true);
		emit isFrame(true);
	}
}
Esempio n. 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;
}