Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
preview/*
preview/*
.idea/*
33 changes: 19 additions & 14 deletions oled_phoniebox.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,23 @@ def main(num_iterations=sys.maxsize):
draw.rectangle((69,10,77,54), outline="white", fill="white")
sleep(displaytime)
oldplaying = playing
volume = int(volume.replace(" ","").replace("%",""))
if (oldvol != volume) and (oldvol != "FirstStart"):
with canvas(device) as draw:
draw.rectangle((30,22,45,42), outline="white", fill="white")
draw.polygon([(45, 22),(60, 10), (60,54), (45, 42)], outline="white", fill="white")
if volume != 0:
draw.rectangle((75,28,105,36), outline="white", fill="white")
if oldvol < volume:
draw.rectangle((86,17,94,47), outline="white", fill="white")
else:
draw.text((75, 2),"X",font=FONT_HIGHTOWER, fill="white")
sleep(displaytime)
oldvol = volume
volume_monitor = True
if initvars['GENERAL'].get("volume_monitor", fallback="true") == 'false':
volume_monitor = False
if volume_monitor:
volume = int(volume.replace(" ","").replace("%",""))
if (oldvol != volume) and (oldvol != "FirstStart"):
with canvas(device) as draw:
draw.rectangle((30,22,45,42), outline="white", fill="white")
draw.polygon([(45, 22),(60, 10), (60,54), (45, 42)], outline="white", fill="white")
if volume != 0:
draw.rectangle((75,28,105,36), outline="white", fill="white")
if oldvol < volume:
draw.rectangle((86,17,94,47), outline="white", fill="white")
else:
draw.text((75, 2),"X",font=FONT_HIGHTOWER, fill="white")
sleep(displaytime)
oldvol = volume
if (playing == "[playing]") or (playing == "[paused]"):
if playing == "[playing]":
#timer = set_characters(get_mpc("mpc -f %time% current"))
Expand Down Expand Up @@ -180,7 +184,8 @@ def main(num_iterations=sys.maxsize):
txtline2 = set_characters(get_mpc("mpc -f %artist% current"))
if txtline2 == "\n":
filename = set_characters(get_mpc("mpc -f %file% current"))
filename = filename.split(":")[2]
if ":" in filename:
filename = filename.split(":")[2]
filename = set_characters(filename)
localfile = filename.split("/")
txtline1 = localfile[1]
Expand Down