Old 06-06-2023, 02:20 PM   #1
ARkaine2
Human being with feelings
 
ARkaine2's Avatar
 
Join Date: Feb 2020
Posts: 62
Default (All) Tracks height to Default

Is there any action/script that will do "subj"?..

I searched in ReaPack and found only
Script: cfillion_Reset TCP height of selected tracks to default.lua
^ but the problem is that it works only for selected tracks.

In default actions seems that only:
View: Toggle track zoom to maximum height
View: Toggle track zoom to minimum height
View: Minimize all tracks

ATM I have custom action, that:
View: Minimize all tracks
View: Zoom in vertical
View: Zoom in vertical
View: Zoom in vertical
View: Zoom in vertical
^ but it's laggy.

I need script that "simply":
Reset TCP height of all tracks to default.

Last edited by ARkaine2; 06-06-2023 at 02:25 PM.
ARkaine2 is offline   Reply With Quote
Old 06-06-2023, 02:27 PM   #2
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,272
Default

Use screensets (track views tab) to store and recall track height etc. I saved a default zoom level in my default project for this.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 06-06-2023, 02:54 PM   #3
Juan D'Fall
Human being with feelings
 
Join Date: May 2017
Location: On the Eastern edge of London (UK), almost on the Essex border.
Posts: 180
Default

This is what I did - I made a custom action

Track: select all tracks
Xenakios/SWS: Set selected tracks to height B
Track: Unselect (clear selection of) all tracks

Then I put a button for it on my toolbar.
I did this a long time ago, as far as I can remember, you can fiddle with the actual height settings in the set selected track heights action dialog. You will need SWS installed, though.
Jim
Juan D'Fall is offline   Reply With Quote
Old 06-06-2023, 02:54 PM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Create a custom action to save track selection, select all, run the script then restore track selection.

cfillion is offline   Reply With Quote
Old 06-06-2023, 04:46 PM   #5
Sibben
Human being with feelings
 
Sibben's Avatar
 
Join Date: Oct 2007
Location: Sweden.
Posts: 1,610
Default

Quote:
Originally Posted by Juan D'Fall View Post
This is what I did - I made a custom action

Track: select all tracks
Xenakios/SWS: Set selected tracks to height B
Track: Unselect (clear selection of) all tracks
I use this solution too. Works fine mapped to hotkeys as well.
__________________
REAPER was made for you and me
Sibben is offline   Reply With Quote
Old 06-07-2023, 09:28 AM   #6
ARkaine2
Human being with feelings
 
ARkaine2's Avatar
 
Join Date: Feb 2020
Posts: 62
Default

Thanks for answers, guys.

.

I found answer about SWS helpful
and I opened for myself SWS toggle track height A/B
and "SWS command parameters" where can be specified tracks height A/B
(also workable: SWS: Store/Recall selected tracks heights).

.

Ironically, but
cfillion_Reset TCP height of selected tracks to default
doesn't work with all tracks selected.

.

Sad that (in custom action) still necessary actions save track selection / select all tracks / restore track selection, which makes "blink" of tracks selection,

^ so, it's still preferable to make (desired action of default height all tracks) on script's "level" (as script)

but it's not as laggy as minimze tracks + vertical zoom that I had before.
ARkaine2 is offline   Reply With Quote
Old 06-07-2023, 03:40 PM   #7
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 10,272
Default

Quote:
Originally Posted by ARkaine2 View Post
Sad that (in custom action) still necessary actions save track selection / select all tracks / restore track selection, which makes "blink" of tracks selection,
Wouldn't be the case with my solution above...It's instant and doesn't depend on selection.
__________________
foxyyymusic
foxAsteria is offline   Reply With Quote
Old 06-07-2023, 05:58 PM   #8
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Quote:
Originally Posted by ARkaine2 View Post
Ironically, but
cfillion_Reset TCP height of selected tracks to default
doesn't work with all tracks selected.
Can't duplicate here: creating 8 tracks, changing the heights of each, selecting a random track, then running that custom action correctly resets the height of all tracks in the project here (REAPER 6.79 and 5.99). Got steps to duplicate a bug starting from a blank project?

Quote:
Originally Posted by ARkaine2 View Post
Sad that (in custom action) still necessary actions save track selection / select all tracks / restore track selection, which makes "blink" of tracks selection
This can be solved by creating a SWS Cycle Action instead of a REAPER Custom Action. Cycle Actions have a "Prevent UI refresh" option for this.

(Also this "blink" thing is a Windows-only issue)
cfillion is offline   Reply With Quote
Old 06-07-2023, 09:01 PM   #9
ARkaine2
Human being with feelings
 
