コード例 #1
0
ファイル: radio.py プロジェクト: nobuyukinyuu/doogradio
def announcer_contents(ann):
    # ann.write("<prosody rate='-0.1' pitch='low'>\n")
    if len(song_history) > 0:
        ann.write("You just heard %s.\n" % song_format(song_history[-1], "%(title)s by the artist %(artist)s"))
    if len(song_history) > 1:
        ann.write("Before that was %s.\n" % song_format(song_history[-2], "%(artist)s with %(title)s"))
    ann.write("Next up is %s.\n" % song_format(get_metadata(playlist.current()), "%(title)s, by %(artist)s"))
コード例 #2
0
ファイル: radio.py プロジェクト: nobuyukinyuu/doogradio
def announcer_contents(ann):
    # ann.write("<prosody rate='-0.1' pitch='low'>\n")
    if len(song_history) > 0:
        ann.write("You just heard %s.\n" % song_format(
            song_history[-1], "%(title)s by the artist %(artist)s"))
    if len(song_history) > 1:
        ann.write("Before that was %s.\n" %
                  song_format(song_history[-2], "%(artist)s with %(title)s"))
    ann.write("Next up is %s.\n" % song_format(
        get_metadata(playlist.current()), "%(title)s, by %(artist)s"))
コード例 #3
0
ファイル: radio.py プロジェクト: nobuyukinyuu/doogradio
def radio_loop():
    global ident_countdown, announce_countdown
    ident_countdown = radio_settings.ident_interval
    announce_countdown = radio_settings.announce_interval
    while 1:
        try:
            if (ident_countdown == 1):
                play_ident()
            if (announce_countdown == 1):
                play_announce()
            play_one_song(playlist.current())
        except ShutdownMessage:
            return
        except NextSongMessage:
            pass
        except RestartMessage:
            continue
        if (len(song_history) > 2):
            song_history.pop(0)
        song_history.append(get_metadata(playlist.current()))
        do_countdowns()
        playlist.next()
コード例 #4
0
ファイル: radio.py プロジェクト: nobuyukinyuu/doogradio
def radio_loop():
    global ident_countdown, announce_countdown
    ident_countdown = radio_settings.ident_interval
    announce_countdown = radio_settings.announce_interval
    while 1:
        try:
            if(ident_countdown == 1):
                play_ident()
            if(announce_countdown == 1):
                play_announce()
            play_one_song(playlist.current())
        except ShutdownMessage:
            return
        except NextSongMessage:
            pass
        except RestartMessage:
            continue
        if(len(song_history) > 2):
           song_history.pop(0)
        song_history.append(get_metadata(playlist.current()))
        do_countdowns()
        playlist.next()