Skip to content

Conversation

@danielskeenan
Copy link
Contributor

Fixes #1604.

This seemed like a good way to learn more about OLA's event handling.

@danielskeenan danielskeenan changed the title #1604 Add in/out point support to ola_recorder Jul 5, 2020
@danielskeenan danielskeenan marked this pull request as ready for review July 5, 2020 12:58
@peternewman peternewman self-assigned this Jul 6, 2020
@peternewman peternewman added this to the 0.11.0 milestone Jul 6, 2020
@peternewman
Copy link
Member

Just for info, I started on #1607 which I think actually covers the specifics of #1604 but then got sidetracked with various stuff. It looks like we've actually worked on different features, which is great, there's just a small chance of a merge conflict when they both go in. I'll try and get mine merged in soon to simplify that.

The other features look good and are certainly likely to be wanted by people.

@danielskeenan
Copy link
Contributor Author

Worst case I can try to rebase this once #1607 is merged. I did a bit of refactoring to clean up how show files are read; I imagine that's the most likely place for a merge conflict.

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few initial changes.

@danielskeenan danielskeenan requested a review from peternewman July 6, 2020 20:45
Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments

@danielskeenan
Copy link
Contributor Author

I've switched --verify to simulate the ShowPlayer instead of attempting to have it match the ShowPlayer's behavior, but poorly. This should clear up some of your comments about the original routine becoming a bit of a mess with the added features, as well as simplifying integrating it with playback.

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments, mostly style changes

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry a few more minor comments now I've been able to review the whole thing en-mass since it's finally settled down and is pretty much finished.

OLA_WARN << "Show file ends before the stop time (actual length "
<< m_playback_pos << " ms)";
if (loop) {
const uint64_t remaining_time = m_stop - m_playback_pos;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was more worried from a maths perspective of having 2 - 5 = trouble!

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more comments

Comment on lines 129 to 132
if (m_iteration_remaining > 0) {
OLA_WARN << "More iterations requested than can fit in the duration "
"(" << m_iteration_remaining << " iteration(s) remain)";
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not go in verify instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that other usage-type problems (e.g. stop point beyond show file end) are warned during playback, this seemed a fitting place for the warning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah, can I say both? 😄 It would be nice to spot config issues during validation, rather than needing to wait for a 30 minute show to run, but it would also be good to see them during show run...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the verify function is the player without output, it appears in both places. For instance, with a recorded show file about 11 seconds long:

ola_recorder --verify recorded.show --iterations 3 --duration 1
------------ Summary ----------
For all (3) iterations:
After playing for 1 second(s) total:
Universe 1: 4 frames
Universe 2: 40 frames

Total frames: 44
Total playback time: 1 seconds
examples/ShowPlayer.cpp:130: More iterations requested than can fit in the duration (3 iteration(s) remain)

Copy link
Member

@peternewman peternewman Aug 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot, and got confused by your comment about it being during playback! If I was to nit-pick, it would be nice if the warnings came before the summary, but no worries if that's not easily possible.

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for all your work on this @DragoonBoots , sorry it became a bit of a beast!

@peternewman peternewman merged commit ea3a18a into OpenLightingProject:master Sep 3, 2020
@peternewman
Copy link
Member

I realised I was being a bit petty with a few bits sorry, so I've merged it. If you fancy trying to tidy them up at some point then great, otherwise I'll try and get to them eventually. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ability for ola_recorder to record for a certain amount of time

2 participants