Giter VIP home page Giter VIP logo

Comments (18)

ScottChesworth avatar ScottChesworth commented on September 2, 2024

I'm adding some undo blocks now, giving those points friendlier names that should also work well in other languages (think it'll happen automatically as the action names are already translated).
IMO removing undo points around navigation would need some discussion of the tradeoffs, seeing as navigation is tied to selection. Also... er... I don't know how that would be done yet.

from osara.

ns-studios avatar ns-studios commented on September 2, 2024

@ScottChesworth
I've just tried the build with the changes.
I don't think this is much better. I now get an undo point for every osara chord action.
The previous behavior with the unselect all events did exactly that at worst, but sometimes I would only get the unselect all point when using the chord osara action for the first time when opening the midi editor, and then the following actions wouldn't generate any more undo points until I edited the note and then another one would be generated.
I'm even confused why the unselecting would be happening as I'm not manually selecting events, just navigating through them.

from osara.

pitermach avatar pitermach commented on September 2, 2024

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

Hmm I think something can be done here, but not sure what yet. Agreed that the approach I took earlier isn't it. Will keep experimenting.

from osara.

jcsteh avatar jcsteh commented on September 2, 2024

I'm even confused why the unselecting would be happening as I'm not manually selecting events, just navigating through them.

Navigating through chords or notes selects them, so we have to unselect them when navigating again unless you're doing multiple selection.

You can compress multiple undo points into a single, custom undo point, but i don't know of a way from the API to completely prevent one of REAPER's own undo points. The only thing I can't recall whether I've tried is passing an empty string to Undo_EndBlock, but I very much doubt that'll do it.

from osara.

XHG20033 avatar XHG20033 commented on September 2, 2024

I think the "Unselect all events" undo point is unnecessary most of the time, because when we press the cursor keys, their function is to browse the contents of the MIDI editor, not to change it. Since the event has not changed there is no need to create an undo point.
However, OSARA may need to Unselect all events in the process of browsing notes, but I personally think that at the user level, this step does not need to be presented in most cases. As other friends said, undoing previously made changes requires undoing several "Unselect all events", which is obviously not a good experience.
Or similar to REAPER, provide an option in the settings for users to choose whether to create undo points.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

I can't recall whether I've tried passing an empty string to Undo_EndBlock, but I very much doubt that'll do it.

Tried that just now and nope.

from osara.

jcsteh avatar jcsteh commented on September 2, 2024

I think the "Unselect all events" undo point is unnecessary most of the time, because when we press the cursor keys, their function is to browse the contents of the MIDI editor, not to change it.

That's understood. The key point is that we aren't intentionally generating these undo points. REAPER is and we can't prevent that.

We could try unselecting each selected event ourselves using API calls, rather than executing a REAPER action to do this. My concern is that this might be slow if there are a lot of events selected, whereas REAPER can probably do this faster internally, but I guess it's worth a shot.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

Shall I poke Justin before we refactor things, just in case there's some trick we don't know about using UndoBlock?

from osara.

jcsteh avatar jcsteh commented on September 2, 2024

UP to you. I'd say there's a 99.9% chance we're not missing something, but I guess it can't hurt to ask if you haven't used up your Justin credits this month. :)

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

Done. Will report back when I hear back.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

Yeah we didn't miss anything. Justin says he'll have a think about a way to prevent selection state being included in undo, says he might be able to add an option.

from osara.

ns-studios avatar ns-studios commented on September 2, 2024

That would be cool if there could be an option to not add midi editor selection actions to undo just like Pitermach mentioned there are options for item/track/envelope selection.
Thank you so much for considering this and even forwarding it to the Reaper devs.

Yeah we didn't miss anything. Justin says he'll have a think about a way to prevent selection state being included in undo, says he might be able to add an option.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

So in today's dev build of REAPER, there's a new Undo category in Prefs, and MIDI events is one of the things that can be unchecked. However, right now it doesn't prevent those unselect undo points from showing up. Hmmm. Not sure where to go from here.

from osara.

jcsteh avatar jcsteh commented on September 2, 2024

That feels like a bug. That undo point is generated by REAPER's Unselect all action, so it would seem that undo option isn't applying there?

I wouldn't want this to prevent us from undoing insertion, length changes, etc. We just want to be able to avoid undo points for selection changes in the MIDI editor.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

I've followed up and asked for "Edit: Unselect all" to not generate an undo point. Suppose Justin wants to keep this behaviour though, I'm thinking a new "Edit: Unselect notes" action would meet our needs so long as it was included in the new option, right?

from osara.

jcsteh avatar jcsteh commented on September 2, 2024

I'm slightly concerned that inserting events and lengthening notes might be part of the new undo setting. Are they?

Edit: Unselect notes would be a change in behaviour I think. If you select all, then press right arrow, you kinda expect that pressing delete will only delete the note you just selected. With unselect notes, I think that will end up deleting any CCs that got selected. Though I'm not entirely sure how select all and unselect all behave with respect to CCs, so maybe I'm wrong.

from osara.

ScottChesworth avatar ScottChesworth commented on September 2, 2024

I'm slightly concerned that inserting events and lengthening notes might be part of the new undo setting. Are they?

No. I was clear that we only wanted it effecting selection. Have just verified that inserting and lengthening are both still fine.

from osara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.