aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-01-26 23:48:43 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2010-01-26 23:48:43 +0000
commit30f2c9f8003afdf49d439017ca9158879b8d1ae8 (patch)
tree71f06782b124343355d51b1858902f40bcfc7b00
parent820a49401286705eb067d75fb0905c4bc4fa3306 (diff)
committing changes submitted in patch #2865481HEADsvn2git-headextensions/gripd
svn path=/trunk/extensions/gripd/; revision=13104
-rw-r--r--src/makefile2
-rw-r--r--src/midiio/include/Array.cpp107
-rw-r--r--src/midiio/include/MidiInPort_alsa.h1
-rw-r--r--src/midiio/include/MidiInPort_oss.h1
-rw-r--r--src/midiio/include/Sequencer_alsa.h16
5 files changed, 65 insertions, 62 deletions
diff --git a/src/makefile b/src/makefile
index 35c152a..f44bf91 100644
--- a/src/makefile
+++ b/src/makefile
@@ -15,7 +15,7 @@ JOYSTICK = TRUE
MIDIOSSUBTYPE = ALSA
#MIDIOSSUBTYPE = OSS
PDINCLUDE = -I../../src -I../../../pd/src
-LINUXPYTHONINCLUDE = -I/usr/include/python2.2
+LINUXPYTHONINCLUDE = -I/usr/include/python2.5
SYSTEMLIBDIR = /usr/lib
#----------- Settings (Windows) -------------------------------
diff --git a/src/midiio/include/Array.cpp b/src/midiio/include/Array.cpp
index 044ed2d..005ed9b 100644
--- a/src/midiio/include/Array.cpp
+++ b/src/midiio/include/Array.cpp
@@ -22,6 +22,7 @@
#include <iostream>
#include <stdlib.h>
+using namespace std;
//////////////////////////////
//
@@ -62,8 +63,8 @@ Array<type>::~Array() { }
template<class type>
void Array<type>::setAll(type aValue) {
- for (int i=0; i<getSize(); i++) {
- array[i] = aValue;
+ for (int i=0; i<this->getSize(); i++) {
+ this->array[i] = aValue;
}
}
@@ -77,8 +78,8 @@ void Array<type>::setAll(type aValue) {
template<class type>
type Array<type>::sum(void) {
type theSum = 0;
- for (int i=0; i<getSize(); i++) {
- theSum += array[i];
+ for (int i=0; i<this->getSize(); i++) {
+ theSum += this->array[i];
}
return theSum;
}
@@ -87,7 +88,7 @@ template<class type>
type Array<type>::sum(int loIndex, int hiIndex) {
type theSum = 0;
for (int i=loIndex; i<=hiIndex; i++) {
- theSum += array[i];
+ theSum += this->array[i];
}
return theSum;
}
@@ -101,19 +102,19 @@ type Array<type>::sum(int loIndex, int hiIndex) {
template<class type>
void Array<type>::zero(int minIndex, int maxIndex) {
- if (size == 0) return;
+ if (this->size == 0) return;
if (minIndex == -1) minIndex = 0;
- if (maxIndex == -1) maxIndex = size-1;
+ if (maxIndex == -1) maxIndex = this->size - 1;
if (minIndex < 0 || maxIndex < 0 || minIndex > maxIndex ||
- maxIndex >= size) {
- cerr << "Error in zero function: min = " << minIndex
- << " max = " << maxIndex << " size = " << size << endl;
+ maxIndex >= this->size) {
+ cerr << "Error in zero function: min = " << minIndex
+ << " max = " << maxIndex << " size = " << this->size << this->endl;
exit(1);
}
for (int i=minIndex; i<=maxIndex; i++) {
- array[i] = 0;
+ this->array[i] = 0;
}
}
@@ -126,12 +127,12 @@ void Array<type>::zero(int minIndex, int maxIndex) {
template<class type>
int Array<type>::operator==(const Array<type>& aArray) {
- if (getSize() != aArray.getSize()) {
+ if (this->getSize() != aArray.getSize()) {
return 0;
}
Array<type>& t = *this;
int i;
- for (i=0; i<getSize(); i++) {
+ for (i=0; i<this->getSize(); i++) {
if (t[i] != aArray[i]) {
return 0;
}
@@ -148,20 +149,20 @@ int Array<type>::operator==(const Array<type>& aArray) {
template<class type>
Array<type>& Array<type>::operator=(const Array<type>& anArray) {
- if (allocSize < anArray.size) {
- if (allocSize != 0) {
- delete [] array;
+ if (this->allocSize < anArray.size) {
+ if (this->allocSize != 0) {
+ delete [] this->array;
}
- allocSize = anArray.size;
- size = anArray.size;
- array = new type[size];
- allowGrowthQ = anArray.allowGrowthQ;
- growthAmount = anArray.growthAmount;
- maxSize = anArray.maxSize;
+ this->allocSize = anArray.size;
+ this->size = anArray.size;
+ this->array = new type[this->size];
+ this->allowGrowthQ = anArray.allowGrowthQ;
+ this->growthAmount = anArray.growthAmount;
+ this->maxSize = anArray.maxSize;
}
- size = anArray.size;
- for (int i=0; i<size; i++) {
- array[i] = anArray.array[i];
+ this->size = anArray.size;
+ for (int i=0; i<this->size; i++) {
+ this->array[i] = anArray.array[i];
}
return *this;
@@ -176,14 +177,14 @@ Array<type>& Array<type>::operator=(const Array<type>& anArray) {
template<class type>
Array<type>& Array<type>::operator+=(const Array<type>& anArray) {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
- for (int i=0; i<size; i++) {
- array[i] += anArray.array[i];
+ for (int i=0; i<this->size; i++) {
+ this->array[i] += anArray.array[i];
}
return *this;
@@ -198,8 +199,8 @@ Array<type>& Array<type>::operator+=(const Array<type>& anArray) {
template<class type>
Array<type> Array<type>::operator+(const Array<type>& anArray) const {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
@@ -213,7 +214,7 @@ Array<type> Array<type>::operator+(const Array<type>& anArray) const {
template<class type>
Array<type> Array<type>::operator+(type aNumber) const {
Array<type> anArray(*this);
- for (int i=0; i<size; i++) {
+ for (int i=0; i<this->size; i++) {
anArray[i] += aNumber;
}
return anArray;
@@ -228,14 +229,14 @@ Array<type> Array<type>::operator+(type aNumber) const {
template<class type>
Array<type>& Array<type>::operator-=(const Array<type>& anArray) {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
- for (int i=0; i<size; i++) {
- array[i] -= anArray.array[i];
+ for (int i=0; i<this->size; i++) {
+ this->array[i] -= anArray.array[i];
}
return *this;
@@ -250,8 +251,8 @@ Array<type>& Array<type>::operator-=(const Array<type>& anArray) {
template<class type>
Array<type> Array<type>::operator-(const Array<type>& anArray) const {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
@@ -265,7 +266,7 @@ Array<type> Array<type>::operator-(const Array<type>& anArray) const {
template<class type>
Array<type> Array<type>::operator-(void) const {
Array<type> anArray(*this);
- for (int i=0; i<size; i++) {
+ for (int i=0; i<this->size; i++) {
anArray[i] = -anArray[i];
}
return anArray;
@@ -274,7 +275,7 @@ Array<type> Array<type>::operator-(void) const {
template<class type>
Array<type> Array<type>::operator-(type aNumber) const {
Array<type> anArray(*this);
- for (int i=0; i<size; i++) {
+ for (int i=0; i<this->size; i++) {
anArray[i] -= aNumber;
}
return anArray;
@@ -289,14 +290,14 @@ Array<type> Array<type>::operator-(type aNumber) const {
template<class type>
Array<type>& Array<type>::operator*=(const Array<type>& anArray) {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
- for (int i=0; i<size; i++) {
- array[i] *= anArray.array[i];
+ for (int i=0; i<this->size; i++) {
+ this->array[i] *= anArray.array[i];
}
return *this;
@@ -311,8 +312,8 @@ Array<type>& Array<type>::operator*=(const Array<type>& anArray) {
template<class type>
Array<type> Array<type>::operator*(const Array<type>& anArray) const {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
@@ -326,7 +327,7 @@ Array<type> Array<type>::operator*(const Array<type>& anArray) const {
template<class type>
Array<type> Array<type>::operator*(type aNumber) const {
Array<type> anArray(*this);
- for (int i=0; i<size; i++) {
+ for (int i=0; i<this->size; i++) {
anArray[i] *= aNumber;
}
return anArray;
@@ -339,14 +340,14 @@ Array<type> Array<type>::operator*(type aNumber) const {
template<class type>
Array<type>& Array<type>::operator/=(const Array<type>& anArray) {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
- for (int i=0; i<size; i++) {
- array[i] /= anArray.array[i];
+ for (int i=0; i<this->size; i++) {
+ this->array[i] /= anArray.array[i];
}
return *this;
@@ -359,8 +360,8 @@ Array<type>& Array<type>::operator/=(const Array<type>& anArray) {
template<class type>
Array<type> Array<type>::operator/(const Array<type>& anArray) const {
- if (size != anArray.size) {
- cerr << "Error: different size arrays " << size << " and "
+ if (this->size != anArray.size) {
+ cerr << "Error: different size arrays " << this->size << " and "
<< anArray.size << endl;
exit(1);
}
diff --git a/src/midiio/include/MidiInPort_alsa.h b/src/midiio/include/MidiInPort_alsa.h
index b321600..5a165da 100644
--- a/src/midiio/include/MidiInPort_alsa.h
+++ b/src/midiio/include/MidiInPort_alsa.h
@@ -28,6 +28,7 @@
typedef unsigned char uchar;
typedef void (*MIDI_Callback_function)(int arrivalPort);
+void *interpretMidiInputStreamPrivateALSA(void * x);
class MidiInPort_alsa : public Sequencer_alsa {
public:
diff --git a/src/midiio/include/MidiInPort_oss.h b/src/midiio/include/MidiInPort_oss.h
index ffa5666..4387c35 100644
--- a/src/midiio/include/MidiInPort_oss.h
+++ b/src/midiio/include/MidiInPort_oss.h
@@ -28,6 +28,7 @@
typedef unsigned char uchar;
typedef void (*MIDI_Callback_function)(int arrivalPort);
+void *interpretMidiInputStreamPrivate(void * x);
class MidiInPort_oss : public Sequencer_oss {
public:
diff --git a/src/midiio/include/Sequencer_alsa.h b/src/midiio/include/Sequencer_alsa.h
index 3227f5e..4ac2136 100644
--- a/src/midiio/include/Sequencer_alsa.h
+++ b/src/midiio/include/Sequencer_alsa.h
@@ -70,14 +70,14 @@ class Sequencer_alsa {
static int outdevcount; // number of MIDI output devices
static int initialized; // for starting buileinfodatabase
- static Collection<snd_rawmidi_t*> Sequencer_alsa::rawmidi_in;
- static Collection<snd_rawmidi_t*> Sequencer_alsa::rawmidi_out;
- static Collection<int> Sequencer_alsa::midiincard;
- static Collection<int> Sequencer_alsa::midioutcard;
- static Collection<int> Sequencer_alsa::midiindevice;
- static Collection<int> Sequencer_alsa::midioutdevice;
- static Collection<char*> Sequencer_alsa::midiinname;
- static Collection<char*> Sequencer_alsa::midioutname;
+ static Collection<snd_rawmidi_t*> rawmidi_in;
+ static Collection<snd_rawmidi_t*> rawmidi_out;
+ static Collection<int> midiincard;
+ static Collection<int> midioutcard;
+ static Collection<int> midiindevice;
+ static Collection<int> midioutdevice;
+ static Collection<char*> midiinname;
+ static Collection<char*> midioutname;
private:
static void buildInfoDatabase (void);