Old 01-04-2019, 09:31 AM   #41
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

This is me with focus on track 4 and running the action 3 or four times trying to get back.

Coachz is offline   Reply With Quote
Old 01-04-2019, 09:56 AM   #42
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Ok, I have found some cases where it is not so smart (or rather dumb!), but I have not been able to reproduce all tracks hidden..


A fix is coming shortly...
amagalma is offline   Reply With Quote
Old 01-04-2019, 12:13 PM   #43
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 132
Default

I confirm sometimes the tracks do not come back.

nappies is offline   Reply With Quote
Old 01-04-2019, 03:33 PM   #44
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,457
Default

Cool idea!

On version 1.2, If run action in this order,..
media item, envelope, envelope, media item

I get error,..
amagalma_Smart contextual zoom.lua:522: bad argument #3 to 'JS_Window_SetScrollPos' (number expected, got nil)
Edgemeal is offline   Reply With Quote
Old 01-05-2019, 06:00 AM   #45
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 634
Default

Quote:
Originally Posted by amagalma View Post
I've just uploaded v1.2

Changelog

-- Fixed display correct scroll position when returning from zoom to envelope mode

-- Behavior change: running the script in empty arrange area, it always zooms to the track under mouse (and not the selected ones)

-- Behavior change: running the script over a track in TCP: if selected tracks < 2 then zooms to track under mouse, else to the selected tracks

-- Behavior change: running the script over an item: if selected items < 2 then zooms to item under mouse, else to the selected items

-- Some code optimization

I updated the usage info in the first post.

Super good. Now much better!!

Still... is there the possibility somehow to zoom both to item AND selection ? Many times I just need to magnify a part of an item

thanmks
g
Gianfini is offline   Reply With Quote
Old 01-05-2019, 09:48 AM   #46
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 634
Default

Quote:
Originally Posted by Gianfini View Post
Super good. Now much better!!

Still... is there the possibility somehow to zoom both to item AND selection ? Many times I just need to magnify a part of an item

thanmks
g
Suggestion
- if a time selection exists and mouse overs the selected part of an item it zooms items to selection
- if a time selection exists but mouse overs outside the selected part all item (or track) is zoomed in)
- if 3 items are selected and a time selection Exists if mouse overs the time selection of one of the items all three are zoomed to time selection

...

g
Gianfini is offline   Reply With Quote
Old 01-05-2019, 04:23 PM   #47
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

I will add more functionality when I iron out all the bugs first.


I am almost there.. I need a few days more to fix the last ones (hopefully)
amagalma is offline   Reply With Quote
Old 01-06-2019, 04:34 AM   #48
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,172
Default

Many thanks. We all stay tuned.
Eliseat is offline   Reply With Quote
Old 01-06-2019, 05:43 AM   #49
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 4,780
Default

I still experience the vanishing Tracks bug with the latest Script release.
Also the script doesn't work as a Zoom Toggle but i am yet unsure of this is just intended behaviour of the Script.

Warm Regards.
OSX 10.14.2.
Reaper - always latest (pre)release.
vanhaze is offline   Reply With Quote
Old 01-06-2019, 11:41 AM   #50
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

v1.5 uploaded to ReaPack

Changelog:

-- Major re-work of code
-- Fixed several corner-cases which resulted to buggy behavior
-- Improved debugging code
-- Script now offers to install js_ReaScriptAPI extension if not present
amagalma is offline   Reply With Quote
Old 01-06-2019, 12:12 PM   #51
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

I updated to 1.5 but no I get no zooming at all
Coachz is offline   Reply With Quote
Old 01-06-2019, 12:52 PM   #52
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

On a new project or on a project you had already used the script?

If it is the latter then use this script once, without having zoomed:
Code:
local clear = {"Env_ID", "SavedTCPView", "V_Scroll", "SavedArrangeView", "hType", "vType", "Env_Scroll"}
for i = 1, #clear do
  reaper.SetProjExtState( 0, "Smart Zoom", clear[i], "")
end

Last edited by amagalma; 01-06-2019 at 01:05 PM.
amagalma is offline   Reply With Quote
Old 01-06-2019, 01:08 PM   #53
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

