Hi all!
I have made a plugin for
"drag zoom" functionality. I must admit that it doesn't work perfectly the way I wanted (details below), and I still believe this would be quite easy for Reaper developers to implement properly. Anyway, this was an interesting project, and I'm eager to hear your comments!
Big thanks to Xenakios for his tip on finding the time display window.
Notes:
- There are two parts of the time display. In the upper part the cursor is a hand, and horizontal drag scrolls the project backward/forward. Vertical drag does nothing, so it seems perfect to use it for zoom in/out. However, there is a problem - the zoom is not centered around the current position, which "runs away" (especially noticeable when zooming in). The adjustZoom() SDK function has "centermode" parameter, but I couldn't find a magic value to make it work properly (well, I tried -1, 0 and 1
)
- Curiously, in the lower part of the time display adjustZoom() works correctly, regardless of "centermode" parameter! However, in this case it is too easy to accidentally change the time selection by dragging horizontally. To prevent this, I ignore the horizontal mouse movement when zooming in lower part - this helped, but sometimes the time selection still changes.
- The plugin registers an action called "Dragzoom Extension : Show Config" which opens a simple configuration dialog. The dialog has no OK or Cancel buttons - simply closing it (e.g. with Esc key) saves the current settings.
- The "scaling" parameter is used to translate vertical movement in pixels to zoom adjustment factor (first parameter to adjustZoom()) - lower value leads to smoother zoom.
- It would be great to implement drag zoom in the MIDI editor as well, but I'm not sure if it's possible.
Please try the plugin and let me know what you think.