コード例 #1
0
bool device_sound_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
{
	bool error = false;

	// loop over all the routes
	for (const sound_route *route = first_route(); route != NULL; route = route->next())
	{
		// find a device with the requested tag
		const device_t *target = device().mconfig().devicelist().find(route->m_target);
		if (target == NULL)
		{
			mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
			error = true;
		}

		// if it's not a speaker or a sound device, error
		const device_sound_interface *sound;
		if (target != NULL && target->type() != SPEAKER && !target->dev_interface(sound))
		{
			mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name());
			error = true;
		}
	}
	return error;
}
コード例 #2
0
void device_sound_interface::interface_validity_check(validity_checker &valid) const
{
	// loop over all the routes
	for (const sound_route *route = first_route(); route != NULL; route = route->next())
	{
		// find a device with the requested tag
		const device_t *target = device().siblingdevice(route->m_target.cstr());
		if (target == NULL)
			mame_printf_error("Attempting to route sound to non-existant device '%s'\n", route->m_target.cstr());

		// if it's not a speaker or a sound device, error
		const device_sound_interface *sound;
		if (target != NULL && target->type() != SPEAKER && !target->get_interface(sound))
			mame_printf_error("Attempting to route sound to a non-sound device '%s' (%s)\n", route->m_target.cstr(), target->name());
	}
}