ARkaine2's Avatar
 
Join Date: Feb 2020
Posts: 62
Default

Quote:
This can be solved by creating a SWS Cycle Action instead of a REAPER Custom Action. Cycle Actions have a "Prevent UI refresh" option for this.

(Also this "blink" thing is a Windows-only issue)
That's perfect. I didn't know abut this feature.


Quote:
Can't duplicate here: creating 8 tracks, changing the heights of each, selecting a random track, then running that custom action correctly resets the height of all tracks in the project here (REAPER 6.79 and 5.99). Got steps to duplicate a bug starting from a blank project?
Hm, now I can't recreate this.
ATM "cfillion_Reset TCP height of selected tracks to default" (with all tracks selected) minimizes all tracks size, which is probably default track size.
But where is it specified? In Reaper's preferences or somewhere else?
I tried different settings at "Default track height in new projects",
but I use template, so it always creates minimized size new tracks.

Hm, even with "New project tab (ignore default template)" Reaper creates and script makes minimized size tracks.

Hm... Ctrl+Scroll defines it?..
It can be changed/"broken" at any moment.

Last edited by ARkaine2; 06-07-2023 at 09:11 PM.
ARkaine2 is offline   Reply With Quote
Old 06-07-2023, 09:57 PM   #10
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Try adding this line at the end of the script to also reset the project's vertical zoom to the one set in REAPER's preferences:

Code:
reaper.SNM_SetDoubleConfigVar('vzoom3', reaper.SNM_GetIntConfigVar('defvzoom', 6))
(REAPER 6.76 or newer only)
(If it solves the problem I'll release that as a separate script)

Last edited by cfillion; 06-07-2023 at 10:03 PM.
cfillion is offline   Reply With Quote
Old 06-08-2023, 02:45 AM   #11
ARkaine2
Human being with feelings
 
ARkaine2's Avatar
 
Join Date: Feb 2020
Posts: 62
Default

Quote:
local UNDO_STATE_TRACKCFG = 1
local I_HEIGHTOVERRIDE = 'I_HEIGHTOVERRIDE'
local SCRIPT_NAME = ({reaper.get_action_context()})[2]:match("([^/\\_]+)%.lua$")

local didSomething = false

for i=0,reaper.CountSelectedTracks(0)-1 do
local track = reaper.GetSelectedTrack(0, i)

if reaper.GetMediaTrackInfo_Value(track, I_HEIGHTOVERRIDE) > 0 then
if not didSomething then
reaper.Undo_BeginBlock()
didSomething = true
end

reaper.SetMediaTrackInfo_Value(track, I_HEIGHTOVERRIDE, 0)
end
end

if didSomething then
reaper.Undo_EndBlock(SCRIPT_NAME, UNDO_STATE_TRACKCFG)
reaper.TrackList_AdjustWindows(true)
else
reaper.defer(function() end)
reaper.SNM_SetDoubleConfigVar('vzoom3', reaper.SNM_GetIntConfigVar('defvzoom', 6))
end

it's strange, but it works only after click on tracks.
I mean that:
I can select or unselect all / any of tracks,
but the script affects only after (mouse) click on track after using it (this script).

I mean that: in any way it's necessary to:
1. use cfillion_Reset TCP height of selected tracks to default.lua
2. click on track (even if tracks were selected before cfillion_Reset TCP height of selected tracks to default.lua).
ARkaine2 is offline   Reply With Quote
Old 06-08-2023, 10:12 AM   #12
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

In that location it only activates if there are no tracks in the project with a non-default height.

It needs to be at the every end of the script. After the word 'end':


Code:
if didSomething then
  reaper.Undo_EndBlock(SCRIPT_NAME, UNDO_STATE_TRACKCFG)
  reaper.TrackList_AdjustWindows(true)
else
  reaper.defer(function() end)
end

reaper.SNM_SetDoubleConfigVar('vzoom3', reaper.SNM_GetIntConfigVar('defvzoom', 6))
cfillion is offline   Reply With Quote
Old 06-08-2023, 10:39 AM   #13
ARkaine2
Human being with feelings
 
ARkaine2's Avatar
 
Join Date: Feb 2020
Posts: 62
Default

Probably that's "my own" bug, but sometimes/often/each time during track resize happens that tracks resizing to normal/default/medium size after minimizing requires additional action about move selection / zoom / click track etc.

So, if combine (in custom actions) something like:

Script: cfillion_Reset TCP height of selected tracks to default.lua
+
Go to Next/Previous Track

^ It works fine.

Last edited by ARkaine2; 06-08-2023 at 10:49 AM.
ARkaine2 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 05:57 PM.


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