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

Zip file drop #4933

Closed
baconpaul opened this issue Aug 27, 2021 · 5 comments
Closed

Zip file drop #4933

baconpaul opened this issue Aug 27, 2021 · 5 comments
Labels
Content Issues related to Surge bundled content (skins, wavetables, patches...) Feature Request New feature request UX Issues related to user experience (UX) - mouse, touch, keyboard, MIDI inputs, etc.
Milestone

Comments

@baconpaul
Copy link
Collaborator

Drop a zip on surge
And unpacks it in the right spot
Patches wavetables skins the lot
Juce:;zip file will help

@baconpaul baconpaul added the Feature Request New feature request label Aug 27, 2021
@baconpaul baconpaul added this to the Surge XT 1.0 milestone Aug 27, 2021
@mkruselj mkruselj added Content Issues related to Surge bundled content (skins, wavetables, patches...) UX Issues related to user experience (UX) - mouse, touch, keyboard, MIDI inputs, etc. labels Aug 27, 2021
@mkruselj
Copy link
Collaborator

Linking to #3757.

@baconpaul
Copy link
Collaborator Author

And #4814

@baconpaul
Copy link
Collaborator Author

OK for this one it is pretty simple

line 4887 of SurgeGUIEditor.cpp will get called if you drop a .zip file onto surge. Right now it will do nothing. So what should it do?

Well lets assume it is a zip file of mixed wavetables and patches and they ahve directories. So step one I would do is use https://docs.juce.com/master/classZipFile.html to at least print out everything in the zip file. (You will get a variable pointing to the path of the dropped file in SGE.cpp).

Once you have that I would do something like

  1. Prompt to see if you want to unpack it like we do right above for skins
  2. Traverse the zip file with something like
foreach element
    if (element ends with .fxp)
        move the element to userDataPatchesPath / (directory from zip ) / file
   if (element ends with .wav or wt )
       WavetablePath
   if (element ends with .surge-skin)
      SkinsPath

those paths are all fs::path members on surgesotrage which at this point of the code you can get with synth->storage.userPatchesPath or the like.

@cannero
Copy link
Contributor

cannero commented Oct 4, 2021

Hi, currently I'm on this and will create a PR draft in the next days. I just wanted to clarify the structure of the zip file.
Can we assume that no top level directories are used, for example

|- Chords
     |- Minor 7.fxp
     |- Tek Stab.fxp
|- dark-mode.surge-skin
   |- all skin files...

That file we can unzip the content to userPatchesPath and userSkinsPath.

Or is it also possible that the toplevel directories are there?

|- patches
    |- Chords
       |- Minor 7.fxp
       |- Tek Stab.fxp

This file we would unzip to the userDataPath. Or should there be a check that this file is not unzipped?

And again thanks for your suggestion @baconpaul.

@baconpaul
Copy link
Collaborator Author

I think if a user has a top level folder called "patches" we move it into the resulting "userDataPath" and the name is redundant. Assume no top-level directories and let folks clean up if it is otherwise. (We have to choose one or the other, and assuming there isn't a structure is much more flexible)

cannero added a commit to cannero/surge that referenced this issue Oct 6, 2021
The user can drop a zip file on surge, the content is then unzipped to the user
data directory. Afterwards a refresh is done for the different content
types.

Addresses surge-synthesizer#4933
@cannero cannero mentioned this issue Oct 6, 2021
baconpaul pushed a commit that referenced this issue Oct 7, 2021
The user can drop a zip file on surge, the content is then unzipped to the user
data directory. Afterwards a refresh is done for the different content
types.

Addresses #4933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content Issues related to Surge bundled content (skins, wavetables, patches...) Feature Request New feature request UX Issues related to user experience (UX) - mouse, touch, keyboard, MIDI inputs, etc.
Projects
None yet
Development

No branches or pull requests

3 participants