root/ocaml-remix/trunk/ladspa_raw.ml

Revision 529, 1.7 kB (checked in by shans, 1 year ago)

Replacing sound implementation - WAS ocaml int arrays, IS native float
arrays. This has not yet been completely been debugged!

Line 
1 type plugin;;
2 type handle;;
3 type buffer = FB.buffer_raw;;
4
5 type portDirection = Input | Output;;
6 type portType = Control | Audio;;
7
8 external open_plugin : string -> plugin = "c_ex_ladspa_open";;
9 external port_count : plugin -> int = "c_ex_ladspa_port_count";;
10 external port_descriptor : plugin -> int -> (portDirection * portType) =
11                                               "c_ex_ladspa_port_descriptor";;
12
13 external instantiate : plugin -> int -> handle = "c_ex_ladspa_instantiate";;
14 external activate : plugin -> handle -> unit = "c_ex_ladspa_activate";;
15
16 external raw_sound_to_buffers : int array -> buffer array -> int -> unit =
17                                           "c_ex_ladspa_raw_sound_to_buffers";;
18
19 external raw_sound_channel_to_buffer : int array -> int -> int -> buffer -> unit
20                                  = "c_ex_ladspa_raw_sound_channel_to_buffer";;
21
22 external buffers_to_raw_sound : buffer array -> int -> int array =
23                                           "c_ex_ladspa_buffers_to_raw_sound";;
24 external control_value_to_buffer : float -> buffer =
25                                       "c_ex_ladspa_control_value_to_buffer";;
26 external empty_buffer : int -> buffer = "c_ex_ladspa_empty_buffer";;
27
28 external connect_port : plugin -> handle -> int -> buffer -> unit =
29                                         "c_ex_ladspa_connect_port";;
30 external run : plugin -> handle -> int -> unit = "c_ex_ladspa_run";;
31 external run_adding : plugin -> handle -> int -> unit =
32                                         "c_ex_ladspa_run_adding";;
33
34
35 let direction_to_string d = match d with
36   | Input  -> "Input"
37   | Output -> "Output";;
38
39 let type_to_string t = match t with
40   | Control -> "Control"
41   | Audio   -> "Audio";;
Note: See TracBrowser for help on using the browser.