1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * This file is part of gmidimonitor
6 * Copyright (C) 2005,2006,2007,2008,2011 Nedko Arnaudov <nedko@arnaudov.name>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *****************************************************************************/
27 /* General MMC decoding, as seen at http://www.borg.com/~jglatt/tech/mmc.htm and
28 extended from "Advanced User Guide for MK-449C MIDI keyboard" info */
33 GString
* msg_str_ptr
)
35 const char * mmc_command_name
;
38 if (buffer_size
== 6 &&
47 mmc_command_name
= "Stop";
50 mmc_command_name
= "Play";
53 mmc_command_name
= "Deferred Play";
56 mmc_command_name
= "Fast Forward";
59 mmc_command_name
= "Rewind";
62 mmc_command_name
= "Record Strobe (Punch In)";
65 mmc_command_name
= "Record Exit (Punch Out)";
68 mmc_command_name
= "Record Pause";
71 mmc_command_name
= "Pause";
74 mmc_command_name
= "Eject";
77 mmc_command_name
= "Chase";
80 mmc_command_name
= "Command Error Reset";
83 mmc_command_name
= "Reset";
101 g_string_append_printf(
104 (unsigned int)(buffer
[2]));
107 /* The goto MMC message, as seen at http://www.borg.com/~jglatt/tech/mmc.htm */
108 else if (buffer_size
== 13 &&
119 "MMC goto %u:%u:%u/%u:%u",
120 (unsigned int)(buffer
[7] & 0x1F), /* fps encoding */
121 (unsigned int)(buffer
[8]),
122 (unsigned int)(buffer
[9]),
123 (unsigned int)(buffer
[10] & 0x1F), /* no fps > 32, but bit 5 looks used for something */
124 (unsigned int)(buffer
[11]));
126 switch (buffer
[7] & 0x60)
150 if (buffer
[2] == 127)
154 ", for all devices");
158 g_string_append_printf(
161 (unsigned int)(buffer
[2]));
169 "SYSEX with size %u:",
170 (unsigned int)buffer_size
);
171 for (i
= 0 ; i
< buffer_size
; i
++)
173 g_string_append_printf(
176 (unsigned int)(buffer
[i
]));