Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add record_sequence #53

Closed
waveform80 opened this issue Feb 14, 2014 · 1 comment

Comments

@waveform80
Copy link
Owner

commented Feb 14, 2014

To mirror capture_continuous we should have a record_continuous. Similar calling convention (filename_or_obj for first parameter and filenames are format() based substitution templates), but first iteration of loop calls start_recording, subsequent iterations call split_recording, and terminating the iterator calls stop_recording (need to check the last bit always works under all circumstances).

@waveform80 waveform80 self-assigned this Feb 14, 2014

@waveform80 waveform80 added this to the 1.3 milestone Feb 26, 2014

@waveform80 waveform80 changed the title Add record_continuous Add record_sequence Mar 19, 2014

@waveform80

This comment has been minimized.

Copy link
Owner Author

commented Mar 19, 2014

After some experimentation and deliberation, I'm going for a record_sequence implementation to mirror capture_sequence with the difference that it returns an iterator like capture_continuous. It turns out implementing record_continuous in a manner analogous to capture_continuous isn't useful in the case of file-like-object output: because recording is active during the calling loop body nothing can manipulate the file-like-object output.

However, a system analogous to capture_sequence permits multiple outputs (and even infinite sequences given a few simple tricks from itertools) solving the problem neatly. We can't exactly replicate the calling convention of capture_sequence as then there'd be no loop body to determine when to split to the next output, hence the eventual solution of combining the iterator convention from capture_continuous with the parameters of capture_sequence.

Having had a play with this new setup, it's occurred to me it'd be much more flexible to combine capture_continuous and capture_sequence in the same manner (it would also simplify use of file-like-objects in capture_continuous). However, this would be a backwards incompatible change (it would break existing uses of capture_sequence and capture_continuous) so it'll have to wait until 2.0 - ticket #69 has been opened to track the idea though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.