Скрипты PAL для Sam Broadcaster

Аватара
Автор темы
Layk M
Прапорщик
Прапорщик
Сообщения: 158
Репутация: 19
С нами: 5 лет 2 месяца

Скрипты PAL для Sam Broadcaster

Сообщение #1 Layk » 9 марта 2015, 19:56

В комментариях можно выкладывать готовые PAL скрипты.

В данной теме рассажу как устанавливать PAL скрипты. Рассмотрим на примере скрипта который будет включать рекламу/джингл, через каждые 5 песен.

Для начала открываем вкладку Playlist

Изображение

И добавляем рекламу в папку: Content => Station IDs => Station IDs (All). После чего файл отобразится в нижней части Playlistа.

Далее нужно загрузить сам PAL скрипт. Открываем окно PAL Scripts, жмем на + в открывшемся окне ставим галочку как показано на скриншоте (для автозапуска). Потом выбираем место хранения скрипта и грузим его.

Изображение

Код скрипта:

Код: Выделить всё

PAL.Loop := True; // скрипт будет выполнятся постоянно
PAL.WaitForPlayCount(5); // ставим задержку на 5 треков
//выбераем случайный трек из "Station IDs" и ставим его вверх очереди
CAT['Station IDs (All)'].QueueTop(smRandom, NoRules); 


Если кто то не знает - вставить в блокнот и сохранить в формате .pal

Этот скрипт будет вставлять через каждые 30 минут

Код: Выделить всё

var Song : TSongInfo;

//скрипт будет выполнятся постоянно(многократно)
PAL.Loop := True;
//ставим задержку на 30 минут
PAL.WaitForTime('+00:30:00');
//выбираем трек наугад
Song := CAT['Station IDs (All)'].ChooseSong(smRandom,NoRules);
//добавляем его в начало очереди
Queue.Add(song,ipTop); 
Изображение

! ! !


Аватара
Автор темы
Layk M
Прапорщик
Прапорщик
Сообщения: 158
Репутация: 19
С нами: 5 лет 2 месяца

Сообщение #2 Layk » 10 марта 2015, 11:31

Проигрывание трэка поверх звучащего:

Код: Выделить всё

var Song : TSongInfo;
var P : TPlayer;

PAL.Loop := True;  // скрипт будет выполнятся постоянно
PAL.WaitForTime('+00:10:00'); // задержка в 10 секунд

:= SoundFX; // через что играть
if P <> nil then
begin
Song 
:= CAT['Каталог'].ChooseSong(1,NoRules);
if Song <> nil then
begin
P
.QueueSong(Song); //
P.Play;
end;
end;
Запуск файла каждый час (отбивка времени):

Код: Выделить всё

var P    : TPlayer;
var Song : TSongInfo;
var strFile, strPath, strJingle : String;

strPath := 'C:\CLOCK\'; // Путь к папке, где лежат отбивки часов
strJingle := '
C:\CLOCK\start_hour.mp3'; //Путь и название джингла после отбивки часов

PAL.Loop := True;

