Mercurial > hg > may
changeset 206:0a61f84c6a8f
More withs
author | Chris Cannam |
---|---|
date | Tue, 07 May 2013 21:36:43 +0100 |
parents | 0c81455270dc |
children | cd2caf235e1f |
files | yetilab/stream/filter.yeti |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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;