I tried it on multiple projects that I have not used it on before.
Coachz is offline   Reply With Quote
Old 01-06-2019, 01:40 PM   #54
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

I can't think of any other reason it shouldn't work.. Try to remove it from the action list and re-install it.

("Browse ReaPack packages" from Action List, locate script, right-click -> re-install)
amagalma is offline   Reply With Quote
Old 01-06-2019, 01:48 PM   #55
nappies
Human being with feelings
 
nappies's Avatar
 
Join Date: Dec 2017
Posts: 132
Default

Seems it works great for me now!Checked it in detail) No bugs! Thank you!
nappies is offline   Reply With Quote
Old 01-06-2019, 01:54 PM   #56
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 2,964
Default

Works for me, too.
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 01-06-2019, 02:28 PM   #57
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

It works here now too. I had put focus on a track and was running the script from the actions window. no bueno. Assigned a shortcut key and it works.

Is it supposed to zoom when I do a marquee select items ? I can't have it doing that when I'm just selecting items.
Coachz is offline   Reply With Quote
Old 01-06-2019, 02:39 PM   #58
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Please check the first post of this thread. It has info on what it does and how to use it
amagalma is offline   Reply With Quote
Old 01-06-2019, 02:59 PM   #59
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

If i'm reading correctly then when I select media items it's going to automatically zoom. grrrr
Coachz is offline   Reply With Quote
Old 01-06-2019, 03:21 PM   #60
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Nope! It does not do anything automatically.. You have to press the hotkey you assigned in order to zoom.


Quote:
4) Hover mouse over an item and press the hotkey: if less than two items are selected, then the item under the mouse gets maximized. If two or more items are selected, then these items get maximized. Press hotkey again over any item to return to initial Arrange view state.
amagalma is offline   Reply With Quote
Old 01-06-2019, 03:25 PM   #61
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

This is with 3 media items selected and hovering mouse over when activated.


Last edited by Coachz; 01-06-2019 at 03:40 PM.
Coachz is offline   Reply With Quote
Old 01-06-2019, 04:34 PM   #62
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

I can't understand what is happening. It seems like you keep pressed the hotkey down and zooming in to things at random.

What do you want to do? What are you doing? What do you expect to happen? And what happens?
amagalma is offline   Reply With Quote
Old 01-06-2019, 04:40 PM   #63
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

Quote:
Originally Posted by amagalma View Post
I can't understand what is happening. It seems like you keep pressed the hotkey down and zooming in to things at random.

What do you want to do? What are you doing? What do you expect to happen? And what happens?
I press the key to zoom in on the 3 selected items and when I press the key again it does not return to the previous zoom state. And when I continue pressing it, you can see what it does.
Coachz is offline   Reply With Quote
Old 01-06-2019, 05:04 PM   #64
poplomop
Human being with feelings
 
Join Date: Jan 2010
Posts: 191
Default

I think you first have to move the mouse so it is over one of the items and then press the key to return to the previous zoom state.
poplomop is offline   Reply With Quote
Old 01-06-2019, 05:06 PM   #65
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

you nailed it, that works much better ! Thanks
I'm old and feeble.
Coachz is offline   Reply With Quote
Old 01-06-2019, 05:21 PM   #66
poplomop
Human being with feelings
 
Join Date: Jan 2010
Posts: 191
Default

Hey no problem I like the probing questions man! Very helpful.
poplomop is offline   Reply With Quote
Old 01-07-2019, 03:19 AM   #67
dupont
Human being with feelings
 
dupont's Avatar
 
Join Date: Nov 2007
Location: France
Posts: 639
Default

API is not loaded when I press OK on Install js_ReaScriptAPI extension box.
dupont is offline   Reply With Quote
Old 01-07-2019, 03:19 AM   #68
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,841
Default

Quote:
Originally Posted by dupont View Post
API is not loaded when I press OK on Install js_ReaScriptAPI extension box.
REAPER must be restarted for the extension to be loaded once installed. You might also need to install it from the package browser first.

(This can be somewhat automated by the script using reaper.ReaPack_BrowsePackages('js_ReascriptAPI'))