PAL.WaitForTime('
XX:59:15'); //запускаемся в конце каждого часа. 45 сек - время буферезации, подбираем по свом параметрам, вкусам

strFile := strPath + FormatDateTime('
hh', now+1/24) + '-00.mp3'; //определяем название файла с нужными часиками. Формат имени файла XX-XX.mp3

P := Aux1;
if P <> nil then
begin

    Queue.AddFile(strJingle, ipTop);
    Queue.AddFile(strFile, ipTop);


P := ActivePlayer;
if P <> nil then P.FadeToNext;

end;
Cкрипт времени с новостями (или тем что вам захочется)

Код: Выделить всё

var strFile, strPath : String;
var P,: Tplayer;

strPath := 'd:\RADIO\Clock\';

PAL.Loop:=True;
PAL.WaitForTime('
XX:59:50');
PAL.LockExecution;
strFile := strPath + FormatDateTime('
hh', now+1/24) + '-00.mp3';
Case strFile Of
'
d:\RADIO\Clock\07-00.mp3' : Begin
                                  If (DayOfWeek(Now) = Sunday) Or (DayOfWeek(Now) = Monday) then
                                  Queue.AddFile('
d:\RADIO\news\новость 18.mp3', ipTop)
                                  Else
                                  Queue.AddFile('
d:\RADIO\news\новость 20.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\08-00.mp3' :  Begin
                                  If (DayOfWeek(Now) = Sunday) Or (DayOfWeek(Now) = Monday) then
                                  Queue.AddFile('
d:\RADIO\news\новость 18.mp3', ipTop)
                                  Else
                                  Queue.AddFile('
d:\RADIO\news\новость 20.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\09-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\гороскоп.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\11-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\гороскоп.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\12-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\новость 12.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\13-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\новость 12.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\15-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\новость 15.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\16-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\новость 15.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\18-00.mp3' :  Begin
                                  Queue.AddFile('
d:\RADIO\news\новость 18.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\19-00.mp3' :  Begin
                                  If (DayOfWeek(Now) <> Sunday) AND (DayOfWeek(Now) <> Saturday) then
                                  Queue.AddFile('
d:\RADIO\news\новость 18.mp3', ipTop);
                                  Queue.AddFile(strFile, ipTop);
                                  Aux1.QueueSong(Queue.NextInQueue);
                                  If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
'
d:\RADIO\Clock\20-00.mp3' :  Begin
                                   If (DayOfWeek(Now) = Sunday) Or (DayOfWeek(Now) = Saturday) then
                                   Queue.AddFile('
d:\RADIO\news\новость 18.mp3', ipTop)
                                   Else
                                   Queue.AddFile('
d:\RADIO\news\новость 20.mp3', ipTop);
                                   Queue.AddFile(strFile, ipTop);
                                   Aux1.QueueSong(Queue.NextInQueue);
                                   If DeckA.Status = psPlaying then
                                                                  Begin
                                                                       DeckB.QueueSong(Queue.NextInQueue);
                                                                       DeckA.FadeToPause;
                                                                       F := DeckA;
                                                                       P := DeckB;
                                                                       Aux1.FadeToPlay;
                                                                   End
                                                               Else
                                                                   Begin
                                                                         DeckA.QueueSong(Queue.NextInQueue);
                                                                         DeckB.FadeToPause;
                                                                         F := DeckB;
                                                                         P := DeckA;
                                                                         Aux1.FadeToPlay;
                                                                    End;

                              End;
Else
     Begin
     Queue.AddFile(strFile, ipTop);
     If DeckA.Status = psPlaying then
                                      Begin
                                            Aux1.QueueSong(Queue.NextInQueue);
                                            DeckA.FadeToPause;
                                            P := DeckA;
                                            F := DeckB;
                                            Aux1.FadeToPlay;
                                        End
                                   Else
                                       Begin
                                             Aux1.QueueSong(Queue.NextInQueue);
                                             DeckB.FadeToPause;
                                             P := DeckB;
                                             F := DeckA;
                                             Aux1.FadeToPlay;
                                        End;
    End;
End;
PAL.UnlockExecution;
PAL.WaitForTime('
+00:00:09');
P.FadeToPlay;
If P.Status <> psPlaying then F.Play
Else F.QueueSong(Queue.NextInQueue);
Вывод новостей на 15 и 45 минуте каждого часа с радиостанции Эхо Москвы

Код: Выделить всё

PAL.Loop:=True;
PAL.WaitForTime('XX:15:00');
Queue.AddURL('http://radio.memonet.ru:501/current.mp3',ipTop);
ActivePlayer.FadeToNext;
PAL.WaitForTime('XX:45:00');
Queue.AddURL('http://radio.memonet.ru:501/current.mp3',ipTop);
ActivePlayer.FadeToNext
Изображение


  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Радиовещание»

Кто сейчас на форуме

Сейчас этот раздел просматривают: 1 гость