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-2009 Christian Schoenebeck * |
* Copyright (C) 2005-2010 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 * |
22 |
***************************************************************************/ |
***************************************************************************/ |
23 |
|
|
24 |
#ifndef __LS_VOICE_H__ |
#ifndef __LS_VOICE_H__ |
25 |
#define __LS_VOICE_H__ |
#define __LS_VOICE_H__ |
26 |
|
|
27 |
#include "Event.h" |
#include "Event.h" |
28 |
#include "../../common/Pool.h" |
#include "../../common/Pool.h" |
40 |
playback_state_disk = 3 |
playback_state_disk = 3 |
41 |
}; |
}; |
42 |
|
|
43 |
// Types |
// Type bits. Mostly mutual exclusive, but a voice may both be of one shot type and require a release trigger at the same time. |
44 |
enum type_t { |
enum type_t { |
45 |
type_normal, |
type_normal = 0, |
46 |
type_release_trigger_required, ///< If the key of this voice will be released, it causes a release triggered voice to be spawned |
type_release_trigger_required = 1 << 1, ///< If the key of this voice will be released, it causes a release triggered voice to be spawned |
47 |
type_release_trigger ///< Release triggered voice which cannot be killed by releasing its key |
type_release_trigger = 1 << 2, ///< Release triggered voice which cannot be killed by releasing its key |
48 |
|
type_one_shot = 1 << 3, ///< Voice should not be released by note off |
49 |
|
type_controller_triggered = 1 << 4 ///< Voice is triggered by MIDI CC instead of a note on |
50 |
}; |
}; |
51 |
|
|
52 |
struct PitchInfo { |
struct PitchInfo { |
121 |
Voice() { } |
Voice() { } |
122 |
virtual ~Voice() { } |
virtual ~Voice() { } |
123 |
}; |
}; |
|
} // namespace LinuxSampler |
|
124 |
|
|
125 |
#endif /* __LS_VOICE_H__ */ |
// |= operator for the type_t enum |
126 |
|
inline Voice::type_t operator|=(Voice::type_t& lhs, Voice::type_t rhs) { |
127 |
|
return lhs = static_cast<Voice::type_t>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); |
128 |
|
} |
129 |
|
|
130 |
|
} // namespace LinuxSampler |
131 |
|
|
132 |
|
#endif /* __LS_VOICE_H__ */ |