-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working version (kinda) of Google Music integration
- Loading branch information
Showing
5 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#/bin/python | ||
|
||
print "Loading Libraries" | ||
from GoogleMusic import GoogleMusic | ||
import pygst | ||
pygst.require('0.10') | ||
import gst | ||
|
||
def on_tag(bus, msg): | ||
taglist = msg.parse_tag() | ||
print 'on_tag:' | ||
for key in taglist.keys(): | ||
print '\t%s = %s' % (key, taglist[key]) | ||
|
||
print "Initializing Google Music" | ||
music = GoogleMusic() | ||
|
||
print "Fetching Playlist" | ||
playlist = music.radioPlaylist() | ||
print playlist | ||
|
||
print "Initializing Player" | ||
player = gst.element_factory_make("playbin", "player") | ||
player.set_state(gst.STATE_READY) | ||
player.set_property('uri', playlist[0]) | ||
player.set_state(gst.STATE_PLAYING) | ||
|
||
print "Monitoring Bus" | ||
bus = player.get_bus() | ||
bus.enable_sync_message_emission() | ||
bus.add_signal_watch() | ||
bus.connect('message::tag', on_tag) | ||
|
||
raw_input('Press enter to stop playing...') |