Ejemplo n.º 1
0
void
editable_event::analyze ()
{
    midibyte status = get_status();
    if (status >= EVENT_NOTE_OFF && status <= EVENT_PITCH_WHEEL)
    {
        char tmp[32];
        midibyte channel = get_channel();
        midibyte d0, d1;
        get_data(d0, d1);
        category(category_channel_message);
        status = get_status() & EVENT_CLEAR_CHAN_MASK;

        /*
         * Get channel message name (e.g. "Program change");
         */

        m_name_status = value_to_name(status, category_channel_message);
        snprintf(tmp, sizeof tmp, "Chan %d", int(channel));
        m_name_channel = std::string(tmp);
        if (is_one_byte_msg(status))
            snprintf(tmp, sizeof tmp, "Data %d", int(d0));
        else
        {
            if (is_note_msg(status))
            {
                snprintf(tmp, sizeof tmp, "Key %d Vel %d", int(d0), int(d1));
            }
            else
            {
                snprintf
                (
                    tmp, sizeof tmp, "Data %d, %d", int(d0), int(d1)
                );
            }
        }
        m_name_data = std::string(tmp);
    }
    else if (status >= EVENT_MIDI_SYSEX)    //  && status <= EVENT_MIDI_RESET
    {
        category(category_system_message);

        /*
         * Get system message name (e.g. "SysEx start");
         */

        m_name_status = value_to_name(status, category_system_message);
        m_name_channel.clear();
        m_name_data.clear();
    }
    else
    {
        // Would try to detect SysEx versus Meta message versus SeqSpec here.
        // Then set either m_name_meta and/or m_name_seqspec.
    }

}
Ejemplo n.º 2
0
void
editable_event::category (category_t c)
{
    if (c >= category_channel_message && c <= category_prop_event)
        m_category = c;
    else
        m_category = category_name;

    m_name_category = value_to_name(c, category_name);
}
Ejemplo n.º 3
0
void
editable_event::category (const std::string & name)
{
    unsigned short catcode = name_to_value(name, category_name);
    if (catcode < SEQ64_END_OF_MIDIBYTE_TABLE)
        m_category = category_t(catcode);
    else
        m_category = category_name;

    m_name_category = value_to_name(m_category, category_name);
}
Ejemplo n.º 4
0
static void
ieee_value_to_sym(cell_t *cif)
{
	u_int	nargs, nresults;
	u_long	value;
	u_int	offset;
	char	*name = symbol;
	extern u_long value_to_name(uintptr_t value, char *symbol);

	nargs = p1275_cell2uint(cif[1]);
	nresults = p1275_cell2uint(cif[2]);

	if (nresults == 0)
		return;		/* No room for results. Just return. */

	/*
	 * If there are no arguments, fall through and return "not found".
	 * Otherwise, try to translate the value to a symbol-name/offset.
	 */
	*name = (char)0;
	offset = (u_int)-1;
	if (nargs != 0) {
		value = p1275_cell2uintptr(cif[3]); /* argument 0 */
		offset = value_to_name(value, name);
	}

	/*
	 * Stuff the results in the argument array and set the
	 * nresults element to the number of results actually returned
	 * in the argument array. (It's a maximum of 2).
	 *
	 * cif[0]:	service name	( Pointer to service name )
	 * cif[1]:	nargs		( number of argument cells)
	 * cif[2]:	nresults	( number of result cells)
	 * cif[3]:	argument{0}	( First argument cell )
	 * ...
	 * cif[3 + nargs]: result{0}	( First result cell )
	 * ...
	 */

	/*
	 * Treat this as an integer, so we sign-extend -1, offsets
	 * are always postive, -1 indicates not found.
	 */
	cif[3 + nargs] = p1275_int2cell((int)offset);

	if (nresults > 1) {
		cif[3 + nargs + 1] = p1275_ptr2cell(name);
		cif[2] = p1275_int2cell(2);	/* there are 2 results */
	} else {
		cif[2] = p1275_int2cell(1);	/* there is 1 result */
	}
}
folly::Future<int32_t> service_with_special_namesSvIf::future_value_to_name() {
  return apache::thrift::detail::si::future([&] { return value_to_name(); });
}