Last edited by cfillion; 01-07-2019 at 03:25 AM.
cfillion is online now   Reply With Quote
Old 01-07-2019, 03:57 AM   #69
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Quote:
Originally Posted by cfillion View Post
REAPER must be restarted for the extension to be loaded once installed. You might also need to install it from the package browser first.

(This can be somewhat automated by the script using reaper.ReaPack_BrowsePackages('js_ReascriptAPI'))

Oh, I forgot that part, because I have "install new packages when synchronizing" enabled here, which is not the default setting. I will add the missing code. Thanks!
amagalma is offline   Reply With Quote
Old 01-07-2019, 05:28 AM   #70
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 634
Default

Quote:
Originally Posted by amagalma View Post
I can't understand what is happening. It seems like you keep pressed the hotkey down and zooming in to things at random.

What do you want to do? What are you doing? What do you expect to happen? And what happens?
It also happened to me.It somehow changed the default track height so when pressing Hot Key again it was returning to a "higher" height than original.

Strange, not easy to reprocuce, it has something to do with Envelopes when they are present but not shown in a separate lane.

I'll try to find out a pattern that reproduces the issue more consistently

g
Gianfini is offline   Reply With Quote
Old 01-07-2019, 05:58 AM   #71
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Quote:
Originally Posted by amagalma View Post
Oh, I forgot that part, because I have "install new packages when synchronizing" enabled here, which is not the default setting. I will add the missing code. Thanks!

@cfillion & juliansader: I tried to improve the code and automate the js_ReaScriptAPI installation as much as possible, but found several difficulties (for example I cannot get the PackageEntry entry). So, I kindly ask you, if you have the time, could you provide the optimal code that looks if the js_ReaScriptAPI v0.961 and higher is installed and if not, to install it with as little user intervention as possible?
This code would be extremely helpful for any scripter making scripts that use this extension, and could incorporate it to his/her scripts. Alternatively, it could be a script on its own that any scripter could import to his/her script with dofile. Another possibility, would be to install said extension by default with ReaPack.


Thanks!
amagalma is offline   Reply With Quote
Old 01-07-2019, 06:13 AM   #72
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Quote:
Originally Posted by Gianfini View Post
It also happened to me.It somehow changed the default track height so when pressing Hot Key again it was returning to a "higher" height than original.

Strange, not easy to reprocuce, it has something to do with Envelopes when they are present but not shown in a separate lane.

I'll try to find out a pattern that reproduces the issue more consistently

g

If you can find the steps to reproduce, then I' ll try to fix it! Thanks!
amagalma is offline   Reply With Quote
Old 01-08-2019, 05:54 AM   #73
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

A few changes in recent versions:


v1.51: Improved js_ReaScriptAPI extension installation, if not present
v1.53:
# Behavior change: When zoomed to tracks, zooming to items zooms only horizontally, so when zooming out you don't loose previous track zoom
# New: when run over empty TCP area, it fits vertically all (as many as possible) tracks into view (no toggle action)
# Various optimizations
amagalma is offline   Reply With Quote
Old 01-08-2019, 06:46 AM   #74
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

You have made a very useful tool. Thanks very much ! The new zooming track and items on track works nicely too. You are rocking the casbah !

https://www.youtube.com/watch?v=0pCFVX6lzHU
Coachz is offline   Reply With Quote
Old 01-08-2019, 02:11 PM   #75
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 634
Default

Ok
0. create a time selection
1. zoom in a item: ok item zoomed
2. zoom in a time selection: ok item+time selection zoomed
3. hit hot key on the item : time selection zoom goes away
4. hit hot key again on to the item: item zoom goes away but time selection zoom comes back

No way to get back to original zoom level...

the selection stay zoomed

Potential solutions
- the easy one: second hot key hit always get back to un-zoomed level, it is NOT possible to combine zooms. This way you never get to a uneasy status
- solution two: create upon HOT KEY on point 3. should un-zoom item NOT un-zoom selection

complex?

Noooo

g
Gianfini is offline   Reply With Quote
Old 01-09-2019, 04:02 AM   #76
dupont
Human being with feelings
 
dupont's Avatar
 
Join Date: Nov 2007
Location: France
Posts: 639
Default

