Skip to content

Commit

Permalink
Document most ~name parameters. Don't make them mandatory yet in case…
Browse files Browse the repository at this point in the history
… some

optional operators have been forgotten. A few names could be improved but
it's already much better than the default "src" in so many places.
  • Loading branch information
dbaelde committed Jul 3, 2012
1 parent cb03311 commit d234427
Show file tree
Hide file tree
Showing 52 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/analyze/analyze_rms.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class rms ~kind ~window_length ~update source =
object (self)
inherit Source.operator kind [source]
inherit Source.operator ~name:"rms" kind [source]

method stype = source#stype
method is_ready = source#is_ready
Expand Down
2 changes: 1 addition & 1 deletion src/io/gstreamer_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class v4l_input v4l_version p kind =
in
let vfps = Lazy.force Frame.video_rate in
object (self)
inherit Source.active_source kind as active_source
inherit Source.active_source ~name:"input.v4l" kind as active_source
inherit [I.t array] IoRing.input ~nb_blocks ~blank as ioring

method private set_clock =
Expand Down
2 changes: 1 addition & 1 deletion src/io/udp_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class input ~kind ~hostname ~port ~decoder_factory ~bufferize =
let log = (fun x -> !log_ref x) in
object (self)

inherit Source.source kind
inherit Source.source ~name:"input.udp" kind
inherit
Generated.source
(Generator.create ~log ~kind ~overfull:(`Drop_old max_ticks) `Undefined)
Expand Down
2 changes: 1 addition & 1 deletion src/operators/add.ml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let get_again s buf =
* is used to add either as an overlay or as a tiling. *)
class add ~kind ~renorm (sources: (int*source) list) video_init video_loop =
object (self)
inherit operator kind (List.map snd sources) as super
inherit operator ~name:"add" kind (List.map snd sources) as super

