Opening a playlist via REST API
Opening a playlist via REST API
What is the best way to open an existing playlist and set as current in ProppFrexx?
I've tested using:
eg: ["PLS_CURRENT_NEW","PLS_CURRENT_LOAD_PLAYLIST ...showname\current_playlist.pfp"]
As it's sending two commend and not waiting for the first to complete in ProppFrexx even though it's sending an OK response, and second command would fail as no current blank playlist is open:
OK
ERROR: no current playlist available
Is there a command or option I've over looked?
I've tested using:
eg: ["PLS_CURRENT_NEW","PLS_CURRENT_LOAD_PLAYLIST ...showname\current_playlist.pfp"]
As it's sending two commend and not waiting for the first to complete in ProppFrexx even though it's sending an OK response, and second command would fail as no current blank playlist is open:
OK
ERROR: no current playlist available
Is there a command or option I've over looked?
Re: Opening a playlist via REST API
ProppFrexx is highly multi-threaded and uses asynchronous programming internally to not block any real time audio processing resp to make the UI as fluent as possible. And you just discovered an effect of this.
What happens is the following:
The first command (to create a new playlist window) is executed asynchronously, i.e. it is triggered, but did not fully finish, while already the second command is also triggered to be executed. Or in other words, the commands are not executed synchronous, i.e. they do NOT wait until the previous command finishes before the next command is executed.
In most cases you will never recognize it, but particular case it matters.
You can solve it in two ways:
1. Simply use the single command
I.e. you can directly specify the playlist filename to open and load with the PLS_CURRENT_NEW command.
2. You just wait some time between the first and second command to ensure, that the first command fully finished. How long that is depends on the speed of your PC, e.g. 5 seconds should be fine in most cases. This results in the following sequence of 4 commands:
But all this has nothing to do with the REST API - the same will happen, e.g. when you test the commands in the User Command window panel and write the commands seperate lines...
E.g.:
Original (not working):
New (single command):
New (four command with waiting):
What happens is the following:
The first command (to create a new playlist window) is executed asynchronously, i.e. it is triggered, but did not fully finish, while already the second command is also triggered to be executed. Or in other words, the commands are not executed synchronous, i.e. they do NOT wait until the previous command finishes before the next command is executed.
In most cases you will never recognize it, but particular case it matters.
You can solve it in two ways:
1. Simply use the single command
Code: Select all
["PLS_CURRENT_NEW C:\showname\current_playlist.pfp"]
2. You just wait some time between the first and second command to ensure, that the first command fully finished. How long that is depends on the speed of your PC, e.g. 5 seconds should be fine in most cases. This results in the following sequence of 4 commands:
Code: Select all
["ASYNC", "PLS_CURRENT_NEW", "SLEEP 5000", "PLS_CURRENT_LOAD_PLAYLIST C:\showname\current_playlist.pfp"]
E.g.:
Original (not working):
Code: Select all
PLS_CURRENT_NEW
PLS_CURRENT_LOAD_PLAYLIST C:\Music\Test.pfp
Code: Select all
PLS_CURRENT_NEW C:\showname\current_playlist.pfp
Code: Select all
ASYNC
PLS_CURRENT_NEW
SLEEP 5000
PLS_CURRENT_LOAD_PLAYLIST C:\showname\current_playlist.pfp
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
Re: Opening a playlist via REST API
Thanks for your reply.
Is the added file name parameter something that's been recently added(PLS_CURRENT_NEW <fileName>)? I checked the manual beforehand and it stated it has no parameters:
Is the added file name parameter something that's been recently added(PLS_CURRENT_NEW <fileName>)? I checked the manual beforehand and it stated it has no parameters:
Thanks again for your help.PLS_CURRENT NEW:
Creates a new and empty playlist (and makes it the current one).
Parameter: none
Reply: OK|ERROR
Re: Opening a playlist via REST API
No, it existed for a very long time, but was never really documented;-)
Bernd - radio42
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution
ProppFrexx ONAIR - The Playout and Broadcast Automation Solution