Skip to content

Commit

Permalink
Workaround for volume being set back to 0.5 after test-play
Browse files Browse the repository at this point in the history
  • Loading branch information
cefn committed Nov 4, 2017
1 parent a326851 commit b361529
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scanplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ class ScanPlayer(Player):
def __init__(self, folders=10, scan=True, *a, **k ):
if 'busy_pin' not in k:
k['busy_pin'] = Pin(0) # configure D3/GPIO0 as default busy pin
super().__init__(*a, **k)
super().__init__(*a, **k)
if folders > 99:
raise AssertionError("Max 99 folders (00-99)")
self.folders = folders
self.tracks = None
self.recent = {}
if scan:
self.scan()
self.scan()
# TODO handle resetting volume after scan

def scan(self):
self.awaitconfig()
Expand All @@ -30,7 +31,7 @@ def scan(self):
continue
else:
break
self.volume(0.5)
self.volume(1.0) # TODO find principled way to set this, or remove volume control from scan

def playNext(self, folderNum, wrap=True):
if self.tracks is not None:
Expand Down Expand Up @@ -63,4 +64,4 @@ def finishAll(self, folderNum):
else:
raise AssertionError("Scan found no '{}' folder".format(folderNum))
else:
raise AssertionError("No scan available, run player.scan() first.")
raise AssertionError("No scan available, run player.scan() first.")

0 comments on commit b361529

Please sign in to comment.