Go Back   Cockos Incorporated Forums > REAPER Forums > newbieland

Reply
 
Thread Tools Display Modes
Old 11-12-2018, 06:56 PM   #1
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 221
Default Project Load Notification? (Lua Scripting)

A couple of questions on how Reaper does things:

1) When you load a project in Reaper, how does the script get notified?

2) How does a script load information from the .rpp file (i.e. Markers, Volume Levels, etc)? (is there an API for that?)
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter is offline   Reply With Quote
Old 11-12-2018, 07:08 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,454
Default

Quote:
Originally Posted by tXShooter View Post
A couple of questions on how Reaper does things:

1) When you load a project in Reaper, how does the script get notified?

2) How does a script load information from the .rpp file (i.e. Markers, Volume Levels, etc)? (is there an API for that?)
1) The scripting API has no support for notifications. (And the situation isn't that great for C++ extension plugins either.) You might be able to hack something with a polling script implemented via the defer mechanism. (That is, repeatedly checking has some property or properties somewhere changed that could indicate a project has loaded.)

2) If you have a project open, there are APIs to deal with markers, track properties, automation envelopes and so on. But if the project is not open in Reaper and you just have the .rpp file, you would need to read in and parse the file yourself. After parsing the relevant sections, you may be able to insert them into an existing project or change an existing project based on them.

These questions would be better suited for the scripting subforum, by the way.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 11-13-2018, 03:51 PM   #3
tXShooter
Human being with feelings
 
tXShooter's Avatar
 
Join Date: Aug 2017
Posts: 221
Default

Quote:
Originally Posted by Xenakios View Post
These questions would be better suited for the scripting subforum, by the way.
Should this be moved then? How does that happen if yes?


Quote:
Originally Posted by Xenakios View Post
1) ... You might be able to hack something with a polling script implemented via the defer mechanism.

2) If you have a project open, there are APIs to deal with markers, track properties, automation envelopes and so on. But if the project is not open in Reaper and you just have the .rpp file, you would need to read in and parse the file yourself. After parsing the relevant sections, you may be able to insert them into an existing project or change an existing project based on them.
This would seem like an appropriate thing to put inside a defer section... cyclically having it check for the active project, scan the markers and other items of interest within that project, and repopulate my script's GUI. Would that be correct?
__________________
"But be ye doers of the word, and not hearers only, deceiving your own selves."
tXShooter 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 01:39 PM.


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