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