package Ġio . github . fro do 8 2 1 . s ire ne . server Ċ Ċ import Ġcom . sun . net . http server . Http Exchange Ċ import Ġio . github . fro do 8 2 1 . s ire ne . application . Main UI Controller Ċ Ċ object ĠSR CP Ġ{ ĊĠĠĠ Ġconst Ġval ĠSTATUS _ SUCCESS Ġ= Ġ 1 0 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ SUCCESS _ WITH _ DATA Ġ= Ġ 1 1 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ SUCCESS _ NO _ ACTION Ġ= Ġ 1 2 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ ERR _ UN SAT IS FIED _ N ARGS Ġ= Ġ 2 0 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ ERR _ INVALID _ ARGUMENT Ġ= Ġ 2 1 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ ERR _ INVALID _ METHOD _ USE Ġ= Ġ 2 2 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ ERR _ INVALID _ METHOD _ TIM ING Ġ= Ġ 2 3 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ FAILURE _ NOT _ ACCEPT ABLE Ġ= Ġ 3 0 ĊĠĠĠ Ġconst Ġval ĠSTATUS _ FAILURE _ NOT _ PROC ES SED Ġ= Ġ 3 1 ĊĊĠĠĠ Ġ// ĠSU CC ES SES ĊĠĠĠ Ġval ĠP LAY _ SUCCEEDED Ġ= ĠSR CP Response ( STATUS _ SUCCESS , Ġ" STATUS ĠSW ITCH ED ĠTO ĠP LAY ING ") ĊĠĠĠ Ġval ĠLIST _ SUCCEEDED Ġ= ĠSR CP Response ( STATUS _ SUCCESS _ WITH _ DATA , Ġ" M US IC ĠLIST ĠRETURN ED ") ĊĊĠĠĠ Ġ// ĠFAILURE S ĊĠĠĠ Ġval ĠP LAY _ FAILED Ġ= ĠSR CP Response ( STATUS _ FAILURE _ NOT _ PROC ES SED , Ġ" CO ULD ĠNOT ĠP LAY ĠM US IC ") ĊĠĠĠ Ġval ĠP LAY _ M US IC _ NOT _ FOUND Ġ= ĠSR CP Response ( STATUS _ ERR _ INVALID _ ARGUMENT , Ġ" M US IC ĠNOT ĠFO UND ") ĊĠĠĠ Ġval ĠT ONE _ OUT _ OF _ RANGE Ġ= ĠSR CP Response ( STATUS _ ERR _ INVALID _ ARGUMENT , Ġ" T ONE ĠNUMBER ĠOUT ĠOF ĠR ANGE ") ĊĠĠĠ Ġval ĠT ONE _ ARG _ NOT _ INTEGER Ġ= ĠSR CP Response ( STATUS _ ERR _ INVALID _ METHOD _ USE , Ġ" ARGUMENT ĠNOT ĠA ĠINTEGER ") ĊĠĠĠ Ġval ĠSTOP _ PAUSE _ NOT _ PLAY ING Ġ= ĠSR CP Response ( STATUS _ ERR _ INVALID _ METHOD _ TIM ING , Ġ" NOT ĠIN ĠP LAY ING ") ĊĠĠĠ Ġval ĠREC ORDER _ NOT _ CONNECTED Ġ= ĠSR CP Response ( STATUS _ FAILURE _ NOT _ ACCEPT ABLE , Ġ" REC ORDER ĠNOT ĠCONNECT ED ") ĊĠĠĠ Ġval ĠRPC _ METHOD _ NOT _ FOUND Ġ= ĠSR CP Response ( STATUS _ FAILURE _ NOT _ ACCEPT ABLE , Ġ" RPC ĠMETHOD ĠNOT ĠFO UND ") ĊĠĠĠ Ġval ĠRPC _ METHOD _ IN VA ILD _ N ARGS Ġ= ĠSR CP Response ( STATUS _ ERR _ UN SAT IS FIED _ N ARGS , Ġ" RPC ĠMETHOD ĠARGS ĠNOT ĠS AT IS FI ABLE ") Ċ } Ċ Ċ data Ġclass ĠSR CP Response ( val Ġstatus : ĠInt , Ġval Ġmessage : ĠString ) Ċ data Ġclass ĠList Response ( val Ġheader : ĠSR CP Response , Ġval Ġdata : ĠList < String >) Ċ Ċ type alias ĠProcedure Ġ= Ġ( Http Exchange , ĠList < String >, ĠString , ĠMain UI Controller ) Ġ-> ĠUnit Ċ