def __init__(self, drivers, name=None):
super(Playlist, self).__init__(name=name)
self.drivers = drivers
- self._max_loaded = 100 # curves to hold in memory simultaneously.
def _set_default_attrs(self):
super(Playlist, self)._set_default_attrs()
self._default_attrs['drivers'] = []
# List of loaded curves, see :meth:`._setup_item`.
self._default_attrs['_loaded'] = []
- self._default_attrs['_max_loaded'] = 100
+ self._default_attrs['_max_loaded'] = 100 # curves to hold in memory simultaneously.
def __setstate__(self, state):
super(Playlist, self).__setstate__(state)
oldest = self._loaded.pop(0)
oldest.unload()
+ def unload(self, curve):
+ "Inverse of .`_setup_item`."
+ curve.unload()
+ self._loaded.remove(curve)
+
+
def playlist_path(path):
"""Normalize playlist path extensions.
for command in params['commands']:
curve.command_stack.append(command)
curve.set_hooke(hooke)
- curve.unload()
+ p.unload(curve)
def __setup_params(self, hooke, params):
if params['commands'] == None: