Esempio n. 1
0
class Button_Pause_MM():
    """
    Concrete class of the "Pause" button from the Main Menu Audio Widget.
    """
    def __init__(self):
        """
        Constructor of the Button_Pause_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 pauses the reproduction.
        """

        if (self.audioObject.getStatus() != AudioStatus.NOFILE):
            self.audioController.pause()

    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/pause_pam.png"),
                           QPixmap("themes/default/img/pause_pam_pressed.png"),
                           sizeX, sizeY, "", self.onClick)

        return button
Esempio n. 2
0
    def __init__(self):
        """
        Constructor of the Button_Pause_MM Class.
        """

        self.audioController = AudioController()
        self.audioObject = self.audioController.getAudioObject()
Esempio n. 3
0
class Button_POff_MM():
    """
    Concrete class of the "Power Off" button from the Main Menu.
    """
    def __init__(self):
        """
        Constructor of the Button_POff_MM Class.
        """

        self.audioController = AudioController()

    def onClick(self, isLongClick=False):
        """
        OnClick method. Describes the behaviour of the button when is pressed.
        In this case, it ends the application.
        """
        self.audioController.stopRadio()
        exit(0)

    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/MenuButton_R.png"),
            QPixmap("themes/default/img/MenuButton_R_Pressed.png"), sizeX,
            sizeY, "Apagar", self.onClick)

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

        audioController = AudioController()
        audioController.previousTrack()
Esempio n. 5
0
    def onClick(self, isLongClick=False):
        """
        OnClick method. Describes the behaviour of the button when is pressed.
        In this case, it resumes the reproduction.
        """

        audioController = AudioController()
        audioController.resume()
    def __init__(self, controller):
        """
        Constructor of the Button_Resume_SAM Class.

        :param controller: GUIController object.
        """


        self.controller = controller
        self.audioController = AudioController()
Esempio n. 7
0
class GUIController(object):
    """
    This class has the responsibility of do the change between menus & initialize the GUI.
    """
    def initialize(self):
        """
        Initialize the GUI and load the Main Menu.
        """

        app = QApplication(sys.argv)
        mainWindow = MainWindow()
        self.centralWidget = QStackedWidget()
        mainWindow.setCentralWidget(self.centralWidget)

        self.db = RAM_DB()
        self.mainMenuWidget = MainMenu(self)
        self.audioController = AudioController()

        self.centralWidget.addWidget(self.mainMenuWidget)
        self.centralWidget.setCurrentWidget(self.mainMenuWidget)

        sys.exit(app.exec_())

    def changeToMenu(self, menuname):
        """
        Changes to the menu passed by parameter.

        :param menuname: String with the name of the menu.
        """

        if (menuname == "MainMenu"):
            self.db.setCurrentMenu("MainMenu")
            self.centralWidget.setCurrentWidget(self.mainMenuWidget)

        elif (menuname == "SelectAudioMenu"):
            self.db.setCurrentMenu("SelectAudioMenu")
            self.selectAudioMenuWidget = SelectAudioMenu(self)
            self.centralWidget.addWidget(self.selectAudioMenuWidget)
            self.centralWidget.setCurrentWidget(self.selectAudioMenuWidget)

        elif (menuname == "PlayAudioMenu"):
            self.db.setCurrentMenu("PlayAudioMenu")
            self.playAudioMenuWidget = PlayAudioMenu(self)
            #Observer pattern register
            self.audioController.register(self.playAudioMenuWidget)
            self.centralWidget.addWidget(self.playAudioMenuWidget)
            self.centralWidget.setCurrentWidget(self.playAudioMenuWidget)

        elif (menuname == "PlayRadioMenu"):
            self.db.setCurrentMenu("PlayRadioMenu")
            self.playRadioMenuWidget = PlayRadioMenu(self)
            # Observer pattern register
            self.audioController.register(self.playRadioMenuWidget)
            self.centralWidget.addWidget(self.playRadioMenuWidget)
            self.centralWidget.setCurrentWidget(self.playRadioMenuWidget)
Esempio n. 8
0
class Button_Memory_PRM():

    def __init__(self, buttonId):
        self.buttonId = buttonId
        self.db = RAM_DB()
        self.radioChannels = self.db.getRadioChannels()
        self.audioController = AudioController()

    def onClick(self, isLongClick = False):
        if(self.audioController.getGUICoolDown() == False and isLongClick == False):
            self.audioController.startGUICoolDown(1)
            # If there's an entry in the XML with memorized channel, we assign it to this button/memory bank
            if(self.radioChannels[self.buttonId] != None):
                self.audioController.setCurrentFMFrequency(self.radioChannels[self.buttonId][0])
        elif ((self.audioController.getGUICoolDown() == False and isLongClick == True)):
            # On long click, we memorize the current radio channel to this memory bank :)
            self.db.setRadioChannel(self.buttonId, self.audioController.getCurrentFMFrequency(), self.audioController.getCurrentFMStationName())
            self.radioChannels = self.db.getRadioChannels()
            self.audioController.updateRadioObservers()



    def createButton(self, sizeX, sizeY):
        button = PicButton(QPixmap("themes/default/img/MemoryButton.png"), QPixmap("themes/default/img/MemoryButton_Pressed.png"), sizeX, sizeY, str(self.buttonId), self.onClick)

        return button
    def __init__(self, parent=None):
        """
        Constructor of the RadioMenuChannelMemory class.
        """

        super(RadioMenuChannelMemory, self).__init__(parent)

        self.db = RAM_DB()
        audioController = AudioController()
        radioChannels = self.db.getRadioChannels()

        self.memoryButtons = []
        self.labelsMemoryButtons = []
        for i in range(0, 9):
            self.memoryButtons.append(
                Button_Memory_PRM(i).createButton(60, 60))
            if (audioController.getPlayingRadio() == False
                    or audioController.getGUICoolDown() == True):
                self.memoryButtons[i].setOppacity(0.3)

        for i in range(0, 9):
            if (radioChannels[i] == None):
                memoryButtonLabel = "Vacío"
            else:
                memoryButtonLabel = radioChannels[i][1]

            self.labelsMemoryButtons.append(CustomLabel().createLabel(
                memoryButtonLabel, Qt.AlignCenter, 7))

        hButtonBarBox = QHBoxLayout()

        hButtonBarBox.addStretch()

        for i in range(0, len(self.memoryButtons)):
            vButtonBox = QVBoxLayout()
            hMemoryButtonBox = QHBoxLayout()

            hMemoryButtonBox.addStretch()
            hMemoryButtonBox.addWidget(self.memoryButtons[i])
            hMemoryButtonBox.addStretch()
            vButtonBox.addLayout(hMemoryButtonBox)

            hMemoryLabelBox = QHBoxLayout()
            hMemoryLabelBox.addStretch()
            hMemoryLabelBox.addWidget(self.labelsMemoryButtons[i])
            hMemoryLabelBox.addStretch()
            vButtonBox.addLayout(hMemoryLabelBox)

            hButtonBarBox.addLayout(vButtonBox)
            hButtonBarBox.addStretch()

        self.setLayout(hButtonBarBox)
Esempio n. 10
0
class Button_Downfreq_PRM():

    def __init__(self, controller):
        self.controller = controller
        self.audioController = AudioController()

    def onClick(self, isLongClick = False):
        if (self.audioController.getGUICoolDown() == False):
            self.audioController.previousFrequency()
            self.audioController.startChangeFrequencyThread()

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

        return button
    def item_click(self, item):
        """
        Changes to the Play Audio Menu when a item is clicked.

        :param item: The clicked item.
        """

        #Set the track selected for playing it
        self.db.setSelection(
            self.db.getIndexByPath(self.itemsDict[str(item)].getPath()))
        #Switch to PlayAudioMenu
        self.controller.changeToMenu("PlayAudioMenu")
        #Call to audioController for load the new audio file...
        audioController = AudioController()
        audioController.loadAudio()
class Button_SeekBack_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.seekDown()

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

        return button
Esempio n. 13
0
    def initialize(self):
        """
        Initialize the GUI and load the Main Menu.
        """

        app = QApplication(sys.argv)
        mainWindow = MainWindow()
        self.centralWidget = QStackedWidget()
        mainWindow.setCentralWidget(self.centralWidget)

        self.db = RAM_DB()
        self.mainMenuWidget = MainMenu(self)
        self.audioController = AudioController()

        self.centralWidget.addWidget(self.mainMenuWidget)
        self.centralWidget.setCurrentWidget(self.mainMenuWidget)

        sys.exit(app.exec_())
Esempio n. 14
0
    def __init__(self, controller, parent=None):
        """
        Constructor of the SelectAudioMenu class.

        :param controller: GUIController object.
        """

        super(SelectAudioMenu, self).__init__(parent)

        self.controller = controller
        self.db = RAM_DB()
        (fileName, pathFiles, self.metaDataList) = self.db.getAudioDB()
        self.audioController = AudioController()

        backButton = Button_Back_SAM(self.controller).createButton(269, 100)
        self.resumeButton = Button_Resume_SAM(self.controller).createButton(
            269, 100)
        selectAudioListWidget = SelectAudioListWidget(self.controller)

        verticalBoxLayout = QVBoxLayout()
        hSelectAudioListBox = QHBoxLayout()
        hButtonsMenuBox = QHBoxLayout()

        verticalBoxLayout.setContentsMargins(0, 0, 0, 0)
        verticalBoxLayout.addStretch()

        hSelectAudioListBox.addStretch()
        hSelectAudioListBox.addWidget(selectAudioListWidget)
        hSelectAudioListBox.addStretch()

        verticalBoxLayout.addLayout(hSelectAudioListBox)

        verticalBoxLayout.addStretch()

        hButtonsMenuBox.addWidget(backButton)
        hButtonsMenuBox.addStretch()
        hButtonsMenuBox.addWidget(self.resumeButton)

        if self.audioController.getStatus() == AudioStatus.NOFILE:
            self.resumeButton.hide()

        verticalBoxLayout.addLayout(hButtonsMenuBox)

        self.setLayout(verticalBoxLayout)
Esempio n. 15
0
    def __init__(self, controller, parent=None):
        """
        Constructor of the MainMenu class.

        :param controller: GUIController object.
        """

        super(MainMenu, self).__init__(parent)

        audioController = AudioController()
        optionsButton = Button_Options_MM(controller).createButton(269, 100)
        optionsButton.setOppacity(0.3)
        poffButton = Button_POff_MM().createButton(269, 100)

        mainMenuAudioWidget = MainMenuAudioWidget()
        mainMenuButtonsWidget = MainMenuButtonsWidget(controller)

        # Observer
        audioController.register(mainMenuAudioWidget)

        # Setting the layouts
        verticalBoxLayout = QVBoxLayout()
        hMainMenuTopWidgets = QHBoxLayout()
        hButtonsMenuBox = QHBoxLayout()

        verticalBoxLayout.setContentsMargins(0, 0, 0, 0)
        verticalBoxLayout.addStretch()
        verticalBoxLayout.addStretch()

        hMainMenuTopWidgets.addStretch()
        hMainMenuTopWidgets.addWidget(mainMenuAudioWidget)
        verticalBoxLayout.addLayout(hMainMenuTopWidgets)
        verticalBoxLayout.addStretch()

        verticalBoxLayout.addWidget(mainMenuButtonsWidget)
        verticalBoxLayout.addStretch()

        hButtonsMenuBox.addWidget(optionsButton)

        hButtonsMenuBox.addStretch()
        hButtonsMenuBox.addWidget(poffButton)
        verticalBoxLayout.addLayout(hButtonsMenuBox)

        self.setLayout(verticalBoxLayout)
Esempio n. 16
0
class Button_Previous_MM():
    """
    Concrete class of the "Previous" button from the Main Menu Audio Widget.
    """
    def __init__(self):
        """
        Constructor of the Button_Previous_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 previous song of the list.
        """

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

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

    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/previous_pam.png"),
            QPixmap("themes/default/img/previous_pam_pressed.png"), sizeX,
            sizeY, "", self.onClick)

        return button
    def __init__ (self, parent = None):
        """
        Constructor of the MainMenuAudioWidget class.
        """

        super(MainMenuAudioWidget, self).__init__(parent)
        self.playButton = Button_Play_MM().createButton(60, 60)
        self.pauseButton = Button_Pause_MM().createButton(60, 60)
        self.pauseButton.setOppacity(0.3)

        self.nextButton = Button_Next_MM().createButton(60, 60)
        self.nextButton.setOppacity(0.3)
        self.previousButton = Button_Previous_MM().createButton(60, 60)
        self.previousButton.setOppacity(0.3)
        self.audioController = AudioController()
        self.audioObject = self.audioController.getAudioObject()

        verticalBoxLayout = QVBoxLayout()
        hRepButtonsBox = QHBoxLayout()

        verticalBoxLayout.addStretch()
        self.textLabel = CustomLabel().createLabel("Sin medios de reproducción", Qt.AlignCenter, 13)
        verticalBoxLayout.addWidget(self.textLabel)
        verticalBoxLayout.addStretch()

        hRepButtonsBox.addStretch()
        if (self.audioObject.getStatus() == AudioStatus.PAUSED):
            self.pauseButton.hide()
        else:
            self.playButton.hide()
        hRepButtonsBox.addWidget(self.previousButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(self.playButton)
        hRepButtonsBox.addWidget(self.pauseButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(self.nextButton)
        hRepButtonsBox.addStretch()

        verticalBoxLayout.addLayout(hRepButtonsBox)

        self.setLayout(verticalBoxLayout)
Esempio n. 18
0
class Button_Resume_SAM():
    """
    Concrete class of the "Resume reproduction" button from the Select Audio Menu.
    """

    def __init__(self, controller):
        """
        Constructor of the Button_Resume_SAM Class.

        :param controller: GUIController object.
        """


        self.controller = controller
        self.audioController = AudioController()

    def onClick(self, isLongClick = False):
        """
        OnClick method. Describes the behaviour of the button when is pressed.
        In this case, it switch to the Play Audio Menu with the current reproduction.
        """

        self.controller.changeToMenu("PlayAudioMenu")
        self.audioController.startUpdateStatusThread()

    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/MenuButton_R.png"), QPixmap("themes/default/img/MenuButton_R_Pressed.png"), sizeX, sizeY, "Reanudar", self.onClick)

        return button
Esempio n. 19
0
    def __init__(self, controller, parent=None):
        """
        Constructor of the PlayAudioMenu class.

        :param controller: GUIController object.
        """

        super(PlayAudioMenu, self).__init__(parent)

        self.controller = controller
        self.db = RAM_DB()

        backButton = Button_Back_PAM(self.controller).createButton(269, 100)
        self.playButton = Button_Play_PAM(self.controller).createButton(60, 60)
        self.pauseButton = Button_Pause_PAM(self.controller).createButton(
            60, 60)
        nextButton = Button_Next_PAM(self.controller).createButton(60, 60)
        previousButton = Button_Previous_PAM(self.controller).createButton(
            60, 60)

        (self.fileName, self.pathFiles,
         self.metaDataList) = self.db.getAudioDB()
        path = self.pathFiles[self.db.getSelection()]

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

        self.textLabel = CustomLabel().createLabel(path, Qt.AlignCenter)
        self.actualTimeLabel = CustomLabel().createLabel(
            "00:00", Qt.AlignCenter)
        self.totalTimeLabel = CustomLabel().createLabel(
            "00:00", Qt.AlignCenter)
        self.timeSlider = TimeSlider(0, 100, 0, self.sliderValueChangedByUser)

        verticalBoxLayout = QVBoxLayout()
        hRepTimeBox = QHBoxLayout()
        hRepButtonsBox = QHBoxLayout()
        hImageBox = QHBoxLayout()
        hButtonsMenuBox = QHBoxLayout()

        verticalBoxLayout.setContentsMargins(0, 0, 0, 0)
        verticalBoxLayout.addStretch()

        verticalBoxLayout.addStretch()
        verticalBoxLayout.addWidget(self.textLabel)
        verticalBoxLayout.addStretch()

        hImageBox.addStretch()
        self.imgQLabel = QLabel()
        self.imgQLabel.setMaximumHeight(150)
        self.imgQLabel.setMaximumWidth(150)

        self.pixmapCover = QPixmap()
        loaded = self.pixmapCover.load(
            getArtworkPath(self.metaDataList[self.db.getSelection()]))

        if (loaded == False):
            self.pixmapCover.load(self.db.getArtworkNotFoundPath())
        self.imgQLabel.setPixmap(self.pixmapCover.scaled(150, 150))

        hImageBox.addWidget(self.imgQLabel)
        hImageBox.addStretch()
        verticalBoxLayout.addLayout(hImageBox)

        verticalBoxLayout.addStretch()

        hRepTimeBox.addWidget(self.actualTimeLabel)
        hRepTimeBox.addStretch()
        hRepTimeBox.addWidget(self.totalTimeLabel)
        verticalBoxLayout.addLayout(hRepTimeBox)
        verticalBoxLayout.addWidget(self.timeSlider)
        verticalBoxLayout.addStretch()

        hRepButtonsBox.addStretch()
        if (self.audioObject.getStatus() == AudioStatus.PAUSED):
            self.pauseButton.hide()
        else:
            self.playButton.hide()
        hRepButtonsBox.addWidget(previousButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(self.playButton)
        hRepButtonsBox.addWidget(self.pauseButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(nextButton)
        hRepButtonsBox.addStretch()

        verticalBoxLayout.addLayout(hRepButtonsBox)
        verticalBoxLayout.addStretch()

        hButtonsMenuBox.addWidget(backButton)
        hButtonsMenuBox.addStretch()
        verticalBoxLayout.addLayout(hButtonsMenuBox)

        self.setLayout(verticalBoxLayout)
 def __init__(self, controller):
     self.controller = controller
     self.audioController = AudioController()
Esempio n. 21
0
 def __init__(self, buttonId):
     self.buttonId = buttonId
     self.db = RAM_DB()
     self.radioChannels = self.db.getRadioChannels()
     self.audioController = AudioController()
class MainMenuAudioWidget (QWidget):
    """
    This class provides a customized widget for control the music & the radio in the Main Menu.
    """

    __metaclass__ = ABCMeta

    def __init__ (self, parent = None):
        """
        Constructor of the MainMenuAudioWidget class.
        """

        super(MainMenuAudioWidget, self).__init__(parent)
        self.playButton = Button_Play_MM().createButton(60, 60)
        self.pauseButton = Button_Pause_MM().createButton(60, 60)
        self.pauseButton.setOppacity(0.3)

        self.nextButton = Button_Next_MM().createButton(60, 60)
        self.nextButton.setOppacity(0.3)
        self.previousButton = Button_Previous_MM().createButton(60, 60)
        self.previousButton.setOppacity(0.3)
        self.audioController = AudioController()
        self.audioObject = self.audioController.getAudioObject()

        verticalBoxLayout = QVBoxLayout()
        hRepButtonsBox = QHBoxLayout()

        verticalBoxLayout.addStretch()
        self.textLabel = CustomLabel().createLabel("Sin medios de reproducción", Qt.AlignCenter, 13)
        verticalBoxLayout.addWidget(self.textLabel)
        verticalBoxLayout.addStretch()

        hRepButtonsBox.addStretch()
        if (self.audioObject.getStatus() == AudioStatus.PAUSED):
            self.pauseButton.hide()
        else:
            self.playButton.hide()
        hRepButtonsBox.addWidget(self.previousButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(self.playButton)
        hRepButtonsBox.addWidget(self.pauseButton)
        hRepButtonsBox.addStretch()
        hRepButtonsBox.addWidget(self.nextButton)
        hRepButtonsBox.addStretch()

        verticalBoxLayout.addLayout(hRepButtonsBox)

        self.setLayout(verticalBoxLayout)

    @abstractmethod
    def update(self, *args, **kwargs):
        """
        Update method of the observer pattern.

        :param args: args
        :param kwargs: kwargs
        """

        self.updateView(*args, **kwargs)

    def updateView(self, *args, arg1, arg2):
        """
        Update view method of the observer pattern.

        :param args: Name of the notification.
        :param arg1: Other data.
        :param arg2: Other data.
        """

        if (args[0] == "NewMetaData"):

            if arg2[1] == None:
                titleText = "Artista desconocido" + " - " + arg2[0]
            else:
                titleText = arg2[1] + " - " + arg2[0]

            self.textLabel.setText(titleText)
            self.playButton.hide()
            self.pauseButton.show()
            self.pauseButton.setOppacity(1)
            self.nextButton.setOppacity(1)
            self.previousButton.setOppacity(1)

        elif (args[0] == "AudioPaused"):
            self.playButton.show()
            self.pauseButton.hide()

        elif (args[0] == "AudioResumed"):
            self.playButton.hide()
            self.pauseButton.show()

        elif (args[0] == "UpdateCurrentFMFrequency"):
            self.playButton.hide()
            self.pauseButton.show()
            self.pauseButton.setOppacity(0.3)
            self.textLabel.setText("Radio: " + str(arg1) + " FM")

        elif (args[0] == "CoolDownStarted"):
            self.nextButton.setOppacity(0.3)
            self.previousButton.setOppacity(0.3)


        elif (args[0] == "CoolDownEnded"):
            self.nextButton.setOppacity(1)
            self.previousButton.setOppacity(1)
Esempio n. 23
0
    def __init__(self, controller, parent=None):
        """
        Constructor of the PlayRadioMenu class.

        :param controller: GUIController object.
        """

        super(PlayRadioMenu, self).__init__(parent)

        self.controller = controller
        audioController = AudioController()
        self.db = RAM_DB()
        radioMenuChannelMemoryWidget = RadioMenuChannelMemory()
        # Observer
        audioController.register(radioMenuChannelMemoryWidget)

        self.backButton = Button_Back_PRM(self.controller).createButton(269, 100)
        self.upFreqButton = Button_Upfreq_PRM(self.controller).createButton(60, 60)
        self.downFreqButton = Button_Downfreq_PRM(self.controller).createButton(60, 60)
        self.seekBackButton = Button_SeekBack_PRM(self.controller).createButton(60, 60)
        self.seekForwardButton = Button_SeekForward_PRM(self.controller).createButton(60, 60)

        if(audioController.getPlayingRadio() == False or audioController.getGUICoolDown() == True):
            self.upFreqButton.setOppacity(0.3)
            self.downFreqButton.setOppacity(0.3)
            self.seekBackButton.setOppacity(0.3)
            self.seekForwardButton.setOppacity(0.3)

        audioController.initRadio()

        self.freqLabel = CustomLabel().createLabel(str(audioController.getCurrentFMFrequency()) + " FM", Qt.AlignCenter, 30)

        verticalBoxLayout = QVBoxLayout()
        verticalBoxLayout.setContentsMargins(0, 0, 0, 0)

        verticalBoxLayout.addStretch()
        verticalBoxLayout.addStretch()
        verticalBoxLayout.addWidget(self.freqLabel)
        verticalBoxLayout.addStretch()

        hMenuBox = QHBoxLayout()
        hMenuBox.addStretch()
        hMenuBox.addWidget(self.seekBackButton)
        hMenuBox.addStretch()
        hMenuBox.addWidget(self.downFreqButton)
        hMenuBox.addStretch()
        hMenuBox.addWidget(self.upFreqButton)
        hMenuBox.addStretch()
        hMenuBox.addWidget(self.seekForwardButton)
        hMenuBox.addStretch()
        verticalBoxLayout.addLayout(hMenuBox)

        verticalBoxLayout.addStretch()

        verticalBoxLayout.addWidget(radioMenuChannelMemoryWidget)

        verticalBoxLayout.addStretch()

        hbox = QHBoxLayout()

        hbox.addWidget(self.backButton)
        hbox.addStretch()

        verticalBoxLayout.addLayout(hbox)

        self.setLayout(verticalBoxLayout)
Esempio n. 24
0
    def __init__(self):
        """
        Constructor of the Button_POff_MM Class.
        """

        self.audioController = AudioController()