inline bool is_channel_pressure() const { return (type() == MIDI_CMD_CHANNEL_PRESSURE); }
inline uint8_t note() const { return (this->_buf[1]); }
inline uint8_t velocity() const { return (this->_buf[2]); }
- inline void set_velocity(uint8_t value) { this->_buf[2] = value; }
- inline void scale_velocity(float factor) {
+ inline void set_velocity(uint8_t value) { this->_buf[2] = value; }
+ inline void scale_velocity(float factor) {
if (factor < 0) factor = 0;
this->_buf[2] = (uint8_t) lrintf (this->_buf[2]*factor);
if (this->_buf[2] > 127) this->_buf[2] = 127;
typedef double MusicalTime;
static inline bool musical_time_equal (MusicalTime a, MusicalTime b) {
- /* acceptable tolerance is 1 tick. Nice if there was no magic number here */
+ /* acceptable tolerance is 1 tick. Nice if there was no magic number here */
return fabs (a - b) <= (1.0/1920.0);
}
bool reset = false;
{
- Glib::Mutex::Lock lm (_lock);
+ Glib::Mutex::Lock lm (_lock);
ControlEvent cp (start, 0.0f);
iterator s;
iterator e;
case 2:
if (x >= _events.back()->when) {
return _events.back()->value;
- } else if (x <= _events.front()->when) {
+ } else if (x <= _events.front()->when) {
return _events.front()->value;
}
default:
if (x >= _events.back()->when) {
return _events.back()->value;
- } else if (x <= _events.front()->when) {
+ } else if (x <= _events.front()->when) {
return _events.front()->value;
}