@name radio
@inputs On Channel Song
@outputs Display:string
@persist Rdio:array Hl1:array Hl2:array Prtl:array Tf2:array Disp:array I:number ChanIncr:number
@trigger 
@model models\props/cs_office/radio.mdl

if(first() | duped()&dupefinished()){
#Radio
Rdio[1,string] = "ambient/music/piano1.wav"
Rdio[2,string] = "ambient/music/piano2.wav"
Rdio[3,string] = "ambient/guit1.wav"
Rdio[4,string] = "ambient/music/flamenco.wav"
Rdio[5,string] = "ambient/music/mirame_radio_thru_wall.wav"
Rdio[6,string] = "ambient/music/looping_radio_mix.wav"
Rdio[7,string] = "ambient/opera.wav"
Rdio[8,string] = "ambient/music/country_rock_am_radio_loop.wav"
Rdio[9,string] = "ambient/music/cubanmusic1.wav"
Rdio[10,string] = "ambient/music/latin.wav"
Rdio[11,string] = "ambient/music/bongo.wav"
Rdio[12,string] = "ambient/music/dustmusic1.wav"
Rdio[13,string] = "ambient/music/dustmusic2.wav"
Rdio[14,string] = "ambient/music/dustmusic3.wav"
Rdio[15,string] = "music/radio1.mp3"
Rdio[16,string] = "test/temp/soundscape_test/tv_music.wav"
#Half Life 1
Hl1[1,string] = "music/hl1_song10.mp3"
Hl1[2,string] = "music/hl1_song11.mp3"
Hl1[3,string] = "music/hl1_song14.mp3"
Hl1[4,string] = "music/hl1_song15.mp3"
Hl1[5,string] = "music/hl1_song17.mp3"
Hl1[6,string] = "music/hl1_song19.mp3"
Hl1[7,string] = "music/hl1_song20.mp3"
Hl1[8,string] = "music/hl1_song21.mp3"
Hl1[9,string] = "music/hl1_song24.mp3"
Hl1[10,string] = "music/hl1_song25_remix3.mp3"
Hl1[11,string] = "music/hl1_song26.mp3"
Hl1[12,string] = "music/hl1_song3.mp3"
Hl1[13,string] = "music/hl1_song5.mp3"
Hl1[14,string] = "music/hl1_song6.mp3"
Hl1[15,string] = "music/hl1_song9.mp3"
#Half Life 2
Hl2[1,string] = "music/hl2_intro.mp3"
Hl2[2,string] = "music/hl2_song0.mp3"
Hl2[3,string] = "music/hl2_song1.mp3"
Hl2[4,string] = "music/hl2_song10.mp3"
Hl2[5,string] = "music/hl2_song11.mp3"
Hl2[6,string] = "music/hl2_song12_long.mp3"
Hl2[7,string] = "music/hl2_song13.mp3"
Hl2[8,string] = "music/hl2_song14.mp3"
Hl2[9,string] = "music/hl2_song15.mp3"
Hl2[10,string] = "music/hl2_song16.mp3"
Hl2[11,string] = "music/hl2_song17.mp3"
Hl2[12,string] = "music/hl2_song19.mp3"
Hl2[13,string] = "music/hl2_song2.mp3"
Hl2[14,string] = "music/hl2_song20_submix4.mp3"
Hl2[15,string] = "music/hl2_song23_suitsong3.mp3"
Hl2[16,string] = "music/hl2_song25_teleporter.mp3"
Hl2[17,string] = "music/hl2_song26.mp3"
Hl2[18,string] = "music/hl2_song26_trainstation1.mp3"
Hl2[19,string] = "music/hl2_song27_trainstation2.mp3"
Hl2[20,string] = "music/hl2_song28.mp3"
Hl2[21,string] = "music/hl2_song29.mp3"
Hl2[22,string] = "music/hl2_song3.mp3"
Hl2[23,string] = "music/hl2_song30.mp3"
Hl2[24,string] = "music/hl2_song31.mp3"
Hl2[25,string] = "music/hl2_song32.mp3"
Hl2[26,string] = "music/hl2_song33.mp3"
Hl2[27,string] = "music/hl2_song4.mp3"
Hl2[28,string] = "music/hl2_song6.mp3"
Hl2[29,string] = "music/hl2_song7.mp3"
Hl2[30,string] = "music/hl2_song8.mp3"
Hl2[31,string] = "music/ravenholm_1.mp3"
#Portal
Prtl[1,string] = "music/portal_4000_degrees_kelvin.mp3"
Prtl[2,string] = "music/portal_android_hell.mp3"
Prtl[3,string] = "music/portal_no_cake_for_you.mp3"
Prtl[4,string] = "music/portal_party_escort.mp3"
Prtl[5,string] = "music/portal_procedural_jiggle_bone.mp3"
Prtl[6,string] = "music/portal_self_esteem_fund.mp3"
Prtl[7,string] = "music/portal_still_alive.mp3"
Prtl[8,string] = "music/portal_stop_what_you_are_doing.mp3"
Prtl[9,string] = "music/portal_subject_name_here.mp3"
Prtl[10,string] = "music/portal_taste_of_blood.mp3"
Prtl[11,string] = "music/portal_you_cant_escape_you_know.mp3"
Prtl[12,string] = "music/portal_youre_not_a_good_person.mp3"
#Team Fortress 2
Tf2[1,string] = "music/fortress_reel.wav"
Tf2[2,string] = "items/tf_music_upgrade_machine.wav"
Tf2[3,string] = "music/mvm_start_wave.wav"
Tf2[4,string] = "music/hl1_song10.mp3"
Tf2[5,string] = "music/hl1_song11.mp3"
Tf2[6,string] = "ui/gamestartup1.mp3"
Tf2[7,string] = "ui/gamestartup10.mp3"
Tf2[8,string] = "ui/gamestartup11.mp3"
Tf2[9,string] = "ui/gamestartup12.mp3"
Tf2[10,string] = "ui/gamestartup13.mp3"
Tf2[11,string] = "ui/gamestartup14.mp3"
Tf2[12,string] = "ui/gamestartup15.mp3"
Tf2[13,string] = "ui/gamestartup16.mp3"
Tf2[14,string] = "ui/gamestartup2.mp3"
Tf2[15,string] = "ui/gamestartup3.mp3"
Tf2[16,string] = "ui/gamestartup4.mp3"
Tf2[17,string] = "ui/gamestartup5.mp3"
Tf2[18,string] = "ui/gamestartup6.mp3"
Tf2[19,string] = "ui/gamestartup7.mp3"
Tf2[20,string] = "ui/gamestartup8.mp3"
Tf2[21,string] = "ui/gamestartup9.mp3"
Tf2[22,string] = "ui/gamestartup9.mp3"
Tf2[23,string] = "ui/holiday/gamestartup_saxxy.mp3"

#display
Disp[1,string] = "Radio"
Disp[2,string] = "Half Life 1"
Disp[3,string] = "Half Life 2"
Disp[4,string] = "Portal"
Disp[5,string] = "Team Fortress 2"

I = 0
ChanIncr = 1
Display = "Radio Off"
SongChoice = I
Max = 16
Back = vec(0,150,0)
Fore = vec(0,0,0)
}

interval(500)

if(On){
if(~Channel&Channel){
    ChanIncr++
    Display = Disp[ChanIncr,string]+": Track "+I
}

if(ChanIncr == 6){
    ChanIncr = 1
    Display = Disp[ChanIncr,string]+": Track "+I
}

if(ChanIncr==1&changed(I)|changed(ChanIncr)){
    soundPlay(0,0,Rdio[I,string])
    Max = 16
    Display = Disp[ChanIncr,string]+": Track "+I
}
if(ChanIncr==2&changed(I)|changed(ChanIncr)){
    soundPlay(0,0,Hl1[I,string])
    Max = 15
    Display = Disp[ChanIncr,string]+": Track "+I
}
if(ChanIncr==3&changed(I)|changed(ChanIncr)){
    soundPlay(0,0,Hl2[I,string])
    Max = 31
    Display = Disp[ChanIncr,string]+": Track "+I
}
if(ChanIncr==4&changed(I)|changed(ChanIncr)){
    soundPlay(0,0,Prtl[I,string])
    Max = 12
    Display = Disp[ChanIncr,string]+": Track "+I
}
if(ChanIncr==5&changed(I)|changed(ChanIncr)){
    soundPlay(0,0,Tf2[I,string])
    Max = 23
    Display = Disp[ChanIncr,string]+": Track "+I
}

if(~Song&Song){
    I++
}

if(I == Max+1){
    I = 1
}
}else{
soundPlay(0,0,"")
reset()
}
