Exemple #1
0
    def __init__(self, app, parent):
        """
            Init window and set transient for parent
            @param app as Gio.Application
            @param parent as Gtk.window
        """
        Gtk.Window.__init__(self)
        self.set_title("Lollypop")
        PlaybackController.__init__(self)
        ProgressController.__init__(self)
        self.set_application(app)
        self._timeout1 = None
        self._timeout2 = None
        self._seeking = False
        self._signal1_id = None
        self._signal2_id = None
        self.set_decorated(False)
        self._parent = parent

        builder = Gtk.Builder()
        builder.add_from_resource('/org/gnome/Lollypop/FullScreen.ui')
        builder.connect_signals(self)

        # Calculate cover size
        screen = Gdk.Screen.get_default()
        monitor = screen.get_primary_monitor()
        geometry = screen.get_monitor_geometry(monitor)
        # We want 500 and 200 in full hd
        scale = self.get_scale_factor()
        if geometry.width > geometry.height:
            artsize = int(ArtSize.FULLSCREEN*geometry.width/1920/scale)
        else:
            artsize = int(ArtSize.FULLSCREEN*geometry.height/1920/scale)
        InfosController.__init__(self, artsize)

        self._play_btn = builder.get_object('play_btn')
        self._next_btn = builder.get_object('next_btn')
        self._prev_btn = builder.get_object('prev_btn')
        self._next_popover = NextPopover()
        self._next_popover.set_position(Gtk.PositionType.BOTTOM)
        self._play_image = builder.get_object('play_image')
        self._pause_image = builder.get_object('pause_image')
        close_btn = builder.get_object('close_btn')
        close_btn.connect('clicked', self._destroy)
        self._cover = builder.get_object('cover')
        self._title_label = builder.get_object('title')
        self._artist_label = builder.get_object('artist')
        self._album_label = builder.get_object('album')

        self._datetime = builder.get_object('datetime')

        self._progress = builder.get_object('progress_scale')
        self._timelabel = builder.get_object('playback')
        self._total_time_label = builder.get_object('duration')
        self.connect('key-release-event', self._on_key_release_event)
        self.add(builder.get_object('widget'))
Exemple #2
0
    def __init__(self, app, parent):
        """
            Init window and set transient for parent
            @param app as Gio.Application
            @param parent as Gtk.window
        """
        Gtk.Window.__init__(self)
        self.set_title("Lollypop")
        PlaybackController.__init__(self)
        ProgressController.__init__(self)
        self.set_application(app)
        self.__timeout1 = None
        self.__timeout2 = None
        self.__signal1_id = None
        self.__signal2_id = None
        self.set_decorated(False)
        self.__parent = parent

        builder = Gtk.Builder()
        builder.add_from_resource('/org/gnome/Lollypop/FullScreen.ui')
        builder.connect_signals(self)

        # Calculate cover size
        screen = Gdk.Screen.get_default()
        monitor = screen.get_primary_monitor()
        geometry = screen.get_monitor_geometry(monitor)
        # We want 500 and 200 in full hd
        scale = self.get_scale_factor()
        if geometry.width > geometry.height:
            artsize = int(ArtSize.FULLSCREEN * geometry.width / 1920 / scale)
        else:
            artsize = int(ArtSize.FULLSCREEN * geometry.height / 1920 / scale)
        InfosController.__init__(self, artsize)

        self._play_btn = builder.get_object('play_btn')
        self._next_btn = builder.get_object('next_btn')
        self._prev_btn = builder.get_object('prev_btn')
        self._next_popover = NextPopover()
        self._next_popover.set_position(Gtk.PositionType.BOTTOM)
        self._play_image = builder.get_object('play_image')
        self._pause_image = builder.get_object('pause_image')
        close_btn = builder.get_object('close_btn')
        close_btn.connect('clicked', self.__destroy)
        self._cover = builder.get_object('cover')
        self._title_label = builder.get_object('title')
        self._artist_label = builder.get_object('artist')
        self._album_label = builder.get_object('album')

        self._datetime = builder.get_object('datetime')

        self._progress = builder.get_object('progress_scale')
        self._timelabel = builder.get_object('playback')
        self._total_time_label = builder.get_object('duration')
        self.connect('key-release-event', self.__on_key_release_event)
        self.add(builder.get_object('widget'))
