/usr/include/tse3/MidiData.h is in libtse3-dev 0.3.1-4.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | /*
* @(#)MidiData.h 3.00 14 May 1999
*
* Copyright (c) 2000 Pete Goodliffe (pete@cthree.org)
*
* This file is part of TSE3 - the Trax Sequencer Engine version 3.00.
*
* This library is modifiable/redistributable under the terms of the GNU
* General Public License.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING. If not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef TSE3_MIDIDATA_H
#define TSE3_MIDIDATA_H
#include "tse3/listen/MidiData.h"
#include "tse3/Notifier.h"
#include "tse3/Midi.h"
#include "tse3/Playable.h"
#include <vector>
#include <cstddef>
namespace TSE3
{
/**
* The MidiData class represents a list of @ref MidiEvents in time order.
* It is an abstract base class, notably implemented by @ref Phrase and
* @ref PhraseEdit.
*
* MidiData objects are not designed to be editable. Only the
* @ref PhraseEdit class defines an editable MidiData object.
*
* MidiData does not implement the @ref Playable interface. This is for a
* very good reason: more than one @ref Part may be using a given
* @ref Phrase at the same time. The @ref Playable interface doesn't
* provide an 'iterator' type so only one client can play a @ref Playable
* at once. Therefore MidiData doesn't implement @ref Playable. It's a
* piece of cake to use, anyway.
*
* @short A list of MidiEvents
* @author Pete Goodliffe
* @version 3.00
* @see MidiEvent
* @see Phrase
* @see PhraseEdit
* @see MidiDataListener
*/
class MidiData : public Playable,
public Notifier<MidiDataListener>
{
public:
/**
* Returns the number of @ref MidiEvents in this MidiData object.
*
* @return Number of @ref MidiEvents
*/
size_t size() const { return data.size(); }
/**
* Returns the nth @ref MidiEvent in this MidiData object.
*
* The value returned for an index that is out of range is
* undefined. The @ref size method describes the valid
* values.
*
* @param n Index
* @return MidiEvent at index n
*/
MidiEvent const &operator[](size_t n) const { return data[n]; }
/**
* Returns the index of the first event that occurs after
* the given @ref Clock.
*
* @param m Clock value to search for.
* @return Index of first MidiEvent at or after this time.
* If past the end of the MidiData object then returns
* 'size'.
*/
size_t index(Clock c) const;
/**
* @reimplemented
*/
virtual PlayableIterator *iterator(Clock index);
/**
* @reimplemented
*/
virtual Clock lastClock() const;
protected:
/**
* MidiData objects can only be created by @ref PhraseEdit
* objects.
*/
MidiData(int noEvents);
virtual ~MidiData() = 0;
MidiData &operator=(const MidiData &);
MidiData(const MidiData &);
std::vector<MidiEvent> data;
friend class PhraseEdit;
};
}
#endif
|