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

Add option to choose default patch #4502

Closed
mkruselj opened this issue May 6, 2021 · 4 comments
Closed

Add option to choose default patch #4502

mkruselj opened this issue May 6, 2021 · 4 comments
Labels
Feature Request New feature request UX Issues related to user experience (UX) - mouse, touch, keyboard, MIDI inputs, etc.
Milestone

Comments

@mkruselj
Copy link
Collaborator

mkruselj commented May 6, 2021

On the heels of #1824, we will finally gonna have properly loaded Init Saw by default.

Add an option to User Settings > Patch Defaults > Set current patch as default. Also add it to CPatchBrowser context menu (both LMB and RMB variants), right after "Initialize patch".

@mkruselj mkruselj added Feature Request New feature request UX Issues related to user experience (UX) - mouse, touch, keyboard, MIDI inputs, etc. labels May 6, 2021
@mkruselj mkruselj added this to the Surge XT 1.0 milestone May 6, 2021
@baconpaul
Copy link
Collaborator

We should add a single function like "int SurgeStorage::idForDefaultPatch" which does

int id = -1;
int defPatchname=getUserDefault
int defPatchcat = getUserDefault
foreach( p in patch )
   if( name && cat )
      id = this id
if( id == -1 )
   // not found
   foreach( p ) if name is "init saw" and cat is "templates" id = this id
return id

then call that from the two spots. this way if you delete your default patch you startup. Then have the clients be resilient to a -1 return value.

baconpaul added a commit to baconpaul/surge that referenced this issue Jun 3, 2021
The initial load would ignore the patchid-from-name
guess since we had already found Init Saw. Make it so
we beleive the name with various checks to make sure
that is reasonable. Closes surge-synthesizer#4625.

Also puts the inti patch name and template as a member of
storage and uses that consistently, which is part of the
way to surge-synthesizer#4502.
@baconpaul
Copy link
Collaborator

So in the PR above I added a initPatchName and initPatchCategory variable to SurgeStorage which is consistently used.
So an easy way to close this issue is

  1. Add a menu item to the PatchBorwser which is "Make this my Init Patch"
  2. When you call that do a userDefaultSet for initPatch and initPatchCategory
  3. In the surge storage constructor at the end set the variables to the getDefault with a default of "Init Saw" and "Template"

and bobs your uncle.

@baconpaul
Copy link
Collaborator

Actually I'm just gonna add that to the PR and close this issue along with the other one

baconpaul added a commit to baconpaul/surge that referenced this issue Jun 3, 2021
The initial load would ignore the patchid-from-name
guess since we had already found Init Saw. Make it so
we beleive the name with various checks to make sure
that is reasonable. Closes surge-synthesizer#4625.

Also puts the inti patch name and template as a member of
storage and uses that consistently, and allows a user default
for the patch to use there.  Closes surge-synthesizer#4502.
@baconpaul
Copy link
Collaborator

And done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants