mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-30 17:20:32 +01:00
2024-02-14 Fred Gleason <fredg@paravelsystems.com>
* Added a 'RDAIRPLAY.MESSAGE_WIDGET_URL' field to the database. * Incremented the database version to 374. * Added 'RDAirPlayConf::messageWidgetUrl()' and 'RDAirPlayConf::setMessageWidgetUrl()' methods. * Modified rdairplay(1) to make the Message Widget retain the loaded URL across instances. * Modified rdairplay(1) to make the Message Widget continually poll and update loaded URLs using the 'file:' schema. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -749,6 +749,24 @@ void RDAirPlayConf::setAuditionPreroll(int msecs) const
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::messageWidgetUrl() const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,"MESSAGE_WIDGET_URL").
|
||||
toString();
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setMessageWidgetUrl(const QString url)
|
||||
{
|
||||
if(url.trimmed().isEmpty()) {
|
||||
SetRowNull("MESSAGE_WIDGET_URL");
|
||||
}
|
||||
else {
|
||||
SetRow("MESSAGE_WIDGET_URL",url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RDAirPlayConf::StartMode RDAirPlayConf::startMode(int lognum) const
|
||||
{
|
||||
RDAirPlayConf::StartMode ret=RDAirPlayConf::StartEmpty;
|
||||
@@ -1162,50 +1180,53 @@ void RDAirPlayConf::SetLogMode(const QString ¶m,int mach,
|
||||
RDAirPlayConf::OpMode mode) const
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("update `LOG_MODES` set `")+param+QString::asprintf("`=%d ",mode)+
|
||||
"where (`STATION_NAME`='"+RDEscapeString(air_station)+"')&&"+
|
||||
QString::asprintf("(`MACHINE`=%d)",mach);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::SetRow(const QString ¶m,int value) const
|
||||
{
|
||||
RDSqlQuery *q;
|
||||
QString sql;
|
||||
|
||||
sql=QString("update `")+air_tablename+"` set `"+
|
||||
param+QString::asprintf("`=%d where ",value)+
|
||||
"`STATION`='"+RDEscapeString(air_station)+"'";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::SetRow(const QString ¶m,unsigned value) const
|
||||
{
|
||||
RDSqlQuery *q;
|
||||
QString sql;
|
||||
|
||||
sql=QString("update `")+air_tablename+"` set `"+
|
||||
param+QString::asprintf("`=%u where ",value)+
|
||||
"`STATION`='"+RDEscapeString(air_station)+"'";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::SetRow(const QString ¶m,const QString &value) const
|
||||
{
|
||||
RDSqlQuery *q;
|
||||
QString sql;
|
||||
|
||||
sql=QString("update `")+air_tablename+"` set `"+
|
||||
param+"`='"+RDEscapeString(value)+"' where "+
|
||||
"`STATION`='"+RDEscapeString(air_station)+"'";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::SetRowNull(const QString ¶m) const
|
||||
{
|
||||
QString sql;
|
||||
|
||||
sql=QString("update `")+air_tablename+"` set `"+
|
||||
param+"`=NULL where "+
|
||||
"`STATION`='"+RDEscapeString(air_station)+"'";
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user