Exemplo n.º 1
0
bool CAutoSoundPlayer::TurnOff(CTurnOff *msg) {
	if (_soundHandle != -1) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, _stopSeconds);

		_soundHandle = -1;
		_active = false;
	}

	return true;
}
Exemplo n.º 2
0
bool CAutoSoundPlayer::SignalObject(CSignalObject *msg) {
	if (_soundHandle != -1) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, msg->_numValue);

		_soundHandle = -1;
		_active = false;
	}

	return true;
}
Exemplo n.º 3
0
bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
	if (msg->_name == "Television" && _isOn) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, 0);

		_channelNum = (_channelNum % _channelsCount) + 1;
		stopMovie();
		playMovie(START_FRAMES[_channelNum], END_FRAMES[_channelNum], MOVIE_NOTIFY_OBJECT);
	}

	return true;
}
Exemplo n.º 4
0
bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) {
	petClear();
	if (_isOn) {
		if (isSoundActive(_soundHandle))
			stopSound(_soundHandle, 0);

		loadFrame(622);
		stopMovie();
		setVisible(0);
		_isOn = false;

		if (compareRoomNameTo("CSGState")) {
			CVisibleMsg visibleMsg(true);
			visibleMsg.execute("Tellypic");
		}
	}

	return true;
}
Exemplo n.º 5
0
bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
	if (msg->_name == "Television") {
		CVisibleMsg visibleMsg(_isOn);
		_isOn = !_isOn;

		if (_isOn) {
			setVisible(true);
			playMovie(0, 55, 0);
			_channelNum = 1;
		} else {
			stopMovie();
			if (isSoundActive(_soundHandle))
				stopSound(_soundHandle, 0);

			setVisible(false);
		}

		if (compareRoomNameTo("SGTState"))
			visibleMsg.execute("Tellypic");
	}

	return true;
}
Exemplo n.º 6
0
bool CAutoSoundPlayer::SetVolumeMsg(CSetVolumeMsg *msg) {
	if (_soundHandle != -1 && isSoundActive(_soundHandle))
		setSoundVolume(_soundHandle, msg->_volume, msg->_secondsTransition);

	return true;
}