本文整理汇总了Python中gnomemusic.playlists.Playlists类的典型用法代码示例。如果您正苦于以下问题:Python Playlists类的具体用法?Python Playlists怎么用?Python Playlists使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Playlists类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, parent):
self.ui = Gtk.Builder()
self.ui.add_from_resource('/org/gnome/Music/PlaylistDialog.ui')
self.dialog_box = self.ui.get_object('dialog1')
self.dialog_box.set_transient_for(parent)
self.view = self.ui.get_object('treeview1')
self.selection = self.ui.get_object('treeview-selection1')
self._add_list_renderers()
self.view.connect('row-activated', self._on_item_activated)
self.model = self.ui.get_object('liststore1')
self.populate()
self.title_bar = self.ui.get_object('headerbar1')
self.dialog_box.set_titlebar(self.title_bar)
self._cancel_button = self.ui.get_object('cancel-button')
self._select_button = self.ui.get_object('select-button')
self._select_button.set_sensitive(False)
self._cancel_button.connect('clicked', self._on_cancel_button_clicked)
self._select_button.connect('clicked', self._on_selection)
self.playlist = Playlists.get_default()
self.playlist.connect('playlist-created', self._on_playlist_created)
示例2: __init__
def __init__(self, app):
self.con = Gio.bus_get_sync(Gio.BusType.SESSION, None)
Gio.bus_own_name_on_connection(self.con,
'org.mpris.MediaPlayer2.GnomeMusic',
Gio.BusNameOwnerFlags.NONE,
None,
None)
super().__init__(self.con, '/org/mpris/MediaPlayer2')
self.app = app
self.player = app.props.player
self.player.connect(
'song-changed', self._on_current_song_changed)
self.player.connect('notify::state', self._on_player_state_changed)
self.player.connect('notify::repeat-mode', self._on_repeat_mode_changed)
self.player.connect('seek-finished', self._on_seek_finished)
self.player.connect(
'playlist-changed', self._on_player_playlist_changed)
self.player_toolbar = app.get_active_window()._player_toolbar
self.player_toolbar.connect(
'thumbnail-updated', self._on_thumbnail_updated)
playlists = Playlists.get_default()
playlists.connect('playlist-created', self._on_playlists_count_changed)
playlists.connect('playlist-deleted', self._on_playlists_count_changed)
grilo.connect('ready', self._on_grilo_ready)
self.playlists = []
self._player_previous_type = None
self._path_list = []
self._metadata_list = []
self._previous_playback_status = "Stopped"
示例3: __init__
def __init__(self, parent, playlists_todelete):
super().__init__()
self._add_playlist_button = None
self._add_playlist_entry = None
self.props.transient_for = parent
self.set_titlebar(self._title_bar)
self._populate()
self._playlists_todelete_ids = playlists_todelete.keys()
self._user_playlists_available = False
self._playlist = Playlists.get_default()
self._playlist.connect('playlist-created', self._on_playlist_created)
示例4: __init__
def __init__(self, app):
DBusGMainLoop(set_as_default=True)
name = dbus.service.BusName('org.mpris.MediaPlayer2.GnomeMusic', dbus.SessionBus())
dbus.service.Object.__init__(self, name, '/org/mpris/MediaPlayer2')
self.app = app
self.player = app.get_active_window().player
self.player.connect('current-changed', self._on_current_changed)
self.player.connect('thumbnail-updated', self._on_thumbnail_updated)
self.player.connect('playback-status-changed', self._on_playback_status_changed)
self.player.connect('repeat-mode-changed', self._on_repeat_mode_changed)
self.player.connect('volume-changed', self._on_volume_changed)
self.player.connect('prev-next-invalidated', self._on_prev_next_invalidated)
self.player.connect('seeked', self._on_seeked)
self.player.connect('playlist-changed', self._on_playlist_changed)
playlists = Playlists.get_default()
playlists.connect('playlist-created', self._on_playlists_count_changed)
playlists.connect('playlist-deleted', self._on_playlists_count_changed)
grilo.connect('ready', self._on_grilo_ready)
self.playlists = []
self.playlist = None
self.playlist_insert_handler = 0
self.playlist_delete_handler = 0
self.first_song_handler = 0