Quote:
Originally Posted by amagalma View Post
Oh, I forgot that part, because I have "install new packages when synchronizing" enabled here, which is not the default setting. I will add the missing code. Thanks!
Updated, thanks.
dupont is offline   Reply With Quote
Old 01-09-2019, 07:34 AM   #77
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Quote:
Originally Posted by Gianfini View Post
Ok
0. create a time selection
1. zoom in a item: ok item zoomed
2. zoom in a time selection: ok item+time selection zoomed
3. hit hot key on the item : time selection zoom goes away
4. hit hot key again on to the item: item zoom goes away but time selection zoom comes back

No way to get back to original zoom level...

the selection stay zoomed

Potential solutions
- the easy one: second hot key hit always get back to un-zoomed level, it is NOT possible to combine zooms. This way you never get to a uneasy status
- solution two: create upon HOT KEY on point 3. should un-zoom item NOT un-zoom selection

complex?

Noooo

g

I have to think about that.. I don't think it is or should be possible to return to initial view after having zoomed two times on two different things on the same axis (item & time selection). But in any case, in step 4, time selection should not come back, so this is a bug. I would expect it to go to full item zoom horizontally, considering how the script works.


Quote:
- the easy one: second hot key hit always get back to un-zoomed level, it is NOT possible to combine zooms. This way you never get to a uneasy status

This would of course prevent uneasy cases, but it would limit a lot the functionality of the script. I don't want it to be a single toggle, I want the zooming in the two axes to be independent. Zooming to items is the only mode that zooms both vertically and horizontally.


Quote:
- solution two: create upon HOT KEY on point 3. should un-zoom item NOT un-zoom selection

This is doable.. And I think is what should happen ideally.. but it requires a major modification of the code, which may break other things (I should add a second buffer for storing the time selection zoom and make it independent from the other horizontal zooms: region, items). For the time being I do not change anything, before I think well about it and if this is the way to go.
amagalma is offline   Reply With Quote
Old 01-09-2019, 07:44 AM   #78
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 2,964
Default

I'm not in front of a computer now, but wouldn't it be possible to store a zoom snapshot (I'm sure there's an action for it), use the smart zoom and in case you want to undo everything, just restore the zoom snapshot?
__________________
My Reascripts forum thread | My Reascripts on GitHub | Stephan Römer - film composer
If you wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is online now   Reply With Quote
Old 01-09-2019, 08:04 AM   #79
Coachz
Human being with feelings
 
Coachz's Avatar
 
Join Date: Oct 2010
Location: Charleston, SC USA
Posts: 7,351
Default

Quote:
Originally Posted by _Stevie_ View Post
I'm not in front of a computer now, but wouldn't it be possible to store a zoom snapshot (I'm sure there's an action for it), use the smart zoom and in case you want to undo everything, just restore the zoom snapshot?
I like that idea. I currently have a keystroke assigned to the smart Zoom and if it was to save a snapshot and also have a separate script for restoring the snapshot I could simply make shift plus my shortcut key or whatever restore me back to the beginning.
Coachz is offline   Reply With Quote
Old 01-09-2019, 08:22 AM   #80
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,509
Default

Quote:
Originally Posted by _Stevie_ View Post
I'm not in front of a computer now, but wouldn't it be possible to store a zoom snapshot (I'm sure there's an action for it), use the smart zoom and in case you want to undo everything, just restore the zoom snapshot?

There are the SWS: Save current arrange view, slot x and SWS: Restore arrange view, slot x actions, but these store both axes (horizontal and vertical) plus they can't be recalled if you close and re-open Reaper or the Project (they are saved in to memory).


My script saves into the project so everything can be recalled. For example try this: create a test project with 10 tracks. Run the SWS action to store the arrange view. Now hide all tracks. Run the action to recall, everything ok. Imagine you want to edit track 4 and want to see it maximized next to track 10. Hide all tracks except 4 & 10. Run the SWS action and store arrange. Save the project (because you don't want to loose any edits). Close Reaper and go play tennis (ok, this is not mandatory :P ), come back. Reopen your project. It's how you left it, BUT you cannot use the SWS action to recall the initial view. It is lost. You either have to do it manually or you should not have saved the project while editing.. These problems do not exist with my solution (saving data into project).
amagalma is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.