Change handle userNumber using WebAPI not working

Discussion and chat related to developing interfaces to the Titan software using the web API.

Moderator: Moderators

vsingmalaysia
Posts: 2
Joined: 27 Feb 2024, 11:09

Change handle userNumber using WebAPI not working

Postby vsingmalaysia » 27 Feb 2024, 14:07

Hello There, I found out few weird behaviour in webAPI

in Macro it works,

Code: Select all

        <step>Handles.SetSourceHandleFromHandle("cueHandleUN=1")</step>
        <step>ActionScript.SetProperty("Handles.CurrentUserNumber", userNumber:2)</step>
        <step>Handles.SetUserNumber()</step>
        <step>Handles.ClearSelection()</step>

It successfully change the userNumber from 1 to 2

but when it comes to webAPI
SetSourceHandleFromHandle only works in titanId, handle_userNumber is not working and when i proceed to setUserNumber , it says "Error: User number already in use" but userNumber 2 does not exist before hand at all

Code: Select all

   http://localhost:4430/titan/script/2/Handles/SetSourceHandleFromHandle?handle_titanId=1869 //only working with handle_titanId
   http://localhost:4430/titan/script/2/ActionScript/SetProperty?id=Handles.CurrentUserNumber&value=userNumber:2 //not sure is this correctly written
   http://localhost:4430/titan/script/2/Handles/SetUserNumber //error here saying ""Error: User number already in use"" note: I''ve already change backe userNUmber 2 cueHandle to 1
   http://localhost:4430/titan/script/2/Handles/ClearSelection  //working



need help here thanks.
icke_siegen
Posts: 1089
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

Re: Change handle userNumber using WebAPI not working

Postby icke_siegen » 29 Feb 2024, 13:06

With massive help from Gregory I am happy to post the solution:

Code: Select all

http://localhost:4430/titan/script/2/Handles/SetSourceHandleFromHandle?handle_string=cueHandleUN:1

http://localhost:4430/titan/script/2/ActionScript/SetProperty?id=Handles.CurrentUserNumber&value_userNumber=2

http://localhost:4430/titan/script/2/Handles/SetUserNumber

http://localhost:4430/titan/script/2/Handles/ClearSelection



A little explanation:
  • in order to provide the usernumber to the first command you need to tell Titan that this is in the scope of playbacks or cues - as there might be a usernumber 1 in fixtures, in groups, in palettes, in playbacks and elsewhere, usernumber isn't unique. For macros the notation for this casting is
    "cueHandleUN=1"
    and in the web API you need to write
    _string=cueHandleUN:1
  • casting the value is also the issue in the second line: instead of
    value=userNumber:2
    it is
    value_userNumber=2
  • and as soon as these values are correctly submitted, line 3 doesn't throw an error any more

I'll put this in the wiki as well.
vsingmalaysia
Posts: 2
Joined: 27 Feb 2024, 11:09

Re: Change handle userNumber using WebAPI not working

Postby vsingmalaysia » 08 Mar 2024, 05:35

I tested and it works in Version 16, with my T2 dongle, Thanks!!

but in version 11.3 Avolite Titan Simulator (online activated), the

Code: Select all

http://localhost:4430/titan/script/2/Handles/SetSourceHandleFromHandle?handle_string=cueHandleUN:1

have this issue
"Error: Object of type 'System.String' cannot be converted to type 'Avolites.Titan.Controllers.Handles.Handle'."

just curious if version 11 have another casting? and where can i check all the parameters?
I am working on making my place lighting able to be controleable through mobile phone using webApi.
icke_siegen
Posts: 1089
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

Re: Change handle userNumber using WebAPI not working

Postby icke_siegen » 11 Mar 2024, 16:07

I already tried various things to make this work in v11 but didn't succeed. I just asked Gregory again, maybe he has another approach.

What you can do is using the location in the current page with

Code: Select all

http://localhost:4430/titan/script/2/Handles/SetSourceHandle?group=Playbacks&index=0


but this is probably not what you want.

Maybe write a JS function to get the Titan ID of the playback with UN 1 from titan/handles?
icke_siegen
Posts: 1089
Joined: 02 Jul 2010, 10:29
Location: Siegen, Germany
Contact:

Re: Change handle userNumber using WebAPI not working

Postby icke_siegen » 13 Mar 2024, 07:18

Okay,

again this is all Gregory, and I am only the delivery boy:

for cues, cuelists and chases the first line must read (respectively)

Code: Select all

http://localhost:4430/titan/script/2/Handles/SetSourceFromUserNumber?handlePath=Handle.Playback.Cue&userNumber=1
http://localhost:4430/titan/script/2/Handles/SetSourceFromUserNumber?handlePath=Handle.Playback.SteppedPlayback.CueList&userNumber=1
http://localhost:4430/titan/script/2/Handles/SetSourceFromUserNumber?handlePath=Handle.Playback.SteppedPlayback.Chase&userNumber=1


It looks like there is no solution to select playback 1 regardless its type. hence you'd probably need to run this three times, once for cues, for cuelists, and for chases.

Who is online

Users browsing this forum: No registered users and 6 guests