コード例 #1
0
bool CTriggerAutoMusicPlayer::TriggerAutoMusicPlayerMsg(CTriggerAutoMusicPlayerMsg *msg) {
	CRoomItem *room1 = msg->_value == 1 ? locateRoom(_roomName) : findRoom();
	CRoomItem *room2 = msg->_value == 2 ? locateRoom(_roomName) : findRoom();

	CChangeMusicMsg changeMsg;
	changeMsg._flags = 1;
	changeMsg.execute(room1, CAutoMusicPlayer::_type,
		MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);

	changeMsg._flags = 2;
	changeMsg.execute(room2, CAutoMusicPlayer::_type,
		MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);

	return true;
}
コード例 #2
0
bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) {
	CChangeMusicMsg musicMsg;
	musicMsg._flags = 2;
	musicMsg.execute(this);

	return true;
}
コード例 #3
0
bool CSeasonalMusicPlayer::ArboretumGateMsg(CArboretumGateMsg *msg) {
	CChangeMusicMsg changeMsg;
	changeMsg._action = msg->_value ? MUSIC_START : MUSIC_STOP;
	changeMsg.execute(this);

	return true;
}
コード例 #4
0
bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) {
	CChangeMusicMsg musicMsg;
	musicMsg._action = MUSIC_START;
	musicMsg.execute(this);

	return true;
}
コード例 #5
0
ファイル: auto_music_player.cpp プロジェクト: 86400/scummvm
bool CAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) {
    if (_isRepeated) {
        CRoomItem *room = findRoom();
        if (msg->_oldRoom == room) {
            CChangeMusicMsg changeMsg;
            changeMsg._flags = 1;
            changeMsg.execute(this);
        }
    }

    if (!_leaveRoomSound.empty())
        playSound(_leaveRoomSound);

    return true;
}
コード例 #6
0
bool CAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) {
	if (_isEnabled) {
		CRoomItem *room = findRoom();
		if (msg->_oldRoom == room) {
			CChangeMusicMsg changeMsg;
			changeMsg._action = MUSIC_STOP;
			changeMsg.execute(this);
		}
	}

	if (!_leaveRoomSound.empty())
		playSound(_leaveRoomSound);

	return true;
}
コード例 #7
0
bool CSeasonalMusicPlayer::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
	_isSpring = msg->_season == "spring";
	_isSummer = msg->_season == "summer";
	_isAutumn = msg->_season == "autumn";
	_isWinter = msg->_season == "winter";

	_springMode = _isSpring ? VOL_QUIET : VOL_MUTE;
	_summerMode = _isSummer ? VOL_QUIET : VOL_MUTE;
	_autumnMode = _isAutumn ? VOL_QUIET : VOL_MUTE;
	_winterMode = _isWinter ? VOL_QUIET : VOL_MUTE;

	CChangeMusicMsg changeMsg;
	changeMsg._filename = msg->_season;
	changeMsg.execute(this);

	return true;
}
コード例 #8
0
bool CNodeAutoSoundPlayer::LeaveNodeMsg(CLeaveNodeMsg *msg) {
	CNodeItem *node = findNode();
	CRoomItem *room = findRoom();

	if (node == msg->_oldNode) {
		CTurnOff offMsg;
		offMsg.execute(this);

		if (_enabled) {
			CChangeMusicMsg changeMsg;
			changeMsg._action = MUSIC_START;
			changeMsg.execute(room, CAutoMusicPlayer::_type,
				MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
		}
	}

	return true;
}
コード例 #9
0
bool CViewAutoSoundPlayer::EnterViewMsg(CEnterViewMsg *msg) {
	CViewItem *view = findView();
	CRoomItem *room = findRoom();

	if (view == msg->_newView) {
		CTurnOn onMsg;
		onMsg.execute(this);

		if (_enabled) {
			CChangeMusicMsg changeMsg;
			changeMsg._action = MUSIC_STOP;
			changeMsg.execute(room, CAutoMusicPlayer::_type,
				MSGFLAG_CLASS_DEF |MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN);
		}
	}

	return true;
}