self.load_drivers()
self.load_ui()
self.engine = engine.CommandEngine()
- self.playlists = playlist.NoteIndexList()
+ self.playlists = playlist.Playlists()
def load_log(self):
config_file = StringIO.StringIO()
return state
def _assert_clean_state(self, owner, state):
- return
for k,v in state.items():
+ if k == 'drivers': # HACK. Need better driver serialization.
+ continue
try:
yaml.safe_dump((k,v))
except RepresenterError, e:
curve.set_hooke(hooke)
if identify == True:
curve.identify(self.drivers)
+
+
+class Playlists (NoteIndexList):
+ """A :class:`NoteIndexList` of :class:`FilePlaylist`\s.
+ """
+ def __init__(self, *arg, **kwargs):
+ super(Playlists, self).__init__(*arg, **kwargs)
+
+ def _item_getstate(self, item):
+ assert isinstance(item, FilePlaylist), type(item)
+ return item.__getstate__()
+
+ def _item_setstate(self, state):
+ item = FilePlaylist(drivers=[])
+ item.__setstate__(state)
+ return item
# loading curves.
outqueue.put('drivers: %s'
% ', '.join([driver.name for driver in hooke.drivers]))
- # hooke.playlists contains a
- # :class:`hooke.playlist.NoteIndexList` of
- # :class:`hooke.playlist.Playlist`\s. Each playlist may
+ # hooke.playlists is a
+ # :class:`hooke.playlist.Playlists` instance full of
+ # :class:`hooke.playlist.FilePlaylist`\s. Each playlist may
# contain several :class:`hooke.curve.Curve`\s representing a
# grouped collection of data.
playlist = hooke.playlists.current()