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

Fix some encoding issues (mostly on Windows) #4401

Merged
merged 6 commits into from Jul 6, 2018

Conversation

Projects
None yet
4 participants
@PhysSong
Member

PhysSong commented Jun 4, 2018

This pull request fixes several encoding issue. Every issue except STK one are Windows-specific.

  • ZynAddSubFX setting loading/saving
  • VST DLL loading
  • VST setting loading/saving
  • Sample file decoding
  • MIDI import
  • STK rawwave path (incomplete on Windows due to upstream issue)

Issues remaining on Windows:

  • .pat file loading
  • .gig file loading
  • STK rawwave path (which toLocal8Bit fails to handle)

I'm planning to track remaining issues in #1191.

Fixes #3855, Fixes #2662, and almost #1191.

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Jun 10, 2018

Member

Every issue except STK one are Windows-specific

I replicated issue #2662 on LinuxMint/Qt4 . It's indeed fixed by this PR.

Ready to merge?

Member

zonkmachine commented Jun 10, 2018

Every issue except STK one are Windows-specific

I replicated issue #2662 on LinuxMint/Qt4 . It's indeed fixed by this PR.

Ready to merge?

@lukas-w lukas-w self-requested a review Jun 10, 2018

@Wallacoloo

This comment has been minimized.

Show comment
Hide comment
@Wallacoloo

Wallacoloo Jun 11, 2018

Member

@PhysSong Thanks for the improvements!

I'm marking this as "approved" now, since you've addressed any concerns I had. But it looks like Lukas wanted to review this too, so you should probably wait until that before merging 🎉

Member

Wallacoloo commented Jun 11, 2018

@PhysSong Thanks for the improvements!

I'm marking this as "approved" now, since you've addressed any concerns I had. But it looks like Lukas wanted to review this too, so you should probably wait until that before merging 🎉

@lukas-w lukas-w referenced this pull request Jun 25, 2018

Closed

Fix MSVC VST compilation #4421

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jun 27, 2018

Member

@lukas-w I addressed these issues and pushed to a separate branch. I'll push this change to the original branch when/if you says okay.

Member

PhysSong commented Jun 27, 2018

@lukas-w I addressed these issues and pushed to a separate branch. I'll push this change to the original branch when/if you says okay.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jun 27, 2018

Member

Oops, accidentally pushed them. I can roll back to original commits whenever needed.

Member

PhysSong commented Jun 27, 2018

Oops, accidentally pushed them. I can roll back to original commits whenever needed.

@lukas-w

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Jun 27, 2018

Member

@PhysSong Please roll back to the original commits, all the comment/review history on GitHub is lost otherwise. It's okay to have one extra commit on top of the original ones, there's no need to rewrite history.

Member

lukas-w commented Jun 27, 2018

@PhysSong Please roll back to the original commits, all the comment/review history on GitHub is lost otherwise. It's okay to have one extra commit on top of the original ones, there's no need to rewrite history.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jun 27, 2018

Member

all the comment/review history on GitHub is lost otherwise.

What do you mean? Review comments are still there unless you commented on specific commits, the are just collapsed.

Anyway, I agree that it's not necessary to rewrite history. I just wanted to keep things cleaner, but that was all. If you're still unhappy with this force-push, I can roll back.

Member

PhysSong commented Jun 27, 2018

all the comment/review history on GitHub is lost otherwise.

What do you mean? Review comments are still there unless you commented on specific commits, the are just collapsed.

Anyway, I agree that it's not necessary to rewrite history. I just wanted to keep things cleaner, but that was all. If you're still unhappy with this force-push, I can roll back.

@lukas-w

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Jun 27, 2018

Member

What do you mean?

Sorry, I was being imprecise. The comments are still there, but the context is lost. Review comments are always on specific commits and you can't view that commits any more, so you can't see the changes the review refers to. Try clicking on the "View changes" button next to a review, this is what you'll get now:

image

If you're still unhappy with this force-push, I can roll back.

Yes, please do 👍

Member

lukas-w commented Jun 27, 2018

