diff --git a/mpris2_support/CHANGELOG b/mpris2_support/CHANGELOG deleted file mode 100644 index 4dec5ba..0000000 --- a/mpris2_support/CHANGELOG +++ /dev/null @@ -1,4 +0,0 @@ -0.3.3 - 26-12-2016 - -- Dont activate Plugin on missing dependencys -- Remove unused imports \ No newline at end of file diff --git a/mpris2_support/__init__.py b/mpris2_support/__init__.py deleted file mode 100644 index cf88f2e..0000000 --- a/mpris2_support/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .mpris2_support import Mpris2Plugin diff --git a/mpris2_support/manifest.ini b/mpris2_support/manifest.ini deleted file mode 100644 index af6e81b..0000000 --- a/mpris2_support/manifest.ini +++ /dev/null @@ -1,8 +0,0 @@ -[info] -name: MPRIS2 support -short_name: mpris2_support -version: 0.3.4 -description: MPRIS2 support. Allows to update status message according to the music you're listening via the MPRIS2 D-Bus API. -authors = Denis Fomin -homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/mprissupportplugin -min_gajim_version: 0.16.11 diff --git a/mpris2_support/mpris2_support.png b/mpris2_support/mpris2_support.png deleted file mode 100644 index 393672a..0000000 Binary files a/mpris2_support/mpris2_support.png and /dev/null differ diff --git a/mpris2_support/mpris2_support.py b/mpris2_support/mpris2_support.py deleted file mode 100644 index db301d9..0000000 --- a/mpris2_support/mpris2_support.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -import os - -from gajim.plugins import GajimPlugin -from gajim.plugins.helpers import log_calls -from gajim.common import dbus_support - -ERR_MSG = '' - -if dbus_support.supported: - from gajim.music_track_listener import MusicTrackListener -else: - ERR_MSG = 'D-Bus Python bindings are missing' - -if os.name == 'nt': - ERR_MSG = 'Plugin can\'t be run under Windows.' - - -class MusicTrackInfo(object): - __slots__ = ['title', 'album', 'artist', 'duration', 'track_number', - 'paused', 'url', 'albumartist'] - - -class Mpris2Plugin(GajimPlugin): - @log_calls('Mpris2Plugin') - def init(self): - self.description = _('MPRIS2 support. Allows to update status message ' - 'according to the music you\'re listening via the MPRIS2 D-Bus API.') - self.config_dialog = None - if ERR_MSG: - self.available_text = ERR_MSG - self.activatable = False - return - self.artist = self.title = self.source = '' - self.listener = MusicTrackListener().get() - - @log_calls('NowListenPlugin') - def activate(self): - self._last_playing_music = None - self.bus = dbus_support.session_bus.SessionBus() - self.bus.add_signal_receiver(self.properties_changed, - "PropertiesChanged", "org.freedesktop.DBus.Properties") - - @log_calls('Mpris2Plugin') - def deactivate(self): - self.bus.remove_signal_receiver(self.properties_changed, - "PropertiesChanged", "org.freedesktop.DBus.Properties") - - def properties_changed(self,*args,**kw): - if args[0] != 'org.mpris.MediaPlayer2.Player': - return - if 'PlaybackStatus' in args[1]: - if args[1]['PlaybackStatus'] in ['Paused', 'Stopped']: - self.title = self.artist = self.source = '' - self.listener.emit('music-track-changed', None) - if args[1]['PlaybackStatus'] == 'Playing': - self.listener.emit('music-track-changed', - self._last_playing_music) - if 'Metadata' not in args[1]: - return - - data = args[1]['Metadata'] - info = MusicTrackInfo() - info.title = data.get("xesam:title", '') - info.album = data.get("xesam:album", '') - info.artist = data.get("xesam:artist", [''])[0] - info.albumartist = data.get("xesam:albumArtist", [''])[0] - info.duration = int(data.get('mpris:length', 0)) - info.track_number = int(data.get('xesam:trackNumber', 0)) - info.url = data.get("xesam:url", '') - - self._last_playing_music = info - self.listener.emit('music-track-changed', info)