2017-02-17 09:11:23 +13:00
|
|
|
|
2016-10-30 07:51:39 +13:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
from mopidy.core import CoreListener
|
2017-02-17 08:03:11 +13:00
|
|
|
|
2017-02-18 12:45:48 +13:00
|
|
|
import mem
|
|
|
|
|
import pykka
|
2017-02-18 22:04:05 +13:00
|
|
|
import logging
|
|
|
|
|
|
|
|
|
|
# import logger
|
|
|
|
|
logger = logging.getLogger(__name__)
|
2017-02-17 08:03:11 +13:00
|
|
|
|
2016-10-30 07:51:39 +13:00
|
|
|
class IrisFrontend(pykka.ThreadingActor, CoreListener):
|
|
|
|
|
|
|
|
|
|
def __init__(self, config, core):
|
|
|
|
|
super(IrisFrontend, self).__init__()
|
2017-02-18 12:45:48 +13:00
|
|
|
mem.iris.core = core
|
|
|
|
|
mem.iris.config = config
|
2016-10-30 07:51:39 +13:00
|
|
|
|
2017-02-16 19:51:49 +13:00
|
|
|
def on_start(self):
|
2018-10-12 16:10:29 +13:00
|
|
|
mem.iris.start()
|
2017-02-18 22:04:05 +13:00
|
|
|
|
2018-03-09 08:23:54 +13:00
|
|
|
def on_stop(self):
|
2018-11-02 10:20:32 +13:00
|
|
|
mem.iris.stop()
|
2018-03-09 08:23:54 +13:00
|
|
|
|
2017-11-21 11:27:34 +13:00
|
|
|
def track_playback_ended(self, tl_track, time_position):
|
2017-02-18 22:04:05 +13:00
|
|
|
mem.iris.check_for_radio_update()
|
2016-12-18 11:32:03 +13:00
|
|
|
|
2017-11-21 11:27:34 +13:00
|
|
|
def tracklist_changed(self):
|
2017-02-18 22:04:05 +13:00
|
|
|
mem.iris.clean_queue_metadata()
|
2016-10-30 18:06:43 +13:00
|
|
|
|