Old 06-30-2020, 02:02 AM   #1
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 440
Default B_HEIGHTLOCK returns 0?

I am trying to read/write the status of track height lock but this line of code always returns 0. Doc says function should return bool.

Code:
local vlock = reaper.GetMediaTrackInfo_Value(xtrack, 'B_HEIGHTLOCK')
Set doesn't seem to work either.

Code:
local vlock = reaper.SetMediaTrackInfo_Value(xtrack, 'B_HEIGHTLOCK', 1.0)
or

Code:
local vlock = reaper.SetMediaTrackInfo_Value(xtrack, 'B_HEIGHTLOCK', true)
-- doc says double for the param not bool?
xtrack contains GUID, all other track functions work on the GUID.

Running the SWS Lock/Unlock Height works SOMETIMES as expected but the status of the above lines never change, always returns 0.0

Searched for more info and came up empty. Anyone have any more info on this? Would like to be able to set height and then lock it.
Steviebone is offline   Reply With Quote
Old 06-30-2020, 02:51 AM   #2
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 440
Default

I also noticed that if I run the SWS lock/unlock toggle it affects whether or not the track height can be set below the threshold where the controls disappear, like tiny in foldercompact.
Steviebone is offline   Reply With Quote
Old 06-30-2020, 06:18 AM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

The doc for B_HEIGHTLOCK says:
Quote:
B_HEIGHTLOCK : bool * : track height lock (must set I_HEIGHTOVERRIDE before locking)
So this seems to work here:
Code:
tr = reaper.GetTrack(0,0)
overrideSetOK = reaper.SetMediaTrackInfo_Value(tr, "I_HEIGHTOVERRIDE", 96)
heightlockSetOK = reaper.SetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK", 1) -- lock trackheight
isLocked = reaper.GetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK") -- returns 1.0 (locked)

Last edited by nofish; 06-30-2020 at 06:29 AM.
nofish is offline   Reply With Quote
Old 06-30-2020, 07:39 AM   #4
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 440
Default

Quote:
Originally Posted by nofish View Post
The doc for B_HEIGHTLOCK says:


So this seems to work here:
Code:
tr = reaper.GetTrack(0,0)
overrideSetOK = reaper.SetMediaTrackInfo_Value(tr, "I_HEIGHTOVERRIDE", 96)
heightlockSetOK = reaper.SetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK", 1) -- lock trackheight
isLocked = reaper.GetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK") -- returns 1.0 (locked)
I tried this:

Code:
tr = reaper.GetSelectedTrack(0,0)
overrideSetOK = reaper.SetMediaTrackInfo_Value(tr, "I_HEIGHTOVERRIDE", 96)
heightlockSetOK = reaper.SetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK", 1) -- lock trackheight
isLocked = reaper.GetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK") -- returns 1.0 (locked)
reaper.ShowConsoleMsg(isLocked)
But it still returns 0.0?

Must be something else going on...

Also... as an aside... in order to get the trackheight tiny (like a collapsed state under 10 pixels) I have to toggle SWS Unlock Track Height first, otherwise track controls remain visible. What is SWS toggl;e action doing that reaper.SetMediaTrackInfo_Value(tr, "B_HEIGHTLOCK", 1) isn't?

Last edited by Steviebone; 06-30-2020 at 07:52 AM.
Steviebone is offline   Reply With Quote
Old 06-30-2020, 09:59 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 658
Default

I'm not sure but I think, this had been brought up as bugreport recently but I might be wrong.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-30-2020, 09:15 PM   #6
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 440
Default

Thanks for the input. I did a search for B_HEIGHTLOCK but the search functions on vBulletin aren't the greatest and I simply don't have the time to spend hours searching for a needle in a haystack. I have found a work around for my specific needs and moved on. However, if anyone can point me to a link I am happy to look at it.
Steviebone is offline   Reply With Quote
Old 07-01-2020, 05:39 AM   #7
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,729
Default

You can use the Google custom forum search (which is way better than the vBulletin search imo):
https://cse.google.com/cse?cx=002458...08:nbhva-j9iic

For API reference I usually use X-Raym's version (has a handy functions filter):
https://www.extremraym.com/cloud/reascript-doc/
nofish 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 12:40 AM.


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