Skip to Content
It is currently November 20th, 2019, 11:28 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: September 8th, 2018, 9:31 am 
Offline
New User
New User

Joined: September 8th, 2018, 9:26 am
Posts: 3
The goal of the script is to look for an intro for the artist in the top of the Queue. It works fine until is plays someone who doesn't have an intros, then it stops working. Anyone have any ideas what I'm doing wrong? If someone has a better idea I'm open.
Code:
    //The Purpose for this script is to load an intro for a song
    //Categories for each artist are created with name "artist" + ' VO'
    //The script is supposed to look at the next artist in the Queue,
    //  look for a category ex: "Alan Jackson OV" select the least played
    //  intro and load it in front of the song.
    //All the intros have"I-" as the first 2 characters.
    //The script checks to see if the current track playing has a "-" for the
    //  second character.  If it does then it should skip attempting to load intro

    var NxSong     : TSongInfo;

    var Announcement  : TSongInfo;
    var Player1  : TSongInfo;
    var Player2  : TSongInfo;
    var GetChar1 : String = '=';
    var GetChar2 : String = '=';
    var IsDash : String = 'N';
   
    Pal.Loop := True;
    Pal.LockExecution;
//Check what tracks are loaded into the players
    Player1 := DeckA.GetSongInfo;
    Player2 := DeckB.GetSongInfo;

//See what the second character in the track is.  Checking for "-"
   GetChar1 := CharAt(Player1['Artist'], 2);
   GetChar2 := CharAt(Player2['Artist'], 2);

   WriteLn(GetChar1);
   WriteLn(GetChar2);
   WriteLn(Player1['Artist']);
   WriteLn(Player2['Artist']);

//Set Y or N for detection of "-"
   If GetChar1 = '-' Then
   Begin
          IsDash  := 'Y'
   end;
   If GetChar2 = '-' Then
   Begin
          IsDash := 'Y'
   End;
   WriteLn(IsDash);

//If there is not a dash then execute process of loading intro track
     If IsDash = 'N' Then
     Begin

            NxSong := Queue.NextInQueue;
            WriteLn(NxSong['Artist']);
            Queue.Add(NxSong,ipTop);
            Announcement := CAT[((NxSong['Artist'])+' VO')].ChooseSong(smLRP,NoRules);

         WriteLn(Announcement['Artist']);
        Queue.Add(Announcement,ipTop);

      End;
    Pal.unLockExecution;
    NxSong.Free;
    Announcement.Free;
    Player1.Free;
    Player2.Free;
   
    Pal.WaitForPlayCount(1);


Last edited by DJ Cassio on September 10th, 2018, 9:25 am, edited 2 times in total.
Added code tags, please use them in the future


Top
 Profile  
Reply with quote  
PostPosted: September 26th, 2018, 10:04 pm 
Offline
Junior User
Junior User

Joined: April 5th, 2013, 9:57 pm
Posts: 46
I'd like to use this as well if you can get it working. I like the concept of it.


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: No registered users and 17 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