Browse Source

update template

master
Nils 5 years ago
parent
commit
115066d7f1
  1. 11
      template/engine/sequencer.py
  2. 5
      template/engine/session.py

11
template/engine/sequencer.py

@ -571,12 +571,11 @@ class TempoMap(object):
def _sanitize(self):
"""Inplace modification of self.tempoMap. Remove zeros and convert to float values. """
self._tempoMap = {int(key):(float(value), timesigNum, timesigDenom) for key, (value,
timesigNum, timesigDenom) in self._tempoMap.items() if value > 0.0} #Don't use the
following. Empty tempo maps are allowed, especially in jack transport slave mode. #Instead
set a default tempo 120 on init explicitly #if not self._tempoMap: # logger.error("Found
invalid tempo map. Forcing to 120 bpm. Please correct manually") # self._tempoMap = {0,
120.0}
self._tempoMap = {int(key):(float(value), timesigNum, timesigDenom) for key, (value, timesigNum, timesigDenom) in self._tempoMap.items() if value > 0.0}
#Don't use the following. Empty tempo maps are allowed, especially in jack transport slave mode. #Instead set a default tempo 120 on init explicitly
#if not self._tempoMap:
#logger.warning("Found invalid tempo map. Forcing to 120 bpm. Please correct manually")
#self._tempoMap = {0, 120.0}
def _clearCboxTempoMap(self):
"""Remove all cbox tempo values by iterating over all of them and set them to None, which is

5
template/engine/session.py

@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging; logger = logging.getLogger(__name__); logger.info("import")
#Python Standard Library
from warnings import warn
import os
import os.path
import json
@ -123,10 +122,10 @@ class Session(object):
text = self.addSessionPrefix(f.read())
result = json.loads(text)
except Exception as error:
warn(error)
logger.error(error)
if result and "version" in result and "origin" in result and result["origin"] == METADATA["url"]:
if result["version"] >= METADATA["version"]:
if METADATA["version"] >= result["version"]:
self.guiWasSavedAsNSMVisible = result["guiWasSavedAsNSMVisible"]
self.guiSharedDataToSave = result["guiSharedDataToSave"]
assert type(self.guiSharedDataToSave) is dict, self.guiSharedDataToSave

Loading…
Cancel
Save