Skip to content

Commit

Permalink
- MIDI Controller mapped shortcuts now working as one-shot,
Browse files Browse the repository at this point in the history
  latched/toggled trigger, independent of MIDI event value.
  • Loading branch information
rncbc committed Dec 21, 2017
1 parent fdd8776 commit 7df5811
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Qtractor - An Audio/MIDI multi-track sequencer
ChangeLog


GIT HEAD

- MIDI Controller mapped shortcuts now working as one-shot,
latched/toggled trigger, independent of MIDI event value.


0.8.5 2017-12-04 Autumn'17 Beta.

- Audio clip gain and panning properties are now taken into
Expand Down
8 changes: 6 additions & 2 deletions src/qtractorMidiControlObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ qtractorMidiControlObserver::~qtractorMidiControlObserver (void)
unsigned short qtractorMidiControlObserver::midiScale (void) const
{
if (m_ctype == qtractorMidiEvent::PITCHBEND ||

m_ctype == qtractorMidiEvent::CONTROL14 ||
m_ctype == qtractorMidiEvent::REGPARAM ||
m_ctype == qtractorMidiEvent::NONREGPARAM)
Expand All @@ -100,7 +101,10 @@ void qtractorMidiControlObserver::setMidiValue ( unsigned short iValue )
= float(m_bInvert ? iScale - iValue : iValue) / float(iScale);
float fValue = valueFromScale(fScale, m_bLogarithmic);

if (!m_bLatch && qtractorObserver::isToggled()) {
const bool bDecimal = qtractorObserver::isDecimal();
const bool bToggled = qtractorObserver::isToggled();

if ((m_bLatch && !bDecimal) || (!m_bLatch && bToggled)) {
const float vmax = qtractorObserver::maxValue();
const float vmin = qtractorObserver::minValue();
const float vmid = 0.5f * (vmax + vmin);
Expand All @@ -110,7 +114,7 @@ void qtractorMidiControlObserver::setMidiValue ( unsigned short iValue )
fValue = (m_fMidiValue < vmid ? vmax : vmin);
}

bool bSync = (m_bHook || !qtractorObserver::isDecimal());
bool bSync = (m_bHook || !bDecimal);
if (!bSync)
bSync = m_bMidiSync;
if (!bSync) {
Expand Down

0 comments on commit 7df5811

Please sign in to comment.