Old 01-27-2021, 09:01 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default How do MarkTrackItemsDirty's arguments work?

The documentation for MarkTrackItemsDirty states:
Code:
Lua: reaper.MarkTrackItemsDirty(MediaTrack track, MediaItem item)

If track is supplied, item is ignored
This implies that "track" is optional, and that it should be possible to NOT supply a track. Can that be done?
juliansader is offline   Reply With Quote
Old 01-27-2021, 09:32 AM   #2
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,241
Default

maybe like this?
reaper.MarkTrackItemsDirty(nil, item)

what does the function do? What are dirty items used for?
heda is offline   Reply With Quote
Old 01-27-2021, 11:42 PM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

The script breaks and the IDE complains if nil is supplied.

If I understand correctly, the function tells REAPER that some change has been made to an item, so that an undo point gets created by Undo_BeginBlock/EndBlock. Some API functions for item editing do not automatically mark an item as dirty, so the script has to do it manually.
juliansader is offline   Reply With Quote
Old 06-06-2021, 05:35 PM   #4
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Yeah, been running into that one as well.
Would like to know how to focus on items only and ignore track.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 06-07-2021, 10:56 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I'd consider this as a bug.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 06-07-2021, 01:21 PM   #6
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Yeah or not implemented as declared.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 01-08-2022, 12:18 PM   #7
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

Ran into this myself just now. The API doesn't work as documented, as least for Lua. It may be possible to pass NULL to either parameter in C, but it certainly doesn't work in Lua.
tack 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 06:00 AM.


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