def check_ini_installed(): """Raise if no GNOME Shell ini file for Quod Libet is found""" quodlibet_installed = False for path in get_gs_provider_files(): try: with open(path, "rb") as handle: if SearchProvider.BUS_NAME in handle.read(): quodlibet_installed = True break except EnvironmentError: pass if not quodlibet_installed: raise PluginImportException( _("No GNOME Shell search provider for " "Quod Libet installed."))
self.pack_start(qltk.Frame(_("Preferences"), child=table), True, True, 0) class Karaoke(GStreamerPlugin): PLUGIN_ID = _PLUGIN_ID PLUGIN_NAME = _("Karaoke") PLUGIN_DESC = _("Removes main vocals from audio.") PLUGIN_ICON = Icons.AUDIO_INPUT_MICROPHONE @classmethod def setup_element(cls): return Gst.ElementFactory.make('audiokaraoke', cls.PLUGIN_ID) @classmethod def update_element(cls, element): element.set_property("level", get_cfg("level")) element.set_property("filter-band", get_cfg("band")) element.set_property("filter-width", get_cfg("width")) @classmethod def PluginPreferences(cls, window): prefs = Preferences() prefs.connect("changed", lambda *x: cls.queue_update()) return prefs if not Karaoke.setup_element(): raise PluginImportException( "GStreamer element 'audiokaraoke' missing (gst-plugins-good)")
scale.set_value(get_cfg(key)) self.pack_start(qltk.Frame(_("Preferences"), child=table), True, True, 0) class Pitch(GStreamerPlugin): PLUGIN_ID = _PLUGIN_ID PLUGIN_NAME = _("Audio Pitch / Speed") PLUGIN_DESC = _("Controls the pitch of an audio stream.") @classmethod def setup_element(cls): return Gst.ElementFactory.make('pitch', cls.PLUGIN_ID) @classmethod def update_element(cls, element): for key in ["tempo", "rate", "pitch"]: element.set_property(key, get_cfg(key)) @classmethod def PluginPreferences(cls, window): prefs = Preferences() prefs.connect("changed", lambda *x: cls.queue_update()) return prefs if not Pitch.setup_element(): raise PluginImportException( "GStreamer element 'pitch' missing (gst-plugins-bad)")
import queue from quodlibet import _, print_d from quodlibet.plugins.gui import UserInterfacePlugin from quodlibet.util import gi_require_versions, is_windows, is_osx from quodlibet.plugins.events import EventPlugin from quodlibet.plugins import (PluginImportException, PluginConfig, ConfProp, BoolConfProp, FloatConfProp, PluginNotSupportedError) try: gi_require_versions("WebKit2", ["4.0", "3.0"]) except ValueError as e: if is_windows() or is_osx(): raise PluginNotSupportedError raise PluginImportException("GObject Introspection: " + str(e)) from gi.repository import WebKit2, Gtk, GLib from quodlibet import qltk from quodlibet.util import escape, cached_property, connect_obj from quodlibet.qltk import Icons, Align from quodlibet.qltk.entry import UndoEntry from quodlibet.pattern import URLFromPattern from quodlibet.util.urllib import urlopen # for the mobile version USER_AGENT = ("Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) " "AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0" "Chrome/43.0.2357.65 Mobile Safari/537.36") LYRICS_WIKIA_URL = ("https://lyrics.wikia.com/api.php?client=QuodLibet"
True, True, 0) class Compressor(GStreamerPlugin): PLUGIN_ID = _PLUGIN_ID PLUGIN_NAME = _("Audio Compressor") PLUGIN_DESC = _("Changes the amplitude of all samples above a specific " "threshold with a specific ratio.") @classmethod def setup_element(cls): return Gst.ElementFactory.make('audiodynamic', cls.PLUGIN_ID) @classmethod def update_element(cls, element): element.set_property("characteristics", "soft-knee") element.set_property("mode", "compressor") element.set_property("ratio", get_cfg("ratio")) element.set_property("threshold", get_cfg("threshold")) @classmethod def PluginPreferences(cls, window): prefs = Preferences() prefs.connect("changed", lambda *x: cls.queue_update()) return prefs if not Compressor.setup_element(): raise PluginImportException( "GStreamer element 'audiodynamic' missing (gst-plugins-good)")