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

Some cleanup around cmake and sfizz_render #206

Merged
merged 7 commits into from
May 4, 2020
Merged

Conversation

jpcima
Copy link
Collaborator

@jpcima jpcima commented May 3, 2020

  • it would not build if SFIZZ_JACK was not set
  • I've edited fmidi such that libfmt can be optional, if we don't use printing APIs (which we don't)
  • in fmidi upstream, I added a script that can roll up the whole source into a single file. (71 kB)
    I have replaced the submodule with this source code, hence 2 submodules less to deal with.

@jpcima
Copy link
Collaborator Author

jpcima commented May 3, 2020

Since sfizz_render was never apparently built on Windows OS (consequence of SFIZZ_JACK), there are the additional changes to make it work.

@jpcima jpcima requested a review from paulfd May 3, 2020 07:12
@@ -143,7 +143,7 @@ int main(int argc, char** argv)
ERROR_IF(!synth.loadSfzFile(sfzPath), "There was an error loading the SFZ file.");
LOG_INFO(synth.getNumRegions() << " regions in the SFZ.");

fmidi_smf_u midiFile { fmidi_smf_file_read(midiPath.c_str()) };
fmidi_smf_u midiFile { fmidi_smf_file_read(midiPath.u8string().c_str()) };
Copy link
Member

Choose a reason for hiding this comment

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

This is under windows? Should we pass native()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The deal here is that Windows native paths are widechar, and fmidi accepts char only.

The other problem of Windows is that char file APIs use the local ANSI codepage instead of UTF-8. This is always a problem when you'd like to open a file which has extended characters in the path.

The commonly accepted resolution to this, it's that you convert the wide path to UTF-8 (u8string), and at app level handle with MultiByteToWideString followed by _wfopen.
(also it's why I introduced the update at 1226a59)

@jpcima jpcima merged commit fab0aaf into sfztools:develop May 4, 2020
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.

2 participants