Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-05-2022, 02:52 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 5,884
Default SetProjectMarkerByIndex sometimes addresses wrong marker (FIXED)

This is an odd issue:

When having multiple markers on the same position, SetProjectMarkerByIndex sometimes gets confused about which marker to address.

I made it happen with the following setup:

Add multiple markers with different names on position 30 secs in the project (A, B, C, etc).

Then I ran this code-line multiple times, which should change the name of the first marker found to Oops:

Code:
reaper.SetProjectMarkerByIndex(0, 1, false, 30, 0, 1, "Oops", 0)
Now what I would expect is, that running this multiple times changes the name of the first marker found to Oops once and leaving all others untouched.
However, sometimes, it "finds" different markers as first ones, so multiple markers get renamed. This is not always the case. Sometimes it works as expected for a long time and out of a sudden: boom.

It looks like Reaper treats multiple markers on the same position as equal, though they are not. And as Reaper sees them as equal, it seems to be, as if it changes the first marker found in memory or something, which might be Marker A or Marker B or Marker C, depending on what the memory does(though I might be wrong about this guess...).

I tried numerous workarounds but they all didn't work out.

I tried to code a Renumerate-Markers-function, where I go through all of them to give them a new shown-number, which worked, when I coded it initially. And suddenly, it stopped, skipping markers. After some bughunting, I found, that SetProjectMarkerByIndex is already the culprit.
Haven't checked SetProjectMarkerByIndex2.


Funny sidenote:
You can pass 0 as parameter isrgn. I made this parameter=0 instead of false and I initially thought, this is the bug. But it isn't.


Tested on Reaper 6.64x64 on Windows 7. Since you didn't change marker-stuff since then, I guess, the issue still persists.

PS: We need an "UpdateMarkerList"-function. I currently need to click into the markerlist or even the marker/region/takemarkers-visibility-checkboxes to see such changes when debugging scripts, which is possible but really tedious...


Edit: It's so frustrating, that it's not easy to reproduce. It sometimes happens for a minute or so and out of a sudden, everything is working fine. Some minutes later, the issue kicks in again.
All I could found, that running a defer-script for some time, doing the above code line, doesn't show the issue.
It seems like it's happening somehow at the initialization of Lua(?). As if Lua gets a list of markers to work with but it might change from creating an instance to the next creating an instance.

Like a table in Lua, whose elements aren't indexed. When you use pair on them, the order of the returned elements may change or be the same....
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish

Last edited by Meo-Ada Mespotine; 11-25-2022 at 03:16 PM.
Meo-Ada Mespotine is offline   Reply With Quote
 

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 06:05 PM.


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