3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
42 |
EventGenerator(uint SampleRate); |
EventGenerator(uint SampleRate); |
43 |
void UpdateFragmentTime(uint SamplesToProcess); |
void UpdateFragmentTime(uint SamplesToProcess); |
44 |
Event CreateEvent(); |
Event CreateEvent(); |
45 |
|
Event CreateEvent(int32_t FragmentPos); |
46 |
protected: |
protected: |
47 |
typedef RTMath::time_stamp_t time_stamp_t; |
typedef RTMath::time_stamp_t time_stamp_t; |
48 |
inline int32_t ToFragmentPos(time_stamp_t TimeStamp) { |
inline int32_t ToFragmentPos(time_stamp_t TimeStamp) { |
61 |
|
|
62 |
/** |
/** |
63 |
* Events are usually caused by a MIDI source or an internal modulation |
* Events are usually caused by a MIDI source or an internal modulation |
64 |
* controller like LFO or EG. An event can only be created by an |
* controller like LFO or EG. An event should only be created by an |
65 |
* EventGenerator. |
* EventGenerator! |
66 |
* |
* |
67 |
* @see EventGenerator |
* @see EventGenerator |
68 |
*/ |
*/ |
85 |
uint8_t Velocity; ///< Trigger or release velocity of note-on / note-off event. |
uint8_t Velocity; ///< Trigger or release velocity of note-on / note-off event. |
86 |
int8_t Layer; ///< Layer index (usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices). |
int8_t Layer; ///< Layer index (usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices). |
87 |
int8_t ReleaseTrigger; ///< If new voice should be a release triggered voice (actually boolean field and usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices). |
int8_t ReleaseTrigger; ///< If new voice should be a release triggered voice (actually boolean field and usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices). |
88 |
|
void* pRegion; ///< Engine specific pointer to instrument region |
89 |
} Note; |
} Note; |
90 |
/// Control change event specifics |
/// Control change event specifics |
91 |
struct _CC { |
struct _CC { |
102 |
} Sysex; |
} Sysex; |
103 |
} Param; |
} Param; |
104 |
EngineChannel* pEngineChannel; ///< Pointer to the EngineChannel where this event occured on, NULL means Engine global event (e.g. SysEx message). |
EngineChannel* pEngineChannel; ///< Pointer to the EngineChannel where this event occured on, NULL means Engine global event (e.g. SysEx message). |
105 |
|
MidiInputPort* pMidiInputPort; ///< Pointer to the MIDI input port on which this event occured (NOTE: currently only for global events, that is SysEx messages) |
106 |
|
|
107 |
inline int32_t FragmentPos() { |
inline int32_t FragmentPos() { |
108 |
if (iFragmentPos >= 0) return iFragmentPos; |
if (iFragmentPos >= 0) return iFragmentPos; |
116 |
protected: |
protected: |
117 |
typedef EventGenerator::time_stamp_t time_stamp_t; |
typedef EventGenerator::time_stamp_t time_stamp_t; |
118 |
Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time); |
Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time); |
119 |
|
Event(EventGenerator* pGenerator, int32_t FragmentPos); |
120 |
friend class EventGenerator; |
friend class EventGenerator; |
121 |
private: |
private: |
122 |
EventGenerator* pEventGenerator; ///< Creator of the event. |
EventGenerator* pEventGenerator; ///< Creator of the event. |