module Sound.Sc3.Server.Command.Generic where
import Data.List
import Data.Maybe
import Sound.Osc.Core
import qualified Sound.Sc3.Common.Base as Common.Base
import qualified Sound.Sc3.Server.Command.Enum as Server.Command.Enum
import qualified Sound.Sc3.Server.Enum as Server.Enum
import qualified Sound.Sc3.Server.Graphdef as Server.Graphdef
import qualified Sound.Sc3.Server.Graphdef.Binary as Server.Graphdef
import qualified Sound.Sc3.Server.Synthdef as Server.Synthdef
cmd_check_arg :: String -> (t -> Bool) -> t -> t
cmd_check_arg :: forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
e t -> Bool
f t
x = if Bool -> Bool
not (t -> Bool
f t
x) then forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
e else t
x
b_bufnum :: Integral t => t -> Datum
b_bufnum :: forall t. Integral t => t -> Datum
b_bufnum = forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
"buffer-number < 0?" (forall a. Ord a => a -> a -> Bool
>= t
0)
b_ix :: Integral t => t -> Datum
b_ix :: forall t. Integral t => t -> Datum
b_ix = forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
"buffer-ix < 0?" (forall a. Ord a => a -> a -> Bool
>= t
0)
b_ch :: Integral t => t -> Datum
b_ch :: forall t. Integral t => t -> Datum
b_ch = forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
"buffer-channel < 0?" (forall a. Ord a => a -> a -> Bool
>= t
0)
b_size :: Integral t => t -> Datum
b_size :: forall t. Integral t => t -> Datum
b_size = forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
"buffer-size < 0?" (forall a. Ord a => a -> a -> Bool
>= t
0)
b_alloc :: Integral i => i -> i -> i -> Message
b_alloc :: forall i. Integral i => i -> i -> i -> Message
b_alloc i
b i
frames i
channels = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_alloc" [forall t. Integral t => t -> Datum
b_bufnum i
b,forall t. Integral t => t -> Datum
b_size i
frames,forall t. Integral t => t -> Datum
int32 i
channels]
b_allocRead :: Integral i => i -> String -> i -> i -> Message
b_allocRead :: forall i. Integral i => i -> Address_Pattern -> i -> i -> Message
b_allocRead i
b Address_Pattern
p i
f i
n = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_allocRead" [forall t. Integral t => t -> Datum
b_bufnum i
b,Address_Pattern -> Datum
string Address_Pattern
p,forall t. Integral t => t -> Datum
b_ix i
f,forall t. Integral t => t -> Datum
b_ix i
n]
b_allocReadChannel :: Integral i => i -> String -> i -> i -> [i] -> Message
b_allocReadChannel :: forall i.
Integral i =>
i -> Address_Pattern -> i -> i -> [i] -> Message
b_allocReadChannel i
b Address_Pattern
p i
f i
n [i]
cs = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_allocReadChannel" ([forall t. Integral t => t -> Datum
b_bufnum i
b,Address_Pattern -> Datum
string Address_Pattern
p,forall t. Integral t => t -> Datum
b_ix i
f,forall t. Integral t => t -> Datum
b_ix i
n] forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
b_ch [i]
cs)
b_close :: Integral i => i -> Message
b_close :: forall i. Integral i => i -> Message
b_close i
b = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_close" [forall t. Integral t => t -> Datum
b_bufnum i
b]
b_fill :: (Integral i,Real n) => i -> [(i,i,n)] -> Message
b_fill :: forall i n. (Integral i, Real n) => i -> [(i, i, n)] -> Message
b_fill i
b [(i, i, n)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_fill" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32 forall n. Real n => n -> Datum
float [(i, i, n)]
l)
b_free :: Integral i => i -> Message
b_free :: forall i. Integral i => i -> Message
b_free i
b = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_free" [forall t. Integral t => t -> Datum
b_bufnum i
b]
b_gen :: Integral i => i -> String -> [Datum] -> Message
b_gen :: forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
b Address_Pattern
name [Datum]
arg = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_gen" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: Address_Pattern -> Datum
string Address_Pattern
name forall a. a -> [a] -> [a]
: [Datum]
arg)
b_gen_sine1 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message
b_gen_sine1 :: forall i n. (Integral i, Real n) => i -> [B_Gen] -> [n] -> Message
b_gen_sine1 i
z [B_Gen]
f [n]
n = forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
z Address_Pattern
"sine1" (forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall n. Real n => n -> Datum
float [n]
n)
b_gen_sine2 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [(n,n)] -> Message
b_gen_sine2 :: forall i n.
(Integral i, Real n) =>
i -> [B_Gen] -> [(n, n)] -> Message
b_gen_sine2 i
z [B_Gen]
f [(n, n)]
n = forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
z Address_Pattern
"sine2" (forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall n. Real n => n -> Datum
float forall n. Real n => n -> Datum
float [(n, n)]
n)
b_gen_sine3 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [(n,n,n)] -> Message
b_gen_sine3 :: forall i n.
(Integral i, Real n) =>
i -> [B_Gen] -> [(n, n, n)] -> Message
b_gen_sine3 i
z [B_Gen]
f [(n, n, n)]
n = forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
z Address_Pattern
"sine3" (forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) forall a. a -> [a] -> [a]
: forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall n. Real n => n -> Datum
float forall n. Real n => n -> Datum
float forall n. Real n => n -> Datum
float [(n, n, n)]
n)
b_gen_cheby :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message
b_gen_cheby :: forall i n. (Integral i, Real n) => i -> [B_Gen] -> [n] -> Message
b_gen_cheby i
z [B_Gen]
f [n]
n = forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
z Address_Pattern
"cheby" (forall t. Integral t => t -> Datum
int32 ([B_Gen] -> Int
Server.Enum.b_gen_flag [B_Gen]
f) forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall n. Real n => n -> Datum
float [n]
n)
b_gen_copy :: Integral i => i -> i -> i -> i -> Maybe i -> Message
b_gen_copy :: forall i. Integral i => i -> i -> i -> i -> Maybe i -> Message
b_gen_copy i
dst_b i
dst_ix i
src_b i
src_ix Maybe i
nf =
let nf' :: i
nf' = forall a. a -> Maybe a -> a
fromMaybe (-i
1) Maybe i
nf
in forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
dst_b Address_Pattern
"copy" (forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32 [i
dst_ix,i
src_b,i
src_ix,i
nf'])
b_get :: Integral i => i -> [i] -> Message
b_get :: forall i. Integral i => i -> [i] -> Message
b_get i
b [i]
i = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_get" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32 [i]
i)
b_getn :: Integral i => i -> [(i,i)] -> Message
b_getn :: forall i. Integral i => i -> [(i, i)] -> Message
b_getn i
b [(i, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_getn" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
b_ix forall t. Integral t => t -> Datum
b_size [(i, i)]
l)
b_query :: Integral i => [i] -> Message
b_query :: forall i. Integral i => [i] -> Message
b_query = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_query" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
b_read :: Integral i => i -> String -> i -> i -> i -> Bool -> Message
b_read :: forall i.
Integral i =>
i -> Address_Pattern -> i -> i -> i -> Bool -> Message
b_read i
bufId Address_Pattern
pathName i
startFrame i
numFrames i
bufFrame Bool
leaveOpen =
Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_read" [forall t. Integral t => t -> Datum
b_bufnum i
bufId,Address_Pattern -> Datum
string Address_Pattern
pathName,forall t. Integral t => t -> Datum
int32 i
startFrame,forall t. Integral t => t -> Datum
int32 i
numFrames,forall t. Integral t => t -> Datum
int32 i
bufFrame,forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum Bool
leaveOpen)]
b_readChannel :: Integral i => i -> String -> i -> i -> i -> Bool -> [i] -> Message
b_readChannel :: forall i.
Integral i =>
i -> Address_Pattern -> i -> i -> i -> Bool -> [i] -> Message
b_readChannel i
b Address_Pattern
p i
f i
n i
f' Bool
z [i]
cs = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_readChannel" ([forall t. Integral t => t -> Datum
b_bufnum i
b,Address_Pattern -> Datum
string Address_Pattern
p,forall t. Integral t => t -> Datum
int32 i
f,forall t. Integral t => t -> Datum
int32 i
n,forall t. Integral t => t -> Datum
int32 i
f',forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum Bool
z)] forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32 [i]
cs)
b_set :: (Integral i,Real n) => i -> [(i,n)] -> Message
b_set :: forall i n. (Integral i, Real n) => i -> [(i, n)] -> Message
b_set i
b [(i, n)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_set" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall n. Real n => n -> Datum
float [(i, n)]
l)
b_setn :: (Integral i,Real n) => i -> [(i,[n])] -> Message
b_setn :: forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
b_setn i
b [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
i,[a]
d) = forall t. Integral t => t -> Datum
int32 n
i forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 (forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall n. Real n => n -> Datum
float [a]
d
in Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_setn" (forall t. Integral t => t -> Datum
b_bufnum i
b forall a. a -> [a] -> [a]
: forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
b_write :: Integral i => i -> String -> Server.Enum.SoundFileFormat -> Server.Enum.SampleFormat -> i -> i -> Bool -> Message
b_write :: forall i.
Integral i =>
i
-> Address_Pattern
-> SoundFileFormat
-> SampleFormat
-> i
-> i
-> Bool
-> Message
b_write i
b Address_Pattern
p SoundFileFormat
h SampleFormat
t i
f i
s Bool
z =
let h' :: Datum
h' = Address_Pattern -> Datum
string (SoundFileFormat -> Address_Pattern
Server.Enum.soundFileFormatString SoundFileFormat
h)
t' :: Datum
t' = Address_Pattern -> Datum
string (SampleFormat -> Address_Pattern
Server.Enum.sampleFormatString SampleFormat
t)
in Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_write" [forall t. Integral t => t -> Datum
b_bufnum i
b,Address_Pattern -> Datum
string Address_Pattern
p,Datum
h',Datum
t',forall t. Integral t => t -> Datum
int32 i
f,forall t. Integral t => t -> Datum
int32 i
s,forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum Bool
z)]
b_zero :: Integral i => i -> Message
b_zero :: forall i. Integral i => i -> Message
b_zero i
b = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/b_zero" [forall t. Integral t => t -> Datum
b_bufnum i
b]
c_fill :: (Integral i,Real n) => [(i,i,n)] -> Message
c_fill :: forall i n. (Integral i, Real n) => [(i, i, n)] -> Message
c_fill = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/c_fill" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32 forall n. Real n => n -> Datum
float
c_get :: Integral i => [i] -> Message
c_get :: forall i. Integral i => [i] -> Message
c_get = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/c_get" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
c_getn :: Integral i => [(i,i)] -> Message
c_getn :: forall i. Integral i => [(i, i)] -> Message
c_getn = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/c_getn" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32
c_set :: (Integral i,Real n) => [(i,n)] -> Message
c_set :: forall i n. (Integral i, Real n) => [(i, n)] -> Message
c_set = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/c_set" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall n. Real n => n -> Datum
float
c_setn :: (Integral i,Real n) => [(i,[n])] -> Message
c_setn :: forall i n. (Integral i, Real n) => [(i, [n])] -> Message
c_setn [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
i,[a]
d) = forall t. Integral t => t -> Datum
int32 n
i forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 (forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall n. Real n => n -> Datum
float [a]
d
in Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/c_setn" (forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
d_recv_bytes :: Blob -> Message
d_recv_bytes :: Blob -> Message
d_recv_bytes Blob
b = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/d_recv" [Blob -> Datum
Blob Blob
b]
d_recv_gr :: Server.Graphdef.Graphdef -> Message
d_recv_gr :: Graphdef -> Message
d_recv_gr = Blob -> Message
d_recv_bytes forall b c a. (b -> c) -> (a -> b) -> a -> c
. Graphdef -> Blob
Server.Graphdef.encode_graphdef
d_recv :: Server.Synthdef.Synthdef -> Message
d_recv :: Synthdef -> Message
d_recv = Blob -> Message
d_recv_bytes forall b c a. (b -> c) -> (a -> b) -> a -> c
. Synthdef -> Blob
Server.Synthdef.synthdefData
d_load :: String -> Message
d_load :: Address_Pattern -> Message
d_load Address_Pattern
p = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/d_load" [Address_Pattern -> Datum
string Address_Pattern
p]
d_loadDir :: String -> Message
d_loadDir :: Address_Pattern -> Message
d_loadDir Address_Pattern
p = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/d_loadDir" [Address_Pattern -> Datum
string Address_Pattern
p]
d_free :: [String] -> Message
d_free :: [Address_Pattern] -> Message
d_free = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/d_free" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map Address_Pattern -> Datum
string
g_deepFree :: Integral i => [i] -> Message
g_deepFree :: forall i. Integral i => [i] -> Message
g_deepFree = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_deepFree" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
g_freeAll :: Integral i => [i] -> Message
g_freeAll :: forall i. Integral i => [i] -> Message
g_freeAll = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_freeAll" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
g_head :: Integral i => [(i,i)] -> Message
g_head :: forall i. Integral i => [(i, i)] -> Message
g_head = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_head" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32
g_new :: Integral i => [(i,Server.Enum.AddAction,i)] -> Message
g_new :: forall i. Integral i => [(i, AddAction, i)] -> Message
g_new = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_new" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall t. Integral t => t -> Datum
int32 (forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) forall t. Integral t => t -> Datum
int32
g_tail :: Integral i => [(i,i)] -> Message
g_tail :: forall i. Integral i => [(i, i)] -> Message
g_tail = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_tail" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32
g_dumpTree :: Integral i => [(i,Bool)] -> Message
g_dumpTree :: forall i. Integral i => [(i, Bool)] -> Message
g_dumpTree = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_dumpTree" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 (forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum)
g_queryTree :: Integral i => [(i,Bool)] -> Message
g_queryTree :: forall i. Integral i => [(i, Bool)] -> Message
g_queryTree = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/g_queryTree" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 (forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum)
n_id :: Integral t => t -> Datum
n_id :: forall t. Integral t => t -> Datum
n_id = forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t. Address_Pattern -> (t -> Bool) -> t -> t
cmd_check_arg Address_Pattern
"node-id < -1?" (forall a. Ord a => a -> a -> Bool
>= (-t
1))
n_after :: Integral i => [(i,i)] -> Message
n_after :: forall i. Integral i => [(i, i)] -> Message
n_after = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_after" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
n_id forall t. Integral t => t -> Datum
n_id
n_before :: Integral i => [(i,i)] -> Message
n_before :: forall i. Integral i => [(i, i)] -> Message
n_before = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_before" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32
n_fill :: (Integral i,Real f) => i -> [(String,i,f)] -> Message
n_fill :: forall i f.
(Integral i, Real f) =>
i -> [(Address_Pattern, i, f)] -> Message
n_fill i
n [(Address_Pattern, i, f)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_fill" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples Address_Pattern -> Datum
string forall t. Integral t => t -> Datum
int32 forall n. Real n => n -> Datum
float [(Address_Pattern, i, f)]
l)
n_free :: Integral i => [i] -> Message
n_free :: forall i. Integral i => [i] -> Message
n_free = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_free" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
n_id
n_map :: Integral i => i -> [(String,i)] -> Message
n_map :: forall i. Integral i => i -> [(Address_Pattern, i)] -> Message
n_map i
n [(Address_Pattern, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_map" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples Address_Pattern -> Datum
string forall t. Integral t => t -> Datum
int32 [(Address_Pattern, i)]
l)
n_mapn :: Integral i => i -> [(i,i,i)] -> Message
n_mapn :: forall i. Integral i => i -> [(i, i, i)] -> Message
n_mapn i
n [(i, i, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_mapn" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32 [(i, i, i)]
l)
n_mapa :: Integral i => i -> [(String,i)] -> Message
n_mapa :: forall i. Integral i => i -> [(Address_Pattern, i)] -> Message
n_mapa i
n [(Address_Pattern, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_mapa" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples Address_Pattern -> Datum
string forall t. Integral t => t -> Datum
int32 [(Address_Pattern, i)]
l)
n_mapan :: Integral i => i -> [(String,i,i)] -> Message
n_mapan :: forall i. Integral i => i -> [(Address_Pattern, i, i)] -> Message
n_mapan i
n [(Address_Pattern, i, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_mapan" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples Address_Pattern -> Datum
string forall t. Integral t => t -> Datum
int32 forall t. Integral t => t -> Datum
int32 [(Address_Pattern, i, i)]
l)
n_query :: Integral i => [i] -> Message
n_query :: forall i. Integral i => [i] -> Message
n_query = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_query" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
n_id
n_run :: Integral i => [(i,Bool)] -> Message
n_run :: forall i. Integral i => [(i, Bool)] -> Message
n_run = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_run" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples forall t. Integral t => t -> Datum
n_id (forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum)
n_set :: (Integral i,Real n) => i -> [(String,n)] -> Message
n_set :: forall i n.
(Integral i, Real n) =>
i -> [(Address_Pattern, n)] -> Message
n_set i
n [(Address_Pattern, n)]
c = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_set" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples Address_Pattern -> Datum
string forall n. Real n => n -> Datum
float [(Address_Pattern, n)]
c)
n_setn :: (Integral i,Real n) => i -> [(i,[n])] -> Message
n_setn :: forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
n_setn i
n [(i, [n])]
l =
let f :: (n, [a]) -> [Datum]
f (n
s,[a]
d) = forall t. Integral t => t -> Datum
int32 n
s forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 (forall (t :: * -> *) a. Foldable t => t a -> Int
length [a]
d) forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall n. Real n => n -> Datum
float [a]
d
in Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_setn" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall {n} {a}. (Integral n, Real a) => (n, [a]) -> [Datum]
f [(i, [n])]
l)
n_trace :: Integral i => [i] -> Message
n_trace :: forall i. Integral i => [i] -> Message
n_trace = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_trace" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
n_order :: Integral i => Server.Enum.AddAction -> i -> [i] -> Message
n_order :: forall i. Integral i => AddAction -> i -> [i] -> Message
n_order AddAction
a i
n [i]
ns = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/n_order" (forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum AddAction
a) forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 i
n forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32 [i]
ns)
p_new :: Integral i => [(i,Server.Enum.AddAction,i)] -> Message
p_new :: forall i. Integral i => [(i, AddAction, i)] -> Message
p_new = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/p_new" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a d b c.
(a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]
Common.Base.mk_triples forall t. Integral t => t -> Datum
int32 (forall t. Integral t => t -> Datum
int32 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Enum a => a -> Int
fromEnum) forall t. Integral t => t -> Datum
int32
s_get :: Integral i => i -> [String] -> Message
s_get :: forall i. Integral i => i -> [Address_Pattern] -> Message
s_get i
n [Address_Pattern]
i = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/s_get" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map Address_Pattern -> Datum
string [Address_Pattern]
i)
s_getn :: Integral i => i -> [(String,i)] -> Message
s_getn :: forall i. Integral i => i -> [(Address_Pattern, i)] -> Message
s_getn i
n [(Address_Pattern, i)]
l = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/s_getn" (forall t. Integral t => t -> Datum
n_id i
n forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples Address_Pattern -> Datum
string forall t. Integral t => t -> Datum
int32 [(Address_Pattern, i)]
l)
s_new :: (Integral i,Real n) => String -> i -> Server.Enum.AddAction -> i -> [(String,n)] -> Message
s_new :: forall i n.
(Integral i, Real n) =>
Address_Pattern
-> i -> AddAction -> i -> [(Address_Pattern, n)] -> Message
s_new Address_Pattern
n i
i AddAction
a i
t [(Address_Pattern, n)]
c = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/s_new" (Address_Pattern -> Datum
string Address_Pattern
n forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 i
i forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum AddAction
a) forall a. a -> [a] -> [a]
: forall t. Integral t => t -> Datum
int32 i
t forall a. a -> [a] -> [a]
: forall a c b. (a -> c) -> (b -> c) -> [(a, b)] -> [c]
Common.Base.mk_duples Address_Pattern -> Datum
string forall n. Real n => n -> Datum
float [(Address_Pattern, n)]
c)
s_noid :: Integral i => [i] -> Message
s_noid :: forall i. Integral i => [i] -> Message
s_noid = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/s_noid" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32
u_cmd :: Integral i => i -> i -> String -> [Datum] -> Message
u_cmd :: forall i.
Integral i =>
i -> i -> Address_Pattern -> [Datum] -> Message
u_cmd i
n i
uid Address_Pattern
name [Datum]
arg = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/u_cmd" ([forall t. Integral t => t -> Datum
n_id i
n,forall t. Integral t => t -> Datum
int32 i
uid,Address_Pattern -> Datum
string Address_Pattern
name] forall a. [a] -> [a] -> [a]
++ [Datum]
arg)
cmd :: String -> [Datum] -> Message
cmd :: Address_Pattern -> [Datum] -> Message
cmd Address_Pattern
name = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/cmd" forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Address_Pattern -> Datum
string Address_Pattern
name forall a. a -> [a] -> [a]
:)
clearSched :: Message
clearSched :: Message
clearSched = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/clearSched" []
dumpOsc :: Server.Enum.PrintLevel -> Message
dumpOsc :: PrintLevel -> Message
dumpOsc PrintLevel
c = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/dumpOSC" [forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum PrintLevel
c)]
errorMode :: Server.Enum.ErrorScope -> Server.Enum.ErrorMode -> Message
errorMode :: ErrorScope -> ErrorMode -> Message
errorMode ErrorScope
scope ErrorMode
mode =
let e :: Int
e = case ErrorScope
scope of
ErrorScope
Server.Enum.Globally -> forall a. Enum a => a -> Int
fromEnum ErrorMode
mode
ErrorScope
Server.Enum.Locally -> -Int
1 forall a. Num a => a -> a -> a
- forall a. Enum a => a -> Int
fromEnum ErrorMode
mode
in Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/error" [forall t. Integral t => t -> Datum
int32 Int
e]
notify :: Bool -> Message
notify :: Bool -> Message
notify Bool
c = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/notify" [forall t. Integral t => t -> Datum
int32 (forall a. Enum a => a -> Int
fromEnum Bool
c)]
nrt_end :: Message
nrt_end :: Message
nrt_end = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/nrt_end" []
quit :: Message
quit :: Message
quit = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/quit" []
status :: Message
status :: Message
status = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/status" []
sync :: Integral i => i -> Message
sync :: forall i. Integral i => i -> Message
sync i
sid = Address_Pattern -> [Datum] -> Message
message Address_Pattern
"/sync" [forall t. Integral t => t -> Datum
int32 i
sid]
with_completion_packet :: Message -> Packet -> Message
with_completion_packet :: Message -> Packet -> Message
with_completion_packet (Message Address_Pattern
c [Datum]
xs) Packet
cm =
if Address_Pattern
c forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Address_Pattern]
Server.Command.Enum.async_cmds
then let xs' :: [Datum]
xs' = [Datum]
xs forall a. [a] -> [a] -> [a]
++ [Blob -> Datum
Blob (Packet -> Blob
encodePacket Packet
cm)]
in Address_Pattern -> [Datum] -> Message
Message Address_Pattern
c [Datum]
xs'
else forall a. HasCallStack => Address_Pattern -> a
error (Address_Pattern
"with_completion_packet: not async: " forall a. [a] -> [a] -> [a]
++ Address_Pattern
c)
withCM :: Message -> Message -> Message
withCM :: Message -> Message -> Message
withCM Message
m Message
cm = Message -> Packet -> Message
with_completion_packet Message
m (Message -> Packet
Packet_Message Message
cm)
b_alloc_setn1 :: (Integral i,Real n) => i -> i -> [n] -> Message
b_alloc_setn1 :: forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_alloc_setn1 i
b i
i [n]
xs =
let k :: i
k = i
i forall a. Num a => a -> a -> a
+ forall i a. Num i => [a] -> i
genericLength [n]
xs
xs' :: [n]
xs' = forall i a. Integral i => i -> a -> [a]
genericReplicate i
i n
0 forall a. [a] -> [a] -> [a]
++ [n]
xs
in Message -> Message -> Message
withCM (forall i. Integral i => i -> i -> i -> Message
b_alloc i
b i
k i
1) (forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
0 [n]
xs')
b_getn1 :: Integral i => i -> (i,i) -> Message
b_getn1 :: forall i. Integral i => i -> (i, i) -> Message
b_getn1 i
b = forall i. Integral i => i -> [(i, i)] -> Message
b_getn i
b forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. Monad m => a -> m a
return
b_query1 :: Integral i => i -> Message
b_query1 :: forall i. Integral i => i -> Message
b_query1 = forall i. Integral i => [i] -> Message
b_query forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. Monad m => a -> m a
return
b_set1 :: (Integral i,Real n) => i -> i -> n -> Message
b_set1 :: forall i n. (Integral i, Real n) => i -> i -> n -> Message
b_set1 i
b i
i n
x = forall i n. (Integral i, Real n) => i -> [(i, n)] -> Message
b_set i
b [(i
i,n
x)]
b_setn1 :: (Integral i,Real n) => i -> i -> [n] -> Message
b_setn1 :: forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i [n]
xs = forall i n. (Integral i, Real n) => i -> [(i, [n])] -> Message
b_setn i
b [(i
i,[n]
xs)]
b_setn1_segmented :: (Integral i,Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented :: forall i n. (Integral i, Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented i
k i
b i
i [n]
d =
if forall i a. Num i => [a] -> i
genericLength [n]
d forall a. Ord a => a -> a -> Bool
< i
k
then [forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i [n]
d]
else forall i n. (Integral i, Real n) => i -> i -> [n] -> Message
b_setn1 i
b i
i (forall i a. Integral i => i -> [a] -> [a]
genericTake i
k [n]
d) forall a. a -> [a] -> [a]
: forall i n. (Integral i, Real n) => i -> i -> i -> [n] -> [Message]
b_setn1_segmented i
k i
b (i
i forall a. Num a => a -> a -> a
+ i
k) (forall i a. Integral i => i -> [a] -> [a]
genericDrop i
k [n]
d)
c_getn1 :: Integral i => (i,i) -> Message
c_getn1 :: forall i. Integral i => (i, i) -> Message
c_getn1 = forall i. Integral i => [(i, i)] -> Message
c_getn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. Monad m => a -> m a
return
c_set1 :: (Integral i,Real n) => i -> n -> Message
c_set1 :: forall i n. (Integral i, Real n) => i -> n -> Message
c_set1 i
i n
x = forall i n. (Integral i, Real n) => [(i, n)] -> Message
c_set [(i
i,n
x)]
c_setn1 :: (Integral i,Real n) => (i,[n]) -> Message
c_setn1 :: forall i n. (Integral i, Real n) => (i, [n]) -> Message
c_setn1 = forall i n. (Integral i, Real n) => [(i, [n])] -> Message
c_setn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. Monad m => a -> m a
return
n_run1 :: Integral i => i -> Bool -> Message
n_run1 :: forall i. Integral i => i -> Bool -> Message
n_run1 i
n Bool
k = forall i. Integral i => [(i, Bool)] -> Message
n_run [(i
n,Bool
k)]
n_set1 :: (Integral i,Real n) => i -> String -> n -> Message
n_set1 :: forall i n.
(Integral i, Real n) =>
i -> Address_Pattern -> n -> Message
n_set1 i
n Address_Pattern
k n
v = forall i n.
(Integral i, Real n) =>
i -> [(Address_Pattern, n)] -> Message
n_set i
n [(Address_Pattern
k,n
v)]
s_new0 :: Integral i => String -> i -> Server.Enum.AddAction -> i -> Message
s_new0 :: forall i.
Integral i =>
Address_Pattern -> i -> AddAction -> i -> Message
s_new0 Address_Pattern
n i
i AddAction
a i
t = forall i n.
(Integral i, Real n) =>
Address_Pattern
-> i -> AddAction -> i -> [(Address_Pattern, n)] -> Message
s_new Address_Pattern
n i
i AddAction
a i
t ([]::[(String,Double)])
b_segment :: Integral i => i -> i -> [i]
b_segment :: forall i. Integral i => i -> i -> [i]
b_segment i
n i
m =
let (i
q,i
r) = i
m forall a. Integral a => a -> a -> (a, a)
`quotRem` i
n
s :: [i]
s = forall i a. Integral i => i -> a -> [a]
genericReplicate i
q i
n
in if i
r forall a. Eq a => a -> a -> Bool
== i
0 then [i]
s else i
r forall a. a -> [a] -> [a]
: [i]
s
b_indices :: Integral i => i -> i -> i -> [(i,i)]
b_indices :: forall i. Integral i => i -> i -> i -> [(i, i)]
b_indices i
n i
m i
k =
let s :: [i]
s = forall i. Integral i => i -> i -> [i]
b_segment i
n i
m
i :: [i]
i = i
0 forall a. a -> [a] -> [a]
: forall n. Num n => [n] -> [n]
Common.Base.dx_d [i]
s
in forall a b. [a] -> [b] -> [(a, b)]
zip (forall a b. (a -> b) -> [a] -> [b]
map (forall a. Num a => a -> a -> a
+ i
k) [i]
i) [i]
s
partConv_preparePartConv :: Integral i => i -> i -> i -> Message
partConv_preparePartConv :: forall i. Integral i => i -> i -> i -> Message
partConv_preparePartConv i
b i
irb i
fft_size = forall i. Integral i => i -> Address_Pattern -> [Datum] -> Message
b_gen i
b Address_Pattern
"PreparePartConv" (forall a b. (a -> b) -> [a] -> [b]
map forall t. Integral t => t -> Datum
int32 [i
irb, i
fft_size])
unpack_n_info_datum_plain :: Num i => [Datum] -> [i]
unpack_n_info_datum_plain :: forall i. Num i => [Datum] -> [i]
unpack_n_info_datum_plain [Datum]
m =
let to_i :: Int32 -> i
to_i = forall a b. (Integral a, Num b) => a -> b
fromIntegral
in case [Datum]
m of
[Int32 Int32
i1,Int32 Int32
i2,Int32 Int32
i3,Int32 Int32
i4,Int32 Int32
i5] -> [Int32 -> i
to_i Int32
i1,Int32 -> i
to_i Int32
i2,Int32 -> i
to_i Int32
i3,Int32 -> i
to_i Int32
i4,Int32 -> i
to_i Int32
i5]
[Int32 Int32
i1,Int32 Int32
i2,Int32 Int32
i3,Int32 Int32
i4,Int32 Int32
i5,Int32 Int32
i6,Int32 Int32
i7] -> [Int32 -> i
to_i Int32
i1,Int32 -> i
to_i Int32
i2,Int32 -> i
to_i Int32
i3,Int32 -> i
to_i Int32
i4,Int32 -> i
to_i Int32
i5,Int32 -> i
to_i Int32
i6,Int32 -> i
to_i Int32
i7]
[Datum]
_ -> []
unpack_n_info_plain :: Num i => Message -> [i]
unpack_n_info_plain :: forall i. Num i => Message -> [i]
unpack_n_info_plain Message
m =
case Message
m of
Message Address_Pattern
"/n_info" [Datum]
dat -> forall i. Num i => [Datum] -> [i]
unpack_n_info_datum_plain [Datum]
dat
Message
_ -> []
unpack_n_info :: Num i => Message -> Maybe (i,i,i,i,i,Maybe (i,i))
unpack_n_info :: forall i. Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i))
unpack_n_info Message
m =
case forall i. Num i => Message -> [i]
unpack_n_info_plain Message
m of
[i
i1,i
i2,i
i3,i
i4,i
i5] -> forall a. a -> Maybe a
Just (i
i1,i
i2,i
i3,i
i4,i
i5,forall a. Maybe a
Nothing)
[i
i1,i
i2,i
i3,i
i4,i
i5,i
i6,i
i7] -> forall a. a -> Maybe a
Just (i
i1,i
i2,i
i3,i
i4,i
i5,forall a. a -> Maybe a
Just (i
i6,i
i7))
[i]
_ -> forall a. Maybe a
Nothing
unpack_n_info_err :: Num i => Message -> (i,i,i,i,i,Maybe (i,i))
unpack_n_info_err :: forall i. Num i => Message -> (i, i, i, i, i, Maybe (i, i))
unpack_n_info_err = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
"unpack_n_info") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i. Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i))
unpack_n_info
unpack_tr :: (Num i,Fractional f) => Message -> Maybe (i,i,f)
unpack_tr :: forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, f)
unpack_tr Message
m =
let to_i :: Int32 -> i
to_i = forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Float -> f
to_f = forall a b. (Real a, Fractional b) => a -> b
realToFrac
in case Message
m of
Message Address_Pattern
"/tr" [Int32 Int32
p,Int32 Int32
q,Float Float
r] -> forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p,Int32 -> i
to_i Int32
q,Float -> f
to_f Float
r)
Message
_ -> forall a. Maybe a
Nothing
unpack_tr_err :: (Num i,Fractional f) => Message -> (i,i,f)
unpack_tr_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, f)
unpack_tr_err = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
"unpack_tr") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, f)
unpack_tr
unpack_b_setn :: (Num i,Fractional f) => Message -> Maybe (i,i,i,[f])
unpack_b_setn :: forall i f.
(Num i, Fractional f) =>
Message -> Maybe (i, i, i, [f])
unpack_b_setn Message
m =
let to_i :: Int32 -> i
to_i = forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Datum -> b
to_f Datum
d = case Datum
d of
Float Float
n -> forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
n
Datum
_ -> forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
"unpack_b_setn: non-float data"
in case Message
m of
Message Address_Pattern
"/b_setn" (Int32 Int32
p:Int32 Int32
q:Int32 Int32
r:[Datum]
z) -> forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p,Int32 -> i
to_i Int32
q,Int32 -> i
to_i Int32
r,forall a b. (a -> b) -> [a] -> [b]
map forall {b}. Fractional b => Datum -> b
to_f [Datum]
z)
Message
_ -> forall a. Maybe a
Nothing
unpack_b_setn_err :: (Num i,Fractional f) => Message -> (i,i,i,[f])
unpack_b_setn_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, i, [f])
unpack_b_setn_err = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
"unpack_b_setn") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i f.
(Num i, Fractional f) =>
Message -> Maybe (i, i, i, [f])
unpack_b_setn
unpack_b_info :: (Num i,Fractional f) => Message -> Maybe (i,i,i,f)
unpack_b_info :: forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, i, f)
unpack_b_info Message
m =
let to_i :: Int32 -> i
to_i = forall a b. (Integral a, Num b) => a -> b
fromIntegral
to_f :: Float -> f
to_f = forall a b. (Real a, Fractional b) => a -> b
realToFrac
in case Message
m of
Message Address_Pattern
"/b_info" [Int32 Int32
p,Int32 Int32
q,Int32 Int32
r,Float Float
s] -> forall a. a -> Maybe a
Just (Int32 -> i
to_i Int32
p,Int32 -> i
to_i Int32
q,Int32 -> i
to_i Int32
r,Float -> f
to_f Float
s)
Message
_ -> forall a. Maybe a
Nothing
unpack_b_info_err :: (Num i,Fractional f) => Message -> (i,i,i,f)
unpack_b_info_err :: forall i f. (Num i, Fractional f) => Message -> (i, i, i, f)
unpack_b_info_err = forall a. a -> Maybe a -> a
fromMaybe (forall a. HasCallStack => Address_Pattern -> a
error Address_Pattern
"unpack_b_info") forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i f. (Num i, Fractional f) => Message -> Maybe (i, i, i, f)
unpack_b_info