diff --git a/ChangeLog b/ChangeLog index ca2e4bae..191d8fdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16731,3 +16731,5 @@ 2018-03-21 Fred Gleason * Added support for cart notifications to Full Disc Ripper in rdlibrary(1). +2018-03-21 Fred Gleason + * Added support for cart notifications to rdairplay(1). diff --git a/rdairplay/log_play.cpp b/rdairplay/log_play.cpp index 252d98f5..9d102825 100644 --- a/rdairplay/log_play.cpp +++ b/rdairplay/log_play.cpp @@ -114,6 +114,8 @@ LogPlay::LogPlay(int id,QSocketDevice *nn_sock,QString logname, // connect(rda->ripc(),SIGNAL(onairFlagChanged(bool)), this,SLOT(onairFlagChangedData(bool))); + connect(rda->ripc(),SIGNAL(notificationReceived(RDNotification *)), + this,SLOT(notificationReceivedData(RDNotification *))); // // Audition Player @@ -1707,6 +1709,42 @@ void LogPlay::auditionStoppedData() } +void LogPlay::notificationReceivedData(RDNotification *notify) +{ + RDLogLine *ll=NULL; + RDLogLine *next_ll=NULL; + + if(notify->type()==RDNotification::CartType) { + unsigned cartnum=notify->id().toUInt(); + for(int i=0;icartNumber()==cartnum)&&(ll->status()==RDLogLine::Scheduled)&& + ((ll->type()==RDLogLine::Cart)||(ll->type()==RDLogLine::Macro))) { + switch(ll->state()) { + case RDLogLine::Ok: + case RDLogLine::NoCart: + case RDLogLine::NoCut: + if((next_ll=logLine(i+1))!=NULL) { + ll->loadCart(ll->cartNumber(),next_ll->transType(),play_id, + ll->timescalingActive()); + } + else { + ll->loadCart(ll->cartNumber(),RDLogLine::Play,play_id, + ll->timescalingActive()); + } + emit modified(i); + break; + + default: + break; + } + } + } + } + } +} + + bool LogPlay::StartEvent(int line,RDLogLine::TransType trans_type, int trans_length,RDLogLine::StartSource src,int mport,int duck_length) { @@ -2616,28 +2654,28 @@ void LogPlay::RefreshEvents(int line,int line_quan,bool force_update) if((logline=logLine(i))!=NULL) { if(logline->type()==RDLogLine::Cart) { switch(logline->state()) { - case RDLogLine::Ok: - case RDLogLine::NoCart: - case RDLogLine::NoCut: - if(logline->status()==RDLogLine::Scheduled) { - state=logline->state(); - if((next_logline=logLine(i+1))!=NULL) { - logline-> - loadCart(logline->cartNumber(),next_logline->transType(), - play_id,logline->timescalingActive()); - } - else { - logline->loadCart(logline->cartNumber(),RDLogLine::Play, - play_id,logline->timescalingActive()); - } - if(force_update||(state!=logline->state())) { - emit modified(i); - } - } - break; - - default: - break; + case RDLogLine::Ok: + case RDLogLine::NoCart: + case RDLogLine::NoCut: + if(logline->status()==RDLogLine::Scheduled) { + state=logline->state(); + if((next_logline=logLine(i+1))!=NULL) { + logline-> + loadCart(logline->cartNumber(),next_logline->transType(), + play_id,logline->timescalingActive()); + } + else { + logline->loadCart(logline->cartNumber(),RDLogLine::Play, + play_id,logline->timescalingActive()); + } + if(force_update||(state!=logline->state())) { + emit modified(i); + } + } + break; + + default: + break; } } } diff --git a/rdairplay/log_play.h b/rdairplay/log_play.h index fad97d08..cd6fd52e 100644 --- a/rdairplay/log_play.h +++ b/rdairplay/log_play.h @@ -2,7 +2,7 @@ // // Rivendell Log Playout Machine // -// (C) Copyright 2002-2004,2016 Fred Gleason +// (C) Copyright 2002-2004,2016-2018 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -31,12 +31,12 @@ #include #include +#include +#include +#include #include #include #include -#include -#include -#include #include #include @@ -134,6 +134,7 @@ class LogPlay : public QObject,public RDLogEvent void rescanEventsData(); void auditionStartedData(); void auditionStoppedData(); + void notificationReceivedData(RDNotification *notify); signals: void renamed();