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

Stretch issues on audio and video #333

Closed
KirbysDarkNebula opened this issue Nov 19, 2024 · 11 comments · Fixed by #340
Closed

Stretch issues on audio and video #333

KirbysDarkNebula opened this issue Nov 19, 2024 · 11 comments · Fixed by #340
Assignees
Labels
bug Something isn't working
Milestone

Comments

@KirbysDarkNebula
Copy link

AUDIO: Audio stretch popup doesn't work.

I was checking the code related to stretching and noticed that audio stretching should be working but for some reason clicking on stretch from the right click menu doesn't do anything.
This doesn't seem to be a limitation of the program with stretching audio tracks, but rather of it being unable to start the popup with the given parameters.

The code for it is basically 1:1 to the one used for images/videos (which works perfectly) so I really don't understand what could be the issue:
sound: https://github.com/friction2d/friction/blob/main/src/core/Sound/eindependentsound.cpp#L80-L90
image: https://github.com/friction2d/friction/blob/main/src/core/Boxes/animationbox.cpp#L235-L246

I manually tried adding popup buttons like the delete item one (https://github.com/friction2d/friction/blob/main/src/core/Sound/eindependentsound.cpp#L92-L95) with hardcoded stretch values just to test and the audio did actually change, proving that the problem is calling the input popup.

AUDIO & VIDEO: Stretch property not working on project load.

Both audio and video are able to save the property to the project files, but similarly to #331 they don't get applied on project load. I checked all stretch code and I wasn't able to find when this property is saved to the project file, but after comparing 2 files with different stretches it's clear that the property does get saved.

I wouldn't mind fixing this myself but despite finding the file load and save functions I cannot really seem to find where options like the one from the issue highlighted before (#331) and this one are handled within those functions.

@rodlie
Copy link
Member

rodlie commented Nov 19, 2024

Note that NLE A/V stuff is not a priority in Friction, it is a fork of something called Enve is Not a Video Editor ;)

Assume stuff I have not touched since forking is broken/never worked.

@rodlie
Copy link
Member

rodlie commented Nov 19, 2024

Regarding the issue with audio stretch:
https://github.com/friction2d/friction/blob/main/src/core/Sound/eindependentsound.cpp#L83

It probably fails on the dialog so nothing happens

@KirbysDarkNebula
Copy link
Author

yup that's the same behavior I found, that's why I'm confused as to why it happens (or rather doesn't happen)

@rodlie
Copy link
Member

rodlie commented Nov 19, 2024

Will need to debug the issue, might have time later tonight.

@rodlie
Copy link
Member

rodlie commented Nov 19, 2024

Yeah, found the issue. The usage of the lambda is broken (of course it is 😄 ) https://github.com/friction2d/friction/blob/main/src/core/Sound/eindependentsound.cpp#L80

Will commit a replacement later today (together with a fix for #331)

@rodlie rodlie added the bug Something isn't working label Nov 19, 2024
@rodlie rodlie added this to the 1.0.0 milestone Nov 19, 2024
@rodlie rodlie self-assigned this Nov 19, 2024
rodlie added a commit that referenced this issue Nov 20, 2024
@rodlie
Copy link
Member

rodlie commented Nov 20, 2024

So, I pushed a fix for #331 and a fix for the stretch action in the av branch.

But load/save of stretch is not implemented anywhere, so this will need to be added.

@KirbysDarkNebula
Copy link
Author

Oh I see you changed the action to a trigger in the end. Works as expected now, nice.

As for the load/save stuff I really thought that the stretch was saved, since I compared files (on a hex editor) where the only changes were the stretch (going from default to 1000), and they did indeed have differences so once again I don't understand when these changes are happening and it really does seem like they are a product of stretch getting saved.

(Maybe the stretch isn't actually getting saved but it's some frame duration property that gets affected by the stretch and DOES get saved?)

@rodlie
Copy link
Member

rodlie commented Nov 20, 2024

(Maybe the stretch isn't actually getting saved but it's some frame duration property that gets affected by the stretch and DOES get saved?)

Don't know :)

What I do know is that there is no code to load or save the stretch value. Will add support for it, but it will have to wait until tomorrow (probably) as this involves bumping the project format etc (any changes to the file format need proper testing before usage).

rodlie added a commit that referenced this issue Nov 23, 2024
@rodlie
Copy link
Member

rodlie commented Nov 23, 2024

The av branch should now read/write the audio/video stretch state, note project format changes so only test on backup projects.

Will make a PR for this issue and #331 when confirmed ok.

rodlie added a commit that referenced this issue Nov 23, 2024
Support undo/redo for stretch.
@rodlie rodlie linked a pull request Nov 23, 2024 that will close this issue
@KirbysDarkNebula
Copy link
Author

Just tested the PR and it seems to be working perfectly, stretch gets loaded and saved as expected 👍

@rodlie
Copy link
Member

rodlie commented Nov 26, 2024

Great, will merge the changes later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants