Exemple #1
0
 def createLabel(self, xpos, ypos, x, y, color, text, connect):
     label_hdl = labelClickable.QLabelClickable(self)
     label_hdl.setGeometry(xpos, ypos, x, y)
     label_hdl.setText("<font color=" + color + ">" + text + "</font>")
     if connect != None:
         label_hdl.clicked.connect(connect)
         return label_hdl
Exemple #2
0
 def createLabel(self, x, y, color, text, connect):
     label_hdl = labelClickable.QLabelClickable(self.dialogParent)
     label_hdl.setFont(self.font)
     label_hdl.setGeometry(x, y, 500, 50)
     label_hdl.setText("<font color=" + color + ">" + text + "</font>")
     if connect != None:
         label_hdl.clicked.connect(connect)
         return label_hdl
Exemple #3
0
 def createIconLabel(self, x, y, color, text, connect):
     font = QtGui.QFont()
     font.setFamily("Droid Sans")
     font.setPointSize(30)
     font.setBold(True)
     font.setWeight(75)
     label_hdl = labelClickable.QLabelClickable(self)
     label_hdl.setFont(font)
     label_hdl.setGeometry(x, y, 48, 48)
     label_hdl.setText("<font color="+color+">"+text+"</font>")
     if connect != None:
         label_hdl.clicked.connect(connect)
     return label_hdl    
Exemple #4
0
 def __init__(self, gui, dia):
     self.gui = gui
     self.dia = dia
     self.menuActive = True
     
     if "arm" in platform.machine():
         print("ARM Detected, so probably Rapberry")
         import rpi_backlight as bl
         import lircradio
        
         # Backlight
         bl.set_brightness(100) # start up with full brightness
         
         # LIRC remote
         lircQueue = queue.Queue()
         
         self.LircObject = lircradio.LircInterface(lircQueue)
         self.LircObject.start()
         
         self.LircHandler = lircradio.LircHandler(lircQueue)
         self.lircTimer = QtCore.QTimer()
         self.lircTimer.timeout.connect(self.LircHandler.timerCall)
         self.lircTimer.start(1000)
         self.LircHandler.addCallback("ok", self.ok_clicked)
         self.LircHandler.addCallback("back", self.back_clicked)
         self.LircHandler.addCallback("up", self.up_clicked)
         self.LircHandler.addCallback("down", self.down_clicked)
         self.LircHandler.addCallback("left", self.left_clicked)
         self.LircHandler.addCallback("right", self.right_clicked)
         self.LircHandler.addCallback("power", self.power_clicked)
     else:
         print("No ARM, so no Rapberry")
         
     self.sDialog = station.SelectStation()
     dia.setStyleSheet("QWidget#Dialog {background-image: url(Music-Record-Vinyl-800-480.jpg);}")
     self.cDialog = clock.Clock(self)
     
     self.infoTimer = QtCore.QTimer()
     self.infoTimer.timeout.connect(self.timercall)
     self.infoTimer.start(5000)
     
     font = QtGui.QFont()
     font.setFamily("Droid Sans")
     font.setPointSize(28)
     font.setBold(True)
     font.setWeight(75)
     
     self.labelStation = labelClickable.QLabelClickable(self.dia)
     self.labelStation.setFont(font)
     self.labelStation.setGeometry(28, 415, 750, 60)
     self.labelStation.setText("<font color='lightGray'> Back </font>")
     self.labelStation.clicked.connect(self.selectStation_clicked)
     self.showArtist("")
     self.showSong("")
     self.getLastPlayed()
     
     self.showStation(self.last_name)
     self.showTime()
     self.showPicture(self.last_image)
     
     self.client = mpd.MPDClient()       # create client object
     self.client.timeout = 2             # network timeout in seconds (floats allowed), default: None
     self.client.idletimeout = None      # timeout for fetching the result of the idle command is handled seperately, default: None
     
     self.number = 0
     self.clear()
     self.addStation(self.lasturl)
     print("Starting")
     self.play(self.number)
     self.status = "playing"
     self.getShowInfo()