How to use the feeluown.controller_api.ControllerApi.player function in feeluown

To help you get started, we’ve selected a few feeluown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feeluown / FeelUOwn / feeluown / plugin / MprisEx / service.py View on Github external
def __init__(self):
        bus = dbus.service.BusName(
            FEELUOWN_MPRIS_BUS_NAME,
            bus=dbus.SessionBus())
        super().__init__(bus, MPRIS_OBJECT_PATH)

        ControllerApi.player.positionChanged.connect(self._Seeked)
        ControllerApi.player.signal_player_media_changed.connect(
            self._update_song_base_props)
        ControllerApi.player.stateChanged.connect(
            self._update_playback_status)

        self._properties = dbus.Dictionary({
            'DesktopEntry': 'FeelUOwn',
            'Identity': 'feeluown',
            'CanQuit': False,
            'CanRaise': False,
            'HasTrackList': False,
        }, signature='sv')

        self._player_properties = dbus.Dictionary({
            'Metadata': dbus.Dictionary({
                'mpris:length': dbus.Int64(0),
github feeluown / FeelUOwn / feeluown / controller_api.py View on Github external
url_middle = mv_model['url_middle']
        clipboard = QApplication.clipboard()
        clipboard.setText(url_middle)

        cls.view.ui.STATUS_BAR.showMessage(
                u"程序已经将视频的播放地址复制到剪切板", 5000)
        if platform.system() == "Linux":
            ControllerApi.player.pause()
            ControllerApi.notify_widget.show_message(
                    "通知", "正在尝试调用VLC视频播放器播放MV")
            try:
                subprocess.Popen(['vlc', url_middle, '--play-and-exit', '-f'])
            except:
                LOG.error('call vlc player failed')
        elif platform.system().lower() == 'Darwin'.lower():
            ControllerApi.player.pause()
            ControllerApi.notify_widget.show_message(
                    "通知", "准备调用 QuickTime Player 播放mv")
            try:
                subprocess.Popen(
                    ['open', '-a', 'QuickTime Player', url_middle])
            except:
                LOG.error('call quicktime player failed')
github feeluown / FeelUOwn / feeluown / plugin / MprisEx / service.py View on Github external
def Seek(self, Offset):
        ControllerApi.player.setPosition(Offset/1000)
github feeluown / FeelUOwn / feeluown / controller_api.py View on Github external
def play_specific_song_by_mid(cls, mid):
        song = ControllerApi.api.get_song_detail(mid)
        if not ControllerApi.api.is_response_ok(song):
            return False

        ControllerApi.player.play(song)
        return True
github feeluown / FeelUOwn / feeluown / controllers / modes.py View on Github external
def reset_song_list(cls):
        ControllerApi.player.clear_playlist()
        if len(cls._songs) > 0:
            song = cls._songs.pop()
            mid = song['id']
            music_model = ControllerApi.api.get_song_detail(mid)
            if not ControllerApi.api.is_response_ok(music_model):
                ControllerApi.notify_widget.show_message("Error", "网络异常,请检查网络连接")
                return
            ControllerApi.player.set_music_list([music_model])
        else:
            cls._songs = cls.get_songs()
            if not ControllerApi.api.is_response_ok(cls._songs):
                ControllerApi.player.stop()
                ControllerApi.notify_widget.show_message("Error", "网络异常,请检查网络连接")
            elif cls._songs == []:
                ControllerApi.notify_widget.show_message("|--|", "未知错误")
            else:
                cls.reset_song_list()
github feeluown / FeelUOwn / feeluown / widgets / playmode_switch.py View on Github external
def _switch_mode(self):
        if ControllerApi.player.playback_mode == 4:
            ControllerApi.player.set_play_mode(1)
        elif ControllerApi.player.playback_mode == 1:
            ControllerApi.player.set_play_mode(3)
        elif ControllerApi.player.playback_mode == 3:
            ControllerApi.player.set_play_mode(4)
        else:
            ControllerApi.player.set_play_mode(4)
github feeluown / FeelUOwn / feeluown / controllers / modes.py View on Github external
def change_to_simi(self):
        PlaylistItem.de_active_all()
        if self.current_mode == 1:
            FmMode.exit_()
        elif self.current_mode == 2:
            ControllerApi.notify_widget.show_message("提示", "你正处于单曲电台模式")
            return
        self.current_mode = 2
        ControllerApi.player.change_player_mode_to_other()
        SimiSongsMode.load_()