Exemple #3
0
    def __init__(self):
        """
            Init toolbar
        """
        Gtk.Bin.__init__(self)
        PlaybackController.__init__(self)
        builder = Gtk.Builder()
        builder.add_from_resource('/org/gnome/Lollypop/ToolbarPlayback.ui')
        builder.connect_signals(self)

        self.add(builder.get_object('playback'))

        self._prev_btn = builder.get_object('previous_button')
        self._play_btn = builder.get_object('play_button')
        self._next_btn = builder.get_object('next_button')
        self._play_image = builder.get_object('play_image')
        self._pause_image = builder.get_object('pause_image')
Exemple #4
0
    def __init__(self):
        """
            Init toolbar
        """
        Gtk.Bin.__init__(self)
        PlaybackController.__init__(self)
        builder = Gtk.Builder()
        builder.add_from_resource("/org/gnome/Lollypop/ToolbarPlayback.ui")
        builder.connect_signals(self)

        self.add(builder.get_object("playback"))

        self._prev_btn = builder.get_object("previous_button")
        self._play_btn = builder.get_object("play_button")
        self._next_btn = builder.get_object("next_button")
        self._play_image = builder.get_object("play_image")
        self._pause_image = builder.get_object("pause_image")

        Lp().player.connect("lock-changed", self.__on_lock_changed)
Exemple #5
0
    def __init__(self, app, parent):
        """
            Init window and set transient for parent
            @param app as Gio.Application
            @param parent as Gtk.window
        """
        Gtk.Window.__init__(self)
        self.set_title("Lollypop")
        PlaybackController.__init__(self)
        ProgressController.__init__(self)
        self.set_application(app)
        self.__timeout1 = None
        self.__timeout2 = None
        self.__signal1_id = None
        self.__signal2_id = None
        self.set_decorated(False)
        self.__parent = parent

        builder = Gtk.Builder()
        builder.add_from_resource("/org/gnome/Lollypop/FullScreen.ui")
        builder.connect_signals(self)

        # Calculate cover size
        screen = Gdk.Screen.get_default()
        monitor = screen.get_primary_monitor()
        geometry = screen.get_monitor_geometry(monitor)
        # We want 500 and 200 in full hd
        if geometry.width > geometry.height:
            artsize = int(ArtSize.FULLSCREEN * geometry.width / 1920)
        else:
            artsize = int(ArtSize.FULLSCREEN * geometry.height / 1920)
        InfoController.__init__(self, artsize)
        widget = builder.get_object("widget")
        self._play_btn = builder.get_object("play_btn")
        self._next_btn = builder.get_object("next_btn")
        self._prev_btn = builder.get_object("prev_btn")
        self._next_popover = NextPopover()
        self._next_popover.set_position(Gtk.PositionType.BOTTOM)
        self._play_image = builder.get_object("play_image")
        self._pause_image = builder.get_object("pause_image")
        close_btn = builder.get_object("close_btn")
        preferences = Gio.Settings.new("org.gnome.desktop.wm.preferences")
        layout = preferences.get_value("button-layout").get_string()
        if layout.split(":")[0] == "close":
            widget.attach(close_btn, 0, 0, 1, 1)
            close_btn.set_property("halign", Gtk.Align.START)
        else:
            widget.attach(close_btn, 2, 0, 1, 1)
            close_btn.set_property("halign", Gtk.Align.END)
        self._cover = builder.get_object("cover")
        self._title_label = builder.get_object("title")
        self._artist_label = builder.get_object("artist")
        self._album_label = builder.get_object("album")

        self._datetime = builder.get_object("datetime")

        self._progress = builder.get_object("progress_scale")
        self._timelabel = builder.get_object("playback")
        self._total_time_label = builder.get_object("duration")
        self.connect("key-release-event", self.__on_key_release_event)
        self.add(widget)