Adjust playlist curve setup to load curves after YAML restore.
[hooke.git] / hooke / playlist.py
index 3b5c8743ba30c04908f32effde1eec80ceafc49c..41132a106c48bbc80774bb2d850cf8c742922108 100644 (file)
@@ -194,7 +194,7 @@ class Playlist (NoteIndexList):
                 self.append(curve)
             if curve.driver == None:
                 c.identify(self.drivers)
-            if curve.data == None:
+            if curve.data == None or max([d.size for d in curve.data]) == 0:
                 curve.load()
             self._loaded.append(curve)
             if len(self._loaded) > self._max_loaded:
@@ -572,7 +572,7 @@ def from_string(string):
 def load(path=None, drivers=None, identify=True, hooke=None):
     """Load a playlist from a file.
     """
-    path = playlist_path(path)
+    path = os.path.expanduser(playlist_path(path))
     with open(path, 'r') as f:
         text = f.read()
     playlist = from_string(text)