(* We want the sources at the beginning of the list to
* have their metadatas copied to the output stream, so direction
Expand Down
2 changes: 1 addition & 1 deletion src/operators/append.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class append ~kind ~insert_missing ~merge source f =
object (self)
inherit operator kind [source]
inherit operator ~name:"append" kind [source]

val mutable state = `Idle

Expand Down
2 changes: 1 addition & 1 deletion src/operators/biquad_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class biquad ~kind (source:source) filter_type freq fparam db_gain =
let channels = (Frame.type_of_kind kind).Frame.audio in
let samplerate = Frame.audio_of_seconds 1. in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"biquad_filter" kind [source] as super

val effect = new Audio.Effect.biquad_filter channels samplerate filter_type ~gain:db_gain freq fparam

Expand Down
2 changes: 1 addition & 1 deletion src/operators/chord.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let note_of_string s = note_of_string s - 12

class chord ~kind metadata_name (source:source) =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"chord" kind [source] as super

method stype = source#stype

Expand Down
6 changes: 3 additions & 3 deletions src/operators/clip.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

open Source

class echo ~kind (source:source) vmin vmax =
class clip ~kind (source:source) vmin vmax =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"clip" kind [source] as super

method stype = source#stype
method remaining = source#remaining
Expand Down Expand Up @@ -57,4 +57,4 @@ let () =
Lang.to_float (f "max"),
Lang.to_source (f "")
in
new echo ~kind src vmin vmax)
new clip ~kind src vmin vmax)
2 changes: 1 addition & 1 deletion src/operators/comb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class comb ~kind (source:source) delay feedback =
let past_len = Frame.audio_of_seconds delay in
let channels = (Frame.type_of_kind kind).Frame.audio in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"comb" kind [source] as super

method stype = source#stype

Expand Down
2 changes: 1 addition & 1 deletion src/operators/compand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class compand ~kind (source:source) mu =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"compand" kind [source] as super

method stype = source#stype

Expand Down
2 changes: 1 addition & 1 deletion src/operators/compress.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class compress ~kind (source:source) attack release threshold ratio knee rms_win
let channels = (Frame.type_of_kind kind).Frame.audio in
let samplerate = Lazy.force Frame.audio_rate in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"compress" kind [source] as super

val effect = new Audio.Effect.compress ~attack:(attack ()) ~release:(release ()) ~threshold:(threshold ()) ~ratio:(ratio ()) ~knee:(knee ()) ~rms_window ~gain:(gain ()) channels samplerate

Expand Down
2 changes: 1 addition & 1 deletion src/operators/compress_exp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class compress ~kind (source:source) mu =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"compress" kind [source] as super

method stype = source#stype

Expand Down
2 changes: 1 addition & 1 deletion src/operators/delay.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ open Source

class delay ~kind ~initial (source:source) delay =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"delay" kind [source] as super

method stype = Fallible
method remaining = source#remaining
Expand Down
2 changes: 1 addition & 1 deletion src/operators/echo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open Source
class echo ~kind (source:source) delay feedback ping_pong =
let channels = (Frame.type_of_kind kind).Frame.audio in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"echo" kind [source] as super

method stype = source#stype
method remaining = source#remaining
Expand Down
2 changes: 1 addition & 1 deletion src/operators/filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class filter ~kind (source:source) freq q wet mode =
let channels = (Frame.type_of_kind kind).Frame.audio in
let rate = float (Lazy.force Frame.audio_rate) in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"filter" kind [source] as super

method stype = source#stype
method remaining = source#remaining
Expand Down
2 changes: 1 addition & 1 deletion src/operators/fir_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let pi = 3.14159265358979323846
class fir ~kind (source:source) freq beta numcoeffs =
let channels = (Frame.type_of_kind kind).Frame.audio in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"fir_filter" kind [source] as super

(* Needed to compute RC *)
val f1 = (1. -. beta) *. (freq /. (float_of_int (Frame.audio_of_seconds 1.)))
Expand Down
2 changes: 1 addition & 1 deletion src/operators/flanger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class flanger ~kind (source:source) delay freq feedback phase =
let past_len = Frame.audio_of_seconds delay in
let channels = (Frame.type_of_kind kind).Frame.audio in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"flanger" kind [source] as super

method stype = source#stype

Expand Down
2 changes: 1 addition & 1 deletion src/operators/iir_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class iir ~kind (source:source)
let channels = (Frame.type_of_kind kind).Frame.audio in
let rate = float (Frame.audio_of_seconds 1.) in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"iir_filter" kind [source] as super

(* Params *)
val raw_alpha1 = freq1 /. rate
Expand Down
4 changes: 2 additions & 2 deletions src/operators/insert_metadata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exception Error

class insert_metadata ~kind source =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"insert_metadata" kind [source] as super

method stype = source#stype
method is_ready = source#is_ready
Expand Down Expand Up @@ -94,7 +94,7 @@ let () =
* Currently used by the switch classes. *)
class replay ~kind meta src =
object (self)
inherit operator kind [src]
inherit operator ~name:"replay_metadata" kind [src]

val mutable first = true

Expand Down
4 changes: 2 additions & 2 deletions src/operators/ladspa_op.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let port_t d p =

class virtual base ~kind source =
object
inherit operator kind [source] as super
inherit operator ~name:"ladspa" kind [source] as super

method stype = source#stype

Expand All @@ -63,7 +63,7 @@ end

class virtual base_nosource ~kind =
object
inherit source kind
inherit source ~name:"ladspa" kind

method stype = Infallible

Expand Down
2 changes: 1 addition & 1 deletion src/operators/map_metadata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class map_metadata ~kind source rewrite_f insert_missing update strip =
object (self)
inherit operator kind [source]
inherit operator ~name:"map_metadata" kind [source]

method stype = source#stype
method is_ready = source#is_ready
Expand Down
2 changes: 1 addition & 1 deletion src/operators/map_op.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class map ~kind source f =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"audio.map" kind [source] as super

method stype = source#stype
method remaining = source#remaining
Expand Down
8 changes: 4 additions & 4 deletions src/operators/midi_routing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

open Source

class virtual base ~kind (source:source) =
class virtual base ~kind ~name (source:source) =
object (self)
inherit operator kind [source] as super
inherit operator ~name kind [source] as super

method stype = source#stype

Expand All @@ -37,7 +37,7 @@ end

class merge ~kind (source:source) out =
object (self)
inherit base ~kind (source)
inherit base ~kind (source) ~name:"midi.merge_all"

method private get_frame buf =
let offset = MFrame.position buf in
Expand All @@ -51,7 +51,7 @@ end

class remove ~kind (source:source) t =
object (self)
inherit base ~kind (source)
inherit base ~kind (source) ~name:"midi.remove"

method private get_frame buf =
let offset = MFrame.position buf in
Expand Down
2 changes: 1 addition & 1 deletion src/operators/mixing_table.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open Source
class mixing ~kind source =
let n = Array.length source in
object (self)
inherit operator kind (Array.to_list source) as super
inherit operator ~name:"mix" kind (Array.to_list source) as super

initializer assert (n>0)

Expand Down
2 changes: 1 addition & 1 deletion src/operators/ms_stereo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type mode = Encode | Decode

class msstereo ~kind (source:source) mode width =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"stereo.ms.encode" kind [source] as super

method stype = source#stype
method is_ready = source#is_ready
Expand Down
8 changes: 4 additions & 4 deletions src/operators/noblank.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
class on_blank ~kind ~length ~threshold
~track_sensitive ~on_blank ~on_noise source =
object (self)
inherit operator kind [source]
inherit operator ~name:"on_blank" kind [source]
inherit base ~length ~threshold as base

val mutable in_blank = true
Expand Down Expand Up @@ -94,7 +94,7 @@ let log = Dtools.Log.make ["noblank"]

class skip ~kind ~length ~threshold ~track_sensitive source =
object (self)
inherit operator kind [source]
inherit operator ~name:"skip_blank" kind [source]
inherit base ~length ~threshold as base

method stype = source#stype
Expand Down Expand Up @@ -122,7 +122,7 @@ end

class strip ~kind ~length ~threshold ~track_sensitive source =
object (self)
inherit active_operator kind [source]
inherit active_operator ~name:"strip_blank" kind [source]
inherit base ~length ~threshold as base

val mutable stripping = false
Expand Down Expand Up @@ -168,7 +168,7 @@ end

class eat ~kind ~at_beginning ~length ~threshold ~track_sensitive source =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"eat_blank" kind [source] as super
inherit base ~length ~threshold as base

val mutable stripping = false
Expand Down
2 changes: 1 addition & 1 deletion src/operators/normalize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class normalize ~kind (source:source)
let channels = (Frame.type_of_kind kind).Frame.audio in
let rmsi = Frame.audio_of_seconds window in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"normalize" kind [source] as super

(** Current squares of RMS. *)
val rms = Array.make channels 0.
Expand Down
2 changes: 1 addition & 1 deletion src/operators/on_metadata.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class on_metadata ~kind f s =
object (self)
inherit Source.operator kind [s]
inherit Source.operator ~name:"on_metadata" kind [s]

method stype = s#stype
method is_ready = s#is_ready
Expand Down
2 changes: 1 addition & 1 deletion src/operators/on_track.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class on_track ~kind f s =
object
inherit Source.operator kind [s]
inherit Source.operator ~name:"on_track" kind [s]

method stype = s#stype
method is_ready = s#is_ready
Expand Down
2 changes: 1 addition & 1 deletion src/operators/pan.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let pi = 3.14159265358979323846

class pan ~kind (source:source) phi phi_0 =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"pan" kind [source] as super

method stype = source#stype
method is_ready = source#is_ready
Expand Down
2 changes: 1 addition & 1 deletion src/operators/pitch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class pitch ~kind every length freq_min freq_max (source:source) =
let channels = (Frame.type_of_kind kind).Frame.audio in
let length = Frame.audio_of_seconds length in
object (self)
inherit operator kind [source] as super
inherit operator ~name:"pitch" kind [source] as super

val ring = Ringbuffer.create channels (2 * length)

Expand Down
2 changes: 1 addition & 1 deletion src/operators/prepend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class prepend ~kind ~merge source f =
object (self)
inherit operator kind [source]
inherit operator ~name:"prepend" kind [source]

val mutable state = `Idle

Expand Down
6 changes: 3 additions & 3 deletions src/operators/setvol.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

open Source

class setvol ~kind (source:source) override_field coeff =
class amplify ~kind (source:source) override_field coeff =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"amplify" kind [source] as super

val mutable override = None

Expand Down Expand Up @@ -87,4 +87,4 @@ let () =
let s = Lang.to_source (Lang.assoc "" 2 p) in
let o = Lang.to_string (Lang.assoc "override" 1 p) in
let o = if o = "" then None else Some (String.lowercase o) in
new setvol ~kind s o c)
new amplify ~kind s o c)
2 changes: 1 addition & 1 deletion src/operators/smartcross.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class cross ~kind (s:source)
~conservative ~active transition =
let channels = float (Frame.type_of_kind kind).Frame.audio in
object (self)
inherit source kind as super
inherit source ~name:"smart_cross" kind as super

(* This actually depends on [f], we have to trust the user here. *)
method stype = s#stype
Expand Down
2 changes: 1 addition & 1 deletion src/operators/soundtouch_op.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ open Source

class soundtouch ~kind (source:source) rate tempo pitch =
object (self)
inherit operator kind [source] as super
inherit operator ~name:"soundtouch" kind [source] as super

val st = Soundtouch.make ((Frame.type_of_kind kind).Frame.audio) (Lazy.force Frame.audio_rate)

Expand Down
Loading

0 comments on commit d234427

Please sign in to comment.