Ardour  9.0-pre0-384-ga76afae0e9
surfaces/mackie/midi_byte_array.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2007 John Anderson
3  * Copyright (C) 2008-2012 Paul Davis <paul@linuxaudiosystems.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 #ifndef midi_byte_array_h
20 #define midi_byte_array_h
21 
22 #include <iostream>
23 #include <vector>
24 
25 //#include <midi++/types.h>
26 namespace MIDI {
27  typedef unsigned char byte;
28 }
29 
47 class MidiByteArray : public std::vector<MIDI::byte>
48 {
49 public:
50  MidiByteArray() : std::vector<MIDI::byte>() {}
51 
52  MidiByteArray( size_t count, MIDI::byte array[] );
53 
57  MidiByteArray( size_t count, MIDI::byte first, ... );
58 
60  void copy( size_t count, MIDI::byte arr[] );
61 };
62 
65 
67 MidiByteArray & operator << ( MidiByteArray & mba, const std::string & );
68 
71 
73 std::ostream & operator << ( std::ostream & os, const MidiByteArray & mba );
74 
75 #endif
void copy(size_t count, MIDI::byte arr[])
copy the given number of bytes from the given array
MidiByteArray(size_t count, MIDI::byte array[])
MidiByteArray(size_t count, MIDI::byte first,...)
MidiByteArray & operator<<(MidiByteArray &mba, const MIDI::byte &b)
append the given byte to the end of the array