What do you mean?

Sorry, I was being imprecise. The comments are still there, but the context is lost. Review comments are always on specific commits and you can't view that commits any more, so you can't see the changes the review refers to. Try clicking on the "View changes" button next to a review, this is what you'll get now:

image

If you're still unhappy with this force-push, I can roll back.

Yes, please do 👍

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jun 27, 2018

Member

I just noticed even a rebasing can cause such a thing. I just accidentally rebased commits because I didn't know that... I'll revert to the revision before rebasing if needed.

Member

PhysSong commented Jun 27, 2018

I just noticed even a rebasing can cause such a thing. I just accidentally rebased commits because I didn't know that... I'll revert to the revision before rebasing if needed.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jul 1, 2018

Member

BTW @lukas-w, do you want any more changes in this pull request?

Member

PhysSong commented Jul 1, 2018

BTW @lukas-w, do you want any more changes in this pull request?

@lukas-w

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Jul 1, 2018

Member

@PhysSong Apart from restoring the pre-force-push commits, nope.

Member

lukas-w commented Jul 1, 2018

@PhysSong Apart from restoring the pre-force-push commits, nope.

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jul 4, 2018

Member

Then do you mind if I merge this(probably with cleaner history)?

Member

PhysSong commented Jul 4, 2018

Then do you mind if I merge this(probably with cleaner history)?

@lukas-w

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Jul 5, 2018

Member

I don't mind, go ahead ❤️

Member

lukas-w commented Jul 5, 2018

I don't mind, go ahead ❤️

@PhysSong

This comment has been minimized.

Show comment
Hide comment
@PhysSong

PhysSong Jul 5, 2018

Member

Just found a very rare encoding issues when using temporary directory whose name contains some non-ASCII characters on Linux. In that case VST plugin can't be loaded.
I can fix it, but it requires some dangerous changes(main->wmain and some more) and is easy to work around. So I'll open an issue instead and merge this soon.

Member

PhysSong commented Jul 5, 2018

Just found a very rare encoding issues when using temporary directory whose name contains some non-ASCII characters on Linux. In that case VST plugin can't be loaded.
I can fix it, but it requires some dangerous changes(main->wmain and some more) and is easy to work around. So I'll open an issue instead and merge this soon.

@PhysSong PhysSong merged commit 62d505b into LMMS:stable-1.2 Jul 6, 2018

2 of 3 checks passed

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@PhysSong PhysSong deleted the PhysSong:encoding branch Jul 6, 2018

int fd = open( _file.c_str(), O_WRONLY | O_BINARY );
if ( ::write( fd, chunk, len ) != len )
FILE* fp = F_OPEN_UTF8( _file, "wb" );
if ( fwrite( chunk, len, 1, fp ) != len )

This comment has been minimized.

@lukas-w

lukas-w Jul 6, 2018

Member

Only spotted this now: fwritereturns the count of elements successfully written, so in this case it will return 1 on success, not len. Therefore this condition is always leading to a false error message on success (except when coincidentally len == 1).

@lukas-w

lukas-w Jul 6, 2018

Member

Only spotted this now: fwritereturns the count of elements successfully written, so in this case it will return 1 on success, not len. Therefore this condition is always leading to a false error message on success (except when coincidentally len == 1).

This comment has been minimized.

@PhysSong

PhysSong Jul 7, 2018

Member

Thank you! Changed to fwrite( chunk, 1, len, fp ) in 0f3b41f.

@PhysSong

PhysSong Jul 7, 2018

Member

Thank you! Changed to fwrite( chunk, 1, len, fp ) in 0f3b41f.

This comment has been minimized.

@PhysSong

PhysSong Jul 7, 2018

Member

Also synced into master via 170a46e.

@PhysSong

PhysSong Jul 7, 2018

Member

Also synced into master via 170a46e.

PhysSong added a commit that referenced this pull request Jul 27, 2018

Fix broken MIDI import
Fix a regression in 3e538d5 (#4401) that
readAllData doesn't read the file from the beginning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment