Old 02-27-2020, 07:49 AM   #961
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Quote:
Originally Posted by juliansader View Post
Is Metal enabled in your REAPER preferences? Perhaps the OSX blitting bug that I recently encountered is not limited to writing *to* Metal windows, but also reading *from* them.
Oh, good point. Will have a try...
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 02-27-2020, 09:58 AM   #962
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Made no difference, as Metal was enabled.
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 02-27-2020, 12:58 PM   #963
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default js_ReaScriptAPI is BROKEN by Reaper 6.04

js_ReaScriptAPI appears to be broken by Reaper 6.04. Various calls have stopped working.

Anybody know anything about this?
cohler is offline   Reply With Quote
Old 02-27-2020, 01:06 PM   #964
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default js_ReaScriptAPI broken by Reaper 6.04

Hi Julian,

Your ReaScriptAPI is FANTASTIC! But it is apparently broken by Reaper 6.04. Any idea when it can be fixed? Or when Reaper 6.04 can be fixed?
cohler is offline   Reply With Quote
Old 02-27-2020, 01:28 PM   #965
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

Quote:
Originally Posted by cohler View Post
js_ReaScriptAPI appears to be broken by Reaper 6.04. Various calls have stopped working.

Anybody know anything about this?
Could you please give more details about your DAW and the problems you are seeing? Which calls have stopped working?

(The functions that I have tested still seem to be working fine on my Window x64 system, with REAPER v6.04 and extension v0.999.)
juliansader is offline   Reply With Quote
Old 02-27-2020, 05:02 PM   #966
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,680
Default

Quote:
Originally Posted by juliansader View Post
Try:
Code:
local r, g, b = reaper.ColorFromNative(reaper.GetTrackColor(track))
color_for_LICE = 0xFF000000 | (r<<16) | (g<<8) | b
Works great, Thanks!
Edgemeal is offline   Reply With Quote
Old 02-28-2020, 08:20 AM   #967
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by juliansader View Post
Could you please give more details about your DAW and the problems you are seeing? Which calls have stopped working?

(The functions that I have tested still seem to be working fine on my Window x64 system, with REAPER v6.04 and extension v0.999.)
reaper.JS_Window_GetTitle doesn't work on REAPER 6.04 on Mac OS X 10.12 running v0.998 of your software.

But it does work on REAPER 6.03.
cohler is offline   Reply With Quote
Old 02-28-2020, 08:22 AM   #968
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Could you try again with version 0.999, which is the latest?
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 02-28-2020, 08:26 AM   #969
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by juliansader View Post
Could you please give more details about your DAW and the problems you are seeing? Which calls have stopped working?

(The functions that I have tested still seem to be working fine on my Window x64 system, with REAPER v6.04 and extension v0.999.)
By the way, is there any way in your software to find out which windows are docked in which docks, and then to find the current height of dock in the Main window? I've been searching for a few hours now and haven't found anything that can do that. What am I missing?
cohler is offline   Reply With Quote
Old 02-28-2020, 08:44 AM   #970
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

No there isn't. The docking of windows is still an area full of feature requests.

You can support my feature-request for more docker-related functions:

https://forum.cockos.com/showthread....ghlight=docker

This could help, maybe.
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 02-28-2020, 10:31 AM   #971
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

Quote:
Originally Posted by cohler View Post
By the way, is there any way in your software to find out which windows are docked in which docks, and then to find the current height of dock in the Main window? I've been searching for a few hours now and haven't found anything that can do that. What am I missing?
Docked windows are a hassle, as discussed in this, this and this thread. I haven't tried this myself, but off the top of my head the native function DockIsChildOfDock can perhaps help you find out which windows are docked in which docks, the extension's GetParent can then find the dock, and the GetRect functions can give the height of the dock.
juliansader is offline   Reply With Quote
Old 02-28-2020, 05:28 PM   #972
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default How about Scrolling on Mac?

JS_Window_SetScroll and JS_Window_GetScroll don't seem to work at all on Mac (at least for the main HWND; I haven't tried it on other windows).

CSurf_OnScroll seems to work but it allows scrolling only in increments of 8 pixels.

Any solution for this?
cohler is offline   Reply With Quote
Old 02-29-2020, 11:50 AM   #973
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,680
Default

@ juliansader,

For JS_Composite() docs says, "If dstw or dsth is -1, the bitmap will be stretched to fill the width or height of the window", but using -1 doesn't work. Finally googled the function name and found a script by Sexan and noticed he's using 1,1 for these params. So I tried 1,1 instead of -1,-1 and now my code is working as expected.

Maybe its just me but the docs seems confusing, shouldn't it say, "If dstw or dsth are 1" (a positive one) instead of -1, or the API function in the extension needs updating?

Last edited by Edgemeal; 02-29-2020 at 12:17 PM.
Edgemeal is offline   Reply With Quote
Old 02-29-2020, 12:25 PM   #974
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

It should definitely be "-1". Sexan uses "1" for the srcw and srch, because his source bitmaps are only single pixels.

I don't think he ever uses the dstw = -1 or dsth = -1 options, because the Area51 selections don't cover the whole destination window.

Last edited by juliansader; 02-29-2020 at 12:54 PM.
juliansader is offline   Reply With Quote
Old 02-29-2020, 12:50 PM   #975
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

Quote:
Originally Posted by cohler View Post
JS_Window_SetScroll and JS_Window_GetScroll don't seem to work at all on Mac (at least for the main HWND; I haven't tried it on other windows).

CSurf_OnScroll seems to work but it allows scrolling only in increments of 8 pixels.

Any solution for this?
I quickly checked the scrolling functions on my High Sierra x64, REAPER v6.04, and they seem to work fine on my system. Please check the following:

* To scroll a child window, you must pass the HWND of that child window, not the parent window. In your case, I assume that you are trying to scroll the arrange view, which is a child window with ID = 1000, IIRC.

* REAPER doesn't like scrolling outside the boundaries of the project, so if the script tries to do that with the SetScrollPos function, REAPER will ignore the request.

(N.B: The scrolling functions can only politely request a window to scroll, and it is up to the window to accept the request or not.)
juliansader is offline   Reply With Quote
Old 02-29-2020, 03:56 PM   #976
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by juliansader View Post
I quickly checked the scrolling functions on my High Sierra x64, REAPER v6.04, and they seem to work fine on my system. Please check the following:

* To scroll a child window, you must pass the HWND of that child window, not the parent window. In your case, I assume that you are trying to scroll the arrange view, which is a child window with ID = 1000, IIRC.
Great, thank you! That solved the problem. Is there a spec somewhere, that lists the standard IDs of the various child windows of the MainHwnd? GetLongPtr doesn't actually return any long integer pointers. It only apparently returns Userdata which can't be accessed in Lua. Or is there another way to get the integer IDs of windows?
cohler is offline   Reply With Quote
Old 02-29-2020, 04:52 PM   #977
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by cohler View Post
Great, thank you! That solved the problem. Is there a spec somewhere, that lists the standard IDs of the various child windows of the MainHwnd? GetLongPtr doesn't actually return any long integer pointers. It only apparently returns Userdata which can't be accessed in Lua. Or is there another way to get the integer IDs of windows?
I figured it out. GetLong (not GetLongPtr) returns integers with parameter "ID".
cohler is offline   Reply With Quote
Old 03-01-2020, 11:29 AM   #978
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,680
Default

Quote:
Originally Posted by juliansader View Post
It should definitely be "-1". Sexan uses "1" for the srcw and srch, because his source bitmaps are only single pixels.
Thanks for the reply, changed some code around and I think things are starting to sink in! Sorry to be a bother!
Edgemeal is offline   Reply With Quote
Old 03-03-2020, 11:11 AM   #979
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 556
Default

Dear JS:

I'm thinking about trying my own attempt at an area selection script using your extension.

Would you by chance know if the following functions work cross-platform?

SetStyle(specifically for "POPUP"), SetOpacity("ALPHA"), and GetClientRect.

My fuzzy idea to get the script working is to overlay a transparent window over the arrange view window of REAPER, in order to intercept mouse action, intercept key presses (if necessary), and draw graphics.
__________________
My Scripts
Dafarkias is offline   Reply With Quote
Old 03-03-2020, 11:57 AM   #980
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

All three of these functions are supposed to work cross-platform -- unless REAPER v6.0's new Metal graphics messed up SetStyle and SetOpacity.

Writing a new AS script would be a horrendously big undertaking. Perhaps you should rather build on Sexan's code? (He actually pleaded for other scripters to get involved.)
juliansader is offline   Reply With Quote
Old 03-03-2020, 12:35 PM   #981
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,369
Default

Or maybe just wait for REAPER 6.1 in the hope that area selection will make it lit? I don't want to discourage you, but area selection is something that needs to be weaved so deeply into REAPER, that I don't think a script will be easy to maintain on the long run.
__________________
My Reascripts forum thread | My Reascripts on GitHub
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 03-03-2020, 01:16 PM   #982
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: England
Posts: 556
Default

It's just a wild hair.

If my enthusiasm fizzes out or I hit an impasse, no harm no foul...
__________________
My Scripts
Dafarkias is offline   Reply With Quote
Old 03-05-2020, 05:00 AM   #983
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 643
Default

I just used this API to make a command that opens the video window in the spot where the main toolbar is above the TCP.

I'm on mac and I can't get the video window to be frameless with no titlebar using "POPUP". Is this possible, even ?

Here's my code can anyone help?

Code:

   V_win = reaper.JS_Window_Find("Video Window ", false )
   
   if not V_win then
   
   reaper.Main_OnCommand(50125, 0) -- toggle video window
   Video = reaper.JS_Window_FindTop( 'Video Window', 1 )
   retval, ZOrder, flags = reaper.JS_Window_SetPosition( Video, 0, 884, 187, 148, TOPMOST, POPUP )
  -- retval, style = reaper.JS_Window_SetStyle( Video, POPUP )
  
   end
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is online now   Reply With Quote
Old 03-05-2020, 11:09 AM   #984
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

Quote:
Originally Posted by Triode View Post
I'm on mac and I can't get the video window to be frameless with no titlebar using "POPUP". Is this possible, even ?
"POPUP" should be a string with quotation marks, not just POPUP.
juliansader is offline   Reply With Quote
Old 03-05-2020, 11:27 AM   #985
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 643
Default

Thanks!

FYI that works with reaper.JS_Window_SetStyle
but not reaper.JS_Window_SetStyle

as far as I can tell
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is online now   Reply With Quote
Old 03-14-2020, 07:27 PM   #986
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Quote:
Originally Posted by Triode View Post
Thanks!

FYI that works with reaper.JS_Window_SetStyle
but not reaper.JS_Window_SetStyle

as far as I can tell
It works with the function, with which it doesn't work? Hmmm....

__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 03-15-2020, 01:57 PM   #987
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default Dimmed menu items

Are there any functions in your ReaScript extension (or is there another method) wherein one could create Reaper menu items that would be greyed out or not based on programmable criteria? Sorry if this has already been discussed elsewhere, but I haven't been able to find anything...
cohler is offline   Reply With Quote
Old 03-15-2020, 02:27 PM   #988
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 643
Default

Quote:
Originally Posted by mespotine View Post
It works with the function, with which it doesn't work? Hmmm....

Sorry yes that was a cut and paste error.

I meant that I couldn't get the window style to change using reaper.JS_Window_SetPosition
but I could with reaper.JS_Window_SetStyle
(I'm on mac)
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is online now   Reply With Quote
Old 03-17-2020, 09:05 AM   #989
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 458
Default "JS_Dialog_BrowseForOpenFiles" Window Title

Why can't I see the window title on this command?

Code:
reaper.JS_Dialog_BrowseForOpenFiles('title', path, '', 'filetype (.RPL)\0*.RPL\0\0', false)

For Save it works great:
Code:
reaper.JS_Dialog_BrowseForSaveFile('title', path, '', 'filetype (.RPL)\0*.RPL\0\0')

I'm on mac
__________________
MP 12 Core 3.46GHZ 48GB OSX10.11.6, MBP 15" 2012 OSX10.12, RME Fireface UFX, MCU,
Reaper 5, SD2, Omnisphere, Wave Altiverb, PSP, VB3, Izotope, Scuffham, Soundtoys 5, Slate All Plugins.
lexaproductions is offline   Reply With Quote
Old 03-17-2020, 11:20 AM   #990
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

Quote:
Why can't I see the window title on this command?

I'm on mac
Since El Capitan, Apple has removed custom captions from standard File Open dialogs. It is possible to "hack" captions by displaying the custom title as a message on top of the dialog, but Cockos's WDL/swell hasn't implemented this:


* macOS file open dialogs don't provide a dropdown list for the extension filter -- instead, all extensions in the list are enabled

* the "Open" button is only enabled once a file (with an acceptable extension) is selected.
juliansader is offline   Reply With Quote
Old 03-17-2020, 12:12 PM   #991
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Quote:
Originally Posted by cohler View Post
Are there any functions in your ReaScript extension (or is there another method) wherein one could create Reaper menu items that would be greyed out or not based on programmable criteria? Sorry if this has already been discussed elsewhere, but I haven't been able to find anything...
You mean in regular menus, like File, Edit, View, etc?
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 03-17-2020, 04:13 PM   #992
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by mespotine View Post
You mean in regular menus, like File, Edit, View, etc?
Yes the regular menus.
cohler is offline   Reply With Quote
Old 03-17-2020, 04:40 PM   #993
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 2,034
Default

Ok, I doubt the regular menus are possible to set, but the c++-only part of the API has some functions, related to menus.
Maybe exposing them can help, maybe not. At least you can add customizeable menus somehow, but I never tried, as I code Lua only:

https://mespotin.uber.space/Ultrasch...stomizableMenu
https://mespotin.uber.space/Ultrasch...nsionsMainMenu
https://mespotin.uber.space/Ultrasch...stomizableMenu
https://mespotin.uber.space/Ultrasch...GetContextMenu
https://mespotin.uber.space/Ultrasch...iftSubModeMenu
https://mespotin.uber.space/Ultrasch...essActionsMenu
https://mespotin.uber.space/Ultrasch..._reprocessMenu

@julian
Would it be possible to expose them, so we can toy around with them?
__________________
Pronounce me with she/her, when referencing me, please. Thanks :)
Ultraschall-API - 1111 ReaScript functions for Reaper
Reaper Internals - Developerdocs4Reaper
mespotine is offline   Reply With Quote
Old 03-17-2020, 04:44 PM   #994
cohler
Human being with feelings
 
Join Date: Dec 2018
Posts: 93
Default

Quote:
Originally Posted by mespotine View Post
Ok, I doubt the regular menus are possible to set, but the c++-only part of the API has some functions, related to menus.
Maybe exposing them can help, maybe not. At least you can add customizeable menus somehow, but I never tried, as I code Lua only:

https://mespotin.uber.space/Ultrasch...stomizableMenu
https://mespotin.uber.space/Ultrasch...nsionsMainMenu
https://mespotin.uber.space/Ultrasch...stomizableMenu
https://mespotin.uber.space/Ultrasch...GetContextMenu
https://mespotin.uber.space/Ultrasch...iftSubModeMenu
https://mespotin.uber.space/Ultrasch...essActionsMenu
https://mespotin.uber.space/Ultrasch..._reprocessMenu

@julian
Would it be possible to expose them, so we can toy around with them?
It seems like there should be a simple way to do this. REAPER boasts of its customizable menus. And indeed, several of its internal functions grey out menu items and report various info (like last executed command etc...). It would seem like this capability would be the FIRST thing one would design into a "customizable" menu interface. But perhaps, this is just another in the long list of things that the developers forgot to do?
cohler is offline   Reply With Quote
Old 03-18-2020, 04:49 AM   #995
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 458
Default

Well in a reascript right-click menu, titles that starts with # will be grayed out.
Dunno if it can work in regular menu.
__________________
MP 12 Core 3.46GHZ 48GB OSX10.11.6, MBP 15" 2012 OSX10.12, RME Fireface UFX, MCU,
Reaper 5, SD2, Omnisphere, Wave Altiverb, PSP, VB3, Izotope, Scuffham, Soundtoys 5, Slate All Plugins.
lexaproductions is offline   Reply With Quote
Old 03-25-2020, 11:55 AM   #996
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 3,060
Default

