~drgeo-developers/drgeo/trunk

1 by Hilaire Fernandes
Initial additions
1
/* sqUnixMIDINone.c -- Unix with no MIDI support
2
 * 
3
 *   Copyright (C) 1996-2007 by Ian Piumarta and other authors/contributors
4
 *                              listed elsewhere in this file.
5
 *   All rights reserved.
6
 *   
7
 *   This file is part of Unix Squeak.
8
 * 
9
 *   Permission is hereby granted, free of charge, to any person obtaining a copy
10
 *   of this software and associated documentation files (the "Software"), to deal
11
 *   in the Software without restriction, including without limitation the rights
12
 *   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
 *   copies of the Software, and to permit persons to whom the Software is
14
 *   furnished to do so, subject to the following conditions:
15
 * 
16
 *   The above copyright notice and this permission notice shall be included in
17
 *   all copies or substantial portions of the Software.
18
 * 
19
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
 *   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
 *   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
 *   SOFTWARE.
26
 */
27
28
/* Author: Ian.Piumarta@INRIA.FR
29
 * 
30
 * Last edited: 2007-03-11 13:30:32 by piumarta on emilia.local
31
 */
32
33
/* Put the given port into MIDI mode, which uses a clock supplied
34
   by an external MIDI interface adaptor to determine the data rate.
35
   Possible external clock rates: 31.25 KHz, 0.5 MHz, 1 MHz, or 2 MHz. */
36
int serialPortMidiClockRate(int portNum, int interfaceClockRate)
37
{
38
	success(false);
39
	return 0;
40
}
41
42
/* Close the given MIDI port. Do nothing if the port is not open.
43
   Fail if there is no port of the given number.*/
44
int sqMIDIClosePort(int portNum)
45
{
46
	success(false);
47
	return 0;
48
}
49
50
/* Return the current value of the clock used to schedule MIDI events.
51
   The MIDI clock is assumed to wrap at or before half the maximum
52
   positive SmallInteger value. This allows events to be scheduled
53
   into the future without overflowing into LargePositiveIntegers. 
54
   This implementation does not support event scheduling, so it
55
   just returns the value of the Squeak millisecond clock. */
56
int sqMIDIGetClock(void)
57
{
58
	success(false);
59
	return 0;
60
}
61
62
/* Return the number of available MIDI interfaces, including both
63
   hardware ports and software entities that act like ports. Ports
64
   are numbered from 0 to N-1, where N is the number returned by this
65
   primitive. */
66
int sqMIDIGetPortCount(void)
67
{
68
	success(false);
69
	return 0;
70
}
71
72
/* Return an integer indicating the directionality of the given
73
   port where: 1 = input, 2 = output, 3 = bidirectional. Fail if
74
   there is no port of the given number. */
75
int sqMIDIGetPortDirectionality(int portNum)
76
{
77
	success(false);
78
	return 0;
79
}
80
81
/* Copy the name of the given MIDI port into the string at the given
82
   address. Copy at most length characters, and return the number of
83
   characters copied. Fail if there is no port of the given number.*/
84
int sqMIDIGetPortName(int portNum, int namePtr, int length)
85
{
86
	success(false);
87
	return 0;
88
}
89
90
/* Open the given port, if possible. If non-zero, readSemaphoreIndex
91
   specifies the index in the external objects array of a semaphore
92
   to be signalled when incoming MIDI data is available. Note that
93
   not all implementations support read semaphores (this one does
94
   not); see sqMIDICanUseSemaphore. The interfaceClockRate parameter
95
   specifies the clock speed for an external MIDI interface
96
   adaptor on platforms that use such adaptors (e.g., Macintosh).
97
   Fail if there is no port of the given number.*/
98
int sqMIDIOpenPort(int portNum, int readSemaIndex, int interfaceClockRate)
99
{
100
	success(false);
101
	return 0;
102
}
103
104
/* Read or write the given MIDI driver parameter. If modify is 0,
105
   then newValue is ignored and the current value of the specified
106
   parameter is returned. If modify is non-zero, then the specified
107
   parameter is set to newValue. Note that many MIDI driver parameters
108
   are read-only; attempting to set one of these parameters fails.
109
   For boolean parameters, true = 1, false = 0. */
110
int sqMIDIParameter(int whichParameter, int modify, int newValue)
111
{
112
	success(false);
113
	return 0;
114
}
115
116
/* bufferPtr is the address of the first byte of a Smalltalk
117
   ByteArray of the given length. Copy up to (length - 4) bytes
118
   of incoming MIDI data into that buffer, preceded by a 4-byte
119
   timestamp in the units of the MIDI clock, most significant byte
120
   first. Implementations that do not support timestamping of
121
   incoming data as it arrives (see sqMIDIHasInputClock) simply
122
   set the timestamp to the value of the MIDI clock when this
123
   function is called. Return the total number of bytes read,
124
   including the timestamp bytes. Return zero if no data is
125
   available. Fail if the buffer is shorter than five bytes,
126
   since there must be enough room for the timestamp plus at
127
   least one data byte. */
128
int sqMIDIPortReadInto(int portNum, int count, int bufferPtr)
129
{
130
	success(false);
131
	return 0;
132
}
133
134
/* bufferPtr is the address of the first byte of a Smalltalk
135
   ByteArray of the given length. Send its contents to the given
136
   port when the MIDI clock reaches the given time. If time equals
137
   zero, then send the data immediately. Implementations that do
138
   not support a timestamped output queue, such as this one, always
139
   send the data immediately; see sqMIDIHasBuffer. */
140
int sqMIDIPortWriteFromAt(int portNum, int count, int bufferPtr, int time)
141
{
142
	success(false);
143
	return 0;
144
}
145
146
147
int midiInit(void)
148
{
149
	success(false);
150
	return 0;
151
}
152
153
int sqMIDIParameterGet(int which)
154
{
155
	success(false);
156
	return 0;
157
}
158
159
int sqMIDIParameterSet(int which, int value)
160
{
161
	success(false);
162
	return 0;
163
}
164
165
int midiShutdown(void)
166
{
167
	success(false);
168
	return 0;
169
}