Skip to Content
It is currently July 26th, 2014, 10:10 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: September 30th, 2009, 3:51 am 
Offline
Junior User
Junior User

Joined: July 27th, 2009, 5:15 am
Posts: 27
Good Morning All

I am using Sam 4.5.6

I am using the following pal script to start an "archive stream encoder"

Quote:
"var I : Integer;

for I := 0 to Encoders.Count-1 do
if not Encoders[I].Started then
Encoders[I].Start;"


This is behaving as hoped for and I can tell Sam to start recording a required program.. However on http://support.spacialaudio.com/wiki/Write_Some_PAL#StartandStopEncoder_Link - (the spacial wiki) it seems to suggest I have to manually stop the encoder which isnt always possible. I have serached the forum and cant seem to find an equivalent stop pal script , and my knowledge on pal writing is sadly lacking.

Would appreciate any advice or help on this.

Rgds and thanks in advance

Dave

southdevonsound.co.uk


Top
 Profile  
 
PostPosted: September 30th, 2009, 4:05 am 
Offline
Super User
Super User

Joined: March 4th, 2005, 1:04 pm
Posts: 876
Location: The Edge of reality
This seems to be the line
Code:
 PAL.WaitForTime('20:00:00');
Encoders.StopAll;


I have a pal that stops my encoders to let another dj in to the shoutcast server then starts them again - not sure what you require but perhaps this will help Change as you need :)

Code:
//===================================================================

//Start encoder
var I : Integer;

for I := 0 to Encoders.Count-1 do
 if not Encoders[I].Started then
  Encoders[I].Start;

//=======================================================================
{
  Don't be a loser.  Leave this here.
  Show update script by FesterHead (aka Steve Kunitzer)
  $Id: set-show.pal,v 1.3 2005/01/20 05:26:59 FesterHead Exp $
  Used especially with sam2nuke from ScottGiles.com

  What this PAL does:
    * Updates currently playing show

  What is configurable:
    * Show updating title and description
    * PAL id for automated schedule highlighting

  PAL built to run manually:
    * Switch to a desktop with the 'PAL Scripts' window visible
       *OR*
       Make the ES visible by Clicking the 'Window' menu item and selecting 'PAL Scripts'

    * Click '+' (Add new PAL script)

    * Uncheck the 'Automatically start script' box

    * Click the folder icon and navigate to this script

    * Click 'OK'

    * Run by highlighting PAL
      * Clicking 'Start selected PAL script' (VCR type play button)
      OR
      * Pressing F9

    * Save settings by clicking the 'File' menu item and selecting 'Save Configuration'

  Only real use is to reset the show after testing another PAL
  OR
  Resetting the current show if something goes awry

  Will automatically create the currentshow table in your SAM MySQL database

  Show your support for the effort, see http://www.festerhead.com/forums/viewtopic.php?t=4

  Mahalo for your kokua

  WARNING!
  IF YOU DON'T CONFIGURE THE SCRIPT, DON'T EXPECT IT TO WORK PROPERLY!
  I built this PAL for my station using my station configuration
  Your results and mileage may vary

  I suggest running the PAL in debugOn mode for a couple days to see if it needs tweaking

  See below for change log
}

// Make the PAL run fast!
PAL.LockExecution;

{
  **************************
  * START OF CONFIGURABLES *
  **************************
}

{
  Define automatic show updating values
  Put some text values in here if you use Show Updating
  Defaults are for my station
}
var text1Update : String = 'HoGG::Radio Presents';
var text2Update : String = 'Live Covenants T.N.E - He is BACK - No Requests via the site, ask in the chatbox';

{
  Define the PAL ids for automated schedule page highlighting
  Leave this alone if you don't have automated schedule page highlighting
  Defaults are for my station
}
var idThisPAL : Integer = 62;

{
  Is this cool or what?
  Default is true
  var cool : Boolean = true;
}

{
  ************************
  * END OF CONFIGURABLES *
  ************************
}

// IF YOU EDIT BELOW HERE, MAKE DARN SURE YOU KNOW WHAT'S GOING ON

// Declare variables
var currentShow : TDataSet;

// Create the table if it doesn't already exist
ExecSQL('CREATE TABLE IF NOT EXISTS currentshow ' +
        '(id MEDIUMINT(9), text1 VARCHAR(255), text2 VARCHAR(255))', []);

currentShow := Query('SELECT COUNT(*) AS cnt FROM currentshow', [], true);

// If no rows in currentshow, do an insert
// Else, do an update
if (currentShow['cnt'] = 0) then
  begin
    ExecSQL('INSERT INTO currentshow (id, text1, text2) ' +
            'VALUES (' + IntToStr(idThisPAL) + ', ' + QuotedStr(text1Update) + ', ' +
                         QuotedStr(text2Update) + ')', []);
  end
else
  begin
    ExecSQL('UPDATE currentshow SET id = ' + IntToStr(idThisPAL), []);
    ExecSQL('UPDATE currentshow SET text1 = ' + QuotedStr(text1Update), []);
    ExecSQL('UPDATE currentshow SET text2 = ' + QuotedStr(text2Update), []);
  end;

PAL.UnlockExecution;

currentShow.Free;
 PAL.WaitForTime('20:00:00');
Encoders.StopAll;

  PAL.WaitForTime('21:55:00');
Encoders.StartAll;

_________________
Image


Top
 Profile  
 
PostPosted: September 30th, 2009, 4:07 am 
Offline
Junior User
Junior User

Joined: July 27th, 2009, 5:15 am
Posts: 27
Sorry , forgot to add...

I am using the above pal script with event scheduler... which will allow me to start a certain time , but obviously not stop.


Rgds


Dave


Top
 Profile  
 
PostPosted: September 30th, 2009, 5:08 am 
Offline
Junior User
Junior User

Joined: July 27th, 2009, 5:15 am
Posts: 27
Many thanks for that - Just the job.

I have done a test record - all okay...

Have set ES up to do multiple programmes - will see how it responds.

Thanks again for advice.


Rgds


Dave

southdevonsound.co.uk


Top
 Profile  
 
PostPosted: October 1st, 2009, 3:59 am 
Offline
Super User
Super User

Joined: March 4th, 2005, 1:04 pm
Posts: 876
Location: The Edge of reality
Glad to be of assistance :)

_________________
Image


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 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