NiCMidi 1.1.0
A MIDI library derived from J.D.Koftinoff jdksmidi
filewritemultitrack.h
Go to the documentation of this file.
1/*
2 * NiCMidi - A C++ Class Library for MIDI
3 *
4 * Copyright (C) 2004 J.D. Koftinoff Software, Ltd.
5 * www.jdkoftinoff.com jeffk@jdkoftinoff.com
6 * Copyright (C) 2021, 2022 Nicola Cassetta
7 * https://github.com/ncassetta/NiCMidi
8 *
9 * This file is part of NiCMidi.
10 *
11 * NiCMidi is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as
13 * published by the Free Software Foundation, either version 3 of
14 * the License, or (at your option) any later version.
15 *
16 * NiCMidi is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with NiCMidi. If not, see <http://www.gnu.org/licenses/>.
23 */
24
25
28
29
30#ifndef _NICMIDI_FILEWRITEMULTITRACK_H
31#define _NICMIDI_FILEWRITEMULTITRACK_H
32
33#include "filewrite.h"
34#include "multitrack.h"
35
36
47 public:
50 MIDIFileWriteMultiTrack(const MIDIMultiTrack *mlt, std::ostream *ost);
52 virtual ~MIDIFileWriteMultiTrack() {}
54 bool Write(int num_tracks, int division);
55
56 private:
57
58 virtual bool PreWrite();
59 virtual bool PostWrite();
60
61 const MIDIMultiTrack *multitrack;
62 MIDIFileWriter writer;
64};
65
66
69
72
79bool WriteMIDIFile(const char* filename, int format, const MIDIMultiTrack* tracks, bool strip = false);
82bool WriteMIDIFile(const std::string& filename, int format, const MIDIMultiTrack* tracks, bool strip = false);
85
86#endif
Writes the contents of a MIDIMultiTrack to a std::ostream in the MIDI file format.
Definition: filewritemultitrack.h:45
Holds an array of pointers to MIDITrack objects to be played simultaneously.
Definition: multitrack.h:50
Contains the definition of the class MIDIFileWiter; this is a low level object used by the MIDIFileWr...
bool WriteMIDIFile(const char *filename, int format, const MIDIMultiTrack *tracks, bool strip=false)
Writes the given MIDIMultiTrack object into a MIDI file.
Contains the definition of the classes MIDIMultiTrack, MIDIMultiTrackIteratorState,...