示例#1
0
void QSoundManager::stopSound(int handle) {
	resetChannel(10);

	for (uint idx = 0; idx < _slots.size(); ++idx) {
		Slot &slot = _slots[idx];
		if (slot._handle == handle) {
			qsWaveMixFlushChannel(slot._channel);
			_sounds.flushChannel(slot._channel);
			resetChannel(10);
		}
	}
}
示例#2
0
void QSoundManager::stopAllChannels() {
	qsWaveMixFlushChannel(0, QMIX_OPENALL);

	for (int idx = 0; idx < 16; ++idx)
		_sounds.flushChannel(idx);
	resetChannel(10);
}
示例#3
0
bool QSoundManager::isActive(int handle) {
	resetChannel(10);

	for (uint idx = 0; idx < _slots.size(); ++idx) {
		if (_slots[idx]._handle == handle)
			return true;
	}

	return false;
}
示例#4
0
/*----------------------------------------------------------------------------------------------*/
void Commando::resetAll()
{

	resetPVT();
	resetEKF();
	resetPPS();

	command_body.reset_channel.chan = MAX_CHANNELS;
	resetChannel();

	command_body.reset_ephemeris.sv = MAX_SV;
	resetEphemeris();

	command_body.reset_almanac.sv = MAX_SV;
	resetAlmanac();

	message_body.command_ack.command_status = SUCCESS_A_ID;

}
示例#5
0
int QSoundManager::playSound(CWaveFile &waveFile, CProximity &prox) {
	int channel = -1;
	uint flags = QMIX_CLEARQUEUE;

	if (prox._priorSoundHandle >= 1) {
		// This sound should only be started after a prior one finishes,
		// so scan the slots for the specified sound
		for (uint idx = 0; idx < _slots.size(); ++idx) {
			if (_slots[idx]._handle == prox._priorSoundHandle) {
				channel = _slots[idx]._channel;
				flags = QMIX_QUEUEWAVE;
				break;
			}
		}
	}

	if (channel >= 0 || (channel = resetChannel(prox._channel)) != -1) {
		return playWave(&waveFile, channel, flags, prox);
	}

	return 0;
}
示例#6
0
void CurvesBox::slotResetChannel()
{
    resetChannel(d->channel);
    emit signalChannelReset(d->channel);
}
示例#7
0
void Channel::applyChanProps(chanProps *props,bool kickexisting) {
	if(kickexisting) {
		//delete the channel and have the modes be applied when someone joins next
		resetChannel(false,props==NULL?true:false);
		return;
	}
	if(props == NULL) {
		clearProps();
		return;
	}
	strcpy(entrymsg,props->entrymsg);
	if(strcmp(this->topic,props->topic) != 0) {
		strcpy(this->topic,props->topic);
		strcpy(this->topicsetter,"SERVER");
		this->topictime = props->setondate;
		this->createtime = props->setondate;
		sendToChan(":SERVER!SERVER@* TOPIC %s :%s",getName(),topic);
	}
	if(props->limit != 0) {
		if(props->limit != this->limit) {
			sendToChan(":SERVER!SERVER@* MODE %s +l %d",getName(),props->limit);
			this->limit = props->limit;
		}
	} else {
		if(this->limit != 0) {
			sendToChan(":SERVER!SERVER@* MODE %s -l",getName());
			this->limit = 0;
		}
	}
	if(props->chankey[0] != 0) {
		if(strcmp(props->chankey,key) != 0) {
			sendToChan(":SERVER!SERVER@* MODE %s +k %s",getName(),props->chankey);
			strcpy(key,props->chankey);
		}
	} else {
		if(this->key[0] != 0) {
			sendToChan(":SERVER!SERVER@* MODE %s -k",getName());
			key[0] = 0;
		}
	}
	#define setMode(modechar, modeval)  \
	if(strchr(props->modes,modechar) != NULL) { \
		if(modeval == 0) { \
			sendToChan(":SERVER!SERVER@* MODE %s +%c",getName(),modechar); \
			modeval = 1; \
		} \
		} else { \
		if(modeval == 1) { \
			sendToChan(":SERVER!SERVER@* MODE %s -%c",getName(),modechar); \
			modeval = 0; \
		} \
	}
	setMode('m',this->moderated)
	setMode('t',this->topic_protect)
	setMode('n',this->nooutsidemsgs)
	setMode('i',this->inviteonly)
	setMode('e',this->mode_ops_obey_channel_limit)
	#undef setMode
	if(strchr(props->modes,'u') != NULL) {
		char oldaudi = this->auditorium;
		if(oldaudi == 1) { //quiet
			sendToChan(":SERVER!SERVER@* MODE %s -q",getName());
		}
		sendToChan(":SERVER!SERVER@* MODE %s +u",getName());
		this->auditorium = 2;
		auditoriumUpdate(oldaudi);
	} else if(this->auditorium == 2) {
		sendToChan(":SERVER!SERVER@* MODE %s -u",getName());
		this->auditorium = 0;
		auditoriumUpdate(2);
	}
	if(strchr(props->modes,'q') != NULL) {
		char oldaudi = this->auditorium;
		if(oldaudi == 2) { //quiet
			sendToChan(":SERVER!SERVER@* MODE %s -u",getName());
		}
		sendToChan(":SERVER!SERVER@* MODE %s +q",getName());
		this->auditorium = 1;
		auditoriumUpdate(oldaudi);
	} else if(this->auditorium == 1) {
		sendToChan(":SERVER!SERVER@* MODE %s -q",getName());
		this->auditorium = 0;
		auditoriumUpdate(1);
	}
	if(strchr(props->modes,'s') != NULL) {
		if(this->priv != 0) {
			sendToChan(":SERVER!SERVER@* MODE %s -p",getName());
			this->priv = 0;
		}
		if(this->secret != 1) {
			sendToChan(":SERVER!SERVER@* MODE %s +s",getName());
			this->secret = 1;
		}
	}else if(this->secret == 1) {
		sendToChan(":SERVER!SERVER@* MODE %s -s",getName());
		this->secret = 0;
	}
	if(strchr(props->modes,'p') != NULL) {
		if(this->secret != 0) {
			sendToChan(":SERVER!SERVER@* MODE %s -s",getName());
			this->secret = 0;
		}
		if(this->priv != 1) {
			sendToChan(":SERVER!SERVER@* MODE %s +p",getName());
			this->priv = 1;
		}
	} else if(this->priv == 1) {
		sendToChan(":SERVER!SERVER@* MODE %s -p",getName());
		this->priv = 0;
	}
	this->onlyowner = props->onlyowner;
	this->stayopen = strchr(props->modes,'z') != NULL?true:false;
	this->registered = strchr(props->modes,'r') != NULL?true:false;
	this->allops = strchr(props->modes,'a') != NULL?true:false;
	if(props->groupname[0] != 0) {
		strcpy(this->groupname,props->groupname);
	}
	return;
}