terminado
This commit is contained in:
@@ -36,14 +36,26 @@ def escuchar(url):
|
||||
print(player.mediaStatus())
|
||||
|
||||
|
||||
# Asigna las acciones de las emisoras
|
||||
iconPlay = QIcon(path + "/play.png")
|
||||
for i, item in enumerate(jsonObject):
|
||||
globals()['action%s' % i] = QAction(iconPlay, item["nombre"])
|
||||
globals()['action%s' % i].triggered.connect(
|
||||
lambda checked, url=item["url"]: escuchar(url)
|
||||
)
|
||||
menu.addAction(globals()['action%s' % i])
|
||||
# para ordenar las emisoras por el nombre
|
||||
def sortFn(dict):
|
||||
return dict['nombre']
|
||||
|
||||
|
||||
# las categorias
|
||||
for tag in sorted(jsonObject[0].keys()):
|
||||
globals()['menu%s' % tag] = QMenu(tag)
|
||||
menu.addMenu(globals()['menu%s' % tag])
|
||||
# las opciones dentro de las catgorias
|
||||
jsonObject[0][tag].sort(key=sortFn)
|
||||
for i, item in enumerate(jsonObject[0][tag]):
|
||||
iconPlay = QIcon(path + "/play.png")
|
||||
globals()['action%s' % item["nombre"]] = QAction(
|
||||
iconPlay, item["nombre"])
|
||||
globals()['action%s' % item["nombre"]].triggered.connect(
|
||||
lambda checked, url=item["url"]: escuchar(url)
|
||||
)
|
||||
globals()['menu%s' % tag].addAction(
|
||||
globals()['action%s' % item["nombre"]])
|
||||
|
||||
|
||||
# Pausar
|
||||
|
||||
62
radios.json
62
radios.json
@@ -1,30 +1,40 @@
|
||||
[
|
||||
{
|
||||
"nombre": "4UHardFm",
|
||||
"url": "http://cdnradio.streamakaci.com/4uhardfm.mp3"
|
||||
},
|
||||
{
|
||||
"nombre": "CodeRadio",
|
||||
"url": "https://coderadio-relay-blr.freecodecamp.org/radio/8010/radio.mp3"
|
||||
},
|
||||
{
|
||||
"nombre": "2000FMHardRock",
|
||||
"url": "http://bigrradio.cdnstream1.com/5104_128?aw_0_1st.playerid=esPlayer&aw_0_1st.skey=1558013565"
|
||||
},
|
||||
{
|
||||
"nombre": "Marca Málaga",
|
||||
"url": "http://malagafm.streaming-pro.com:8130/malagafmmobile"
|
||||
},
|
||||
{
|
||||
"nombre": "Hard Rock`s 80",
|
||||
"url": "http://stream-licensing.com:8128"
|
||||
},
|
||||
{
|
||||
"nombre": "Mariskal Rock",
|
||||
"url": "http://media.profesionalhosting.com:8047/stream"
|
||||
},
|
||||
{
|
||||
"nombre": "Rock FM",
|
||||
"url": "http://rockfm-cope-rrcast.flumotion.com/cope/rockfm-low.mp3"
|
||||
"Rock": [
|
||||
{
|
||||
"nombre": "4UHardFm",
|
||||
"url": "http://cdnradio.streamakaci.com/4uhardfm.mp3"
|
||||
},
|
||||
{
|
||||
"nombre": "2000FMHardRock",
|
||||
"url": "http://bigrradio.cdnstream1.com/5104_128?aw_0_1st.playerid=esPlayer&aw_0_1st.skey=1558013565"
|
||||
},
|
||||
{
|
||||
"nombre": "Rock FM",
|
||||
"url": "http://rockfm-cope-rrcast.flumotion.com/cope/rockfm-low.mp3"
|
||||
}
|
||||
],
|
||||
"Hard Rock": [
|
||||
{
|
||||
"nombre": "Hard Rock`s 80",
|
||||
"url": "http://stream-licensing.com:8128"
|
||||
},
|
||||
{
|
||||
"nombre": "Mariskal Rock",
|
||||
"url": "http://media.profesionalhosting.com:8047/stream"
|
||||
}
|
||||
],
|
||||
"For Code": [
|
||||
{
|
||||
"nombre": "CodeRadio",
|
||||
"url": "https://coderadio-relay-blr.freecodecamp.org/radio/8010/radio.mp3"
|
||||
}
|
||||
],
|
||||
"Deporte": [
|
||||
{
|
||||
"nombre": "Marca Málaga",
|
||||
"url": "http://malagafm.streaming-pro.com:8130/malagafmmobile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user