module Sound.SC3.Server.Command.Enum where
import Data.List
import Data.Maybe
import Sound.OSC.Packet
type SC3_Command = String
sc3_cmd_enumeration :: [(SC3_Command,Int)]
sc3_cmd_enumeration =
[("/notify",1)
,("/status",2)
,("/quit",3)
,("/cmd",4)
,("/d_recv",5)
,("/d_load",6)
,("/d_loadDir",7)
,("/d_freeAll",8)
,("/s_new",9)
,("/n_trace",10)
,("/n_free",11)
,("/n_run",12)
,("/n_cmd",13)
,("/n_map",14)
,("/n_set",15)
,("/n_setn",16)
,("/n_fill",17)
,("/n_before",18)
,("/n_after",19)
,("/u_cmd",20)
,("/g_new",21)
,("/g_head",22)
,("/g_tail",23)
,("/g_freeAll",24)
,("/c_set",25)
,("/c_setn",26)
,("/c_fill",27)
,("/b_alloc",28)
,("/b_allocRead",29)
,("/b_read",30)
,("/b_write",31)
,("/b_free",32)
,("/b_close",33)
,("/b_zero",34)
,("/b_set",35)
,("/b_setn",36)
,("/b_fill",37)
,("/b_gen",38)
,("/dumpOSC",39)
,("/c_get",40)
,("/c_getn",41)
,("/b_get",42)
,("/b_getn",43)
,("/s_get",44)
,("/s_getn",45)
,("/n_query",46)
,("/b_query",47)
,("/n_mapn",48)
,("/s_noid",49)
,("/g_deepFree",50)
,("/clearSched",51)
,("/sync",52)
,("/d_free",53)
,("/b_allocReadChannel",54)
,("/b_readChannel",55)
,("/g_dumpTree",56)
,("/g_queryTree",57)
,("/error",58)
,("/s_newargs",59)
,("/n_mapa",60)
,("/n_mapan",61)
,("/n_order",62)
]
sc3_cmd_number :: SC3_Command -> Maybe Int
sc3_cmd_number = flip lookup sc3_cmd_enumeration
known_sc3_cmd :: SC3_Command -> Bool
known_sc3_cmd = isJust . sc3_cmd_number
async_cmds :: [SC3_Command]
async_cmds =
["/b_alloc"
,"/b_allocRead"
,"/b_allocReadChannel"
,"/b_close"
,"/b_free"
,"/b_read"
,"/b_readChannel"
,"/b_write"
,"/b_zero"
,"/d_load"
,"/d_loadDir"
,"/d_recv"
,"/notify"
,"/quit"
,"/sync"]
isAsync :: Message -> Bool
isAsync (Message a _) = a `elem` async_cmds
partition_async :: [Message] -> ([Message],[Message])
partition_async = partition isAsync
b_info_fields :: [(String,String)]
b_info_fields =
[("int","buffer-id")
,("int","frame-count")
,("int","channels-count")
,("float","sample-rate")]
n_info_fields :: [(String,String,String)]
n_info_fields =
[("int","node-id","")
,("int","parent group-id","-1 = nil")
,("int","previous node-id","-1 = nil")
,("int","next node-id","-1 = nil")
,("int","node-type","0 = synth,1 = group")
,("int","head node-id","-1 = nil")
,("int","tail node-id","-1 = nil")]