Ejemplo n.º 1
0
void ui_menu_barcode_reader::populate()
{
	if (current_device())
	{
		std::string buffer;
		const char *new_barcode;

		// selected device
		item_append(current_display_name().c_str(), "", current_display_flags(), ITEMREF_SELECT_READER);

		// append the "New Barcode" item
		if (get_selection() == ITEMREF_NEW_BARCODE)
		{
			buffer.append(m_barcode_buffer);
			new_barcode = buffer.c_str();
		}
		else
		{
			new_barcode = m_barcode_buffer;
		}

		item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE);

		// finish up the menu
		item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
		item_append("Enter Code", NULL, 0, ITEMREF_ENTER_BARCODE);

		customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
	}
}
Ejemplo n.º 2
0
void menu_tape_control::populate()
{
	if (current_device())
	{
		// name of tape
		item_append(current_display_name().c_str(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT);

		if (current_device()->exists())
		{
			std::string timepos;
			cassette_state state;
			double t0 = current_device()->get_position();
			double t1 = current_device()->get_length();
			UINT32 tapeflags = 0;

			// state
			if (t1 > 0)
			{
				if (t0 > 0)
					tapeflags |= FLAG_LEFT_ARROW;
				if (t0 < t1)
					tapeflags |= FLAG_RIGHT_ARROW;
			}

			get_time_string(timepos, current_device(), nullptr, nullptr);
			state = current_device()->get_state();
			item_append(
						(state & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED
						?   _("stopped")
						:   ((state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY
								? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? _("playing") : _("(playing)"))
								: ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? _("recording") : _("(recording)"))
								),
								timepos.c_str(),
						tapeflags,
						TAPECMD_SLIDER);

			// pause or stop
			item_append(_("Pause/Stop"), nullptr, 0, TAPECMD_STOP);

			// play
			item_append(_("Play"), nullptr, 0, TAPECMD_PLAY);

			// record
			item_append(_("Record"), nullptr, 0, TAPECMD_RECORD);

			// rewind
			item_append(_("Rewind"), nullptr, 0, TAPECMD_REWIND);

			// fast forward
			item_append(_("Fast Forward"), nullptr, 0, TAPECMD_FAST_FORWARD);
		}
	}
}