The macOS 32-bit build fails to load due to missing symbols (_png_create_info_struct):

Code:
dlopen(reaper_js_ReaScriptAPI32.dylib, 6): Symbol not found: _png_create_info_struct
  Referenced from: reaper_js_ReaScriptAPI32.dylib
  Expected in: flat namespace
 in reaper_js_ReaScriptAPI32.dylib
cfillion is offline   Reply With Quote
Old Yesterday, 06:32 AM   #997
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,537
Default

Hi Julian.
Area51 is finally working on OSX but there is one issue:
Code:
if reaper.JS_Window_GetForeground() ~= main_wnd then
    return
  end
This is used to prevent clicking thru windows.On windows its working as expected but on osx its not working.
On OSX when any window is opened its triggering this API call.

Code:
reaper.BR_Win32_GetForegroundWindow()
Is also affected.

Windows

Area should move as you see.

On OSX if any window is opened you cannot move it (its triggering true).

Stevie will follow up this post with OSX side

Last edited by Sexan; Yesterday at 06:57 AM.
Sexan is offline   Reply With Quote
Old Yesterday, 06:37 AM   #998
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,369
Default

Yes, I can confirm that. I've tried a simple code to retrieve the current window in OS X, but the console doesn't pop up:

__________________
My Reascripts forum thread | My Reascripts on GitHub
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 Yesterday, 11:41 AM   #999
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,004
Default

I checked the WDL/swell code, and it seems that swell usually regards the foreground window and the focused window as the same thing. On OSX and Linux, therefore, the focused *child* window will also be the foreground window.

I therefore suggest that you check whether the arrange view is focused, rather than whether the main window is in the foreground.

On Windows, AFAIK, the foreground window should be the parent toplevel window of the focused child window. Am I correct?

Perhaps I can add some code to JS_Window_GetForeground on Linux/OSX to return the parent toplevel window.

Last edited by juliansader; Yesterday at 11:50 AM.
juliansader is offline   Reply With Quote
Old Yesterday, 01:40 PM   #1000
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,699
Default

I am doing my first steps in drawing with the JS_ReascriptAPI and wrote this simple test:
Code:
local start = reaper.time_precise()
local trackview = reaper.JS_Window_FindChildByID(reaper.GetMainHwnd(), 1000)
local pen = reaper.JS_GDI_CreatePen( 1, 16777215 )
local first_x = reaper.GetMousePosition()

function main()
  local item = reaper.BR_ItemAtMouseCursor()
  local x = reaper.GetMousePosition() -- screen
  if item and x ~= first_x then
    local y = reaper.GetMediaTrackInfo_Value( reaper.GetMediaItem_Track( item ), "I_TCPY" ) + 
              reaper.GetMediaItemInfo_Value( item, "I_LASTY" ) -- client
    local height = reaper.GetMediaItemInfo_Value( item, "I_LASTH" )
    x = reaper.JS_Window_ScreenToClient( trackview, x, 0 )
    
    local hdc = reaper.JS_GDI_GetClientDC( trackview )
    reaper.JS_GDI_SelectObject( hdc, pen ) 
    reaper.JS_GDI_Line( hdc, x, y + 1, x, y + height - 2 )
    reaper.JS_GDI_ReleaseDC( trackview, hdc )
    first_x = x
  end
  local now = reaper.time_precise()
  if now - start >= 10 then
    reaper.ShowConsoleMsg("script ended\n\n")
    reaper.JS_GDI_DeleteObject( pen )
    reaper.UpdateArrange()
    return
  else
    reaper.defer(main)
  end
end

main()

Basically, it displays a line over the position of the mouse cursor when it is over an item. The problem is that it gets full of lines as I move the mouse. How can I erase them and keep only the one that is currently under the mouse pointer? Furthermore, what I wrote, is it correct? Is this the correct way to do it? Thanks!


Last edited by amagalma; Yesterday at 02:32 PM.
amagalma is online now   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:07 PM.


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