module Sound.SC3.Server.Command.Completion where
import Sound.OSC
import Sound.SC3.Server.Enum
import Sound.SC3.Server.Synthdef
encode_blob :: Packet -> Datum
encode_blob = Blob . encodePacket
d_recv :: Packet -> Synthdef -> Message
d_recv osc d = Message "/d_recv" [Blob (synthdefData d),encode_blob osc]
d_load :: Packet -> String -> Message
d_load osc p = Message "/d_load" [string p,encode_blob osc]
d_loadDir :: Packet -> String -> Message
d_loadDir osc p = Message "/d_loadDir" [string p,encode_blob osc]
b_alloc :: Packet -> Int -> Int -> Int -> Message
b_alloc osc nid frames channels = Message "/b_alloc" [int32 nid,int32 frames,int32 channels,encode_blob osc]
b_allocRead :: Packet -> Int -> String -> Int -> Int -> Message
b_allocRead osc nid p f n = Message "/b_allocRead" [int32 nid,string p,int32 f,int32 n,encode_blob osc]
b_allocReadChannel :: Packet -> Int -> String -> Int -> Int -> [Int] -> Message
b_allocReadChannel osc nid p f n cs = Message "/b_allocReadChannel" ([int32 nid,string p,int32 f,int32 n] ++ map int32 cs ++ [encode_blob osc])
b_free :: Packet -> Int -> Message
b_free osc nid = Message "/b_free" [int32 nid,encode_blob osc]
b_close :: Packet -> Int -> Message
b_close osc nid = Message "/b_close" [int32 nid,encode_blob osc]
b_read :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> Message
b_read osc nid p f n f' z = Message "/b_read" [int32 nid,string p,int32 f,int32 n,int32 f',int32 (fromEnum z),encode_blob osc]
b_readChannel :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message
b_readChannel osc nid p f n f' z cs = Message "/b_readChannel" ([int32 nid,string p,int32 f,int32 n,int32 f',int32 (fromEnum z)] ++ map int32 cs ++ [encode_blob osc])
b_write :: Packet -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message
b_write osc nid p h t f s z = Message "/b_write" [int32 nid,string p,string (soundFileFormatString h),string (sampleFormatString t),int32 f,int32 s,int32 (fromEnum z),encode_blob osc]
b_zero :: Packet -> Int -> Message
b_zero osc nid = Message "/b_zero" [int32 nid,encode_blob osc]