Skip to Content
It is currently December 15th, 2019, 4:17 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: July 12th, 2019, 11:42 am 
Offline
New User
New User

Joined: July 12th, 2019, 11:41 am
Posts: 1
Hi. Is it possible to return encoder status via command line prompt for SAMCast and / or SAMBC???

Perhaps there is a better way? I essentially want to create a script that returns the status of each encoder like: Running with Audio, Unable to start, No audio detected.

It would be great too if I can trigger an encoder from the command line too.

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: July 12th, 2019, 3:11 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7889
Location: Aachen (Germany)
Michealgomes wrote:
Hi. Is it possible to return encoder status via command line prompt for SAMCast and / or SAMBC???

No, sorry.

Michealgomes wrote:
Perhaps there is a better way?

Not sure if this qualifies as a better way, but at least it is one way:
  1. Create a PAL Script and make it autostart
  2. In said script, use PAL.Loop := True; to make the script repeat itself
  3. Also use PAL.WaitForEvent('encoderstatus'); in order to trigger the script from outside of SAM
  4. You can't change the response to the event trigger, but you can tell SAM to write the Encoder status to a file every time the event is triggered.
    i.e.:
    Code:
    var I : Integer;
    PAL.Loop := True;

    PAL.WaitForEvent('encoderstatus');

    for I := 0 to Encoders.Count-1 do
      if Encoders[I].Started then
        StrToFile('C:\Users\Micheal\SAM-EncoderStatus'+I+'.txt', Encoders[I].StatusLong);
  5. Trigger the Event from outside of SAM using an HTTP client (The CMD.exe shell in Windows does not have a built-in command for that, but you can use the PowerShell Module Invoke-WebRequest that comes preinstalled on Windows 8 onwards - `iwr http://localhost:1221/events/encoderstatus` in the above example)

Note: I've got no idea what is included in StatusLong nor is it documented in the PAL Scripting Reference.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: MSN [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group