Conversation
c920e92 to
dabfae4
Compare
| } | ||
| if (selectionBox_.getNumItems() == 1) { | ||
| selectionBox_.setSelectedId(1); | ||
| selectionBox_.setSelectedId(1, juce::dontSendNotification); |
There was a problem hiding this comment.
This was causing hard to trace state changes during UI initialization.
| return seekFrame(frameIdx, abort); | ||
| } | ||
|
|
||
| bool IAMFFileReader::seekFrame(const size_t frameIdx, |
There was a problem hiding this comment.
Updating the seek method to make it cancellable as seeking often requires parsing large amounts of data.
| FilePlayback fpb = fpbr_.get(); | ||
| fpb.setPlaybackFile(""); | ||
| fpb.setPlaybackCommand(FilePlayback::PlaybackCommand::kPause); | ||
| fpbr_.update(fpb); |
There was a problem hiding this comment.
I've learned the hard way that it's much simpler to have processors depend on one repository for their state / commands. This is also a more obvious approach to resetting the player.
| if (FileExport::validateFilePath( | ||
| FileExport::expandTildePath(kIamfPath).toStdString(), false)) { | ||
| // Clean up the file if it exists | ||
| std::filesystem::remove(kIamfPath.toStdString()); |
There was a problem hiding this comment.
This line causes difficult problems.
As it relates to the player, when export starts we want to release any handles we have to the file that is to be written. This is done asynchronously (we don't want to freeze the audio thread) as it requires joining multiple threads and doing other cleanup. As it's asynchronous there's no guarantee by the time we reach this line that the file has been relinquished.
There was a problem hiding this comment.
What happens if we export to a file that is being held or being played?
I guess it's fine if writing to the file doesn't cause issues, maybe this is handled sensibly by the filesystem somehow. But if it blocks export then we should try and release the handles and then flag for the process to continue somehow.
Handle and filesystem behaviour might differ between windows and macos as well.
There was a problem hiding this comment.
We do destroy the reader when export begins here so it should technically be fine to delete this file.
I would prefer to let the host OS handle what to do in case things got out of sync at some point and there is a write to a file currently being read. If this were to occur, my position is that it's better in this case to continue reading from the outdated file than to crash - let the OS handle the file conflicts.
In my testing in MacOS and Windows DAWs there aren't any crashes if you start an export while buffering or while playing.
| audioElementSpatialLayoutRepository_->registerListener(this); | ||
|
|
||
| // Tie the horizontal scrollbars together | ||
| profileSelectionBox_.onChange([this]() { |
There was a problem hiding this comment.
Moved callback enabling for this component to after all the other initialization is done.
BrandenAvalonCx
left a comment
There was a problem hiding this comment.
I noticed 2 issues when testing:
- After seeking to the midpoint of the file, if I change Mix Presentation layout and then press play, the player shows that it will play from the middle of the file, but actually plays from the start again. Probably the file should be played from the middle, where the caret shows.
- Seeking in general is a bit tough, since there's an immediate load when you click on the seek bar. Maybe we can start seeking on release / mouse button up? In this way would I be able to see the value I'm scrolling the seek to? Not sure if this worked before, so if not we can make it a future improvement instead.
| if (FileExport::validateFilePath( | ||
| FileExport::expandTildePath(kIamfPath).toStdString(), false)) { | ||
| // Clean up the file if it exists | ||
| std::filesystem::remove(kIamfPath.toStdString()); |
There was a problem hiding this comment.
What happens if we export to a file that is being held or being played?
I guess it's fine if writing to the file doesn't cause issues, maybe this is handled sensibly by the filesystem somehow. But if it blocks export then we should try and release the handles and then flag for the process to continue somehow.
Handle and filesystem behaviour might differ between windows and macos as well.
2519ba9 to
3cdcbc5
Compare
There was a problem hiding this comment.
Superficial test changes as I renamed the type it was testing and adjusted its constructor
Changing the layout properly resets playback position. Seeking is now only submitted after release on drag. |
BrandenAvalonCx
left a comment
There was a problem hiding this comment.
I think this looks good, I think the cleanup makes this a bit simpler. Tested with REAPER and playback seems to be working fine. I wouldn't mind a few minor improvements, but I think these can be handled as later work.
I think just a general comment, I wouldn't mind seeing more comments in these larger changes. It may be worth writing a longer comment at the top of the FilePlaybackProcessor explaining the logic and how it works in case we need to make adjustments in the future.
Description
Playing audio back through arbitrary system devices causes issues in some DAWs. This work moves file playback to the audio processor chain.
Changes
Validation and Acceptance Criteria
Validated in: