home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume43
/
tclmidi
/
part10
< prev
next >
Wrap
Internet Message Format
|
1994-07-21
|
62KB
From: durian@boogie.com (Mike Durian)
Newsgroups: comp.sources.misc
Subject: v43i118: tclmidi - A language for manipulating MIDI files, v2.0, Part10/14
Date: 21 Jul 1994 19:27:45 -0500
Organization: Sterling Software
Sender: kent@sparky.sterling.com
Approved: kent@sparky.sterling.com
Message-ID: <30n3q1$779@sparky.sterling.com>
X-Md4-Signature: dc38e1f3e15aeba8e810a3fdee3e78f4
Submitted-by: durian@boogie.com (Mike Durian)
Posting-number: Volume 43, Issue 118
Archive-name: tclmidi/part10
Environment: POSIX, (BSDI, NetBSD, LINUX, SVR4 for optional driver), C++, TCL
Supersedes: tclm: Volume 37, Issue 43-47
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# Contents: tclmidi-2.0/contrib/mmap.mt32
# tclmidi-2.0/device/MidiDevice.h tclmidi-2.0/events/ChanPressure.C
# tclmidi-2.0/events/Makefile tclmidi-2.0/events/MetaChanPrefix.h
# tclmidi-2.0/events/MetaKey.h tclmidi-2.0/events/MetaSMPTE.h
# tclmidi-2.0/events/MetaSeqSpec.h tclmidi-2.0/events/MetaTime.h
# tclmidi-2.0/events/MetaUnknown.h tclmidi-2.0/events/PitchWheel.C
# tclmidi-2.0/events/Program.C tclmidi-2.0/events/SystemExcl.h
# tclmidi-2.0/man/midirecord.n tclmidi-2.0/smf/SMFUtils.C
# tclmidi-2.0/song/EventTree.h tclmidi-2.0/song/Song.h
# Wrapped by kent@sparky on Thu Jul 21 19:05:16 1994
PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
echo If this archive is complete, you will see the following message:
echo ' "shar: End of archive 10 (of 14)."'
if test -f 'tclmidi-2.0/contrib/mmap.mt32' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/contrib/mmap.mt32'\"
else
echo shar: Extracting \"'tclmidi-2.0/contrib/mmap.mt32'\" \(3100 characters\)
sed "s/^X//" >'tclmidi-2.0/contrib/mmap.mt32' <<'END_OF_FILE'
X#!/usr/local/bin/tclmidi
X#
X# mmap.mt32 - a General MIDI -> Roland MT-32 remapping filter
X#
X# Copyright (c) 1994 by Luchezar Georgiev, Bulgaria <lucho@midi.tu-varna.bg>
X#
X# Tip: Run your GM files through this mapper in advance, put the resulting
X# files in a ZIP or other archive, and then use `playzip' or similar shell
X# script to play them from the archive. You'll save both disk space and
X# playing time!
X#
X# It shouldn't be difficult for you to customize this to your synth. Try it!
X
Xif {$argc} {
X puts stderr {Usage: mmap.mt32 < GMfile.mid > MT-32file.mid}
X exit 1
X}
X
X# Channel map
Xset cm {1 2 3 4 5 6 7 8 8 9 10 11 12 13 14 15}
X
X# Drum channel for GM ----^
Xset dchan 9
X
X# Drum map
Xset dm { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 \
X24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 \
X49 50 51 49 51 54 46 56 49 73 51 60 61 62 63 64 65 66 67 68 69 70 71 72 70 \
X69 75 75 75 62 63 68 67 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 \
X99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 \
X118 119 120 121 122 123 124 125 126 127 }
X
X# Patch map
Xset pm { 0 1 3 7 5 6 17 21 22 101 101 97 104 103 102 105 12 9 10 13 14 \
X15 87 15 59 60 59 62 61 59 62 62 64 67 66 71 68 69 66 70 53 52 54 56 53 51 \
X57 112 48 50 48 50 34 42 33 122 88 90 94 89 92 95 89 91 78 79 80 81 84 85 \
X86 83 75 73 76 77 110 107 108 72 47 67 75 51 61 72 52 67 32 33 67 34 32 32 \
X33 33 41 36 35 37 45 33 43 32 63 105 105 105 51 81 52 81 23 103 103 113 117\
X113 116 119 124 120 119 124 123 120 119 114 }
X
X# Pitch wheel ratio. MT-32 sensitivity is 12 semitones, while GM - 2
Xset pwratio [expr 12/2]
X
Xset imf [midiread stdin]
Xmidirewind $imf
X
Xset config [midiconfig $imf]
Xset format [lindex $config 0]
Xset division [lindex $config 1]
Xset tracks [lindex $config 2]
X
Xset omf [midimake]
Xmidiconfig $omf $format $division $tracks
X
Xset errMsg ""
X
Xfor {set i 0} {$i < [lindex $tracks 1]} {incr i} {
X while {[set event [midiget $imf $i next]] != "EOT"} {
X switch [set type [lindex $event 1]] {
X "NoteOff" -
X "NoteOn" -
X "Note" {
X if {[lindex $event 2] == $dchan} {
X # new channel and drum note
X set event [lreplace $event 2 3 \
X [lindex $cm [lindex $event 2]] \
X [lindex $dm [lindex $event 3]]]
X } else {
X # new channel only
X set event [lreplace $event 2 2 \
X [lindex $cm [lindex $event 2]]]
X }
X }
X "KeyPressure" -
X "Parameter" -
X "ChannelPressure" {
X # new channel
X set event [lreplace $event 2 2 [lindex $cm [lindex $event 2]]]
X }
X "Program" {
X # new channel and program
X set event [lreplace $event 2 3 [lindex $cm [lindex $event 2]]\
X [lindex $pm [lindex $event 3]]]
X }
X "PitchWheel" {
X # new pitchwheel value
X set pw [expr ([lindex $event 3] - 8192) / $pwratio + 8192]
X set event [lreplace $event 2 3 [lindex $cm [lindex $event 2]]\
X $pw]
X }
X }
X # make it robust
X catch {
X midiput $omf $i $event
X } errMsg
X if {$errMsg != ""} {
X puts stderr "$errMsg \"$event\""
X }
X }
X}
X
Xmidiwrite stdout $omf
Xmidifree $imf
Xmidifree $omf
END_OF_FILE
if test 3100 -ne `wc -c <'tclmidi-2.0/contrib/mmap.mt32'`; then
echo shar: \"'tclmidi-2.0/contrib/mmap.mt32'\" unpacked with wrong size!
fi
chmod +x 'tclmidi-2.0/contrib/mmap.mt32'
# end of 'tclmidi-2.0/contrib/mmap.mt32'
fi
if test -f 'tclmidi-2.0/device/MidiDevice.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/device/MidiDevice.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/device/MidiDevice.h'\" \(2894 characters\)
sed "s/^X//" >'tclmidi-2.0/device/MidiDevice.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef MIDIDEVICE_H
X#define MIDIDEVICE_H
X
X#include "Song.h"
X
Xtypedef void (*MidiDeviceCallback)(const Event *e);
X
Xclass MidiDevice {
Xpublic:
X MidiDevice();
X MidiDevice(const char *dev);
X MidiDevice(const MidiDevice &md);
X virtual ~MidiDevice();
X
X virtual int Play(Song *s, int r = 0) = 0;
X virtual int Record(Song *rec_song, Song *play_song = 0,
X int r = 0) = 0;
X virtual int Stop(void) = 0;
X virtual int Wait(void) = 0;
X void SetPlayCallback(MidiDeviceCallback pcb) {play_callback = pcb;}
X void SetRecordCallback(MidiDeviceCallback rcb) {record_callback = rcb;}
X void SetRepeat(int r) {repeat = r;}
X void SetMidiThru(int mt) {midithru = (mt != 0);}
X const char *GetName(void) const {return (name);}
X const char *GetError(void) const {return (error);}
X int GetRepeat(void) const {return (repeat);}
X int GetMidiThru(void) const {return (midithru);}
X MidiDeviceCallback GetPlayCallback(void) const {return (play_callback);}
X MidiDeviceCallback GetRecordCallback(void) const
X {return (record_callback);}
X
X void SetName(const char *dev);
X void SetError(const char *err);
Xprivate:
X char *name;
X char *error;
X MidiDeviceCallback record_callback;
X MidiDeviceCallback play_callback;
X int repeat;
X int midithru;
X};
X#endif
END_OF_FILE
if test 2894 -ne `wc -c <'tclmidi-2.0/device/MidiDevice.h'`; then
echo shar: \"'tclmidi-2.0/device/MidiDevice.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/device/MidiDevice.h'
fi
if test -f 'tclmidi-2.0/events/ChanPressure.C' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/ChanPressure.C'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/ChanPressure.C'\" \(3075 characters\)
sed "s/^X//" >'tclmidi-2.0/events/ChanPressure.C' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#include "ChanPressure.h"
X
XChannelPressureEvent::ChannelPressureEvent() : pressure(0)
X{
X}
X
XChannelPressureEvent::ChannelPressureEvent(unsigned long t, unsigned char chan,
X unsigned char pres) : NormalEvent(t, chan), pressure(pres)
X{
X}
X
XChannelPressureEvent::ChannelPressureEvent(const ChannelPressureEvent &e) : NormalEvent(e),
X pressure(e.pressure)
X{
X}
X
XChannelPressureEvent &
XChannelPressureEvent::operator=(const ChannelPressureEvent &e)
X{
X
X (NormalEvent)*this = (NormalEvent)e;
X pressure = e.pressure;
X return (*this);
X}
X
Xchar *
XChannelPressureEvent::GetEventStr(void) const
X{
X ostrstream buf;
X char *tbuf;
X
X tbuf = NormalEvent::GetEventStr();
X buf << tbuf << " Pressure: " << (int)pressure << ends;
X delete tbuf;
X return (buf.str());
X}
X
Xconst char *
XChannelPressureEvent::SMFRead(SMFTrack &t)
X{
X const unsigned char *ptr;
X
X if ((ptr = t.GetByte()) == 0)
X return ("Incomplete ChannelPressureEvent");
X pressure = *ptr;
X return (0);
X}
X
Xconst char *
XChannelPressureEvent::SMFWrite(SMFTrack &t) const
X{
X
X if (!t.PutByte(pressure))
X return ("Out of memory");
X return (0);
X}
X
Xint
XChannelPressureEvent::Equal(const Event *e) const
X{
X ChannelPressureEvent *eptr = (ChannelPressureEvent *)e;
X
X return (NormalEvent::Equal(e) && pressure == eptr->pressure);
X}
X
Xostream &
Xoperator<<(ostream &os, const ChannelPressureEvent &e)
X{
X char *str;
X
X os << (str = e.GetEventStr());
X delete str;
X return (os);
X}
END_OF_FILE
if test 3075 -ne `wc -c <'tclmidi-2.0/events/ChanPressure.C'`; then
echo shar: \"'tclmidi-2.0/events/ChanPressure.C'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/ChanPressure.C'
fi
if test -f 'tclmidi-2.0/events/Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/Makefile'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/Makefile'\" \(2879 characters\)
sed "s/^X//" >'tclmidi-2.0/events/Makefile' <<'END_OF_FILE'
XCXX = CC
XCXX = g++
XCFLAGS = -g
XINCDIRS = -I../smf
X
XEVENTFILES = ChanPressure.o Event.o MetaChanPrefix.o MetaCopy.o MetaCue.o \
X MetaEOT.o MetaEvent.o MetaInstName.o MetaKey.o MetaLyric.o \
X MetaMarker.o MetaPortNum.o MetaSMPTE.o MetaSeqName.o MetaSeqNum.o \
X MetaSeqSpec.o MetaTempo.o MetaText.o MetaTime.o NormalEvent.o \
X NoteOff.o NoteOn.o KeyPressure.o Parameter.o PitchWheel.o Program.o \
X SystemExcl.o MetaUnknown.o EventUtil.o Note.o
X
X.SUFFIXES: .C $(SUFFIXES)
X
Xobjs: $(EVENTFILES)
X touch objs
X
X.C.o:
X $(CXX) $(CFLAGS) $(INCDIRS) -c -o $@ $<
X
Xclean:
X -rm *.o objs
X
XChanPressure.o: ChanPressure.h NormalEvent.h Event.h ../smf/SMFTrack.h
XEvent.o: Event.h ../smf/SMFTrack.h
XKeyPressure.o: KeyPressure.h NormalEvent.h Event.h ../smf/SMFTrack.h
XMetaChanPrefix.o: MetaChanPrefix.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaCopy.o: MetaCopy.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaCue.o: MetaCue.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaEOT.o: MetaEOT.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaEvent.o: MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaInstName.o: MetaInstName.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaKey.o: MetaKey.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaLyric.o: MetaLyric.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaMarker.o: MetaMarker.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaPortNum.o: MetaPortNum.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaSMPTE.o: MetaSMPTE.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaSeqName.o: MetaSeqName.h MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaSeqNum.o: MetaSeqNum.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaSeqSpec.o: MetaSeqSpec.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaTempo.o: MetaTempo.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaText.o: MetaText.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaTime.o: MetaTime.h MetaEvent.h Event.h ../smf/SMFTrack.h
XMetaUnknown.o: MetaUnknown.h MetaEvent.h Event.h ../smf/SMFTrack.h
XNormalEvent.o: NormalEvent.h Event.h ../smf/SMFTrack.h
XNote.o: Note.h NormalEvent.h Event.h ../smf/SMFTrack.h
XNoteOff.o: NoteOff.h Note.h NormalEvent.h Event.h ../smf/SMFTrack.h
XNoteOn.o: NoteOn.h Note.h NormalEvent.h Event.h ../smf/SMFTrack.h
XParameter.o: Parameter.h NormalEvent.h Event.h ../smf/SMFTrack.h
XPitchWheel.o: PitchWheel.h NormalEvent.h Event.h ../smf/SMFTrack.h
XProgram.o: Program.h NormalEvent.h Event.h ../smf/SMFTrack.h
XSystemExcl.o: SystemExcl.h Event.h ../smf/SMFTrack.h
XEventUtil.o: EventUtil.h AllEvents.h Event.h NormalEvent.h Note.h \
X NoteOff.h NoteOn.h KeyPressure.h Parameter.h Program.h ChanPressure.h \
X PitchWheel.h SystemExcl.h MetaEvent.h MetaSeqNum.h MetaText.h \
X MetaCopy.h MetaSeqName.h MetaInstName.h MetaLyric.h MetaMarker.h \
X MetaCue.h MetaChanPrefix.h MetaEOT.h MetaTempo.h MetaSMPTE.h MetaTime.h \
X MetaKey.h MetaSeqSpec.h MetaUnknown.h ../smf/SMFTrack.h
END_OF_FILE
if test 2879 -ne `wc -c <'tclmidi-2.0/events/Makefile'`; then
echo shar: \"'tclmidi-2.0/events/Makefile'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/Makefile'
fi
if test -f 'tclmidi-2.0/events/MetaChanPrefix.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaChanPrefix.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaChanPrefix.h'\" \(2800 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaChanPrefix.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METACHANPREFIX_H
X#define METACHANPREFIX_H
X
X#include "MetaEvent.h"
X
Xclass MetaChannelPrefixEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os,
X const MetaChannelPrefixEvent &e);
Xpublic:
X MetaChannelPrefixEvent();
X MetaChannelPrefixEvent(unsigned long t, const unsigned char *data,
X long length);
X MetaChannelPrefixEvent(const MetaChannelPrefixEvent &e);
X virtual ~MetaChannelPrefixEvent();
X virtual Event *Dup(void) const
X {return (new MetaChannelPrefixEvent(*this));}
X
X virtual EventType GetType(void) const {return (METACHANNELPREFIX);}
X virtual char *GetTypeStr(void) const
X {return ("MetaChannelPrefixEvent");}
X virtual char *GetEventStr(void) const;
X const unsigned char *GetData(void) const {return (data);}
X long GetLength(void) const {return (length);}
X
X void SetData(const unsigned char *data, long length);
X
X MetaChannelPrefixEvent &operator=(const MetaChannelPrefixEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char *data;
X long length;
X};
X#endif
END_OF_FILE
if test 2800 -ne `wc -c <'tclmidi-2.0/events/MetaChanPrefix.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaChanPrefix.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaChanPrefix.h'
fi
if test -f 'tclmidi-2.0/events/MetaKey.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaKey.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaKey.h'\" \(3099 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaKey.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METAKEY_H
X#define METAKEY_H
X
X#include "MetaEvent.h"
X
Xtypedef enum {KEY_CFLAT = -7, KEY_GFLAT = -6, KEY_DFLAT = -5, KEY_AFLAT = -4,
X KEY_EFLAT = -3, KEY_BFLAT = -2, KEY_F = -1, KEY_C = 0, KEY_G = 1,
X KEY_D = 2, KEY_A = 3, KEY_E = 4, KEY_B = 5, KEY_FSHARP = 6,
X KEY_CSHARP = 7} Key;
X
XKey IntToKey(int i);
Xint KeyToInt(Key k);
X
Xtypedef enum {MODE_MAJOR = 0, MODE_MINOR = 1} Mode;
X
Xextern Key StrToKey(const char *str, int *match);
Xextern Mode StrToMode(const char *str, int *match);
X
Xclass MetaKeyEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os, const MetaKeyEvent &e);
Xpublic:
X MetaKeyEvent();
X MetaKeyEvent(unsigned long t, Key k = KEY_C, Mode m = MODE_MAJOR);
X MetaKeyEvent(const MetaKeyEvent &e);
X virtual Event *Dup(void) const {return (new MetaKeyEvent(*this));}
X
X virtual EventType GetType(void) const {return (METAKEY);}
X virtual char *GetTypeStr(void) const {return ("MetaKeyEvent");}
X virtual char *GetEventStr(void) const;
X Key GetKey(void) const {return (key);}
X const char *GetKeyStr(void) const;
X Mode GetMode(void) const {return (mode);}
X const char *GetModeStr(void) const;
X
X void SetKey(Key k) {key = k;}
X void SetMode(Mode m) {mode = m;}
X
X MetaKeyEvent &operator=(const MetaKeyEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X Key key;
X Mode mode;
X};
X#endif
END_OF_FILE
if test 3099 -ne `wc -c <'tclmidi-2.0/events/MetaKey.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaKey.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaKey.h'
fi
if test -f 'tclmidi-2.0/events/MetaSMPTE.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaSMPTE.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaSMPTE.h'\" \(3170 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaSMPTE.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METASMPTE_H
X#define METASMPTE_H
X
X#include "MetaEvent.h"
X
Xclass MetaSMPTEEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os, const MetaSMPTEEvent &e);
Xpublic:
X MetaSMPTEEvent();
X MetaSMPTEEvent(unsigned long t, unsigned char h, unsigned char m,
X unsigned char s, unsigned char f, unsigned char ff);
X MetaSMPTEEvent(const MetaSMPTEEvent &e);
X virtual Event *Dup(void) const {return (new MetaSMPTEEvent(*this));}
X
X virtual EventType GetType(void) const {return (METASMPTE);}
X virtual char *GetTypeStr(void) const {return ("MetaSMPTEEvent");}
X virtual char *GetEventStr(void) const;
X unsigned char GetHour(void) const {return (hour);}
X unsigned char GetMinute(void) const {return (minute);}
X unsigned char GetSecond(void) const {return (second);}
X unsigned char GetFrame(void) const {return (frame);}
X unsigned char GetFractionalFrame(void) const
X {return (fractional_frame);}
X
X void SetHour(unsigned char h) {hour = h;}
X void SetMinute(unsigned char m) {minute = m;}
X void SetSecond(unsigned char s) {second = s;}
X void SetFrame(unsigned char f) {frame = f;}
X void SetFractionalFrame(unsigned char ff) {fractional_frame = ff;}
X
X MetaSMPTEEvent &operator=(const MetaSMPTEEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char hour;
X unsigned char minute;
X unsigned char second;
X unsigned char frame;
X unsigned char fractional_frame;
X};
X#endif
END_OF_FILE
if test 3170 -ne `wc -c <'tclmidi-2.0/events/MetaSMPTE.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaSMPTE.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaSMPTE.h'
fi
if test -f 'tclmidi-2.0/events/MetaSeqSpec.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaSeqSpec.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaSeqSpec.h'\" \(2848 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaSeqSpec.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METASEQSPEC_H
X#define METASEQSPEC_H
X
X#include "MetaEvent.h"
X
Xclass MetaSequencerSpecificEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os,
X const MetaSequencerSpecificEvent &e);
Xpublic:
X MetaSequencerSpecificEvent();
X MetaSequencerSpecificEvent(unsigned long t, const unsigned char *data,
X long length);
X MetaSequencerSpecificEvent(const MetaSequencerSpecificEvent &e);
X virtual ~MetaSequencerSpecificEvent();
X virtual Event *Dup(void) const
X {return (new MetaSequencerSpecificEvent(*this));}
X
X virtual EventType GetType(void) const {return (METASEQUENCERSPECIFIC);}
X virtual char *GetTypeStr(void) const
X {return ("MetaSequencerSpecificEvent");}
X virtual char *GetEventStr(void) const;
X const unsigned char *GetData(void) const {return (data);}
X long GetLength(void) const {return (length);}
X
X void SetData(const unsigned char *data, long length);
X
X MetaSequencerSpecificEvent &operator=(
X const MetaSequencerSpecificEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char *data;
X long length;
X};
X#endif
END_OF_FILE
if test 2848 -ne `wc -c <'tclmidi-2.0/events/MetaSeqSpec.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaSeqSpec.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaSeqSpec.h'
fi
if test -f 'tclmidi-2.0/events/MetaTime.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaTime.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaTime.h'\" \(3110 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaTime.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METATIME_H
X#define METATIME_H
X
X#include "MetaEvent.h"
X
Xclass MetaTimeEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os, const MetaTimeEvent &e);
Xpublic:
X MetaTimeEvent();
X MetaTimeEvent(unsigned long time, unsigned char n = 4,
X unsigned char d = 4, unsigned char c = 24, unsigned char t = 8);
X MetaTimeEvent(const MetaTimeEvent &e);
X virtual Event *Dup(void) const {return (new MetaTimeEvent(*this));}
X
X virtual EventType GetType(void) const {return (METATIME);}
X virtual char *GetTypeStr(void) const {return ("MetaTimeEvent");}
X virtual char *GetEventStr(void) const;
X unsigned char GetNumerator(void) const {return (numerator);}
X unsigned char GetDenominator(void) const {return (denominator);}
X unsigned char GetClocksPerBeat(void) const {return (clocks);}
X unsigned char Get32ndNotesPerQuarterNote(void) const
X {return (thirty_seconds);}
X
X void SetNumerator(unsigned char n) {numerator = n;}
X void SetDenominator(unsigned char d) {denominator = d;}
X void SetClocksPerBeat(unsigned char c) {clocks = c;}
X void Set32ndNotesPerQuarterNote(unsigned char t) {thirty_seconds = t;}
X
X MetaTimeEvent &operator=(const MetaTimeEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char numerator;
X unsigned char denominator;
X unsigned char clocks;
X unsigned char thirty_seconds;
X};
X#endif
END_OF_FILE
if test 3110 -ne `wc -c <'tclmidi-2.0/events/MetaTime.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaTime.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaTime.h'
fi
if test -f 'tclmidi-2.0/events/MetaUnknown.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/MetaUnknown.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/MetaUnknown.h'\" \(2885 characters\)
sed "s/^X//" >'tclmidi-2.0/events/MetaUnknown.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef METAUNKNOWN_H
X#define METAUNKNOWN_H
X
X#include "MetaEvent.h"
X
Xclass MetaUnknownEvent : public MetaEvent {
X friend ostream &operator<<(ostream &os, const MetaUnknownEvent &e);
Xpublic:
X MetaUnknownEvent();
X MetaUnknownEvent(unsigned char t);
X MetaUnknownEvent(unsigned long t, const unsigned char *data,
X long length, unsigned char ty);
X MetaUnknownEvent(const MetaUnknownEvent &e);
X virtual ~MetaUnknownEvent();
X virtual Event *Dup(void) const {return (new MetaUnknownEvent(*this));}
X
X virtual EventType GetType(void) const {return (METAUNKNOWN);}
X virtual char *GetTypeStr(void) const {return ("MetaUnknownEvent");}
X virtual char *GetEventStr(void) const;
X const unsigned char *GetData(void) const {return (data);}
X long GetLength(void) const {return (length);}
X unsigned char GetMetaType(void) const {return (type);}
X
X void SetData(const unsigned char *data, long length);
X void SetMetaType(unsigned char t) {type = t;}
X
X MetaUnknownEvent &operator=(const MetaUnknownEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char type;
X unsigned char *data;
X long length;
X};
X#endif
END_OF_FILE
if test 2885 -ne `wc -c <'tclmidi-2.0/events/MetaUnknown.h'`; then
echo shar: \"'tclmidi-2.0/events/MetaUnknown.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/MetaUnknown.h'
fi
if test -f 'tclmidi-2.0/events/PitchWheel.C' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/PitchWheel.C'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/PitchWheel.C'\" \(3109 characters\)
sed "s/^X//" >'tclmidi-2.0/events/PitchWheel.C' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#include "PitchWheel.h"
X
XPitchWheelEvent::PitchWheelEvent() : value(0)
X{
X}
X
XPitchWheelEvent::PitchWheelEvent(unsigned long t, unsigned char chan,
X short val) : NormalEvent(t, chan), value(val)
X{
X}
X
XPitchWheelEvent::PitchWheelEvent(const PitchWheelEvent &e) : NormalEvent(e),
X value(e.value)
X{
X}
X
XPitchWheelEvent &
XPitchWheelEvent::operator=(const PitchWheelEvent &e)
X{
X
X (NormalEvent)*this = (NormalEvent)e;
X value = e.value;
X return (*this);
X}
X
Xchar *
XPitchWheelEvent::GetEventStr(void) const
X{
X ostrstream buf;
X char *tbuf;
X
X tbuf = NormalEvent::GetEventStr();
X buf << tbuf << " Value: " << (int)value << ends;
X delete tbuf;
X return(buf.str());
X}
X
Xconst char *
XPitchWheelEvent::SMFRead(SMFTrack &t)
X{
X const unsigned char *ptr;
X
X if ((ptr = t.GetByte()) == 0)
X return ("Incomplete PitchWheelEvent");
X value = *ptr;
X if ((ptr = t.GetByte()) == 0)
X return ("Incomplete PitchWheelEvent");
X value |= (short)*ptr << 7;
X return (0);
X}
X
Xconst char *
XPitchWheelEvent::SMFWrite(SMFTrack &t) const
X{
X
X if (!t.PutByte(value & 0x7f))
X return ("Out of memory");
X if (!t.PutByte((value >> 7) & 0x7f))
X return ("Out of memory");
X return (0);
X}
X
Xint
XPitchWheelEvent::Equal(const Event *e) const
X{
X PitchWheelEvent *eptr = (PitchWheelEvent *)e;
X
X return (NormalEvent::Equal(e) && value == eptr->value);
X}
X
Xostream &
Xoperator<<(ostream &os, const PitchWheelEvent &e)
X{
X char *str;
X
X os << (str = e.GetEventStr());
X delete str;
X return (os);
X}
END_OF_FILE
if test 3109 -ne `wc -c <'tclmidi-2.0/events/PitchWheel.C'`; then
echo shar: \"'tclmidi-2.0/events/PitchWheel.C'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/PitchWheel.C'
fi
if test -f 'tclmidi-2.0/events/Program.C' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/Program.C'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/Program.C'\" \(2888 characters\)
sed "s/^X//" >'tclmidi-2.0/events/Program.C' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#include "Program.h"
X
XProgramEvent::ProgramEvent() : value(0)
X{
X}
X
XProgramEvent::ProgramEvent(unsigned long t, unsigned char chan,
X unsigned char val) : NormalEvent(t, chan), value(val)
X{
X}
X
XProgramEvent::ProgramEvent(const ProgramEvent &e) : NormalEvent(e),
X value(e.value)
X{
X}
X
XProgramEvent &
XProgramEvent::operator=(const ProgramEvent &e)
X{
X
X (NormalEvent)*this = (NormalEvent)e;
X value = e.value;
X return (*this);
X}
X
Xchar *
XProgramEvent::GetEventStr(void) const
X{
X ostrstream buf;
X char *tbuf;
X
X tbuf = NormalEvent::GetEventStr();
X buf << tbuf << " Value: " << (int)value << ends;
X delete tbuf;
X return (buf.str());
X}
X
Xconst char *
XProgramEvent::SMFRead(SMFTrack &t)
X{
X const unsigned char *ptr;
X
X if ((ptr = t.GetByte()) == 0)
X return ("Incomplete ProgramEvent");
X value = *ptr;
X return (0);
X}
X
Xconst char *
XProgramEvent::SMFWrite(SMFTrack &t) const
X{
X
X if (!t.PutByte(value))
X return ("Out of memory");
X return (0);
X}
X
Xint
XProgramEvent::Equal(const Event *e) const
X{
X ProgramEvent *eptr = (ProgramEvent *)e;
X
X return (NormalEvent::Equal(e) && value == eptr->value);
X}
X
Xostream &
Xoperator<<(ostream &os, const ProgramEvent &e)
X{
X char *str;
X
X os << (str = e.GetEventStr());
X delete str;
X return (os);
X}
END_OF_FILE
if test 2888 -ne `wc -c <'tclmidi-2.0/events/Program.C'`; then
echo shar: \"'tclmidi-2.0/events/Program.C'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/Program.C'
fi
if test -f 'tclmidi-2.0/events/SystemExcl.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/events/SystemExcl.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/events/SystemExcl.h'\" \(2938 characters\)
sed "s/^X//" >'tclmidi-2.0/events/SystemExcl.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef SYSEXEVENT_H
X#define SYSEXEVENT_H
X
X#include "Event.h"
X
Xclass SystemExclusiveEvent : public Event {
X friend ostream &operator<<(ostream &os, const SystemExclusiveEvent &e);
Xpublic:
X SystemExclusiveEvent();
X SystemExclusiveEvent(unsigned char c);
X SystemExclusiveEvent(unsigned long t, const unsigned char *data,
X long length);
X SystemExclusiveEvent(const SystemExclusiveEvent &e);
X virtual ~SystemExclusiveEvent();
X virtual Event *Dup(void) const
X {return (new SystemExclusiveEvent(*this));}
X
X virtual EventType GetType(void) const {return (SYSTEMEXCLUSIVE);}
X virtual char *GetTypeStr(void) const {return ("SystemExclusiveEvent");}
X virtual char *GetEventStr(void) const;
X const unsigned char *GetData(void) const {return (data);}
X long GetLength(void) const {return (length);}
X unsigned char GetContinued(void) const {return (continued);}
X
X void SetData(const unsigned char *data, long length);
X void SetContinued(unsigned char cont) {continued = cont;}
X
X SystemExclusiveEvent &operator=(const SystemExclusiveEvent &e);
X
X virtual const char *SMFRead(SMFTrack &t);
X virtual const char *SMFWrite(SMFTrack &t) const;
Xprotected:
X virtual int Equal(const Event *e) const;
Xprivate:
X unsigned char *data;
X unsigned char continued;
X long length;
X};
X#endif
END_OF_FILE
if test 2938 -ne `wc -c <'tclmidi-2.0/events/SystemExcl.h'`; then
echo shar: \"'tclmidi-2.0/events/SystemExcl.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/events/SystemExcl.h'
fi
if test -f 'tclmidi-2.0/man/midirecord.n' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/man/midirecord.n'\"
else
echo shar: Extracting \"'tclmidi-2.0/man/midirecord.n'\" \(1764 characters\)
sed "s/^X//" >'tclmidi-2.0/man/midirecord.n' <<'END_OF_FILE'
X.Dd January 30, 1994
X.Dt MIDIRECORD N
X.Os
X.Sh NAME
X.Nm midirecord
X.Nd "tclmidi command to record a MIDI song"
X.Sh SYNOPSIS
X.Nm
X.Ar RecMidiID
X.Op PlayMidiID Op repeat
X.Sh DESCRIPTION
X.Nm
Xis a
X.Xr tclmidi 1
Xcommand that records events from a \%MIDI
Xdevice and puts them in a \%MIDI song.
XCurrently, only MPU-401 compatible cards in UART mode are
Xsupported.
XA device driver for the MPU-401 is included with this
Xrelease for the following architectures:
X.Bl -item -offset indent -compact
X.It
XBSD/386
X.It
X386BSD and variants
X.It
XSVR4
X.It
XLinux
X.El
X.Pp
XThe first argument to
X.Nm
Xis the \%MIDI song descriptor of the record song.
XIt should be one returned from
X.Xr midimake n
Xor
X.Xr midiread n .
XThe second argument is an optional \%MIDI song descriptor
Xfor a song that should be played while recording.
XFurthermore, an optional third argument of ``repeat'' may be specified
Xso the play song will be repeated.
X.Pp
XRecording continues until the
X.Xr midistop n
Xcommand is issued.
X.Xr midiwait n
Xmay be used to block until the play song finishes.
X.Pp
XAll recorded events are put into track 0 of the \%MIDI song.
X.Sh RETURN VALUES
X.Nm
Xreturns immediately with 0
Xif no \%MIDI devices are available, or
X1 if one is.
X.Sh BUGS
XThe MPU-401 device interface
Xdynamically creates events in the record \%MIDI song
Xasynchronously.
XSince this involves a call to
X.Xr malloc 3
Xwhich
Xis not re-entrant, this is a potential hazard.
XUntil I figure out a way around this, avoid other
Xcalls to
X.Xr malloc 3
Xwhile recording.
XThreads would provide a good way to work around this, but
Xuntil they are more common, we'll just have to be careful.
X.Sh SEE ALSO
X.Xr tclm 1 ,
X.Xr midiplay n ,
X.Xr midiread n ,
X.Xr midimake n ,
X.Xr midistop n ,
X.Xr midiwait n
X.Sh AUTHOR
XMike Durian - durian@boogie.com
END_OF_FILE
if test 1764 -ne `wc -c <'tclmidi-2.0/man/midirecord.n'`; then
echo shar: \"'tclmidi-2.0/man/midirecord.n'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/man/midirecord.n'
fi
if test -f 'tclmidi-2.0/smf/SMFUtils.C' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/smf/SMFUtils.C'\"
else
echo shar: Extracting \"'tclmidi-2.0/smf/SMFUtils.C'\" \(3083 characters\)
sed "s/^X//" >'tclmidi-2.0/smf/SMFUtils.C' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#include <stdlib.h>
X#include <unistd.h>
X#include "SMFUtils.h"
X
Xstatic int MEOF = 0;
X
Xlong
XMRead(int fd, char *data, long len)
X{
X int num_read;
X int total_read;
X
X total_read = 0;
X do {
X if ((num_read = read(fd, data, len - total_read)) == -1)
X return (-1);
X if (num_read == 0)
X break;
X total_read += num_read;
X data += num_read;
X } while (len > total_read);
X if (total_read == 0)
X MEOF = 1;
X return (total_read);
X}
X
Xlong
XMWrite(int fd, char *data, long len)
X{
X int num_written;
X int total_written;
X
X total_written = 0;
X do {
X if ((num_written = write(fd, data, len - total_written)) == -1)
X return (-1);
X if (num_written == 0)
X break;
X total_written += num_written;
X data += num_written;
X } while (len > total_written);
X return (total_written);
X}
X
Xint
XMEof(void)
X{
X
X return (MEOF);
X}
X
Xvoid
XClearMEof(void)
X{
X
X MEOF = 0;
X}
X
Xlong
XVarToFix(unsigned char *var, int *len)
X{
X long fix;
X
X fix = 0;
X *len = 0;
X if (*var & 0x80)
X do {
X fix = (fix << 7) + (*var & 0x7f);
X (*len)++;
X } while (*var++ & 0x80);
X else {
X fix = *var++;
X (*len)++;
X }
X
X return (fix);
X}
X
X
Xint
XFixToVar(long fix, unsigned char *var)
X{
X int i;
X unsigned char buf[4];
X unsigned char *bptr;
X
X buf[0] = buf[1] = buf[2] = buf[3] = 0;
X bptr = buf;
X *bptr++ = fix & 0x7f;
X while ((fix >>= 7) > 0) {
X *bptr |= 0x80;
X *bptr++ += (fix & 0x7f);
X }
X
X i = 0;
X do {
X *var++ = *--bptr;
X i++;
X } while (bptr != buf);
X
X return (i);
X}
X
END_OF_FILE
if test 3083 -ne `wc -c <'tclmidi-2.0/smf/SMFUtils.C'`; then
echo shar: \"'tclmidi-2.0/smf/SMFUtils.C'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/smf/SMFUtils.C'
fi
if test -f 'tclmidi-2.0/song/EventTree.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/song/EventTree.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/song/EventTree.h'\" \(3191 characters\)
sed "s/^X//" >'tclmidi-2.0/song/EventTree.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef EVENTTREE_H
X#define EVENTTREE_H
X
X#include <iostream.h>
X#include <strstream.h>
X#include <iomanip.h>
X
X#include "Event.h"
X
Xextern "C" {
X#include "rb.h"
X}
X
Xtypedef struct rb_node EventTreeNode;
Xtypedef struct rb_node EventTreeHead;
X
Xclass EventTree {
X friend ostream &operator<<(ostream &os, const EventTree &t);
Xpublic:
X EventTree();
X EventTree(const EventTree &t);
X ~EventTree();
X
X Event *GetEvents(unsigned long time);
X Event *NextEvent(void);
X Event *NextEvent(const Event *e);
X Event *NextEvents(void);
X Event *NextEvents(const Event *e);
X Event *PrevEvent(void);
X Event *PrevEvent(const Event *e);
X Event *PrevEvents(void);
X Event *PrevEvents(const Event *e);
X Event *GetFirstEvent(void);
X Event *GetFirstEvents(void);
X Event *GetLastEvent(void);
X Event *GetLastEvents(void);
X EventTreeNode *GetFirstNode(void);
X EventTreeNode *GetLastNode(void);
X EventTreeNode *NextNode(const EventTreeNode *n);
X EventTreeNode *PrevNode(const EventTreeNode *n);
X unsigned long GetStartTime(void);
X unsigned long GetEndTime(void);
X
X int Add(const EventTree &et, unsigned long start, double scalar = 1);
X EventTree *GetRange(unsigned long start, unsigned long end) const;
X int DeleteRange(unsigned long start, unsigned long end);
X
X Event *PutEvent(const Event &event);
X void RewindEvents(void);
X int DeleteEvent(const Event &event);
X
X EventTree &operator=(const EventTree &t);
Xprivate:
X void DeleteTree(void);
X void CopyTree(const EventTree &t);
X
X EventTreeHead *head;
X EventTreeNode *curr_node;
X Event *curr_event;
X};
X#endif
END_OF_FILE
if test 3191 -ne `wc -c <'tclmidi-2.0/song/EventTree.h'`; then
echo shar: \"'tclmidi-2.0/song/EventTree.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/song/EventTree.h'
fi
if test -f 'tclmidi-2.0/song/Song.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tclmidi-2.0/song/Song.h'\"
else
echo shar: Extracting \"'tclmidi-2.0/song/Song.h'\" \(3201 characters\)
sed "s/^X//" >'tclmidi-2.0/song/Song.h' <<'END_OF_FILE'
X/*-
X * Copyright (c) 1993, 1994 Michael B. Durian. All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X * notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X * notice, this list of conditions and the following disclaimer in the
X * documentation and/or other materials provided with the distribution.
X * 3. All advertising materials mentioning features or use of this software
X * must display the following acknowledgement:
X * This product includes software developed by Michael B. Durian.
X * 4. The name of the the Author may be used to endorse or promote
X * products derived from this software without specific prior written
X * permission.
X *
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
X * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
X * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X */
X#ifndef SONG_H
X#define SONG_H
X
X#include "EventTree.h"
X
Xclass Song {
X friend ostream &operator<<(ostream &os, const Song &s);
Xpublic:
X Song();
X Song(const Song &s);
X Song(short num);
X Song(short form, short div, short num);
X ~Song();
X
X Event *GetEvents(short track, unsigned long time);
X Event *NextEvent(short track);
X Event *PrevEvent(short track);
X short GetFormat(void) const {return (format);}
X short GetDivision(void) const {return (division);}
X short GetNumTracks(void) const {return (num_tracks);}
X EventTree &GetTrack(short track);
X
X Event *PutEvent(short track, const Event &event);
X void RewindEvents(void);
X void RewindEvents(short track);
X int DeleteEvent(short track, const Event &event);
X void SetFormat(short form) {format = form;}
X void SetDivision(short div) {division = div;}
X void SetNumTracks(short num);
X
X int Add(short track, const EventTree &et, unsigned long start,
X double scalar = 1.0);
X EventTree *GetRange(short track, unsigned long start,
X unsigned long end) const;
X int DeleteRange(short track, unsigned long start, unsigned long end);
X
X int Merge(short dest_track, const Song &song, short src_track);
X int Split(short src_track, Song &meta_song, short meta_track,
X Song &normal_song, short normal_track) const;
X
X Song &operator=(const Song &s);
X
X int SMFRead(int fd);
X int SMFWrite(int fd);
X const char *GetError(void) const;
X
X void SetNotePair(int track_num, Event *event);
Xprivate:
X short format;
X short division;
X short num_tracks;
X EventTree *tracks;
X const char *errstr;
X};
X#endif
END_OF_FILE
if test 3201 -ne `wc -c <'tclmidi-2.0/song/Song.h'`; then
echo shar: \"'tclmidi-2.0/song/Song.h'\" unpacked with wrong size!
fi
# end of 'tclmidi-2.0/song/Song.h'
fi
echo shar: End of archive 10 \(of 14\).
cp /dev/null ark10isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 14 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still must unpack the following archives:
echo " " ${MISSING}
fi
exit 0
exit 0 # Just in case...