# HG changeset patch # User Chris Cannam # Date 1367959003 -3600 # Node ID 0a61f84c6a8fcd9f99fd382696e92d053f994edc # Parent 0c81455270dc1f28befeaa507d3211306b69a1a1 More withs diff -r 0c81455270dc -r 0a61f84c6a8f yetilab/stream/filter.yeti --- a/yetilab/stream/filter.yeti Mon May 06 21:45:38 2013 +0100 +++ b/yetilab/stream/filter.yeti Tue May 07 21:36:43 2013 +0100 @@ -27,10 +27,9 @@ withDuration nsamples s = //!!! should nsamples be a time in seconds? (no) (var pos = 0; + s with { get position () = pos, - get channels () = s.channels, - get sampleRate () = s.sampleRate, get available () = Known (nsamples - pos), get finished? () = not (nsamples > pos), read count = @@ -41,7 +40,6 @@ else mat.zeroMatrix { columns = n, rows = s.channels } fi), - close = s.close, }); delayedBy nsamples s = //!!! should nsamples be a time in seconds? (no) @@ -76,7 +74,7 @@ //!!! poor name, confusion with mixed, but consistent with channels.yeti mixedTo targetChannels s = - s with //!!! should use this more in this module + s with { get channels () = targetChannels, read count = ch.mixedTo targetChannels (s.read count), @@ -176,10 +174,9 @@ else mat.concat (Horizontal ()) (cachedPartsFor count); fi); + s with { get position () = pos, - get channels () = s.channels, - get sampleRate () = s.sampleRate, get available () = Infinite (), get finished? () = false, read count = @@ -196,7 +193,6 @@ [part, readFromCache (count - len)]; fi; fi, - close = s.close } fi;