本文整理汇总了Python中lollypop.player_base.BasePlayer类的典型用法代码示例。如果您正苦于以下问题:Python BasePlayer类的具体用法?Python BasePlayer怎么用?Python BasePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BasePlayer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
"""
Init playbin
"""
Gst.init(None)
BasePlayer.__init__(self)
self._codecs = Codecs()
self._crossfading = False
self._playbin = self._playbin1 = Gst.ElementFactory.make(
'playbin', 'player')
self._playbin2 = Gst.ElementFactory.make('playbin', 'player')
self._preview = None
self._plugins = self.plugins1 = PluginsPlayer(self._playbin1)
self.plugins2 = PluginsPlayer(self._playbin2)
self._volume_id = self._playbin.connect('notify::volume',
self._on_volume_changed)
for playbin in [self._playbin1, self._playbin2]:
flags = playbin.get_property("flags")
flags &= ~GstPlayFlags.GST_PLAY_FLAG_VIDEO
playbin.set_property('flags', flags)
playbin.set_property('buffer-size', 5 << 20)
playbin.set_property('buffer-duration', 10 * Gst.SECOND)
playbin.connect('about-to-finish',
self._on_stream_about_to_finish)
bus = playbin.get_bus()
bus.add_signal_watch()
bus.connect('message::error', self._on_bus_error)
bus.connect('message::eos', self._on_bus_eos)
bus.connect('message::element', self._on_bus_element)
bus.connect('message::stream-start', self._on_stream_start)
bus.connect("message::tag", self._on_bus_message_tag)
self._handled_error = None
self._start_time = 0
示例2: __init__
def __init__(self):
"""
Init radio player
"""
BasePlayer.__init__(self)
self.__current = None
self.__radios = []
示例3: __init__
def __init__(self):
"""
Init playbin
"""
Gst.init(None)
BasePlayer.__init__(self)
self._codecs = Codecs()
self._playbin = Gst.ElementFactory.make('playbin', 'player')
flags = self._playbin.get_property("flags")
flags &= ~GstPlayFlags.GST_PLAY_FLAG_VIDEO
self._playbin.set_property('flags', flags)
self._playbin.set_property('buffer-size', 5 << 20)
self._playbin.set_property('buffer-duration', 10 * Gst.SECOND)
ReplayGainPlayer.__init__(self, self._playbin)
self._playbin.connect('about-to-finish',
self._on_stream_about_to_finish)
bus = self._playbin.get_bus()
bus.add_signal_watch()
bus.connect('message::error', self._on_bus_error)
bus.connect('message::eos', self._on_bus_eos)
bus.connect('message::element', self._on_bus_element)
bus.connect('message::stream-start', self._on_stream_start)
bus.connect("message::tag", self._on_bus_message_tag)
self._handled_error = None
self._start_time = 0
示例4: __init__
def __init__(self):
"""
Init user playlist
"""
BasePlayer.__init__(self)
self._user_playlist_ids = []
self._user_playlist = []
self._user_playlist_backup = []
示例5: __init__
def __init__(self):
"""
Init shuffle player
"""
BasePlayer.__init__(self)
self.reset_history()
# Party mode
self.__is_party = False
Lp().settings.connect('changed::shuffle', self.__set_shuffle)
示例6: __init__
def __init__(self):
Gst.init(None)
BasePlayer.__init__(self)
self._playbin = Gst.ElementFactory.make('playbin', 'player')
flags = self._playbin.get_property("flags")
flags &= ~GstPlayFlags.GST_PLAY_FLAG_VIDEO
self._playbin.set_property("flags", flags)
ReplayGainPlayer.__init__(self, self._playbin)
self._playbin.connect("about-to-finish",
self._on_stream_about_to_finish)
bus = self._playbin.get_bus()
bus.add_signal_watch()
bus.connect('message::error', self._on_bus_error)
bus.connect('message::eos', self._on_bus_eos)
bus.connect('message::stream-start', self._on_stream_start)
示例7: __init__
def __init__(self):
"""
Init linear player
"""
BasePlayer.__init__(self)
示例8: __init__
def __init__(self):
BasePlayer.__init__(self)
self._current = None
示例9: __init__
def __init__(self):
"""
Init user playlist
"""
BasePlayer.__init__(self)
示例10: __init__
def __init__(self):
"""
Init user playlist
"""
BasePlayer.__init__(self)
self._user_playlist_id = None
示例11: __init__
def __init__(self):
BasePlayer.__init__(self)
示例12: __init__
def __init__(self):
BasePlayer.__init__(self)
Objects.settings.connect('changed::shuffle', self._set_shuffle)