Python_2  1.0
Classes | Functions | Variables
_11_tkradio Namespace Reference

A simple tkinter interface for fmtools, with lirc and recording support. More...

Classes

class  FMRec
 
class  IRRec
 
class  radioState
 

Functions

def init (loc, player='mplayer')
 
def killProc (pid)
 
def start_irrec ()
 
def set_rec_type ()
 
def execmd (cmd)
 
def radio (cmd)
 
def getStation (frequency)
 
def setCurStation (frequency)
 
def internetRadio (freq)
 
def setstation ()
 
def setStation (ind)
 
def changeStation (st)
 
def fini ()
 
def mute ()
 
def enter ()
 
def readStations ()
 
def next (e=None)
 
def previous (e=None)
 
def trigger ()
 
def net ()
 
def loop ()
 
def loopon ()
 
def chn ()
 
def rec ()
 
def rec_on ()
 
def rec_off ()
 
def getFreq (s)
 
def mouse_leave (event)
 
def mouse_enter (event)
 
def str2num (datum)
 
def getpid (proc)
 
def help (e=None)
 
def main (argv=None)
 

Variables

bool use_lirc = True
 
bool use_notify = True
 
bool use_Notify = False
 
 notification = Notify()
 
list stations
 
list radbut = stations[4][1]
 
int ivolume = 100
 
bool state = False
 
int blocking = 0
 
int tid = 0
 
int lid = 0
 
 fmrec = None
 
 irrec = None
 
int mpid = 0
 
int message = 0
 

Detailed Description

A simple tkinter interface for fmtools, with lirc and recording support.

The radio is turned off on exit.

Author
Paulo Roma
Since
23/12/2009

Function Documentation

◆ changeStation()

def _11_tkradio.changeStation (   st)
Set the station to the given station.

References internetRadio(), and radio().

Referenced by enter(), next(), previous(), setstation(), and setStation().

◆ chn()

def _11_tkradio.chn ( )
Set the sound channel.

Referenced by main().

◆ enter()

def _11_tkradio.enter ( )

◆ execmd()

def _11_tkradio.execmd (   cmd)
Execute the given command.

Referenced by net(), and radio().

◆ fini()

def _11_tkradio.fini ( )
Quit the radio.

References killProc(), and radio().

Referenced by main(), and _11_tkradio.IRRec.run().

◆ getFreq()

def _11_tkradio.getFreq (   s)
Returns the frequency of a station.

Referenced by main(), mouse_enter(), and mouse_leave().

◆ getpid()

def _11_tkradio.getpid (   proc)
Return the ID of the given process.

References str2num().

Referenced by main(), set_rec_type(), and start_irrec().

◆ getStation()

def _11_tkradio.getStation (   frequency)
Return the frequency index.

Referenced by enter(), and setCurStation().

◆ help()

def _11_tkradio.help (   e = None)
Enters a given URL for being played.

Referenced by main().

◆ init()

def _11_tkradio.init (   loc,
  player = 'mplayer' 
)

Referenced by main().

◆ internetRadio()

def _11_tkradio.internetRadio (   freq)
 Set the internet radio 

References killProc().

Referenced by changeStation(), and net().

◆ killProc()

def _11_tkradio.killProc (   pid)
Kill the given process.

Referenced by fini(), internetRadio(), loop(), net(), radio(), and _11_tkradio.FMRec.stop().

◆ loop()

def _11_tkradio.loop ( )
Route the capture sources on the sound card back in as PCM audio.

References killProc().

Referenced by loopon(), main(), and net().

◆ loopon()

def _11_tkradio.loopon ( )
Toggle the loop variable.

References loop().

Referenced by _11_tkradio.IRRec.run().

◆ main()

def _11_tkradio.main (   argv = None)

◆ mouse_enter()

def _11_tkradio.mouse_enter (   event)
Respond to mouse enter events.

References getFreq().

◆ mouse_leave()

def _11_tkradio.mouse_leave (   event)
Respond to mouse leave events.

References getFreq().

◆ mute()

def _11_tkradio.mute ( )
Mute/Unmute the radio.

References radio().

Referenced by main(), and _11_tkradio.IRRec.run().

◆ net()

def _11_tkradio.net ( )
Activate the internet radio.

References execmd(), internetRadio(), killProc(), and loop().

◆ next()

def _11_tkradio.next (   e = None)

◆ previous()

def _11_tkradio.previous (   e = None)

References changeStation().

Referenced by _11_tkradio.IRRec.run().

◆ radio()

def _11_tkradio.radio (   cmd)
Send the given command to the radio.

References execmd(), killProc(), and setstation().

Referenced by changeStation(), fini(), mute(), and _11_tkradio.IRRec.run().

◆ readStations()

def _11_tkradio.readStations ( )
Read the preset station file.

Referenced by main().

◆ rec()

def _11_tkradio.rec ( )
Record the current station.

References rec_off(), and rec_on().

◆ rec_off()

def _11_tkradio.rec_off ( )
Turn the recorder off.

Referenced by rec(), and _11_tkradio.IRRec.run().

◆ rec_on()

def _11_tkradio.rec_on ( )
Turn the recorder on.

References trigger().

Referenced by rec(), and _11_tkradio.IRRec.run().

◆ set_rec_type()

def _11_tkradio.set_rec_type ( )
Set recording based on alsa or pulseaudio.

References getpid().

Referenced by main().

◆ setCurStation()

def _11_tkradio.setCurStation (   frequency)
Update the current station.

References getStation().

Referenced by enter(), setstation(), and setStation().

◆ setstation()

def _11_tkradio.setstation ( )
Set the station chosen via Radio Button.

References changeStation(), and setCurStation().

Referenced by radio().

◆ setStation()

def _11_tkradio.setStation (   ind)
Set the station to ind.

References changeStation(), and setCurStation().

Referenced by _11_tkradio.IRRec.run().

◆ start_irrec()

def _11_tkradio.start_irrec ( )
Start the IRRec thread if lircd is running.

References getpid().

Referenced by main().

◆ str2num()

def _11_tkradio.str2num (   datum)
A conversion function that "guesses" the best conversion.

Referenced by getpid().

◆ trigger()

def _11_tkradio.trigger ( )
Create a thread for recording.

Referenced by rec_on().

Variable Documentation

◆ blocking

int _11_tkradio.blocking = 0

◆ fmrec

_11_tkradio.fmrec = None

◆ irrec

_11_tkradio.irrec = None

◆ ivolume

int _11_tkradio.ivolume = 100

◆ lid

int _11_tkradio.lid = 0

◆ message

int _11_tkradio.message = 0

◆ mpid

int _11_tkradio.mpid = 0

◆ notification

_11_tkradio.notification = Notify()

◆ radbut

list _11_tkradio.radbut = stations[4][1]

◆ state

bool _11_tkradio.state = False

◆ stations

list _11_tkradio.stations
Initial value:
1 = [["RĂ¡dio Mundial", "1180 100",
2  "http://stm7.srvstm.com:9836/stream"],
3  ["Band_News_RJ", "90.3 100",
4  "https://evpp.mm.uol.com.br/band/bandnewsfm_rj/playlist.m3u8"],
5  ["CBN", "92.5 100",
6  "http://playerservices.streamtheworld.com/api/livestream-redirect/CBN_RJ_ADP"],
7  ["Paradiso", "95.7 100",
8  "http://playerservices.streamtheworld.com/api/livestream-redirect/SULAMERICA"],
9  ["Band News SP", "96.9 100",
10  "http://playerservices.streamtheworld.com/api/livestream-redirect/BANDNEWSFM_SPAAC.m3u8"],
11  ["Tupi", "96.5 100",
12  "http://8923.brasilstream.com.br/stream"],
13  ["Globo FM", "98.1 100",
14  "http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO_GLOBO_RJAAC.aac"],
15  ["MEC", "98.9 100",
16  "http://radiomecfm-stream.ebc.com.br/index.m3u8"],
17  ["JB FM", "99.7 100",
18  "http://playerservices.streamtheworld.com/api/livestream-redirect/JBFMAAC"],
19  ["O Dia", "100.5 100",
20  "http://streaming.livespanel.com:20000/live"],
21  ["Transamerica", "101.3 100",
22  "http://playerservices.streamtheworld.com/api/livestream-redirect/RT_RJAAC.aac"],
23  ["Mix", "102.1 100",
24  "http://playerservices.streamtheworld.com/api/livestream-redirect/MIXRIO"],
25  ["Cidade", "102.9 100",
26  "http://playerservices.streamtheworld.com/api/livestream-redirect/RADIOCIDADEAAC"],
27  ["Antena1_Lite_FM", "103.7 100",
28  "http://a1rj.streams.com.br:7801/stream"]]

◆ tid

int _11_tkradio.tid = 0

◆ use_lirc

bool _11_tkradio.use_lirc = True

◆ use_notify

bool _11_tkradio.use_notify = True

◆ use_Notify

bool _11_tkradio.use_Notify = False