Old 04-18-2018, 02:44 PM   #1
barbaroja
Human being with feelings
 
barbaroja's Avatar
 
Join Date: Jul 2009
Posts: 429
Default Lil Help with a text input box

I am using gofer region scripts to create quick regions from time selection, with preset names for the arrangement sections I use. (intro, chorus, verse...)

So far has been great. However one feature I really would like is the ability to get user input for appending to the already set name.

For example. I hit the button to create a chorus. My structure goes from sections (A,B,C...) and occurrences in the song (1, 1', 2, 2'...).

Could I make a textbox appear when I call the script that asks me for the suffix manual input?

I.e: I hit the chorus button, so I input 1A' and I get "CHORUS 1A" as region name.

I am appending the script I am using now:





colorlist = [18894459, 24596520, 18633001, 18160236, 23541849]
listlength = len(colorlist)
colorindex = 0

TimeSel = RPR_GetSet_LoopTimeRange2(0, 0, 0, 0, 0, 0)
SelStart = TimeSel[3]
SelEnd = TimeSel[4]

HasState = RPR_HasExtState("Ruler", "Region_CustomColor")
if HasState == 1:
colorindex = int(RPR_GetExtState("Ruler", "Region_CustomColor"))
if colorindex > listlength - 1:
colorindex = 0

RPR_AddProjectMarker2(0, 1, SelStart, SelEnd, "CHORUS", -1, colorlist[colorindex])

colorindex += 1
RPR_SetExtState("Ruler", "Region_CustomColor", colorindex, 0)


RPR_UpdateTimeline()
barbaroja is offline   Reply With Quote
Old 04-18-2018, 02:58 PM   #2
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

RPR_GetUserInputs
cfillion is offline   Reply With Quote
Old 04-18-2018, 03:23 PM   #3
barbaroja
Human being with feelings
 
barbaroja's Avatar
 
Join Date: Jul 2009
Posts: 429
Default

Thanks man. Any help on how could that be used as a suffix?
barbaroja is offline   Reply With Quote
Old 04-23-2018, 09:45 PM   #4
barbaroja
Human being with feelings
 
barbaroja's Avatar
 
Join Date: Jul 2009
Posts: 429
Default

Any words?
barbaroja is offline   Reply With Quote
Old 04-23-2018, 10:20 PM   #5
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Replace this line:

Code:
RPR_AddProjectMarker2(0, 1, SelStart, SelEnd, "CHORUS", -1, colorlist[colorindex])
With this:

Code:
(retval, title, num_inputs, captions_csv, retvals_csv, retvals_csv_sz) = RPR_GetUserInputs("Title", 1, "Suffix", "", 512)
if retval:
  RPR_AddProjectMarker2(0, 1, SelStart, SelEnd, "CHORUS " + retvals_csv, -1, colorlist[colorindex])

Last edited by cfillion; 04-23-2018 at 10:26 PM.
cfillion 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 04:35 PM.


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