Beispiel #1
0
class Button_SeekForward_PRM():
    def __init__(self, controller):
        self.controller = controller
        self.audioController = AudioController()

    def onClick(self, isLongClick=False):
        if (self.audioController.getGUICoolDown() == False):
            self.audioController.startGUICoolDown(1.1)
            self.audioController.seekUp()

    def createButton(self, sizeX, sizeY):
        button = PicButton(
            QPixmap("themes/default/img/seekforward_prm.png"),
            QPixmap("themes/default/img/seekforward_prm_pressed.png"), sizeX,
            sizeY, "", self.onClick)

        return button
Beispiel #2
0
class Button_Next_MM():
    """
    Concrete class of the "Next" button from the Main Menu Audio Widget.
    """
    def __init__(self):
        """
        Constructor of the Button_Next_MM Class.
        """

        self.audioController = AudioController()
        self.audioObject = self.audioController.getAudioObject()

    def onClick(self, isLongClick=False):
        """
        OnClick method. Describes the behaviour of the button when is pressed.
        In this case, it switch to the next song of the list.
        """

        if (self.audioObject.getStatus() != AudioStatus.NOFILE
                and self.audioController.getPlayingRadio() == False):
            self.audioController.nextTrack()

        if (self.audioObject.getStatus() == AudioStatus.NOFILE
                and self.audioController.getPlayingRadio() == True):
            if (self.audioController.getGUICoolDown() == False):
                self.audioController.startGUICoolDown(1.1)
                self.audioController.seekUp()

    def createButton(self, sizeX, sizeY):
        """
        This method is a factory of a PicButton object. Creates a button with the described size.

        :param sizeX: X size of the button.
        :param sizeY: Y size of the button.
        :return: Created button object.
        """

        button = PicButton(QPixmap("themes/default/img/next_pam.png"),
                           QPixmap("themes/default/img/next_pam_pressed.png"),
                           sizeX, sizeY, "", self.onClick)

        return button