Skip to content

Commit

Permalink
1836
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjoerd82 committed Feb 18, 2018
1 parent d33fe91 commit 5dde255
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion hu.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,17 @@ def udisk_rem( device ):

# stop playing, if removed source is current source
arIxCurr = Sources.getIndexCurrent()
print "DEBUG 1: {0}".format(arIxCurr)
if ix == arIxCurr[0] and ix_ss == arIxCurr[1]:
print "DEBUG 2"
Sources.sourceStop()
print "DEBUG 3"
x = Sources.next(reverse=True)
#x = Sources.next()
print "DEBUG: {0}".format(x)
print "DEBUG 4: {0}".format(x)
hu_play()
print "DEBUG 5"


# display overview
printSummary(Sources)
Expand Down
8 changes: 5 additions & 3 deletions hu_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,14 @@ def source_iterator(i_start, i_end, j_start, reverse):
if reverse:
step = -1
logtext = "to prev."
print "DEBUG A - reverse"
else:
step = 1
logtext = "to next"
print "DEBUG A - forward"

for source in self.lSource[i_start:i_end:step]:
#print "DEBUG A -- {0}".format(source)
print "DEBUG B -- {0}".format(source)
# no sub-source and available:
if not source['template'] and source['available']:
self.__printer('NEXT: Switching {0} {1}: {2:s}'.format(logtext,i_start,source['displayname']))
Expand All @@ -233,8 +235,8 @@ def source_iterator(i_start, i_end, j_start, reverse):
# sub-source and available:
elif source['template'] and source['available']:
for subsource in source['subsources'][j_start::step]:
print "DEBUG C {0}".format(subsource)
if subsource['available']:
#print "DEBUG 4"
self.__printer('NEXT: Switching {0}: {1}/{2}: {3:s}'.format(logtext,i_start,j_start,subsource['displayname']))
self.iCurrentSource[0] = i_start
self.iCurrentSource[1] = j_start
Expand Down Expand Up @@ -318,7 +320,7 @@ def source_iterator(i_start, i_end, j_start, reverse):
if res == None:
# Let's start from the beginning till current
ssi_start = 0
#print "DEBUG still here..."
print "DEBUG still here..."
return source_iterator(0, si_cur-1, ssi_start, reverse)
else:
return res
Expand Down

0 comments on commit 5dde255

Please sign in to comment.