Skip to content

Commit

Permalink
Update music_caster.py
Browse files Browse the repository at this point in the history
Added tray messages
  • Loading branch information
elibroftw committed Jul 17, 2019
1 parent 9cee4b5 commit 11687d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
from pathlib import Path
import pychromecast.controllers.media
from pychromecast.error import *
from pychromecast.error import UnsupportedNamespace
import pychromecast
from pygame import mixer as local_music_player # https://www.pygame.org/docs/ref/music.html
from pynput.keyboard import Listener
Expand Down Expand Up @@ -164,6 +164,7 @@ def save_json():
filled_logo_data = b'iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAABbtJREFUeAHt\nm02IVWUYx+eatjKJIrEvIkqjsmiTi6BpConc9LHKTasRWtQuN+kyAhPBRSXC5MZaFFFUy4hRSVpE\ntbCib0kUi6ACFcrSuf2e4Z7re+48/3Pec885d7oz7wN/7nue7/d/3/Oej5k7MZEkMZAYSAwkBhID\niYHEQGIgMeAw0HF0E91u1/TTPWzkc7XntwR0Z5nD1+CAodPpdAfntIAgyFmH0+tg86DzEj/+iPk9\nBUm/hvPMEdRbOR/isNzIyTgxkh4OV9KKzNL7tNNquZJjFNjcjYO+DBK0rW9ZvoMcQYOnmG1aS3VD\njv3Kz3GKXZE5DxK0YBc3RwJyflnwuH+y55bOd/AUG/c5N95/IqiE0kRQIqiEgRJzWkElBK0ssRea\n1VWgMGgRjHWuwmkFlXxhiaASgnKnWJ2lWFJnbM11V9DFsZ15ZON1CbqROjvBT5H1xs6tkWes3nuk\nB5n9s+CJ/xsLautQV+HQvxGCQkIouonjl8BUqF/McTjhsI8YguqeYmG9+THNfApsNW0BXy5wGDNF\nbgXB6Hn6t3dChj/AD+A78A04ysRP8Rkt5Lsc5xfAdtD4lxHbSJ0VNEiQ+34kaMQImwVvg0MUngts\ncghRkxgPgpukU4uGURIUTsNW0xtgHw2cDA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CejMx7mmG/xEx4duFXt7UqUnG6EUte+XTlxiCzNlImulHBQPetfzG4SeBKhw+Gh4E\n46+CcTi0v6IsttgP7PoSS5AFTPKtqI37/X7G/ECtCPuHCE/We8oR6w6E9aoQZHFPhsHB2N4CenKd\np0R3QuivEvpRqe0HdbUIul90elroFUFnhH//Z0jC3qbayLGfZOY26ZUVK14v/H8RekVQbiMMYkdN\n0Dlq235oq8b9UW/QWxomBhIDiYHEQGIgMZAYSAwkBi4x8B9krI+z1gY5YgAAAABJRU5ErkJggg==\n'

tray = sg.SystemTray(menu=menu_def_1, data_base64=unfilled_logo_data, tooltip='Music Caster')
tray.ShowMessage('Music Caster', 'Music Caster is running in the tray', time=500)
music_directories = settings['music directories']
if not music_directories:
music_directories = settings['music directories'] = [home_music_dir]
Expand Down Expand Up @@ -221,6 +222,7 @@ def play_file(filename, position=0):
song_start = time()
song_end = song_start + song_length - position
playing_status = 'PLAYING'
tray.ShowMessage('Music Caster', f"Playing: {artist.split(', ')[0]} - {title}", time=500)


def pause():
Expand Down

0 comments on commit 11687d1

Please sign in to comment.