diff options
-rw-r--r-- | build/features.py | 33 | ||||
-rw-r--r-- | src/engine/loopingcontrol.cpp | 14 |
2 files changed, 33 insertions, 14 deletions
diff --git a/build/features.py b/build/features.py index 9321bbca1d..da5091ed4c 100644 --- a/build/features.py +++ b/build/features.py @@ -441,11 +441,12 @@ class ModPlug(Feature): def description(self): return "Modplug module decoder plugin" - def default(self, build): - return 1 if build.platform_is_linux else 0 - def enabled(self, build): - build.flags['modplug'] = util.get_flags(build.env, 'modplug', self.default(build)) + # Default to enabled on but only throw an error if it was explicitly + # requested and is not available. + if 'modplug' in build.flags: + return int(build.flags['modplug']) > 0 + build.flags['modplug'] = util.get_flags(build.env, 'modplug', 1) if int(build.flags['modplug']): return True return False @@ -453,22 +454,30 @@ class ModPlug(Feature): def add_options(self, build, vars): vars.Add('modplug', 'Set to 1 to enable libmodplug based module tracker support.', - self.default(build)) + 1) def configure(self, build, conf): if not self.enabled(build): return - build.env.Append(CPPDEFINES='__MODPLUG__') + # Only block the configure if modplug was explicitly requested. + explicit = 'modplug' in SCons.ARGUMENTS - have_modplug_h = conf.CheckHeader('libmodplug/modplug.h') - have_modplug = conf.CheckLib(['modplug', 'libmodplug'], autoadd=True) + if not conf.CheckHeader('libmodplug/modplug.h'): + if explicit: + raise Exception('Could not find libmodplug development headers.') + else: + build.flags['modplug'] = 0 + return - if not have_modplug_h: - raise Exception('Could not find libmodplug development headers.') + if not conf.CheckLib(['modplug', 'libmodplug'], autoadd=True): + if explicit: + raise Exception('Could not find libmodplug shared library.') + else: + build.flags['modplug'] = 0 + return - if not have_modplug: - raise Exception('Could not find libmodplug shared library.') + build.env.Append(CPPDEFINES='__MODPLUG__') def sources(self, build): depends.Qt.uic(build)('preferences/dialog/dlgprefmodplugdlg.ui') diff --git a/src/engine/loopingcontrol.cpp b/src/engine/loopingcontrol.cpp index 201a1e0e1b..adf9953968 100644 --- a/src/engine/loopingcontrol.cpp +++ b/src/engine/loopingcontrol.cpp @@ -353,18 +353,28 @@ double LoopingControl::nextTrigger(bool reverse, LoopSamples loopSamples = m_loopSamples.getValue(); + // m_bAdjustingLoopIn is true while the LoopIn button is pressed while a loop is active (slotLoopIn) if (m_bAdjustingLoopInOld != m_bAdjustingLoopIn) { m_bAdjustingLoopInOld = m_bAdjustingLoopIn; - if (reverse && !m_bAdjustingLoopIn) { + + // When the LoopIn button is released in reverse mode we jump to the end of the loop to not fall out and disable the active loop + // This must not happen in quantized mode. The newly set start is always ahead (in time, but behind spacially) of the current position so we don't jump. + // Jumping to the end is then handled when the loop's start is reached later in this function. + if (reverse && !m_bAdjustingLoopIn && !m_pQuantizeEnabled->toBool()) { m_oldLoopSamples = loopSamples; *pTarget = loopSamples.end; return currentSample; } } + // m_bAdjustingLoopOut is true while the LoopOut button is pressed while a loop is active (slotLoopOut) if (m_bAdjustingLoopOutOld != m_bAdjustingLoopOut) { m_bAdjustingLoopOutOld = m_bAdjustingLoopOut; - if (!reverse && !m_bAdjustingLoopOut) { + + // When the LoopOut button is released in forward mode we jump to the start of the loop to not fall out and disable the active loop + // This must not happen in quantized mode. The newly set end is always ahead of the current position so we don't jump. + // Jumping to the start is then handled when the loop's end is reached later in this function. + if (!reverse && !m_bAdjustingLoopOut && !m_pQuantizeEnabled->toBool()) { m_oldLoopSamples = loopSamples; *pTarget = loopSamples.start; return currentSample; |