Changeset 6706
- Timestamp:
- 07/01/09 13:01:24 (14 months ago)
- Location:
- trunk/liquidsoap/src
- Files:
-
- 3 modified
- 1 copied
-
Makefile (modified) (1 diff)
-
lang/lang.ml (modified) (2 diffs)
-
lang/lang.mli (modified) (1 diff)
-
operators/midi_routing.ml (copied) (copied from trunk/liquidsoap/src/operators/id.ml) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/liquidsoap/src/Makefile
r6701 r6706 88 88 operators/time_wrap.ml operators/lag.ml \ 89 89 operators/video_effects.ml operators/video_fade.ml \ 90 operators/fork.ml 90 operators/fork.ml operators/midi_routing.ml 91 91 # operators/pipe.ml 92 92 -
trunk/liquidsoap/src/lang/lang.ml
r6695 r6706 79 79 type category = 80 80 | Input | Output 81 | TrackProcessing | SoundProcessing | VideoProcessing 81 | TrackProcessing | SoundProcessing | VideoProcessing | MIDIProcessing 82 82 | Visualization | SoundSynthesis 83 83 … … 88 88 | SoundProcessing -> "Sound Processing" 89 89 | VideoProcessing -> "Video Processing" 90 | MIDIProcessing -> "MIDI Processing" 90 91 | SoundSynthesis -> "Sound Synthesis" 91 92 | Visualization -> "Visualization" -
trunk/liquidsoap/src/lang/lang.mli
r6695 r6706 86 86 | SoundProcessing (** Operations on sound (e.g. compression, etc.). *) 87 87 | VideoProcessing (** Operations on video. *) 88 | MIDIProcessing (** Operations on MIDI. *) 88 89 | Visualization (** Visializations of the sound. *) 89 90 | SoundSynthesis (** Synthesis. *) -
trunk/liquidsoap/src/operators/midi_routing.ml
r6527 r6706 23 23 open Source 24 24 25 class id(source:source) =25 class virtual base (source:source) = 26 26 object (self) 27 27 inherit operator [source] as super … … 34 34 35 35 method abort_track = source#abort_track 36 end 36 37 37 method private get_frame buf = source#get buf 38 class merge (source:source) out = 39 object (self) 40 inherit base (source) 41 42 method private get_frame buf = 43 source#get buf; 44 let m = MFrame.tracks buf in 45 for c = 0 to Array.length m - 1 do 46 m.(out) := !(m.(c)) @ !(m.(out)); 47 if c <> out then m.(c) := [] 48 done; 49 m.(out) := List.sort (fun (t1, _) (t2, _) -> t1 - t2) !(m.(out)) 50 end 51 52 class remove (source:source) t = 53 object (self) 54 inherit base (source) 55 56 method private get_frame buf = 57 source#get buf; 58 let m = MFrame.tracks buf in 59 List.iter (fun c -> m.(c) := []) t 38 60 end 39 61 40 62 let () = 41 Lang.add_operator "id" 42 ["", Lang.source_t, None, None] 43 ~category:Lang.SoundProcessing 44 ~descr:"Identity: does not do anything." 45 ~flags:[Lang.Hidden] 63 Lang.add_operator "midi.merge_all" 64 [ 65 "track_out", Lang.int_t, Some (Lang.int 0), Some "Destination track."; 66 "", Lang.source_t, None, None 67 ] 68 ~category:Lang.MIDIProcessing 69 ~descr:"Merge all MIDI tracks in one." 46 70 (fun p _ -> 47 71 let f v = List.assoc v p in 72 let out = Lang.to_int (f "track_out") in 48 73 let src = Lang.to_source (f "") in 49 new id src) 74 new merge src out) 75 76 let () = 77 Lang.add_operator "midi.remove" 78 [ 79 "", Lang.list_t Lang.int_t, None, Some "Tracks to remove."; 80 "", Lang.source_t, None, None 81 ] 82 ~category:Lang.MIDIProcessing 83 ~descr:"Remove MIDI tracks." 84 (fun p _ -> 85 (* let f v = List.assoc v p in *) 86 let t = List.map Lang.to_int (Lang.to_list (Lang.assoc "" 1 p)) in 87 let src = Lang.to_source (Lang.assoc "" 2 p) in 88 new remove src t)
