/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#define USE_ERROR
#define USE_TRACE
#include "PlatformMidi.h"
switch (err) {
case MIDI_SUCCESS: return "";
case MIDI_NOT_SUPPORTED: return "feature not supported";
case MIDI_INVALID_DEVICEID: return "invalid device ID";
case MIDI_INVALID_HANDLE: return "internal error: invalid handle";
case MIDI_OUT_OF_MEMORY: return "out of memory";
}
return NULL;
}
/*
* internal implementation for getting error string
*/
#if USE_PLATFORM_MIDI_IN == TRUE
if (!result) {
}
#endif
if (!result) {
}
return result;
}
/*
* internal implementation for getting error string
*/
#if USE_PLATFORM_MIDI_OUT == TRUE
if (!result) {
}
#endif
if (!result) {
}
return result;
}
#if USE_MIDI_QUEUE == TRUE
// MessageQueue implementation
MidiMessageQueue* queue = (MidiMessageQueue*) malloc(sizeof(MidiMessageQueue) + ((capacity-1) * sizeof(MidiMessage)));
if (queue) {
TRACE0("MIDI_CreateQueue\n");
queue->writeIndex = 0;
}
return queue;
}
if (queue) {
TRACE0("MIDI_DestroyQueue\n");
}
}
// if overwrite is true, oldest messages will be overwritten when the queue is full
// returns true, if message has been added
if (queue) {
TRACE0("MIDI_QueueAddShort: overflow\n");
return FALSE; // failed
}
// adjust overwritten readIndex
} else {
}
return TRUE;
}
return FALSE;
}
if (queue) {
TRACE0("MIDI_QueueAddLong: overflow\n");
return FALSE; // failed
}
// adjust overwritten readIndex
} else {
}
//fprintf(stdout, "MIDI_QueueAddLong sysex-index %d\n", sysexIndex); fflush(stdout);
return TRUE;
}
return FALSE;
}
// returns NULL if no messages in queue.
if (queue) {
}
}
return msg;
}
if (queue) {
}
}
}
}
if (queue) {
queue->writeIndex = 0;
}
}
#endif