-
Notifications
You must be signed in to change notification settings - Fork 4
/
Chromecast.py
40 lines (32 loc) · 1.25 KB
/
Chromecast.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# - encoding: utf8
from __future__ import print_function
from gi.repository import RB, GObject, Peas, Gtk
# self.__chromecast = pychromecast.get_chromecast(friendly_name="RobsKamerMuziek")
# self.__chromecast_player = self.__chromecast.media_controller
import ChromecastSource
class Chromecast(GObject.Object, Peas.Activatable):
__gtype_name__ = 'ChromecastPlugin'
object = GObject.property(type=GObject.GObject)
def __init__(self):
GObject.Object.__init__(self)
def do_activate(self):
shell = self.object
db = shell.props.db
model = RB.RhythmDBQueryModel.new_empty(db)
what, width, height = Gtk.icon_size_lookup(Gtk.IconSize.LARGE_TOOLBAR)
self.source = GObject.new(
ChromecastSource.ChromecastSource,
name=_("Chromecast"),
shell=shell,
query_model=model,
plugin=self
)
# source_group = RB.DisplayPageGroup.get_by_id("library")
# shell.append_display_page(self.source, source_group)
self.source.setup()
# settings=settings,
# shell.register_entry_type_for_source(self.source, entry_type)
def do_deactivate(self):
# destroy source
self.source.uninstall()
del self.source