mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-29 07:02:34 +02:00
2025-04-26 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up compiler warning in 'lib/'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
79518592e4
commit
03307341bc
@ -24977,3 +24977,5 @@
|
||||
* Incremented the package version to 4.3.0int8.
|
||||
2025-04-24 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'RDTimeArray' class for optimization and debugging.
|
||||
2025-04-26 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Cleaned up compiler warning in 'lib/'.
|
||||
|
@ -90,9 +90,9 @@ void RDBiPushButton::paintEvent(QPaintEvent *e)
|
||||
p->setPen(palette().color(QPalette::Disabled,QPalette::ButtonText));
|
||||
}
|
||||
p->setFont(buttonFont());
|
||||
p->drawText((w-m->width(d_top_text))/2,h/2-5,d_top_text);
|
||||
p->drawText((w-m->horizontalAdvance(d_top_text))/2,h/2-5,d_top_text);
|
||||
p->drawLine(10,h/2,w-10,h/2);
|
||||
p->drawText((w-m->width(d_bottom_text))/2,h/2+m->height(),d_bottom_text);
|
||||
p->drawText((w-m->horizontalAdvance(d_bottom_text))/2,h/2+m->height(),d_bottom_text);
|
||||
p->end();
|
||||
delete p;
|
||||
}
|
||||
|
@ -204,12 +204,12 @@ bool RDCae::connectHost(QString *err_msg)
|
||||
}
|
||||
usleep(100000);
|
||||
if(count>0) {
|
||||
SendCommand(QString().sprintf("PW %s!",
|
||||
SendCommand(QString::asprintf("PW %s!",
|
||||
cae_config->password().toUtf8().constData()));
|
||||
for(int i=0;i<RD_MAX_CARDS;i++) {
|
||||
SendCommand(QString().sprintf("TS %d!",i));
|
||||
SendCommand(QString::asprintf("TS %d!",i));
|
||||
for(int j=0;j<RD_MAX_PORTS;j++) {
|
||||
SendCommand(QString().sprintf("IS %d %d!",i,j));
|
||||
SendCommand(QString::asprintf("IS %d %d!",i,j));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -226,7 +226,7 @@ bool RDCae::connectHost(QString *err_msg)
|
||||
|
||||
void RDCae::enableMetering(QList<int> *cards)
|
||||
{
|
||||
QString cmd=QString().sprintf("ME %u",0xFFFF&cae_meter_port);
|
||||
QString cmd=QString::asprintf("ME %u",0xFFFF&cae_meter_port);
|
||||
for(int i=0;i<cards->size();i++) {
|
||||
if(cards->at(i)>=0) {
|
||||
bool found=false;
|
||||
@ -236,7 +236,7 @@ void RDCae::enableMetering(QList<int> *cards)
|
||||
}
|
||||
}
|
||||
if(!found) {
|
||||
cmd+=QString().sprintf(" %d",cards->at(i));
|
||||
cmd+=QString::asprintf(" %d",cards->at(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -247,7 +247,7 @@ void RDCae::enableMetering(QList<int> *cards)
|
||||
unsigned RDCae::loadPlay(unsigned card,unsigned port,const QString &name)
|
||||
{
|
||||
unsigned serial=next_serial_number++;
|
||||
SendCommand(QString().sprintf("LP %u %u %u %s!",
|
||||
SendCommand(QString::asprintf("LP %u %u %u %s!",
|
||||
serial,card,port,name.toUtf8().constData()));
|
||||
bool found=false;
|
||||
for(QMap<unsigned,__RDCae_PlayChannel *>::const_iterator it=cae_play_channels.begin();it!=cae_play_channels.end();it++) {
|
||||
@ -267,7 +267,7 @@ unsigned RDCae::loadPlay(unsigned card,unsigned port,const QString &name)
|
||||
|
||||
void RDCae::unloadPlay(unsigned serial)
|
||||
{
|
||||
SendCommand(QString().sprintf("UP %u!",serial));
|
||||
SendCommand(QString::asprintf("UP %u!",serial));
|
||||
}
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ void RDCae::positionPlay(unsigned serial,int pos)
|
||||
if(pos<0) {
|
||||
return;
|
||||
}
|
||||
SendCommand(QString().sprintf("PP %u %u!",serial,pos));
|
||||
SendCommand(QString::asprintf("PP %u %u!",serial,pos));
|
||||
}
|
||||
|
||||
|
||||
@ -288,14 +288,14 @@ void RDCae::play(unsigned serial,unsigned length,int speed,bool pitch)
|
||||
pitch_state=1;
|
||||
}
|
||||
//printf(" play: %s\n",QTime::currentTime().toString("hh:mm:ss.zzz").toUtf8().constData());
|
||||
SendCommand(QString().sprintf("PY %u %u %d %d!",
|
||||
SendCommand(QString::asprintf("PY %u %u %d %d!",
|
||||
serial,length,speed,pitch_state));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::stopPlay(unsigned serial)
|
||||
{
|
||||
SendCommand(QString().sprintf("SP %u!",serial));
|
||||
SendCommand(QString::asprintf("SP %u!",serial));
|
||||
}
|
||||
|
||||
|
||||
@ -303,7 +303,7 @@ void RDCae::loadRecord(int card,int stream,QString name,
|
||||
AudioCoding coding,int chan,int samp_rate,
|
||||
int bit_rate)
|
||||
{
|
||||
SendCommand(QString().sprintf("LR %d %d %d %d %d %d %s!",
|
||||
SendCommand(QString::asprintf("LR %d %d %d %d %d %d %s!",
|
||||
card,stream,(int)coding,chan,samp_rate,
|
||||
bit_rate,name.toUtf8().constData()));
|
||||
}
|
||||
@ -311,87 +311,86 @@ void RDCae::loadRecord(int card,int stream,QString name,
|
||||
|
||||
void RDCae::unloadRecord(int card,int stream)
|
||||
{
|
||||
SendCommand(QString().sprintf("UR %d %d!",card,stream));
|
||||
SendCommand(QString::asprintf("UR %d %d!",card,stream));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::record(int card,int stream,unsigned length,int threshold)
|
||||
{
|
||||
SendCommand(QString().sprintf("RD %d %d %u %d!",
|
||||
SendCommand(QString::asprintf("RD %d %d %u %d!",
|
||||
card,stream,length,threshold));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::stopRecord(int card,int stream)
|
||||
{
|
||||
SendCommand(QString().sprintf("SR %d %d!",card,stream));
|
||||
SendCommand(QString::asprintf("SR %d %d!",card,stream));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setClockSource(int card,RDCae::ClockSource src)
|
||||
{
|
||||
SendCommand(QString().sprintf("CS %d %d!",card,src));
|
||||
SendCommand(QString::asprintf("CS %d %d!",card,src));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setInputVolume(int card,int stream,int level)
|
||||
{
|
||||
SendCommand(QString().sprintf("IV %d %d %d!",card,stream,level));
|
||||
SendCommand(QString::asprintf("IV %d %d %d!",card,stream,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setOutputVolume(unsigned serial,int level)
|
||||
{
|
||||
SendCommand(QString().sprintf("OV %u %d!",serial,level));
|
||||
SendCommand(QString::asprintf("OV %u %d!",serial,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::fadeOutputVolume(unsigned serial,int level,int length)
|
||||
{
|
||||
SendCommand(QString().sprintf("FV %u %d %d!",serial,level,length));
|
||||
SendCommand(QString::asprintf("FV %u %d %d!",serial,level,length));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setInputLevel(int card,int port,int level)
|
||||
{
|
||||
SendCommand(QString().sprintf("IL %d %d %d!",card,port,level));
|
||||
SendCommand(QString::asprintf("IL %d %d %d!",card,port,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setOutputLevel(int card,int port,int level)
|
||||
{
|
||||
SendCommand(QString().sprintf("OL %d %d %d!",card,port,level));
|
||||
SendCommand(QString::asprintf("OL %d %d %d!",card,port,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setInputMode(int card,int stream,RDCae::ChannelMode mode)
|
||||
{
|
||||
SendCommand(QString().sprintf("IM %d %d %d!",card,stream,mode));
|
||||
SendCommand(QString::asprintf("IM %d %d %d!",card,stream,mode));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setOutputMode(int card,int stream,RDCae::ChannelMode mode)
|
||||
{
|
||||
SendCommand(QString().sprintf("OM %d %d %d!",card,stream,mode));
|
||||
SendCommand(QString::asprintf("OM %d %d %d!",card,stream,mode));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setInputVOXLevel(int card,int stream,int level)
|
||||
{
|
||||
SendCommand(QString().sprintf("IX %d %d %d!",card,stream,level));
|
||||
SendCommand(QString::asprintf("IX %d %d %d!",card,stream,level));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setInputType(int card,int port,RDCae::SourceType type)
|
||||
{
|
||||
SendCommand(QString().sprintf("IT %d %d %d!",card,port,type));
|
||||
SendCommand(QString::asprintf("IT %d %d %d!",card,port,type));
|
||||
}
|
||||
|
||||
|
||||
void RDCae::setPassthroughVolume(int card,int in_port,int out_port,int level)
|
||||
{
|
||||
SendCommand(QString().
|
||||
sprintf("AL %d %d %d %d!",card,in_port,out_port,level));
|
||||
SendCommand(QString::asprintf("AL %d %d %d %d!",card,in_port,out_port,level));
|
||||
}
|
||||
|
||||
|
||||
@ -442,7 +441,7 @@ unsigned RDCae::playPosition(unsigned serial)
|
||||
|
||||
void RDCae::requestTimescale(int card)
|
||||
{
|
||||
SendCommand(QString().sprintf("TS %d!",card));
|
||||
SendCommand(QString::asprintf("TS %d!",card));
|
||||
}
|
||||
|
||||
|
||||
@ -495,7 +494,7 @@ void RDCae::SendCommand(QString cmd)
|
||||
void RDCae::DispatchCommand(const QString &cmd)
|
||||
{
|
||||
__RDCae_PlayChannel *chan=NULL;
|
||||
QStringList cmds=cmd.split(" ",QString::SkipEmptyParts);
|
||||
QStringList cmds=cmd.split(" ",Qt::SkipEmptyParts);
|
||||
bool was_processed=false;
|
||||
bool ok=false;
|
||||
|
||||
|
@ -216,9 +216,9 @@ void RDCardSelector::portData(int port)
|
||||
|
||||
void RDCardSelector::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
int label_width=defaultFontMetrics()->width(tr("Card:"));
|
||||
if(defaultFontMetrics()->width(tr("Port:")>label_width)) {
|
||||
label_width=defaultFontMetrics()->width(tr("Port:"));
|
||||
int label_width=defaultFontMetrics()->horizontalAdvance(tr("Card:"));
|
||||
if(defaultFontMetrics()->horizontalAdvance(tr("Port:")>label_width)) {
|
||||
label_width=defaultFontMetrics()->horizontalAdvance(tr("Port:"));
|
||||
}
|
||||
card_title->setGeometry(0,0,width(),19);
|
||||
card_card_label->setGeometry(0,
|
||||
|
@ -571,7 +571,7 @@ void RDCartFilter::resizeEvent(QResizeEvent *e)
|
||||
d_group_box->setGeometry(70,38,140,24);
|
||||
d_codes_label->setGeometry(215,40,115,20);
|
||||
d_codes_box->setGeometry(335,38,120,24);
|
||||
d_and_codes_label->setGeometry(455,40,labelFontMetrics()->width(d_and_codes_label->text()),20);
|
||||
d_and_codes_label->setGeometry(455,40,labelFontMetrics()->horizontalAdvance(d_and_codes_label->text()),20);
|
||||
d_and_codes_box->setGeometry(d_and_codes_label->x()+d_and_codes_label->width(),38,120,24);
|
||||
d_matches_label->setGeometry(660,40,100,20);
|
||||
d_matches_edit->setGeometry(765,40,55,20);
|
||||
@ -602,7 +602,7 @@ QString RDCartFilter::phraseFilter(QString phrase, bool incl_cuts)
|
||||
//
|
||||
// Separate Out Cart Numbers
|
||||
//
|
||||
QStringList words=phrase.split(" ",QString::KeepEmptyParts);
|
||||
QStringList words=phrase.split(" ",Qt::KeepEmptyParts);
|
||||
for(int i=0;i<words.size();i++) {
|
||||
unsigned cartnum=words.at(i).toUInt(&ok);
|
||||
if(ok&&(cartnum>0)&&(cartnum<=RD_MAX_CART_NUMBER)) {
|
||||
|
@ -614,8 +614,7 @@ unsigned RDCartSlot::SelectCart(const QString &svcname,unsigned msecs)
|
||||
"`CART`.`FORCED_LENGTH` "+ // 01
|
||||
"from "+
|
||||
"`AUTOFILLS` left join `CART` on `AUTOFILLS`.`CART_NUMBER`=`CART`.`NUMBER`"+
|
||||
QString().
|
||||
sprintf(" where (`CART`.`FORCED_LENGTH`>%u)&&(`CART`.`FORCED_LENGTH`<%u)&&",
|
||||
QString::asprintf(" where (`CART`.`FORCED_LENGTH`>%u)&&(`CART`.`FORCED_LENGTH`<%u)&&",
|
||||
(unsigned)((double)msecs*RD_TIMESCALE_MIN),
|
||||
(unsigned)((double)msecs*RD_TIMESCALE_MAX))+
|
||||
"(`SERVICE`='"+RDEscapeString(svcname)+"')";
|
||||
|
@ -256,7 +256,7 @@ bool RDCatchEvent::read(const QString &str)
|
||||
|
||||
case RDCatchEvent::SendMeterLevelsOp:
|
||||
for(int i=2;i<f0.size();i++) {
|
||||
QStringList f1=f0.at(i).split(":",QString::KeepEmptyParts);
|
||||
QStringList f1=f0.at(i).split(":",Qt::KeepEmptyParts);
|
||||
if(f1.size()==(1+RDCatchMeterLevel::LastChannel)) {
|
||||
chan=f1.at(0).toUInt(&ok);
|
||||
if(chan>=255) {
|
||||
|
@ -232,7 +232,7 @@ void RDCddbLookup::readyReadData()
|
||||
QApplication::restoreOverrideCursor();
|
||||
if((index_line=exec())>=0) {
|
||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
f0=titlesKey()->at(index_line).split(" ",QString::SkipEmptyParts);
|
||||
f0=titlesKey()->at(index_line).split(" ",Qt::SkipEmptyParts);
|
||||
if(f0.size()!=2) {
|
||||
FinishCddbLookup(RDCddbLookup::LookupError,
|
||||
"Unexpected response from CDDB server");
|
||||
|
@ -59,7 +59,7 @@ RDCmdSwitch::RDCmdSwitch(const QString &modname,const QString &usage)
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
QStringList f0=value.split("=",QString::KeepEmptyParts);
|
||||
QStringList f0=value.split("=",Qt::KeepEmptyParts);
|
||||
if(f0.size()>=2) {
|
||||
if(f0.at(0).left(1)=="-") {
|
||||
switch_keys.push_back(f0.at(0));
|
||||
@ -115,7 +115,7 @@ RDCmdSwitch::RDCmdSwitch(int argc,char *argv[],const QString &modname,
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
QStringList f0=value.split("=",QString::KeepEmptyParts);
|
||||
QStringList f0=value.split("=",Qt::KeepEmptyParts);
|
||||
if(f0.size()>=2) {
|
||||
if(f0.at(0).left(1)=="-") {
|
||||
switch_keys.push_back(f0.at(0));
|
||||
|
@ -970,8 +970,8 @@ bool RDProcessActive(const QStringList &cmds)
|
||||
if(ok) {
|
||||
if((f=fopen((QString("/proc/")+dirs[i]+"/cmdline").toUtf8(),"r"))!=NULL) {
|
||||
if(fgets(line,1024,f)!=NULL) {
|
||||
QStringList f1=QString(line).split(" ",QString::SkipEmptyParts);
|
||||
QStringList f2=f1[0].split("/",QString::SkipEmptyParts);
|
||||
QStringList f1=QString(line).split(" ",Qt::SkipEmptyParts);
|
||||
QStringList f2=f1[0].split("/",Qt::SkipEmptyParts);
|
||||
cmdline=f2[f2.size()-1];
|
||||
for(int j=0;j<cmds.size();j++) {
|
||||
if(cmdline==cmds[j]) {
|
||||
@ -1011,45 +1011,7 @@ bool RDModulesActive()
|
||||
|
||||
QByteArray RDStringToData(const QString &str)
|
||||
{
|
||||
int istate=0;
|
||||
unsigned n;
|
||||
QString code;
|
||||
QByteArray ret;
|
||||
bool ok=false;
|
||||
|
||||
for(int i=0;i<str.length();i++) {
|
||||
switch(istate) {
|
||||
case 0:
|
||||
if(str.at(i)==QChar('%')) {
|
||||
istate=1;
|
||||
}
|
||||
else {
|
||||
ret+=str.at(i);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
n=str.mid(i,1).toUInt(&ok);
|
||||
if((!ok)||(n>9)) {
|
||||
istate=0;
|
||||
}
|
||||
code=str.mid(i,1);
|
||||
istate=2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
n=str.mid(i,1).toUInt(&ok);
|
||||
if((!ok)||(n>9)) {
|
||||
istate=0;
|
||||
}
|
||||
code+=str.mid(i,1);
|
||||
ret+=code.toUInt(NULL,16);
|
||||
istate=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return str.toUtf8();
|
||||
}
|
||||
|
||||
|
||||
@ -1143,7 +1105,7 @@ QString RDMimeType(const QString &filename,bool *ok)
|
||||
}
|
||||
*ok=true;
|
||||
ret=QString(proc->readAllStandardOutput()).
|
||||
split(":",QString::SkipEmptyParts).last().trimmed();
|
||||
split(":",Qt::SkipEmptyParts).last().trimmed();
|
||||
|
||||
delete proc;
|
||||
|
||||
@ -1173,7 +1135,7 @@ QString RDMimeType(const QByteArray &data,bool *ok)
|
||||
*ok=true;
|
||||
|
||||
ret=QString(proc->readAllStandardOutput()).
|
||||
split(":",QString::SkipEmptyParts).last().trimmed();
|
||||
split(":",Qt::SkipEmptyParts).last().trimmed();
|
||||
|
||||
delete proc;
|
||||
|
||||
@ -1185,7 +1147,7 @@ QString RDWrapText(const QString &str,int width)
|
||||
{
|
||||
QString line;
|
||||
QString ret;
|
||||
QStringList f0=str.split(" ",QString::KeepEmptyParts);
|
||||
QStringList f0=str.split(" ",Qt::KeepEmptyParts);
|
||||
int fn=0;
|
||||
|
||||
while(fn<f0.size()) {
|
||||
|
@ -753,8 +753,8 @@ bool RDConfig::load()
|
||||
int c=1;
|
||||
QString dest;
|
||||
while(!(dest=profile->
|
||||
stringValue("RDBackup",QString().
|
||||
sprintf("Destination%d",c++),"")).isEmpty()) {
|
||||
stringValue("RDBackup",
|
||||
QString::asprintf("Destination%d",c++),"")).isEmpty()) {
|
||||
conf_destinations.push_back(dest);
|
||||
}
|
||||
delete profile;
|
||||
|
@ -678,7 +678,7 @@ bool RDCoreApplication::isUniqueProcess(const QString &cmdname)
|
||||
QFile *file=new QFile("/proc/"+dirs.at(i)+"/cmdline");
|
||||
if(file->open(QIODevice::ReadOnly)) {
|
||||
QString cmdline(QString::fromUtf8(file->readAll()));
|
||||
QStringList f0=cmdline.trimmed().split("/",QString::SkipEmptyParts);
|
||||
QStringList f0=cmdline.trimmed().split("/",Qt::SkipEmptyParts);
|
||||
if((f0.size()>0)&&(f0.last().trimmed()==cmdname)) {
|
||||
delete file;
|
||||
return false;
|
||||
@ -720,7 +720,7 @@ void RDCoreApplication::userChangedData()
|
||||
delete q;
|
||||
}
|
||||
fprintf(stderr,"%s: %s\n",
|
||||
QString(qApp->arguments().at(0)).split("/",QString::SkipEmptyParts).last().toUtf8().constData(),
|
||||
QString(qApp->arguments().at(0)).split("/",Qt::SkipEmptyParts).last().toUtf8().constData(),
|
||||
RDCoreApplication::exitCodeText(RDCoreApplication::ExitBadTicket).
|
||||
toUtf8().constData());
|
||||
exit(RDCoreApplication::ExitBadTicket);
|
||||
@ -769,7 +769,7 @@ QString RDCoreApplication::commandName() const
|
||||
else {
|
||||
*err_msg=tr("Rivendell service is not active.");
|
||||
QStringList f0=QString(proc->readAllStandardOutput()).
|
||||
split("\n",QString::SkipEmptyParts);
|
||||
split("\n",Qt::SkipEmptyParts);
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
QStringList f1=f0.at(i).trimmed().split("=");
|
||||
if((f1.size()==2)&&(f1.at(0)=="ActiveState")) {
|
||||
|
@ -639,10 +639,10 @@ void RDCueEdit::wheelEvent(QWheelEvent *e)
|
||||
edit_play_deck->pause();
|
||||
}
|
||||
if(edit_shift_pressed) {
|
||||
edit_slider->setValue(edit_slider->value()+(e->delta()*10)/12);
|
||||
edit_slider->setValue(edit_slider->value()+(e->angleDelta().y()*10)/12);
|
||||
}
|
||||
else {
|
||||
edit_slider->setValue(edit_slider->value()+(e->delta()*100)/12);
|
||||
edit_slider->setValue(edit_slider->value()+(e->angleDelta().y()*100)/12);
|
||||
}
|
||||
sliderChangedData(edit_slider->value());
|
||||
}
|
||||
|
@ -1120,7 +1120,7 @@ void RDCut::setMetadata(RDWaveData *data) const
|
||||
sql+=QString::asprintf("`START_POINT`=%d,",data->startPos());
|
||||
}
|
||||
if(data->endPos()>=0) {
|
||||
if(data->endPos()>length()) {
|
||||
if((unsigned)data->endPos()>length()) {
|
||||
sql+=QString::asprintf("`END_POINT`=%d,",length());
|
||||
}
|
||||
else {
|
||||
@ -1205,7 +1205,7 @@ void RDCut::setMetadata(RDWaveData *data) const
|
||||
}
|
||||
if(data->startDate().isValid() &&
|
||||
(data->startDate()>QDate(1900,1,1))&&(data->endDate().year()<8000)) {
|
||||
QDateTime startDateTime(data->startDate());
|
||||
QDateTime startDateTime=data->startDate().startOfDay();
|
||||
if(data->startTime().isValid()) {
|
||||
startDateTime.setTime(data->startTime());
|
||||
}
|
||||
@ -1215,7 +1215,7 @@ void RDCut::setMetadata(RDWaveData *data) const
|
||||
sql+=QString("`START_DATETIME`=")+
|
||||
RDCheckDateTime(startDateTime,"yyyy-MM-dd hh:mm:ss")+",";
|
||||
if(data->endDate().isValid()&&(data->endDate().year()<8000)) {
|
||||
QDateTime endDateTime(data->endDate());
|
||||
QDateTime endDateTime=data->endDate().startOfDay();
|
||||
if(data->endTime().isValid()) {
|
||||
endDateTime.setTime(data->endTime());
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ void RDCutListModel::sortRows(int use_weighting)
|
||||
for(int i=0;i<(d_row_index.size()-1);i++) {
|
||||
if(d_texts.at(d_row_index.at(i)).at(12).toString()>
|
||||
d_texts.at(d_row_index.at(i+1)).at(12).toString()) {
|
||||
d_row_index.swap(i,i+1);
|
||||
d_row_index.swapItemsAt(i,i+1);
|
||||
modified=true;
|
||||
}
|
||||
}
|
||||
@ -494,7 +494,7 @@ void RDCutListModel::sortRows(int use_weighting)
|
||||
for(int i=0;i<(d_row_index.size()-1);i++) {
|
||||
if(d_texts.at(d_row_index.at(i)).at(0).toInt()>
|
||||
d_texts.at(d_row_index.at(i+1)).at(0).toInt()) {
|
||||
d_row_index.swap(i,i+1);
|
||||
d_row_index.swapItemsAt(i,i+1);
|
||||
modified=true;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Decode Rivendell Date Macros
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -142,24 +142,27 @@ QString RDDateDecode(QString str,const QDate &date,RDStation *station,
|
||||
}
|
||||
|
||||
//
|
||||
// Wildcard Lookup
|
||||
// Wildcard Lookups
|
||||
//
|
||||
// Maintainer's Note: These lookups should be locale-independent. Do
|
||||
// *not* use QLocale methods to resolve these!
|
||||
//
|
||||
switch(str.at(i).toLatin1()) {
|
||||
case 'a': // Abbreviated weekday name
|
||||
field=QDate::shortDayName(dt.dayOfWeek()).toLower();
|
||||
field=RDShortDayName(dt.dayOfWeek()).toLower();
|
||||
break;
|
||||
|
||||
case 'A': // Full weekday name
|
||||
field=QDate::longDayName(dt.dayOfWeek()).toLower();
|
||||
field=RDLongDayName(dt.dayOfWeek()).toLower();
|
||||
break;
|
||||
|
||||
case 'b': // Abbreviated month name
|
||||
case 'h':
|
||||
field=QDate::shortMonthName(dt.month()).toLower();
|
||||
field=RDShortMonthName(dt.month()).toLower();
|
||||
break;
|
||||
|
||||
case 'B': // Full month name
|
||||
field=QDate::longMonthName(dt.month()).toLower();
|
||||
field=RDLongMonthName(dt.month()).toLower();
|
||||
break;
|
||||
|
||||
case 'C': // Century
|
||||
@ -357,20 +360,20 @@ QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
//
|
||||
switch(str.at(i).toLatin1()) {
|
||||
case 'a': // Abbreviated weekday name
|
||||
field=QDate::shortDayName(dt.date().dayOfWeek()).toLower();
|
||||
field=RDShortDayName(dt.date().dayOfWeek()).toLower();
|
||||
break;
|
||||
|
||||
case 'A': // Full weekday name
|
||||
field=QDate::longDayName(dt.date().dayOfWeek()).toLower();
|
||||
field=RDLongDayName(dt.date().dayOfWeek()).toLower();
|
||||
break;
|
||||
|
||||
case 'b': // Abbreviated month name
|
||||
case 'h':
|
||||
field=QDate::shortMonthName(dt.date().month()).toLower();
|
||||
field=RDShortMonthName(dt.date().month()).toLower();
|
||||
break;
|
||||
|
||||
case 'B': // Full month name
|
||||
field=QDate::longMonthName(dt.date().month()).toLower();
|
||||
field=RDLongMonthName(dt.date().month()).toLower();
|
||||
break;
|
||||
|
||||
case 'C': // Century
|
||||
@ -529,3 +532,198 @@ QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Local-independent date element names
|
||||
//
|
||||
QString RDShortDayName(int dow)
|
||||
{
|
||||
QString ret="Xxx";
|
||||
|
||||
switch(dow) {
|
||||
case 1:
|
||||
ret="Mon";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ret="Tue";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ret="Wed";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ret="Thu";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ret="Fri";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ret="Sat";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ret="Sun";
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDLongDayName(int dow)
|
||||
{
|
||||
QString ret="Unknown";
|
||||
|
||||
switch(dow) {
|
||||
case 1:
|
||||
ret="Monday";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ret="Tuesday";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ret="Wednesday";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ret="Thursday";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ret="Friday";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ret="Saturday";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ret="Sunday";
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDShortMonthName(int month)
|
||||
{
|
||||
QString ret="Xxx";
|
||||
|
||||
switch(month) {
|
||||
case 1:
|
||||
ret="Jan";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ret="Feb";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ret="Mar";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ret="Apr";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ret="May";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ret="Jun";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ret="Jul";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
ret="Aug";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ret="Sep";
|
||||
break;
|
||||
|
||||
case 10:
|
||||
ret="Oct";
|
||||
break;
|
||||
|
||||
case 11:
|
||||
ret="Nov";
|
||||
break;
|
||||
|
||||
case 12:
|
||||
ret="Dec";
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDLongMonthName(int month)
|
||||
{
|
||||
QString ret="Unknown";
|
||||
|
||||
switch(month) {
|
||||
case 1:
|
||||
ret="January";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ret="February";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ret="March";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ret="April";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ret="May";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ret="June";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
ret="July";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
ret="August";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
ret="Sepember";
|
||||
break;
|
||||
|
||||
case 10:
|
||||
ret="October";
|
||||
break;
|
||||
|
||||
case 11:
|
||||
ret="November";
|
||||
break;
|
||||
|
||||
case 12:
|
||||
ret="December";
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Decode Rivendell Date Macros
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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,6 +31,10 @@ QString RDDateDecode(QString str,const QDate &date,RDStation *station,
|
||||
QString RDDateTimeDecode(QString str,const QDateTime &datetime,
|
||||
RDStation *station,RDConfig *config,
|
||||
const QString &svcname="");
|
||||
QString RDShortDayName(int dow);
|
||||
QString RDLongDayName(int dow);
|
||||
QString RDShortMonthName(int month);
|
||||
QString RDLongMonthName(int month);
|
||||
|
||||
|
||||
#endif // RDDATEDECODE
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Calendar Widget.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -25,6 +25,7 @@
|
||||
RDDatePicker::RDDatePicker(int low_year,int high_year,QWidget *parent)
|
||||
: RDWidget(parent)
|
||||
{
|
||||
QLocale locale;
|
||||
pick_low_year=low_year;
|
||||
pick_high_year=high_year;
|
||||
|
||||
@ -34,7 +35,8 @@ RDDatePicker::RDDatePicker(int low_year,int high_year,QWidget *parent)
|
||||
pick_month_box=new QComboBox(this);
|
||||
pick_month_box->setGeometry(0,0,120,26);
|
||||
for(int i=1;i<13;i++) {
|
||||
pick_month_box->insertItem(pick_month_box->count(),QDate::longMonthName(i));
|
||||
pick_month_box->
|
||||
insertItem(pick_month_box->count(),locale.standaloneMonthName(i));
|
||||
}
|
||||
connect(pick_month_box,SIGNAL(activated(int)),
|
||||
this,SLOT(monthActivatedData(int)));
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Parse and write dates/times in various standard formats.
|
||||
//
|
||||
// (C) Copyright 2019-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2019-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -160,8 +160,8 @@ QString RDWriteXmlTime(const QTime &time)
|
||||
if(utc_off<0) {
|
||||
tz_str="+";
|
||||
}
|
||||
tz_str+=QString().
|
||||
sprintf("%02d:%02d",utc_off/3600,(utc_off-3600*(utc_off/3600))/60);
|
||||
tz_str+=QString::asprintf("%02d:%02d",utc_off/3600,
|
||||
(utc_off-3600*(utc_off/3600))/60);
|
||||
|
||||
return time.toString("hh:mm:ss")+tz_str;
|
||||
}
|
||||
@ -234,7 +234,7 @@ QString RDWriteXmlDateTime(const QDateTime &dt)
|
||||
//
|
||||
QDateTime RDParseRfc822DateTime(const QString &str,bool *ok)
|
||||
{
|
||||
QStringList f0=str.trimmed().split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=str.trimmed().split(" ",Qt::SkipEmptyParts);
|
||||
|
||||
//
|
||||
// Remove useless day-of-the-week tag
|
||||
@ -347,8 +347,8 @@ QString RDWriteRfc822DateTime(const QDateTime &dt)
|
||||
if(utc_off<0) {
|
||||
tz_str="+";
|
||||
}
|
||||
tz_str+=QString().
|
||||
sprintf("%02d%02d",utc_off/3600,(utc_off-3600*(utc_off/3600))/60);
|
||||
tz_str+=QString::asprintf("%02d%02d",utc_off/3600,
|
||||
(utc_off-3600*(utc_off/3600))/60);
|
||||
|
||||
return __rddatetime_dow_names[dt.date().dayOfWeek()-1]+", "+
|
||||
QString::asprintf("%d ",dt.date().day())+
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Deck.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -41,8 +41,7 @@ RDDeck::RDDeck(QString station,unsigned channel,bool create)
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->size()!=1) {
|
||||
delete q;
|
||||
sql=QString().
|
||||
sprintf("insert into `DECKS` set ")+
|
||||
sql=QString::asprintf("insert into `DECKS` set ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(deck_station)+"',"+
|
||||
QString::asprintf("`CHANNEL`=%d",deck_channel);
|
||||
RDSqlQuery::apply(sql);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Delete a file from the audio store via the Rivendell Web Service
|
||||
//
|
||||
// (C) Copyright 2010-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2010-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -151,7 +151,7 @@ RDDelete::ErrorCode RDDelete::runDelete(const QString &username,
|
||||
}
|
||||
|
||||
if(conv_target_url.scheme().toLower()=="ftp"||conv_target_url.scheme().toLower()=="ftps") {
|
||||
QStringList f0=conv_target_url.path().split("/",QString::SkipEmptyParts);
|
||||
QStringList f0=conv_target_url.path().split("/",Qt::SkipEmptyParts);
|
||||
filename=f0.last();
|
||||
f0.removeLast();
|
||||
if(f0.size()>0) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Base class for CD metadata lookup methods
|
||||
//
|
||||
// (C) Copyright 2003-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2003-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -496,7 +496,7 @@ bool RDDiscLookup::ReadCdText(const QString &cdda_dev)
|
||||
//
|
||||
for(int i=0;i<lookup_record->tracks();i++) {
|
||||
title_profile->setSource(tempDirectoryPath()+
|
||||
QString().sprintf("/audio_%02d.inf",i+1));
|
||||
QString::asprintf("/audio_%02d.inf",i+1));
|
||||
str=title_profile->stringValue("","Albumtitle","");
|
||||
str.remove("'");
|
||||
if((!str.isEmpty())&&(str!="''")) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Container Class for Compact Disc Metadata
|
||||
//
|
||||
// (C) Copyright 2003-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2003-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -32,7 +32,7 @@ void RDDiscRecord::clear()
|
||||
{
|
||||
for(int i=0;i<CDROM_LEADOUT;i++) {
|
||||
disc_track_title[RDDiscRecord::LocalSource][i]=
|
||||
QObject::tr("Track")+QString().sprintf(" %d",i+1);
|
||||
QObject::tr("Track")+QString::asprintf(" %d",i+1);
|
||||
disc_track_title[RDDiscRecord::RemoteSource][i]="";
|
||||
}
|
||||
for(int i=0;i<RDDiscRecord::LastSource;i++) {
|
||||
@ -405,7 +405,7 @@ QString RDDiscRecord::summary(RDDiscRecord::DataSource src) const
|
||||
discArtist(src)+"<br>\n";
|
||||
}
|
||||
for(int i=0;i<tracks();i++) {
|
||||
ret+="<strong>"+QObject::tr("Track")+QString().sprintf(" %2d: ",i+1)+
|
||||
ret+="<strong>"+QObject::tr("Track")+QString::asprintf(" %2d: ",i+1)+
|
||||
"</strong>"+trackTitle(src,i)+"<br>\n";
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ QString RDDiscRecord::summary(RDDiscRecord::DataSource src) const
|
||||
|
||||
QString RDDiscRecord::dump(RDDiscRecord::DataSource src) const
|
||||
{
|
||||
QString ret=QString().sprintf("RDDiscRecord::dump(%u)\n",src);
|
||||
QString ret=QString::asprintf("RDDiscRecord::dump(%u)\n",src);
|
||||
|
||||
ret+=QString::asprintf("tracks: %d\n",tracks());
|
||||
ret+=QString::asprintf("discLength: %d\n",discLength());
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Log Manager Event
|
||||
//
|
||||
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -1116,7 +1116,7 @@ void RDEventLine::GenerateMusicSchedEvent(__RDEventLine_GeneratorState *state,
|
||||
RDSchedCartList *schedCL=new RDSchedCartList();
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
QStringList codes=q->value(3).toString().split("|",QString::SkipEmptyParts);
|
||||
QStringList codes=q->value(3).toString().split("|",Qt::SkipEmptyParts);
|
||||
if((codes.size()>0)&&(codes.last()==".")) {
|
||||
codes.removeLast();
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell RSS Feed
|
||||
//
|
||||
// (C) Copyright 2002-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -816,7 +816,7 @@ int RDFeed::importImageFile(const QString &pathname,QString *err_msg,
|
||||
//
|
||||
QString im_err;
|
||||
|
||||
QStringList f0=pathname.split(".",QString::SkipEmptyParts);
|
||||
QStringList f0=pathname.split(".",Qt::SkipEmptyParts);
|
||||
sql=QString("insert into `FEED_IMAGES` set ")+
|
||||
QString::asprintf("`FEED_ID`=%u,",id())+
|
||||
"`FEED_KEY_NAME`='"+RDEscapeString(keyName())+"',"+
|
||||
@ -1980,12 +1980,12 @@ bool RDFeed::frontActiveCasts(QList<unsigned> *cast_ids,QString *err_msg)
|
||||
RDXsltEngine *xslt=
|
||||
new RDXsltEngine("/usr/share/rivendell/rss-item-enclosures.xsl",this);
|
||||
if(xslt->transform(&text,xml,err_msg)) {
|
||||
QStringList f0=text.split("|",QString::SkipEmptyParts);
|
||||
QStringList f0=text.split("|",Qt::SkipEmptyParts);
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
QStringList f1=f0.at(i).split("/",QString::SkipEmptyParts);
|
||||
QStringList f2=f1.last().split(".",QString::KeepEmptyParts);
|
||||
QStringList f1=f0.at(i).split("/",Qt::SkipEmptyParts);
|
||||
QStringList f2=f1.last().split(".",Qt::KeepEmptyParts);
|
||||
if(f2.size()==2) {
|
||||
QStringList f3=f2.first().split("_",QString::KeepEmptyParts);
|
||||
QStringList f3=f2.first().split("_",Qt::KeepEmptyParts);
|
||||
if(f3.size()==2) {
|
||||
cast_ids->push_back(f3.last().toUInt(&ok));
|
||||
if(ok) {
|
||||
@ -2034,12 +2034,12 @@ bool RDFeed::backActiveCasts(QList<unsigned> *cast_ids,QString *err_msg)
|
||||
new RDXsltEngine("/usr/share/rivendell/rss-item-enclosures.xsl",
|
||||
this);
|
||||
if(xslt->transform(&text,xml,err_msg)) {
|
||||
QStringList f0=text.split("|",QString::SkipEmptyParts);
|
||||
QStringList f0=text.split("|",Qt::SkipEmptyParts);
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
QStringList f1=f0.at(i).split("/",QString::SkipEmptyParts);
|
||||
QStringList f2=f1.last().split(".",QString::KeepEmptyParts);
|
||||
QStringList f1=f0.at(i).split("/",Qt::SkipEmptyParts);
|
||||
QStringList f2=f1.last().split(".",Qt::KeepEmptyParts);
|
||||
if(f2.size()==2) {
|
||||
QStringList f3=f2.first().split("_",QString::KeepEmptyParts);
|
||||
QStringList f3=f2.first().split("_",Qt::KeepEmptyParts);
|
||||
if(f3.size()==2) {
|
||||
cast_ids->push_back(f3.last().toUInt(&ok));
|
||||
if(ok) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell RSS feeds
|
||||
//
|
||||
// (C) Copyright 2021-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -196,7 +196,7 @@ QVariant RDFeedListModel::data(const QModelIndex &index,int role) const
|
||||
|
||||
case Qt::SizeHintRole:
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+
|
||||
d_font_metrics->width(d_cast_texts.
|
||||
d_font_metrics->horizontalAdvance(d_cast_texts.
|
||||
at(index.internalId()-1).at(row).at(col).toString()),
|
||||
24);
|
||||
default:
|
||||
@ -233,7 +233,8 @@ QVariant RDFeedListModel::data(const QModelIndex &index,int role) const
|
||||
case Qt::SizeHintRole:
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+
|
||||
(d_icons.at(row).at(col).value<QPixmap>().width())+
|
||||
d_font_metrics->width(d_texts.at(row).at(col).toString()),
|
||||
d_font_metrics->horizontalAdvance(d_texts.at(row).at(col).
|
||||
toString()),
|
||||
40);
|
||||
|
||||
default:
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Handle data from an HTML form.
|
||||
//
|
||||
// (C) Copyright 2009-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2009-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -628,7 +628,7 @@ void RDFormPost::LoadUrlEncoding(char first)
|
||||
lines=QString(post_data).split("&");
|
||||
|
||||
for(int i=0;i<lines.size();i++) {
|
||||
line=lines[i].split("=",QString::KeepEmptyParts);
|
||||
line=lines[i].split("=",Qt::KeepEmptyParts);
|
||||
for(int j=2;j<line.size();j++) {
|
||||
line[1]+="="+line.at(j);
|
||||
}
|
||||
@ -737,7 +737,7 @@ bool RDFormPost::GetMimePart(QString *name,QString *value,bool *is_file,
|
||||
if(f0[0].toLower()=="content-disposition") {
|
||||
QStringList f1=f0[1].split(";");
|
||||
for(int i=0;i<f1.size();i++) {
|
||||
QStringList f2=f1[i].trimmed().split("=",QString::KeepEmptyParts);
|
||||
QStringList f2=f1[i].trimmed().split("=",Qt::KeepEmptyParts);
|
||||
for(int j=2;j<f2.size();j++) {
|
||||
f2[1]+="="+f2.at(j);
|
||||
}
|
||||
|
@ -33,6 +33,10 @@
|
||||
|
||||
QString __RDSha1Hash_MakePasswordHash(const QString &secret,const QString &salt)
|
||||
{
|
||||
//
|
||||
// FIXME: Reimplement this using modern methods!
|
||||
//
|
||||
/*
|
||||
SHA_CTX ctx;
|
||||
unsigned char md[SHA_DIGEST_LENGTH];
|
||||
|
||||
@ -46,11 +50,17 @@ QString __RDSha1Hash_MakePasswordHash(const QString &secret,const QString &salt)
|
||||
}
|
||||
|
||||
return ret;
|
||||
*/
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
QString RDSha1HashData(const QByteArray &data)
|
||||
{
|
||||
//
|
||||
// FIXME: Reimplement this using modern methods!
|
||||
//
|
||||
/*
|
||||
SHA_CTX ctx;
|
||||
unsigned char md[SHA_DIGEST_LENGTH];
|
||||
QString ret;
|
||||
@ -63,11 +73,17 @@ QString RDSha1HashData(const QByteArray &data)
|
||||
}
|
||||
|
||||
return ret;
|
||||
*/
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
QString RDSha1HashFile(const QString &filename,bool throttle)
|
||||
{
|
||||
//
|
||||
// FIXME: Reimplement this using modern methods!
|
||||
//
|
||||
/*
|
||||
QString ret;
|
||||
SHA_CTX ctx;
|
||||
int fd=-1;
|
||||
@ -93,6 +109,8 @@ QString RDSha1HashFile(const QString &filename,bool throttle)
|
||||
}
|
||||
|
||||
return ret;
|
||||
*/
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for the Rivendell cart library
|
||||
//
|
||||
// (C) Copyright 2021-2024 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -279,7 +279,7 @@ QVariant RDLibraryModel::data(const QModelIndex &index,int role) const
|
||||
|
||||
case Qt::SizeHintRole:
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+
|
||||
d_font_metrics->width(d_cut_texts.
|
||||
d_font_metrics->horizontalAdvance(d_cut_texts.
|
||||
at(index.internalId()-1).at(row).at(col).toString()),
|
||||
RD_LISTWIDGET_ITEM_HEIGHT);
|
||||
default:
|
||||
@ -322,7 +322,8 @@ QVariant RDLibraryModel::data(const QModelIndex &index,int role) const
|
||||
case Qt::SizeHintRole:
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+
|
||||
(d_icons.at(row).at(col).value<QPixmap>().width())+
|
||||
d_font_metrics->width(d_texts.at(row).at(col).toString()),
|
||||
d_font_metrics->horizontalAdvance(d_texts.at(row).at(col).
|
||||
toString()),
|
||||
RD_LISTWIDGET_ITEM_HEIGHT);
|
||||
|
||||
default:
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A LiveWire Node Driver for Rivendell
|
||||
//
|
||||
// (C) Copyright 2007-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2007-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -605,7 +605,7 @@ void RDLiveWire::ReadVersion(const QString &cmd)
|
||||
if(!live_connected) {
|
||||
f0=AString(cmd).split(" ","\"");
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
f1=f0.at(i).split(":",QString::KeepEmptyParts);
|
||||
f1=f0.at(i).split(":",Qt::KeepEmptyParts);
|
||||
if(f1.size()==2) {
|
||||
if(f1[0]=="LWRP") {
|
||||
live_protocol_version=f1[1];
|
||||
@ -721,7 +721,7 @@ void RDLiveWire::ReadSources(const QString &cmd)
|
||||
QStringList f0=AString(cmd).split(" ","\"");
|
||||
src->setSlotNumber(f0[0].toInt());
|
||||
for(int i=1;i<f0.size();i++) {
|
||||
f1=f0.at(i).split(":",QString::KeepEmptyParts);
|
||||
f1=f0.at(i).split(":",Qt::KeepEmptyParts);
|
||||
if(f1.size()==2) {
|
||||
if(f1[0]=="PSNM") {
|
||||
src->setPrimaryName(f1[1]);
|
||||
@ -766,7 +766,7 @@ void RDLiveWire::ReadDestinations(const QString &cmd)
|
||||
QStringList f0=AString(cmd).split(" ","\"");
|
||||
dst->setSlotNumber(f0[0].toInt());
|
||||
for(int i=1;i<f0.size();i++) {
|
||||
f1=f0.at(i).split(":",QString::KeepEmptyParts);
|
||||
f1=f0.at(i).split(":",Qt::KeepEmptyParts);
|
||||
if(f1.size()==2) {
|
||||
if(f1[0]=="NAME") {
|
||||
dst->setPrimaryName(f1[1]);
|
||||
@ -849,7 +849,7 @@ void RDLiveWire::ReadGpioConfig(const QString &cmd)
|
||||
f0=AString(cmd).split(" ","\"");
|
||||
int slot=f0[0].toInt()-1;
|
||||
for(int i=1;i<f0.size();i++) {
|
||||
f1=f0.at(i).split(":",QString::KeepEmptyParts);
|
||||
f1=f0.at(i).split(":",Qt::KeepEmptyParts);
|
||||
if(f1.size()==2) {
|
||||
if(f1[0]=="SRCA") {
|
||||
int chan=PruneUrl(f1[1]).toInt();
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell logs
|
||||
//
|
||||
// (C) Copyright 2020-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2020-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -104,20 +104,20 @@ void RDLogModel::setFont(const QFont &font)
|
||||
// Calculate Minimum Column Widths
|
||||
//
|
||||
if(rda->showTwelveHourTime()) {
|
||||
d_size_hints[0]=QSize(40+d_bold_fms->width("T00:00:00.0 AM"),0);
|
||||
d_size_hints[0]=QSize(40+d_bold_fms->horizontalAdvance("T00:00:00.0 AM"),0);
|
||||
}
|
||||
else {
|
||||
d_size_hints[0]=QSize(40+d_bold_fms->width("T00:00:00.0"),0);
|
||||
d_size_hints[0]=QSize(40+d_bold_fms->horizontalAdvance("T00:00:00.0"),0);
|
||||
}
|
||||
width=d_bold_fms->width(tr("PLAY"));
|
||||
if(d_bold_fms->width(tr("SEGUE"))>width) {
|
||||
width=d_bold_fms->width(tr("SEGUE"));
|
||||
width=d_bold_fms->horizontalAdvance(tr("PLAY"));
|
||||
if(d_bold_fms->horizontalAdvance(tr("SEGUE"))>width) {
|
||||
width=d_bold_fms->horizontalAdvance(tr("SEGUE"));
|
||||
}
|
||||
if(d_bold_fms->width(tr("STOP"))>width) {
|
||||
width=d_bold_fms->width(tr("STOP"));
|
||||
if(d_bold_fms->horizontalAdvance(tr("STOP"))>width) {
|
||||
width=d_bold_fms->horizontalAdvance(tr("STOP"));
|
||||
}
|
||||
d_size_hints[1]=QSize(10+width,0);
|
||||
d_size_hints[2]=QSize(10+d_bold_fms->width("000000"),0);
|
||||
d_size_hints[2]=QSize(10+d_bold_fms->horizontalAdvance("000000"),0);
|
||||
|
||||
width=0;
|
||||
sql=QString("select ")+
|
||||
@ -125,19 +125,19 @@ void RDLogModel::setFont(const QFont &font)
|
||||
"from `GROUPS`";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
if(d_bold_fms->width(q->value(0).toString())>width) {
|
||||
width=d_bold_fms->width(q->value(0).toString());
|
||||
if(d_bold_fms->horizontalAdvance(q->value(0).toString())>width) {
|
||||
width=d_bold_fms->horizontalAdvance(q->value(0).toString());
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
d_size_hints[3]=QSize(10+width,0);
|
||||
d_size_hints[4]=QSize(10+d_bold_fms->width("8:88:88"),0);
|
||||
d_size_hints[4]=QSize(10+d_bold_fms->horizontalAdvance("8:88:88"),0);
|
||||
|
||||
width=0;
|
||||
for(int i=0;i<RDLogLine::LastSource;i++) {
|
||||
RDLogLine::Source src=(RDLogLine::Source)i;
|
||||
if(d_bold_fms->width(RDLogLine::sourceText(src))>width) {
|
||||
width=d_bold_fms->width(RDLogLine::sourceText(src));
|
||||
if(d_bold_fms->horizontalAdvance(RDLogLine::sourceText(src))>width) {
|
||||
width=d_bold_fms->horizontalAdvance(RDLogLine::sourceText(src));
|
||||
}
|
||||
}
|
||||
d_size_hints[10]=QSize(10+width,0);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A container class for a list of RML macros.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -135,8 +135,7 @@ bool RDMacroEvent::load(const QString &str)
|
||||
|
||||
bool RDMacroEvent::load(unsigned cartnum)
|
||||
{
|
||||
QString sql=QString().
|
||||
sprintf("select `MACROS` from `CART` where (`NUMBER`=%d)&&(`TYPE`=2)",
|
||||
QString sql=QString::asprintf("select `MACROS` from `CART` where (`NUMBER`=%d)&&(`TYPE`=2)",
|
||||
cartnum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(!q->first()) {
|
||||
@ -230,7 +229,7 @@ void RDMacroEvent::exec(int line)
|
||||
break;
|
||||
|
||||
case RDMacro::CC: // Send Command
|
||||
args=event_cmds[line]->arg(0).split(":",QString::KeepEmptyParts);
|
||||
args=event_cmds[line]->arg(0).split(":",Qt::KeepEmptyParts);
|
||||
stationname=args[0];
|
||||
if(args.size()==2) {
|
||||
port=args[1].toUInt();
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell services
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -173,7 +173,7 @@ int RDMacroCartModel::totalLength() const
|
||||
|
||||
for(int i=0;i<lineCount();i++) {
|
||||
QStringList f0=
|
||||
d_texts.at(i).at(1).toString().split(" ",QString::SkipEmptyParts);
|
||||
d_texts.at(i).at(1).toString().split(" ",Qt::SkipEmptyParts);
|
||||
if((f0.size()==2)&&(f0.at(0)=="SP")) {
|
||||
f0[1].remove("!");
|
||||
int msec=f0.at(1).toInt(&ok);
|
||||
@ -254,7 +254,7 @@ void RDMacroCartModel::updateModel()
|
||||
d_texts.clear();
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
QStringList f0=q->value(0).toString().split("!",QString::SkipEmptyParts);
|
||||
QStringList f0=q->value(0).toString().split("!",Qt::SkipEmptyParts);
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
d_texts.push_back(texts);
|
||||
d_texts.back()[0]=QString::asprintf("%d",i+1);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Component class for sound panel widgets.
|
||||
//
|
||||
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -538,7 +538,7 @@ void RDPanelButton::WriteKeycap(int msecs)
|
||||
else {
|
||||
if(button_active_length>=0) {
|
||||
QString lenstr=RDGetTimeLength(button_active_length+1000,true,false);
|
||||
p->drawText(pix->width()-p->fontMetrics().width(lenstr)-
|
||||
p->drawText(pix->width()-p->fontMetrics().horizontalAdvance(lenstr)-
|
||||
RDPANEL_BUTTON_MARGIN-2,
|
||||
pix->height()-2-RDPANEL_BUTTON_MARGIN,
|
||||
lenstr);
|
||||
@ -551,12 +551,12 @@ void RDPanelButton::WriteKeycap(int msecs)
|
||||
}
|
||||
else {
|
||||
QString lenstr=RDGetTimeLength(1000+msecs,true,false);
|
||||
p->drawText(pix->width()-p->fontMetrics().width(lenstr)-
|
||||
p->drawText(pix->width()-p->fontMetrics().horizontalAdvance(lenstr)-
|
||||
RDPANEL_BUTTON_MARGIN-2,
|
||||
pix->height()-2-RDPANEL_BUTTON_MARGIN,
|
||||
lenstr);
|
||||
p->setFont(bigLabelFont());
|
||||
p->drawText((pix->width()-p->fontMetrics().width(button_output_text))/2,
|
||||
p->drawText((pix->width()-p->fontMetrics().horizontalAdvance(button_output_text))/2,
|
||||
74*pix->height()/100,
|
||||
button_output_text);
|
||||
}
|
||||
@ -628,7 +628,7 @@ QString RDPanelButton::GetNextLine(QString *str,const QFontMetrics &m,int len)
|
||||
QString ret;
|
||||
|
||||
for(int i=0;i<str->length();i++) {
|
||||
if(m.width(str->left(i))>len) {
|
||||
if(m.horizontalAdvance(str->left(i))>len) {
|
||||
int l=i;
|
||||
while((!str->at(l--).isSpace())&&(l>=0));
|
||||
if(l>0) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
// This implements a widget that represents a stereo audio level meter,
|
||||
// complete with labels and scale.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -247,28 +247,28 @@ void RDPlayMeter::makeFont()
|
||||
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||
label_font.setPixelSize(height()-2);
|
||||
meter_label_x=(height()-QFontMetrics(label_font).
|
||||
width(meter_label))/2;
|
||||
horizontalAdvance(meter_label))/2;
|
||||
break;
|
||||
|
||||
case RDSegMeter::Right:
|
||||
label_font=QFont("helvetica",height()-2,QFont::Bold);
|
||||
label_font.setPixelSize(height()-2);
|
||||
meter_label_x=(height()-QFontMetrics(label_font).
|
||||
width(meter_label))/2;
|
||||
horizontalAdvance(meter_label))/2;
|
||||
break;
|
||||
|
||||
case RDSegMeter::Up:
|
||||
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||
label_font.setPixelSize(width()-2);
|
||||
meter_label_x=(width()-QFontMetrics(label_font).
|
||||
width(meter_label))/2;
|
||||
horizontalAdvance(meter_label))/2;
|
||||
break;
|
||||
|
||||
case RDSegMeter::Down:
|
||||
label_font=QFont("helvetica",width()-2,QFont::Bold);
|
||||
label_font.setPixelSize(width()-2);
|
||||
meter_label_x=(width()-QFontMetrics(label_font).
|
||||
width(meter_label))/2;
|
||||
horizontalAdvance(meter_label))/2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell podcast episodes
|
||||
//
|
||||
// (C) Copyright 2021-2023 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -206,11 +206,11 @@ QVariant RDPodcastListModel::data(const QModelIndex &index,int role) const
|
||||
if(col==0) {
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+32+
|
||||
d_bold_font_metrics->
|
||||
width(d_texts.at(row).at(col).toString()),40);
|
||||
horizontalAdvance(d_texts.at(row).at(col).toString()),40);
|
||||
}
|
||||
return QSize(RD_LISTWIDGET_ITEM_WIDTH_PADDING+
|
||||
d_font_metrics->
|
||||
width(d_texts.at(row).at(col).toString()),40);
|
||||
horizontalAdvance(d_texts.at(row).at(col).toString()),40);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A flashing button widget.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -296,7 +296,7 @@ void RDPushButton::flashOff()
|
||||
void RDPushButton::ComposeText()
|
||||
{
|
||||
int lines;
|
||||
QStringList f0=plain_text.split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=plain_text.split(" ",Qt::SkipEmptyParts);
|
||||
QFont font(buttonFont().family(),(double)size().height()/2.0,QFont::Bold);
|
||||
QString accum;
|
||||
QString text;
|
||||
@ -314,8 +314,8 @@ void RDPushButton::ComposeText()
|
||||
QFontMetrics fm(font);
|
||||
lines=1;
|
||||
for(int i=0;i<f0.size();i++) {
|
||||
if((fm.width(accum+f0.at(i)+" "))>w) {
|
||||
if(fm.width(f0.at(i))>w) {
|
||||
if((fm.horizontalAdvance(accum+f0.at(i)+" "))>w) {
|
||||
if(fm.horizontalAdvance(f0.at(i))>w) {
|
||||
singleton=true;
|
||||
break;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Implement Rivendell range specifications
|
||||
//
|
||||
// (C) Copyright 2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2022-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -44,7 +44,7 @@ int RDRange::end() const
|
||||
|
||||
bool RDRange::parse(const QString &str)
|
||||
{
|
||||
QStringList f0=str.split(":",QString::KeepEmptyParts);
|
||||
QStringList f0=str.split(":",Qt::KeepEmptyParts);
|
||||
bool ok1=false;
|
||||
bool ok2=false;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Render a Rivendell log to a single audio object.
|
||||
//
|
||||
// (C) Copyright 2017-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -218,7 +218,7 @@ bool __RDRenderLogLine::GetCutFile(const QString &cutname,int start_pt,
|
||||
void __RDRenderLogLine::DeleteCutFile(const QString &dest_filename) const
|
||||
{
|
||||
unlink(dest_filename.toUtf8());
|
||||
QStringList f0=dest_filename.split("/",QString::SkipEmptyParts);
|
||||
QStringList f0=dest_filename.split("/",Qt::SkipEmptyParts);
|
||||
f0.removeLast();
|
||||
rmdir(("/"+f0.join("/")).toUtf8());
|
||||
}
|
||||
@ -637,7 +637,7 @@ bool RDRenderer::ImportCart(const QString &srcfile,unsigned cartnum,int cutnum,
|
||||
void RDRenderer::DeleteTempFile(const QString &filename) const
|
||||
{
|
||||
unlink(filename.toUtf8());
|
||||
QStringList f0=filename.split("/",QString::SkipEmptyParts);
|
||||
QStringList f0=filename.split("/",Qt::SkipEmptyParts);
|
||||
f0.removeLast();
|
||||
rmdir(("/"+f0.join("/")).toUtf8());
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Connection to the Rivendell Interprocess Communication Daemon
|
||||
//
|
||||
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -298,7 +298,7 @@ void RDRipc::DispatchCommand()
|
||||
QString str;
|
||||
|
||||
// printf("RDRipc::DispatchCommand: %s\n",ripc_accum.toUtf8().constData());
|
||||
QStringList cmds=ripc_accum.split(" ",QString::SkipEmptyParts);
|
||||
QStringList cmds=ripc_accum.split(" ",Qt::SkipEmptyParts);
|
||||
|
||||
if(cmds.size()==0) {
|
||||
return;
|
||||
@ -468,7 +468,7 @@ void RDRipc::DispatchCommand()
|
||||
msg+=QString(cmds[i])+" ";
|
||||
}
|
||||
msg=msg.left(msg.length()-1);
|
||||
QStringList f0=msg.split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=msg.split(" ",Qt::SkipEmptyParts);
|
||||
if(f0.at(0)=="NOTIFY") {
|
||||
RDNotification *notify=new RDNotification();
|
||||
if(!notify->read(msg)) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Send an e-mail message using sendmail(1)
|
||||
//
|
||||
// (C) Copyright 2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2020-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -289,8 +289,8 @@ bool RDSendMail(QString *err_msg,const QString &subject,const QString &body,
|
||||
const QString &cc_addrs,const QString &bcc_addrs,bool dry_run)
|
||||
{
|
||||
return RDSendMail(err_msg,subject,body,from_addr,
|
||||
to_addrs.split(",",QString::SkipEmptyParts),
|
||||
cc_addrs.split(",",QString::SkipEmptyParts),
|
||||
bcc_addrs.split(",",QString::SkipEmptyParts),
|
||||
to_addrs.split(",",Qt::SkipEmptyParts),
|
||||
cc_addrs.split(",",Qt::SkipEmptyParts),
|
||||
bcc_addrs.split(",",Qt::SkipEmptyParts),
|
||||
dry_run);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Cart slot label widget for RDCartSlot
|
||||
//
|
||||
// (C) Copyright 2012-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2012-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -507,7 +507,8 @@ void RDSlotBox::mousePressEvent(QMouseEvent *e)
|
||||
line_group_label->
|
||||
palette().color(QPalette::Foreground));
|
||||
drag->setMimeData(cd);
|
||||
drag->setPixmap(*line_icon_label->pixmap());
|
||||
// drag->setPixmap(*line_icon_label->pixmap());
|
||||
drag->setPixmap(line_icon_label->pixmap((Qt::ReturnByValueConstant)0));
|
||||
drag->exec();
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Start/stop button for rdcartslots(1).
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -104,13 +104,12 @@ void RDSlotButton::WriteKeycap()
|
||||
p->fillRect(0,0,w,h,palette().color(QPalette::Background));
|
||||
|
||||
p->setFont(hugeButtonFont());
|
||||
p->drawText((w-p->fontMetrics().width(QString().
|
||||
sprintf("%d",1+d_slot_number)))/2,
|
||||
p->drawText((w-p->fontMetrics().horizontalAdvance(QString::asprintf("%d",1+d_slot_number)))/2,
|
||||
p->fontMetrics().height(),
|
||||
QString::asprintf("%d",1+d_slot_number));
|
||||
|
||||
p->setFont(bigLabelFont());
|
||||
p->drawText((w-p->fontMetrics().width(d_port_label))/2,
|
||||
p->drawText((w-p->fontMetrics().horizontalAdvance(d_port_label))/2,
|
||||
3*h/4,
|
||||
d_port_label);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The sound panel widget.
|
||||
//
|
||||
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -991,13 +991,11 @@ void RDSoundPanel::resizeEvent(QResizeEvent *e)
|
||||
|
||||
void RDSoundPanel::wheelEvent(QWheelEvent *e)
|
||||
{
|
||||
if(e->orientation()==Qt::Vertical) {
|
||||
if(e->delta()>0) {
|
||||
panelDown();
|
||||
}
|
||||
if(e->delta()<0) {
|
||||
panelUp();
|
||||
}
|
||||
if(e->angleDelta().y()>0) {
|
||||
panelDown();
|
||||
}
|
||||
if(e->angleDelta().y()<0) {
|
||||
panelUp();
|
||||
}
|
||||
e->accept();
|
||||
}
|
||||
@ -1094,8 +1092,7 @@ bool RDSoundPanel::PlayAudio(RDPanelButton *button,RDCart *cart,bool hookmode,in
|
||||
bool timescale=false;
|
||||
int button_deck=GetFreeButtonDeck();
|
||||
if(button_deck<0) {
|
||||
LogLine(QString().
|
||||
sprintf("No button deck available, playout aborted. Cart=%u",
|
||||
LogLine(QString::asprintf("No button deck available, playout aborted. Cart=%u",
|
||||
cart->number()));
|
||||
return false;
|
||||
}
|
||||
@ -1119,8 +1116,7 @@ bool RDSoundPanel::PlayAudio(RDPanelButton *button,RDCart *cart,bool hookmode,in
|
||||
if(!button->playDeck()->setCart(&logline,true)) {
|
||||
delete button->playDeck();
|
||||
button->setPlayDeck(NULL);
|
||||
LogLine(QString().
|
||||
sprintf("No CAE stream available, playout aborted. Cart=%u",
|
||||
LogLine(QString::asprintf("No CAE stream available, playout aborted. Cart=%u",
|
||||
cart->number()));
|
||||
return false;
|
||||
}
|
||||
@ -1659,8 +1655,7 @@ void RDSoundPanel::Playing(int id)
|
||||
panel_active_buttons[id]->setColor(RDPANEL_PLAY_BACKGROUND_COLOR);
|
||||
LogPlayEvent(panel_active_buttons[id]->playDeck()->cart()->number(),
|
||||
panel_active_buttons[id]->playDeck()->cut()->cutNumber());
|
||||
LogLine(QString().
|
||||
sprintf("Playout started: id=%d cart=%u cut=%d",
|
||||
LogLine(QString::asprintf("Playout started: id=%d cart=%u cut=%d",
|
||||
id,panel_active_buttons[id]->playDeck()->cart()->number(),
|
||||
panel_active_buttons[id]->playDeck()->cut()->cutNumber()));
|
||||
}
|
||||
@ -1675,8 +1670,7 @@ void RDSoundPanel::Paused(int id)
|
||||
}
|
||||
panel_active_buttons[id]->setState(true);
|
||||
panel_active_buttons[id]->setColor(RDPANEL_PAUSED_BACKGROUND_COLOR);
|
||||
LogLine(QString().
|
||||
sprintf("Playout paused: id=%d cart=%u cut=%d",
|
||||
LogLine(QString::asprintf("Playout paused: id=%d cart=%u cut=%d",
|
||||
id,panel_active_buttons[id]->playDeck()->cart()->number(),
|
||||
panel_active_buttons[id]->playDeck()->cut()->cutNumber()));
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Data model for Rivendell hosts
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2021-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -368,7 +368,7 @@ void RDStationListModel::updateRow(int row,RDSqlQuery *q)
|
||||
}
|
||||
else {
|
||||
texts.push_back(q->value(8).toString().
|
||||
split("/",QString::SkipEmptyParts).last());
|
||||
split("/",Qt::SkipEmptyParts).last());
|
||||
}
|
||||
icons.push_back(QVariant());
|
||||
|
||||
@ -378,7 +378,7 @@ void RDStationListModel::updateRow(int row,RDSqlQuery *q)
|
||||
}
|
||||
else {
|
||||
texts.push_back(q->value(9).toString().
|
||||
split("/",QString::SkipEmptyParts).last());
|
||||
split("/",Qt::SkipEmptyParts).last());
|
||||
}
|
||||
icons.push_back(QVariant());
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
// This implements a widget that represents a stereo audio level meter,
|
||||
// complete with labels and scale.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -161,7 +161,7 @@ void RDStereoMeter::setLabel(QString label)
|
||||
QFont meter_font=QFont("System",18,QFont::Normal);
|
||||
meter_font.setPixelSize(18);
|
||||
QFontMetrics meter_metrics=QFontMetrics(meter_font);
|
||||
label_x=(335-meter_metrics.width(meter_label))/2;
|
||||
label_x=(335-meter_metrics.horizontalAdvance(meter_label))/2;
|
||||
setFixedSize(335,80);
|
||||
}
|
||||
else {
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A StringList with quote mode
|
||||
//
|
||||
// (C) Copyright 2010,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2010-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -42,7 +42,7 @@ RDStringList RDStringList::split(const QChar &sep,const QString &str,
|
||||
const QString &esc)
|
||||
{
|
||||
if(esc.isEmpty()) {
|
||||
return (RDStringList)str.split(sep,QString::KeepEmptyParts);
|
||||
return (RDStringList)str.split(sep,Qt::KeepEmptyParts);
|
||||
}
|
||||
RDStringList list;
|
||||
bool escape=false;
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Spawn an external text file viewer.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -43,7 +43,7 @@ bool RDTextFile(const QString &data,bool delete_on_exit)
|
||||
editor=rda->station()->reportEditorPath();
|
||||
}
|
||||
memset(args,0,sizeof(args));
|
||||
QStringList f0=editor.split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=editor.split(" ",Qt::SkipEmptyParts);
|
||||
if(f0.size()>64) {
|
||||
QMessageBox::warning(NULL,"File Error",
|
||||
"Too many arguments to report editor!");
|
||||
@ -96,7 +96,7 @@ bool RDTextViewer(const QString &filename)
|
||||
editor=rda->station()->reportEditorPath();
|
||||
}
|
||||
memset(args,0,sizeof(args));
|
||||
QStringList f0=editor.split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=editor.split(" ",Qt::SkipEmptyParts);
|
||||
if(f0.size()>64) {
|
||||
QMessageBox::warning(NULL,"File Error",
|
||||
"Too many arguments to report editor!");
|
||||
@ -137,7 +137,7 @@ bool RDWebBrowser(const QString &url)
|
||||
return false;
|
||||
}
|
||||
memset(args,0,sizeof(args));
|
||||
QStringList f0=editor.split(" ",QString::SkipEmptyParts);
|
||||
QStringList f0=editor.split(" ",Qt::SkipEmptyParts);
|
||||
if(f0.size()>64) {
|
||||
QMessageBox::warning(NULL,"Error",
|
||||
"Too many arguments to web browser!");
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Rivendell Voice Tracker
|
||||
//
|
||||
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -2121,31 +2121,31 @@ void RDTrackerWidget::keyReleaseEvent(QKeyEvent *e)
|
||||
void RDTrackerWidget::wheelEvent(QWheelEvent *e)
|
||||
{
|
||||
if(d_shift_pressed) {
|
||||
if(e->y()<TRACKER_Y_ORIGIN+TRACKER_Y_HEIGHT) {
|
||||
DragTrack(0,e->delta());
|
||||
if(e->position().y()<TRACKER_Y_ORIGIN+TRACKER_Y_HEIGHT) {
|
||||
DragTrack(0,e->angleDelta().y());
|
||||
}
|
||||
else {
|
||||
if(e->y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) {
|
||||
DragTrack(1,e->delta());
|
||||
if(e->position().y()<(TRACKER_Y_ORIGIN+2*TRACKER_Y_HEIGHT)) {
|
||||
DragTrack(1,e->angleDelta().y());
|
||||
}
|
||||
else {
|
||||
if(e->y()<(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT)) {
|
||||
DragTrack(2,e->delta());
|
||||
if(e->position().y()<(TRACKER_Y_ORIGIN+3*TRACKER_Y_HEIGHT)) {
|
||||
DragTrack(2,e->angleDelta().y());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!d_wave_name[0].isEmpty() && !TransportActive()) {
|
||||
DragTrack(0,e->delta());
|
||||
DragTrack(0,e->angleDelta().y());
|
||||
}
|
||||
else {
|
||||
if(!d_wave_name[1].isEmpty() && !TransportActive()) {
|
||||
DragTrack(1,e->delta());
|
||||
DragTrack(1,e->angleDelta().y());
|
||||
}
|
||||
else {
|
||||
if(!d_wave_name[2].isEmpty() && !TransportActive()) {
|
||||
DragTrack(2,e->delta());
|
||||
DragTrack(2,e->angleDelta().y());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3231,8 +3231,8 @@ void RDTrackerWidget::DrawTrackMap(int trackno)
|
||||
QString::asprintf(" :%d",(talk_len+500)/1000));
|
||||
}
|
||||
else {
|
||||
d_wpg[2]->drawText(550,75,tr("Talk")+QString().
|
||||
sprintf(" :%d",(d_loglines[2]->talkLength()+500)/1000));
|
||||
d_wpg[2]->drawText(550,75,tr("Talk")+
|
||||
QString::asprintf(" :%d",(d_loglines[2]->talkLength()+500)/1000));
|
||||
}
|
||||
d_wpg[2]->end();
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell User.
|
||||
//
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -746,7 +746,7 @@ bool RDUser::ticketIsValid(const QString &ticket,
|
||||
|
||||
bool RDUser::emailIsValid(const QString &addr)
|
||||
{
|
||||
QStringList f0=addr.split("@",QString::KeepEmptyParts);
|
||||
QStringList f0=addr.split("@",Qt::KeepEmptyParts);
|
||||
|
||||
if(f0.size()!=2) {
|
||||
return false;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <QObject>
|
||||
|
||||
#include "rdconf.h"
|
||||
#include "rddatedecode.h"
|
||||
#include "rdwavedata.h"
|
||||
|
||||
RDWaveData::RDWaveData()
|
||||
@ -1224,10 +1225,10 @@ QString RDWaveData::dump() const
|
||||
ret+="\n";
|
||||
for(int i=1;i<8;i++) {
|
||||
if(dayOfWeek(i)) {
|
||||
ret+=QDate::longDayName(i)+": true\n";
|
||||
ret+=RDLongDayName(i)+": true\n";
|
||||
}
|
||||
else {
|
||||
ret+=QDate::longDayName(i)+": false\n";
|
||||
ret+=RDLongDayName(i)+": false\n";
|
||||
}
|
||||
}
|
||||
ret+="daypartStartTime: ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user