31#ifndef _NICMIDI_FILEWRITE_H
32#define _NICMIDI_FILEWRITE_H
47 MIDIFileWriter(std::ostream *out_stream_);
48 virtual ~MIDIFileWriter() {}
50 bool ErrorOccurred() {
return error; }
51 unsigned long GetFileLength() {
return file_length; }
52 unsigned long GetTrackLength() {
return track_length; }
53 void ResetTrackLength() { track_length = 0; }
54 void ResetTrackTime() { track_time = 0; }
56 void WriteFileHeader(
int format,
int ntrks,
int division);
57 void WriteTrackHeader(
unsigned long length);
61 void WriteMetaEvent(
unsigned long time,
unsigned char type,
const unsigned char *data,
long length );
62 void WriteEndOfTrack(
unsigned long time);
64 virtual void RewriteTrackLength();
67 virtual void Error(
char *s);
69 void WriteCharacter(
unsigned char c) { out_stream->put(c);
if(!out_stream->good()) error =
true; }
70 void Seek(
unsigned long pos) { out_stream->seekp(pos);
if (!out_stream->good()) error =
true; }
71 void IncrementCounters(
int c) { track_length += c; file_length += c; }
72 void WriteShort(
unsigned short c);
73 void Write3Char(
long c);
74 void WriteLong(
unsigned long c);
75 int WriteVariableNum(
unsigned long n);
76 void WriteDeltaTime(
unsigned long time);
81 unsigned long file_length;
82 unsigned long track_length;
83 unsigned long track_time;
84 unsigned long track_position;
85 unsigned char running_status;
87 std::ostream* out_stream;
The MIDITimedMessage class inherits from the MIDIMessage and represents a message associated with a s...
Definition: msg.h:382
Contains the definition of the classes MIDIMessage and MIDITimedMessage.