diff --git a/ChangeLog b/ChangeLog index eee42d16..da28951e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20756,3 +20756,6 @@ 'RDLogListModel'. 2020-12-27 Fred Gleason * Removed the 'RDLogEvent' class. +2020-12-29 Fred Gleason + * Refactored the Full Log widget in rdairplay to use the model-based + API. diff --git a/lib/librd_cs.ts b/lib/librd_cs.ts index 1adbe655..d16ecbd3 100644 --- a/lib/librd_cs.ts +++ b/lib/librd_cs.ts @@ -2785,6 +2785,21 @@ Bitte Kofiguration prüfen und erneut versuchen. + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_de.ts b/lib/librd_de.ts index 489d260f..80b0ce41 100644 --- a/lib/librd_de.ts +++ b/lib/librd_de.ts @@ -2780,6 +2780,21 @@ Bitte Kofiguration prüfen und erneut versuchen. + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_es.ts b/lib/librd_es.ts index e0d47a68..5657bb33 100644 --- a/lib/librd_es.ts +++ b/lib/librd_es.ts @@ -2770,6 +2770,21 @@ Do you still want to proceed? + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_fr.ts b/lib/librd_fr.ts index 39672afc..4a39eb4d 100644 --- a/lib/librd_fr.ts +++ b/lib/librd_fr.ts @@ -2292,6 +2292,21 @@ Do you want to overwrite it? + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_nb.ts b/lib/librd_nb.ts index f615021f..9e950ca5 100644 --- a/lib/librd_nb.ts +++ b/lib/librd_nb.ts @@ -2751,6 +2751,21 @@ Sjekk eksportoppsettet ditt og prøv att. + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_nn.ts b/lib/librd_nn.ts index f615021f..9e950ca5 100644 --- a/lib/librd_nn.ts +++ b/lib/librd_nn.ts @@ -2751,6 +2751,21 @@ Sjekk eksportoppsettet ditt og prøv att. + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/librd_pt_BR.ts b/lib/librd_pt_BR.ts index 6a80f1c3..6c9df3ea 100644 --- a/lib/librd_pt_BR.ts +++ b/lib/librd_pt_BR.ts @@ -2785,6 +2785,21 @@ Por Favor, cheque suas configurações e tenbte outra vez. + + RDLogPlay + + [CART NOT FOUND] + + + + [NO AUDIO AVAILABLE] + + + + T + + + RDMbLookup diff --git a/lib/rdlogmodel.cpp b/lib/rdlogmodel.cpp index d2974c91..96b2f6d2 100644 --- a/lib/rdlogmodel.cpp +++ b/lib/rdlogmodel.cpp @@ -34,62 +34,6 @@ RDLogModel::RDLogModel(const QString &logname,bool read_only,QObject *parent) d_read_only=read_only; MakeModel(); - /* - d_fms=NULL; - d_bold_fms=NULL; - d_log_icons=new RDLogIcons(); - d_start_time_style=RDLogModel::Scheduled; - d_max_id=0; - - // - // Column Attributes - // - unsigned left=Qt::AlignLeft|Qt::AlignVCenter; - unsigned center=Qt::AlignCenter; - unsigned right=Qt::AlignRight|Qt::AlignVCenter; - - d_headers.push_back(tr("Start Time")); - d_alignments.push_back(right); - - d_headers.push_back(tr("Trans")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Cart")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Group")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Length")); - d_alignments.push_back(right); - - d_headers.push_back(tr("Title")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Artist")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Client")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Agency")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Label")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Source")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Ext Data")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Line ID")); - d_alignments.push_back(right); - - d_headers.push_back(tr("Count")); - d_alignments.push_back(right); - */ } @@ -129,6 +73,18 @@ void RDLogModel::setPalette(const QPalette &pal) } +QFont RDLogModel::normalFont() const +{ + return d_font; +} + + +QFont RDLogModel::boldFont() const +{ + return d_bold_font; +} + + void RDLogModel::setFont(const QFont &font) { d_font=font; @@ -179,78 +135,19 @@ QVariant RDLogModel::data(const QModelIndex &index,int role) const if((ll=logLine(row))!=NULL) { switch((Qt::ItemDataRole)role) { case Qt::DisplayRole: - switch(index.column()) { - case 0: // Start Time - return StartTimeString(row); - - case 1: // Transition - return RDLogLine::transText(ll->transType()); - - case 2: // Cart Number - return ll->cartNumberText(); - - case 3: // Group - return ll->groupName(); - - case 4: // Length - return ll->forcedLengthText(); - - case 5: // Title - return ll->titleText(); - - case 6: // Artist - return ll->artist(); - - case 7: // Client - return ll->client(); - - case 8: // Agency - return ll->agency(); - - case 9: // Label - return ll->markerLabel(); - - case 10: // Source - return RDLogLine::sourceText(ll->source()); - - case 11: // Ext Data - return ll->extData(); - - case 12: // Line ID - return QString().sprintf("%d",ll->id()); - - case 13: // Count - return QString().sprintf("%d",row); - } - break; + return cellText(col,row,ll); case Qt::DecorationRole: - if(col==0) { - return d_log_icons->typeIcon(ll->type(),ll->source()); - } - break; + return cellIcon(col,row,ll); case Qt::FontRole: - if(col==3) { - return d_bold_font; - } - return d_font; + return cellTextFont(col,row,ll); case Qt::TextColorRole: - switch(col) { - case 0: - if(ll->timeType()==RDLogLine::Hard) { - return Qt::blue; - } - break; - - case 3: - return ll->groupColor(); - } - break; + return cellTextColor(col,row,ll); case Qt::BackgroundRole: - return backgroundColor(row,ll); + return rowBackgroundColor(row,ll); default: break; @@ -319,6 +216,8 @@ int RDLogModel::load(bool track_ptrs) QString sql; RDSqlQuery *q; + beginResetModel(); + // // Get the service name // @@ -336,10 +235,7 @@ int RDLogModel::load(bool track_ptrs) LoadLines(d_log_name,0,track_ptrs); - if(lineCount()>0) { - beginInsertRows(QModelIndex(),0,lineCount()-1); - endInsertRows(); - } + endResetModel(); return d_log_lines.size(); } @@ -517,7 +413,7 @@ int RDLogModel::validate(QString *report,const QDate &date) } -void RDLogModel::refresh(int line) +void RDLogModel::update(int line) { if(d_log_name.isEmpty()) { return; @@ -1606,7 +1502,140 @@ void RDLogModel::emitAllDataChanged() } -QColor RDLogModel::backgroundColor(int line,RDLogLine *ll) const +QStringList RDLogModel::headerTexts() const +{ + QStringList ret; + + ret.push_back(tr("Start Time")); + ret.push_back(tr("Trans")); + ret.push_back(tr("Cart")); + ret.push_back(tr("Group")); + ret.push_back(tr("Length")); + ret.push_back(tr("Title")); + ret.push_back(tr("Artist")); + ret.push_back(tr("Client")); + ret.push_back(tr("Agency")); + ret.push_back(tr("Label")); + ret.push_back(tr("Source")); + ret.push_back(tr("Ext Data")); + ret.push_back(tr("Line ID")); + ret.push_back(tr("Count")); + + return ret; +} + + +QList RDLogModel::columnAlignments() const +{ + QList ret; + int left=Qt::AlignLeft|Qt::AlignVCenter; + int center=Qt::AlignCenter; + int right=Qt::AlignRight|Qt::AlignVCenter; + + ret.push_back(right); // Start Time + ret.push_back(center); // Trans + ret.push_back(center); // Cart + ret.push_back(center); // Group + ret.push_back(right); // Length + ret.push_back(left); // Title + ret.push_back(left); // Artist + ret.push_back(left); // Client + ret.push_back(left); // Agency + ret.push_back(left); // Label + ret.push_back(left); // Source + ret.push_back(left); // Ext Data + ret.push_back(right); // Line ID + ret.push_back(right); // Count + + return ret; +} + + +QPixmap RDLogModel::cellIcon(int col,int row,RDLogLine *ll) const +{ + if(col==0) { + return d_log_icons->typeIcon(ll->type(),ll->source()); + } + return QPixmap(); +} + + +QString RDLogModel::cellText(int col,int line,RDLogLine *ll) const +{ + switch(col) { + case 0: // Start Time + return StartTimeString(line); + + case 1: // Transition + return RDLogLine::transText(ll->transType()); + + case 2: // Cart Number + return ll->cartNumberText(); + + case 3: // Group + return ll->groupName(); + + case 4: // Length + return ll->forcedLengthText(); + + case 5: // Title + return ll->titleText(); + + case 6: // Artist + return ll->artist(); + + case 7: // Client + return ll->client(); + + case 8: // Agency + return ll->agency(); + + case 9: // Label + return ll->markerLabel(); + + case 10: // Source + return RDLogLine::sourceText(ll->source()); + + case 11: // Ext Data + return ll->extData(); + + case 12: // Line ID + return QString().sprintf("%d",ll->id()); + + case 13: // Count + return QString().sprintf("%d",line); + } + return QString(); +} + + +QFont RDLogModel::cellTextFont(int col,int line,RDLogLine *ll) const +{ + if(col==3) { + return d_bold_font; + } + return d_font; +} + + +QColor RDLogModel::cellTextColor(int col,int line,RDLogLine *ll) const +{ + switch(col) { + case 0: + if(ll->timeType()==RDLogLine::Hard) { + return Qt::blue; + } + break; + + case 3: + return ll->groupColor(); + } + + return d_palette.color(QPalette::Foreground); +} + + +QColor RDLogModel::rowBackgroundColor(int line,RDLogLine *ll) const { return d_palette.color(QPalette::Base); } @@ -1620,52 +1649,16 @@ void RDLogModel::MakeModel() d_start_time_style=RDLogModel::Scheduled; d_max_id=0; - // - // Column Attributes - // - unsigned left=Qt::AlignLeft|Qt::AlignVCenter; - unsigned center=Qt::AlignCenter; - unsigned right=Qt::AlignRight|Qt::AlignVCenter; + QStringList headers=headerTexts(); + QList alignments=columnAlignments(); - d_headers.push_back(tr("Start Time")); - d_alignments.push_back(right); + if(headers.size()!=alignments.size()) { + fprintf(stderr,"header/alignment size mismatch\n"); + exit(1); + } - d_headers.push_back(tr("Trans")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Cart")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Group")); - d_alignments.push_back(center); - - d_headers.push_back(tr("Length")); - d_alignments.push_back(right); - - d_headers.push_back(tr("Title")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Artist")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Client")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Agency")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Label")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Source")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Ext Data")); - d_alignments.push_back(left); - - d_headers.push_back(tr("Line ID")); - d_alignments.push_back(right); - - d_headers.push_back(tr("Count")); - d_alignments.push_back(right); + for(int i=0;i columnAlignments() const; + virtual QPixmap cellIcon(int col,int row,RDLogLine *ll) const; + virtual QString cellText(int col,int line,RDLogLine *ll) const; + virtual QFont cellTextFont(int col,int line,RDLogLine *ll) const; + virtual QColor cellTextColor(int col,int line,RDLogLine *ll) const; + virtual QColor rowBackgroundColor(int line,RDLogLine *ll) const; private: QString StartTimeString(int line) const; diff --git a/lib/rdlogplay.cpp b/lib/rdlogplay.cpp index f9157746..a98b966b 100644 --- a/lib/rdlogplay.cpp +++ b/lib/rdlogplay.cpp @@ -55,6 +55,7 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,QObject *parent) play_duck_volume_port1=0; play_duck_volume_port2=0; play_start_next=false; + play_time_mode=RDAirPlayConf::TwentyFourHour; play_running=false; play_next_line=0; play_post_time=QTime(); @@ -71,6 +72,9 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,QObject *parent) for(int i=0;i0)&&(lineCount()>running)) { makeNext(running); @@ -601,10 +606,10 @@ void RDLogPlay::append(const QString &log_name) } } RefreshEvents(old_size,lineCount()-old_size); - UpdateStartTimes(old_size); + UpdateStartTimes(); emit reloaded(); SetTransTimer(); - emit transportChanged(); + ChangeTransport(); UpdatePostPoint(); } @@ -755,10 +760,10 @@ bool RDLogPlay::refresh() logLine(i)->clearPass(); } RefreshEvents(0,lineCount()); - UpdateStartTimes(next_line); + UpdateStartTimes(); UpdatePostPoint(); SetTransTimer(); - emit transportChanged(); + ChangeTransport(); emit reloaded(); if(play_refreshable) { play_refreshable=false; @@ -854,19 +859,20 @@ void RDLogPlay::insert(int line,int cartnum,RDLogLine::TransType next_type, logline->loadCart(cartnum,next_type,play_id,play_timescaling_available,type); logline-> setTimescalingActive(play_timescaling_available&&logline->enforceLength()); - UpdateStartTimes(line); + UpdateStartTimes(); emit inserted(line); UpdatePostPoint(); if(mod_line>=0) { emit modified(mod_line); } - emit transportChanged(); + ChangeTransport(); SetTransTimer(); UpdatePostPoint(); } -void RDLogPlay::insert(int line,RDLogLine *l,bool update,bool preserv_custom_transition) +void RDLogPlay::insert(int line,RDLogLine *l,bool update, + bool preserv_custom_transition) { RDLogLine *logline; int lines[TRANSPORT_QUANTITY]; @@ -908,13 +914,13 @@ void RDLogPlay::insert(int line,RDLogLine *l,bool update,bool preserv_custom_tra logline-> setTimescalingActive(play_timescaling_available&&logline->enforceLength()); if(update) { - UpdateStartTimes(line); + UpdateStartTimes(); emit inserted(line); UpdatePostPoint(); if(mod_line>=0) { emit modified(mod_line); } - emit transportChanged(); + ChangeTransport(); SetTransTimer(); UpdatePostPoint(); } @@ -971,14 +977,14 @@ void RDLogPlay::remove(int line,int num_lines,bool update, if(nextLine()>line) { makeNext(nextLine()-num_lines); } - UpdateStartTimes(line); + UpdateStartTimes(); if(lineCount()==0) { emit reloaded(); } if(mod_line>=0) { emit modified(mod_line); } - emit transportChanged(); + ChangeTransport(); SetTransTimer(); UpdatePostPoint(); } @@ -1050,12 +1056,7 @@ void RDLogPlay::move(int from_line,int to_line) offset=1; } RDLogModel::move(from_line,to_line); - if(from_line>to_line) { - UpdateStartTimes(to_line); - } - else { - UpdateStartTimes(from_line); - } + UpdateStartTimes(); SetTransTimer(); UpdatePostPoint(); emit inserted(to_line); @@ -1072,7 +1073,7 @@ void RDLogPlay::move(int from_line,int to_line) makeNext(nextLine()+1); } else { - emit transportChanged(); + ChangeTransport(); } } } @@ -1297,7 +1298,7 @@ void RDLogPlay::lineModified(int line) RDLogLine *next_logline; SetTransTimer(); - UpdateStartTimes(line); + UpdateStartTimes(); if((logline=logLine(line))!=NULL) { if((next_logline=logLine(line+1))==NULL) { @@ -1317,7 +1318,7 @@ void RDLogPlay::lineModified(int line) line=lines[count-1]; } UpdatePostPoint(); - emit transportChanged(); + ChangeTransport(); } @@ -1362,6 +1363,25 @@ QTime RDLogPlay::nextStop() const } +int RDLogPlay::startOfHour(int hour) const +{ + for(int i=0;istartTime(RDLogLine::Predicted).isValid()) { + if(ll->startTime(RDLogLine::Predicted).hour()==hour) { + return i; + } + } + if(ll->startTime(RDLogLine::Imported).isValid()) { + if(ll->startTime(RDLogLine::Imported).hour()==hour) { + return i; + } + } + } + return -1; +} + + bool RDLogPlay::running(bool include_paused) { if(runningEvents(NULL,include_paused)==0) { @@ -1386,6 +1406,15 @@ bool RDLogPlay::isRefreshable() const (play_log->linkDatetime()==play_link_datetime)&& (play_log->modifiedDatetime()>play_modified_datetime); } + + +void RDLogPlay::setTimeMode(RDAirPlayConf::TimeMode mode) +{ + if(play_time_mode!=mode) { + play_time_mode=mode; + emit dataChanged(createIndex(0,0),createIndex(0,lineCount())); + } +} void RDLogPlay::transTimerData() @@ -1553,11 +1582,11 @@ void RDLogPlay::segueEndData(int id) (logline->status()==RDLogLine::Finishing)) { ((RDPlayDeck *)logline->playDeck())->stop(); CleanupEvent(id); - UpdateStartTimes(line); - LogTraffic(logline,(RDLogLine::PlaySource)(play_id+1), - RDAirPlayConf::TrafficFinish,play_onair_flag); + UpdateStartTimes(); + LogTraffic(logline,(RDLogLine::PlaySource)(play_id+1), + RDAirPlayConf::TrafficFinish,play_onair_flag); emit stopped(line); - emit transportChanged(); + ChangeTransport(); } } @@ -1609,10 +1638,10 @@ void RDLogPlay::macroStartedData() logline-> setStartTime(RDLogLine::Initial, QTime::currentTime().addMSecs(rda->station()->timeOffset())); - UpdateStartTimes(line); + UpdateStartTimes(); emit played(line); UpdatePostPoint(); - emit transportChanged(); + ChangeTransport(); } @@ -1636,7 +1665,7 @@ void RDLogPlay::macroFinishedData() refresh(); play_refresh_pending=false; } - emit transportChanged(); + ChangeTransport(); } @@ -1654,7 +1683,7 @@ void RDLogPlay::macroStoppedData() RDAirPlayConf::TrafficMacro,play_onair_flag); } UpdatePostPoint(); - emit transportChanged(); + ChangeTransport(); } @@ -1757,6 +1786,118 @@ void RDLogPlay::notificationReceivedData(RDNotification *notify) } +QString RDLogPlay::cellText(int col,int row,RDLogLine *ll) const +{ + if(col==0) { // Start time + if((ll->status()==RDLogLine::Scheduled)|| + (ll->status()==RDLogLine::Paused)) { + if(ll->timeType()==RDLogLine::Hard) { + return tr("T")+TimeString(ll->startTime(RDLogLine::Logged)); + } + if(!ll->startTime(RDLogLine::Predicted).isNull()) { + return TimeString(ll->startTime(RDLogLine::Predicted)); + } + return QString(""); + } + return TimeString(ll->startTime(RDLogLine::Actual)); + } + + if(((ll->cutNumber()<0)&&(ll->type()==RDLogLine::Cart))) { + if(col==5) { // Title + if(ll->state()==RDLogLine::NoCart) { + return tr("[CART NOT FOUND]"); + } + } + if(col==6) { // Artist + if(ll->state()==RDLogLine::NoCut) { + return tr("[NO AUDIO AVAILABLE]"); + } + } + } + + return RDLogModel::cellText(col,row,ll); +} + + +QFont RDLogPlay::cellTextFont(int col,int row,RDLogLine *ll) const +{ + if(ll->timeType()==RDLogLine::Hard) { + return boldFont(); + } + + return RDLogModel::cellTextFont(col,row,ll); +} + + +QColor RDLogPlay::cellTextColor(int col,int row,RDLogLine *ll) const +{ + if(col==3) { + return ll->groupColor(); + } + if(ll->timeType()==RDLogLine::Hard) { + return Qt::blue; + } + + return RDLogModel::cellTextColor(col,row,ll); +} + + +QColor RDLogPlay::rowBackgroundColor(int row,RDLogLine *ll) const +{ + switch(ll->status()) { + case RDLogLine::Scheduled: + case RDLogLine::Auditioning: + if((ll->type()==RDLogLine::Cart)&& + (ll->state()==RDLogLine::NoCart)) { + return LOG_ERROR_COLOR; + } + else { + if(((ll->cutNumber()<0)&&(ll->type()==RDLogLine::Cart))|| + (ll->state()==RDLogLine::NoCut)) { + if((play_next_line>=0)&&(play_next_line==row)) { + return LOG_NEXT_COLOR; + } + return LOG_ERROR_COLOR; + } + else { + if((play_next_line>=0)&&(play_next_line==row)) { + if(ll->evergreen()) { + return LOG_EVERGREEN_COLOR; + } + else { + return LOG_NEXT_COLOR; + } + } + else { + if(ll->evergreen()) { + return LOG_EVERGREEN_COLOR; + } + else { + return LOG_SCHEDULED_COLOR; + } + } + } + } + break; + + case RDLogLine::Playing: + case RDLogLine::Finishing: + return LOG_PLAYING_COLOR; + + case RDLogLine::Paused: + return LOG_PAUSED_COLOR; + + case RDLogLine::Finished: + if(ll->state()==RDLogLine::Ok) { + return LOG_FINISHED_COLOR; + } + return LOG_ERROR_COLOR; + } + + return RDLogModel::rowBackgroundColor(row,ll); +} + + bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type, int trans_length,RDLogLine::StartSource src, int mport,int duck_length) @@ -1980,7 +2121,7 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type, LogTraffic(logline,(RDLogLine::PlaySource)(play_id+1), RDAirPlayConf::TrafficMacro,play_onair_flag); FinishEvent(line); - emit transportChanged(); + ChangeTransport(); rda->syslog(LOG_INFO, "log engine: asynchronously executed macro cart: Line: %d Cart: %u", line,logline->cartNumber()); @@ -2018,7 +2159,7 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type, // Skip Past // logline->setStatus(RDLogLine::Finished); - UpdateStartTimes(line); + UpdateStartTimes(); emit played(line); FinishEvent(line); emit nextEventChanged(play_next_line); @@ -2160,7 +2301,7 @@ void RDLogPlay::CleanupEvent(int id) } -void RDLogPlay::UpdateStartTimes(int line) +void RDLogPlay::UpdateStartTimes() { QTime time; QTime new_time; @@ -2176,13 +2317,13 @@ void RDLogPlay::UpdateStartTimes(int line) RDLogLine *next_logline; RDLogLine::TransType next_trans; int lines[TRANSPORT_QUANTITY]; + bool hours[24]={false}; + int line=play_next_line; if((running=runningEvents(lines,false))>0) { line=lines[0]; } - else { - line=play_next_line; - } + for(int i=line;istatus()) { - case RDLogLine::Playing: - case RDLogLine::Finishing: + if((logline->status()==RDLogLine::Playing)|| + (logline->status()==RDLogLine::Finishing)){ time=logline->startTime(RDLogLine::Actual); - break; - - default: + } + else { time=GetStartTime(logline->startTime(RDLogLine::Logged), logline->transType(), logline->timeType(), time,prev_total_length,prev_segue_length, &stop,running); logline->setStartTime(RDLogLine::Predicted,time); - break; } + if(stop&&(!stop_set)) { next_stop=time.addMSecs(prev_total_length); stop_set=true; @@ -2220,23 +2359,19 @@ void RDLogPlay::UpdateStartTimes(int line) time.addMSecs(logline->effectiveLength()- logline->playPosition()); - switch(logline->status()) { - case RDLogLine::Scheduled: - case RDLogLine::Paused: + if((logline->status()==RDLogLine::Scheduled)|| + (logline->status()==RDLogLine::Paused)) { prev_total_length=logline->effectiveLength()- logline->playPosition(); prev_segue_length= logline->segueLength(next_trans)-logline->playPosition(); end_time= - time.addMSecs(logline->effectiveLength()- - logline->playPosition()); - break; - default: + time.addMSecs(logline->effectiveLength()-logline->playPosition()); + } + else { prev_total_length=logline->effectiveLength(); - prev_segue_length= - logline->segueLength(next_trans); - end_time= - time.addMSecs(logline->effectiveLength()); + prev_segue_length=logline->segueLength(next_trans); + end_time=time.addMSecs(logline->effectiveLength()); } } } @@ -2246,6 +2381,27 @@ void RDLogPlay::UpdateStartTimes(int line) play_next_stop=next_stop; emit nextStopChanged(play_next_stop); } + + emit dataChanged(createIndex(0,0),createIndex(0,lineCount())); + + for(int i=0;istartTime(RDLogLine::Predicted).isValid()) { + hours[ll->startTime(RDLogLine::Predicted).hour()]=true; + } + else { + if(ll->startTime(RDLogLine::Imported).isValid()) { + hours[ll->startTime(RDLogLine::Imported).hour()]=true; + } + } + } + for(int i=0;i<24;i++) { + if(hours[i]!=play_hours[i]) { + emit hourChanged(i,hours[i]); + play_hours[i]=hours[i]; + } + } + SendNowNext(); } @@ -2274,7 +2430,7 @@ void RDLogPlay::FinishEvent(int line) } } } - UpdateStartTimes(line); + UpdateStartTimes(); emit stopped(line); } @@ -2454,7 +2610,6 @@ void RDLogPlay::AdvanceActiveEvent() } } else { - //if(line<(size()-1)) { if(line<(lineCount())) { RDLogLine *logline; if((logline=logLine(line+1))!=NULL) { @@ -2601,8 +2756,9 @@ bool RDLogPlay::GetNextPlayable(int *line,bool skip_meta,bool forced_start) emit modified(i); } else { - if(logline->status()==RDLogLine::Scheduled || logline->status()==RDLogLine::Paused || - logline->status()==RDLogLine::Auditioning) { + if((logline->status()==RDLogLine::Scheduled)|| + (logline->status()==RDLogLine::Paused)|| + (logline->status()==RDLogLine::Auditioning)) { if(((logline->transType()==RDLogLine::Stop)|| (play_op_mode==RDAirPlayConf::LiveAssist))&&((i-skipped)!=*line)) { makeNext(i); @@ -2656,8 +2812,6 @@ void RDLogPlay::LogPlayEvent(RDLogLine *logline) void RDLogPlay::RefreshEvents(int line,int line_quan,bool force_update) { - //QTime st=QTime::currentTime(); - // // Check Event Status // @@ -2698,6 +2852,16 @@ void RDLogPlay::RefreshEvents(int line,int line_quan,bool force_update) } +void RDLogPlay::ChangeTransport() +{ + emit transportChanged(); + if(play_next_line>=0) { + emit dataChanged(createIndex(play_next_line,0), + createIndex(play_next_line+6,columnCount())); + } +} + + void RDLogPlay::Playing(int id) { RDLogLine *logline; @@ -2706,7 +2870,7 @@ void RDLogPlay::Playing(int id) if((logline=logLine(line))==NULL) { return; } - UpdateStartTimes(line); + UpdateStartTimes(); emit played(line); AdvanceActiveEvent(); UpdatePostPoint(); @@ -2717,7 +2881,7 @@ void RDLogPlay::Playing(int id) play_grace_timer->stop(); } LogPlayEvent(logline); - emit transportChanged(); + ChangeTransport(); } @@ -2730,12 +2894,12 @@ void RDLogPlay::Paused(int id) logline->setPortName(""); logline->setStatus(RDLogLine::Paused); } - UpdateStartTimes(line); + UpdateStartTimes(); emit paused(line); UpdatePostPoint(); LogTraffic(logLine(line),(RDLogLine::PlaySource)(play_id+1), RDAirPlayConf::TrafficPause,play_onair_flag); - emit transportChanged(); + ChangeTransport(); } @@ -2749,7 +2913,7 @@ void RDLogPlay::Stopped(int id) int line=GetLineById(id); int lines[TRANSPORT_QUANTITY]; CleanupEvent(id); - UpdateStartTimes(line); + UpdateStartTimes(); emit stopped(line); LogTraffic(logLine(line),(RDLogLine::PlaySource)(play_id+1), RDAirPlayConf::TrafficStop,play_onair_flag); @@ -2763,7 +2927,7 @@ void RDLogPlay::Stopped(int id) if(runningEvents(lines)==0) { next_channel=0; } - emit transportChanged(); + ChangeTransport(); } @@ -2793,7 +2957,7 @@ void RDLogPlay::Finished(int id) } LogTraffic(logline,(RDLogLine::PlaySource)(play_id+1), RDAirPlayConf::TrafficFinish,play_onair_flag); - emit transportChanged(); + ChangeTransport(); } @@ -2839,6 +3003,24 @@ RDLogLine::TransType RDLogPlay::GetTransType(const QString &logname,int line) } +QString RDLogPlay::TimeString(const QTime &time) const +{ + QString ret; + switch(play_time_mode) { + case RDAirPlayConf::TwelveHour: + ret=time.toString("h:mm:ss.zzz"); + ret=ret.left(ret.length()-2); + ret+=(" "+time.toString("ap")); + break; + + case RDAirPlayConf::TwentyFourHour: + ret=time.toString("hh:mm:ss.zzz").left(10); + break; + } + return ret; +} + + bool RDLogPlay::ClearBlock(int start_line) { RDLogLine::Status status; @@ -2979,15 +3161,16 @@ void RDLogPlay::SendNowNext() // play_pad_socket->write(QString("{\r\n").toUtf8()); play_pad_socket->write(QString(" \"padUpdate\": {\r\n").toUtf8()); - play_pad_socket->write(RDJsonField("dateTime",QDateTime::currentDateTime(),8). - toUtf8()); - play_pad_socket->write(RDJsonField("hostName", - rda->station()->name(),8).toUtf8()); - play_pad_socket->write(RDJsonField("shortHostName", - rda->station()->shortName(),8).toUtf8()); + play_pad_socket-> + write(RDJsonField("dateTime",QDateTime::currentDateTime(),8).toUtf8()); + play_pad_socket-> + write(RDJsonField("hostName",rda->station()->name(),8).toUtf8()); + play_pad_socket-> + write(RDJsonField("shortHostName",rda->station()->shortName(),8).toUtf8()); play_pad_socket->write(RDJsonField("machine",play_id+1,8)); play_pad_socket->write(RDJsonField("onairFlag",play_onair_flag,8)); - play_pad_socket->write(RDJsonField("mode",RDAirPlayConf::logModeText(play_op_mode),8)); + play_pad_socket-> + write(RDJsonField("mode",RDAirPlayConf::logModeText(play_op_mode),8)); // // Service @@ -3142,12 +3325,12 @@ void RDLogPlay::LogTraffic(RDLogLine *logline,RDLogLine::PlaySource src, return; } - QString eventDateTimeSQL = "NULL"; - - if(datetime.isValid() && logline->startTime(RDLogLine::Actual).isValid()) - eventDateTimeSQL = RDCheckDateTime(QDateTime(datetime.date(), - logline->startTime(RDLogLine::Actual)), "yyyy-MM-dd hh:mm:ss"); + QString evt_sql="NULL"; + if(datetime.isValid()&&logline->startTime(RDLogLine::Actual).isValid()) { + evt_sql=RDCheckDateTime(QDateTime(datetime.date(), + logline->startTime(RDLogLine::Actual)), "yyyy-MM-dd hh:mm:ss"); + } sql=QString("insert into ELR_LINES set ")+ "SERVICE_NAME=\""+RDEscapeString(serviceName())+"\","+ QString().sprintf("LENGTH=%d,",length)+ @@ -3155,7 +3338,7 @@ void RDLogPlay::LogTraffic(RDLogLine *logline,RDLogLine::PlaySource src, QString().sprintf("LOG_ID=%d,",logline->id())+ QString().sprintf("CART_NUMBER=%u,",logline->cartNumber())+ "STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\","+ - "EVENT_DATETIME="+eventDateTimeSQL+","+ + "EVENT_DATETIME="+evt_sql+","+ QString().sprintf("EVENT_TYPE=%d,",action)+ QString().sprintf("EVENT_SOURCE=%d,",logline->source())+ "EXT_START_TIME="+RDCheckDateTime(logline->extStartTime(),"hh:mm:ss")+","+ diff --git a/lib/rdlogplay.h b/lib/rdlogplay.h index 9b33bbdc..1b654133 100644 --- a/lib/rdlogplay.h +++ b/lib/rdlogplay.h @@ -21,8 +21,6 @@ #ifndef RDLOGPLAY_H #define RDLOGPLAY_H -#include - #include #include #include @@ -87,8 +85,10 @@ class RDLogPlay : public RDLogModel void clear(); void insert(int line,int cartnum,RDLogLine::TransType next_type, RDLogLine::TransType type=RDLogLine::Play); - void insert(int line,RDLogLine *logline,bool update=true,bool preserv_custom_transition=false); - void remove(int line,int num_lines,bool update=true,bool preserv_custom_transition=false); + void insert(int line,RDLogLine *logline,bool update=true, + bool preserv_custom_transition=false); + void remove(int line,int num_lines,bool update=true, + bool preserv_custom_transition=false); void move(int from_line,int to_line); void copy(int from_line,int to_line, RDLogLine::TransType type=RDLogLine::Play); @@ -105,10 +105,14 @@ class RDLogPlay : public RDLogModel RDLogLine::Status status(int line); QTime startTime(int line); QTime nextStop() const; + int startOfHour(int hour) const; bool running(bool include_paused=true); void resync(); bool isRefreshable() const; + public slots: + void setTimeMode(RDAirPlayConf::TimeMode mode); + private slots: void transTimerData(); void graceTimerData(); @@ -123,7 +127,6 @@ class RDLogPlay : public RDLogModel void macroFinishedData(); void macroStoppedData(); void timescalingSupportedData(int card,bool state); - // void rescanEventsData(); void auditionStartedData(); void auditionStoppedData(); void notificationReceivedData(RDNotification *notify); @@ -135,6 +138,7 @@ class RDLogPlay : public RDLogModel void inserted(int line); void removed(int line,int num,bool moving); void modified(int line); + void hourChanged(int hour,bool state); void auditionHeadPlayed(int line); void auditionTailPlayed(int line); void auditionStopped(int line); @@ -153,12 +157,18 @@ class RDLogPlay : public RDLogModel void channelStarted(int id,int mport,int card,int port); void channelStopped(int id,int mport,int card,int port); + protected: + QString cellText(int col,int line,RDLogLine *ll) const; + QFont cellTextFont(int col,int row,RDLogLine *ll) const; + QColor cellTextColor(int col,int row,RDLogLine *ll) const; + QColor rowBackgroundColor(int row,RDLogLine *ll) const; + private: bool StartEvent(int line,RDLogLine::TransType trans_type,int trans_length, RDLogLine::StartSource src,int mport=-1,int duck_length=0); bool StartAudioEvent(int line); void CleanupEvent(int id); - void UpdateStartTimes(int line); + void UpdateStartTimes(); void FinishEvent(int line); QTime GetStartTime(QTime sched_time,RDLogLine::TransType trans_type, RDLogLine::TimeType time_type,QTime prev_time, @@ -177,6 +187,7 @@ class RDLogPlay : public RDLogModel bool GetNextPlayable(int *line,bool skip_meta,bool forced_start=false); void LogPlayEvent(RDLogLine *logline); void RefreshEvents(int line,int line_quan,bool force_update=false); + void ChangeTransport(); void Playing(int id); void Paused(int id); void Stopping(int id); @@ -184,6 +195,7 @@ class RDLogPlay : public RDLogModel void Finished(int id); void ClearChannel(int deckid); RDLogLine::TransType GetTransType(const QString &logname,int line); + QString TimeString(const QTime &time) const; bool ClearBlock(int start_line); void SendNowNext(); QString GetPadJson(const QString &name,RDLogLine *ll, @@ -193,6 +205,7 @@ class RDLogPlay : public RDLogModel RDAirPlayConf::TrafficAction action,bool onair_flag) const; RDCae *play_cae; RDAirPlayConf::OpMode play_op_mode; + RDAirPlayConf::TimeMode play_time_mode; int play_slot_id[LOGPLAY_MAX_PLAYS]; int play_segue_length; int play_trans_length; @@ -243,6 +256,7 @@ class RDLogPlay : public RDLogModel int play_audition_preroll; RDEventPlayer *play_event_player; RDUnixSocket *play_pad_socket; + bool play_hours[24]; }; diff --git a/rdairplay/Makefile.am b/rdairplay/Makefile.am index 0ad6adaf..0ef68ea6 100644 --- a/rdairplay/Makefile.am +++ b/rdairplay/Makefile.am @@ -51,6 +51,7 @@ dist_rdairplay_SOURCES = button_log.cpp button_log.h\ list_logs.cpp list_logs.h\ local_macros.cpp colors.h\ loglinebox.cpp loglinebox.h\ + logtableview.cpp logtableview.h\ mode_display.cpp mode_display.h\ pie_counter.cpp pie_counter.h\ post_counter.cpp post_counter.h\ @@ -67,6 +68,7 @@ nodist_rdairplay_SOURCES = moc_button_log.cpp\ moc_list_log.cpp\ moc_list_logs.cpp\ moc_loglinebox.cpp\ + moc_logtableview.cpp\ moc_mode_display.cpp\ moc_pie_counter.cpp\ moc_post_counter.cpp\ diff --git a/rdairplay/hourselector.cpp b/rdairplay/hourselector.cpp index 8e8bc437..e43e9033 100644 --- a/rdairplay/hourselector.cpp +++ b/rdairplay/hourselector.cpp @@ -97,11 +97,9 @@ void HourSelector::setTimeMode(RDAirPlayConf::TimeMode mode) } -void HourSelector::updateHours(bool states[24]) +void HourSelector::updateHour(int hour,bool state) { - for(unsigned i=0;i<24;i++) { - hour_button[i]->setEnabled(states[i]); - } + hour_button[hour]->setEnabled(state); } diff --git a/rdairplay/hourselector.h b/rdairplay/hourselector.h index 40cc7c2d..a5eb9732 100644 --- a/rdairplay/hourselector.h +++ b/rdairplay/hourselector.h @@ -31,7 +31,9 @@ class HourSelector : public RDWidget HourSelector(QWidget *parent=0); QSizePolicy sizePolicy() const; void setTimeMode(RDAirPlayConf::TimeMode mode); - void updateHours(bool states[24]); + + public slots: + void updateHour(int hour,bool state); signals: void hourSelected(int hour); diff --git a/rdairplay/list_log.cpp b/rdairplay/list_log.cpp index 917b0574..af974532 100644 --- a/rdairplay/list_log.cpp +++ b/rdairplay/list_log.cpp @@ -1,8 +1,8 @@ // list_log.cpp // -// The full log list for RDAirPlay +// The full log widget for RDAirPlay // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -26,15 +26,6 @@ #include "colors.h" #include "list_log.h" -#include "../icons/play.xpm" -#include "../icons/rml5.xpm" -#include "../icons/chain.xpm" -#include "../icons/track_cart.xpm" -#include "../icons/mic16.xpm" -#include "../icons/notemarker.xpm" -#include "../icons/traffic.xpm" -#include "../icons/music.xpm" - ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, QWidget *parent) : RDWidget(parent) @@ -50,18 +41,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_audition_head_playing=false; list_audition_tail_playing=false; - // - // Create Icons - // - list_playout_map=new QPixmap(play_xpm); - list_macro_map=new QPixmap(rml5_xpm); - list_chain_map=new QPixmap(chain_xpm); - list_track_cart_map=new QPixmap(track_cart_xpm); - list_mic16_map=new QPixmap(mic16_xpm); - list_notemarker_map=new QPixmap(notemarker_xpm); - list_traffic_map=new QPixmap(traffic_xpm); - list_music_map=new QPixmap(music_xpm); - // // Create Palettes // @@ -130,12 +109,10 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_hour_selector->setTimeMode(list_time_mode); connect(list_hour_selector,SIGNAL(hourSelected(int)), this,SLOT(selectHour(int))); + connect(list_log,SIGNAL(hourChanged(int,bool)), + list_hour_selector,SLOT(updateHour(int,bool))); list_hour_selector->hide(); - // - // Log List - // - list_log_list=new LibListView(this); int y=0; int h=sizeHint().height()-60; if(rda->airplayConf()->showCounters()) { @@ -147,54 +124,33 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_hour_selector->setGeometry(0,0,sizeHint().width(),80); list_hour_selector->show(); } - list_log_list->setGeometry(0,y,sizeHint().width(),h); - list_log_list->setAllColumnsShowFocus(true); - list_log_list->setSelectionMode(Q3ListView::Extended); - list_log_list->setItemMargin(5); - list_log_list->addColumn(""); - list_log_list->setColumnAlignment(0,Qt::AlignHCenter); - list_log_list->addColumn(tr("Est. Time")); - list_log_list->setColumnAlignment(1,Qt::AlignRight); - list_log_list->addColumn(tr("Len")); - list_log_list->setColumnAlignment(2,Qt::AlignRight); - list_log_list->addColumn(tr("Trans")); - list_log_list->setColumnAlignment(3,Qt::AlignHCenter); - list_log_list->addColumn(tr("Cart")); - list_log_list->setColumnAlignment(4,Qt::AlignHCenter); - list_log_list->addColumn(tr("Title")); - list_log_list->setColumnAlignment(5,Qt::AlignLeft); - list_log_list->addColumn(tr("Artist")); - list_log_list->setColumnAlignment(6,Qt::AlignLeft); - list_log_list->addColumn(tr("Group")); - list_log_list->setColumnAlignment(7,Qt::AlignHCenter); - list_log_list->addColumn(tr("Sch. Time")); - list_log_list->setColumnAlignment(8,Qt::AlignHCenter); - list_log_list->addColumn(tr("Album")); - list_log_list->setColumnAlignment(9,Qt::AlignLeft); - list_log_list->addColumn(tr("Label")); - list_log_list->setColumnAlignment(10,Qt::AlignLeft); - list_log_list->addColumn(tr("Client")); - list_log_list->setColumnAlignment(11,Qt::AlignLeft); - list_log_list->addColumn(tr("Agency")); - list_log_list->setColumnAlignment(12,Qt::AlignLeft); - list_log_list->addColumn(tr("Marker")); - list_log_list->setColumnAlignment(13,Qt::AlignHCenter); - list_log_list->addColumn(tr("Line ID")); - list_log_list->setColumnAlignment(14,Qt::AlignHCenter); - list_log_list->addColumn(tr("Count")); - list_log_list->setColumnAlignment(15,Qt::AlignHCenter); - list_log_list->addColumn(tr("Status")); - list_log_list->setColumnAlignment(16,Qt::AlignHCenter); - list_log_list->setHardSortColumn(15); - list_log_list->setFocusPolicy(Qt::NoFocus); - connect(list_log_list,SIGNAL(selectionChanged()), - this,SLOT(selectionChangedData())); - connect(list_log_list, - SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)), - this, - SLOT(doubleclickedData(Q3ListViewItem *,const QPoint &,int))); - connect(list_log_list,SIGNAL(cartDropped(int,RDLogLine *)), + + // + // Log View + // + list_log_view=new LogTableView(this); + list_log_view->setGeometry(0,y,sizeHint().width(),h); + list_log_view->setSelectionBehavior(QAbstractItemView::SelectRows); + list_log_view->setSelectionMode(QAbstractItemView::ContiguousSelection); + list_log_view->setShowGrid(false); + list_log_view->setSortingEnabled(false); + list_log_view->setWordWrap(false); + list_log->setFont(defaultFont()); + list_log->setPalette(palette()); + list_log_view->setModel(list_log); + list_log_view->resizeColumnsToContents(); + list_log->setTimeMode(list_time_mode); + connect(list_log_view->selectionModel(), + SIGNAL(selectionChanged(const QItemSelection &,const QItemSelection &)), + this, + SLOT(selectionChangedData(const QItemSelection &,const QItemSelection))); + connect(list_log_view,SIGNAL(doubleClicked(const QModelIndex &)), + this,SLOT(doubleClickedData(const QModelIndex &))); + connect(list_log,SIGNAL(modelReset()),this,SLOT(modelResetData())); + connect(list_log_view,SIGNAL(cartDropped(int,RDLogLine *)), this,SLOT(cartDroppedData(int,RDLogLine *))); + connect(rda->ripc(),SIGNAL(notificationReceived(RDNotification *)), + list_log,SLOT(processNotification(RDNotification *))); // // List Logs Dialog @@ -247,7 +203,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_take_button=new QPushButton(this); list_take_button->setGeometry(10,sizeHint().height()-55,80,50); list_take_button->setFont(bigButtonFont()); - list_take_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_take_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_take_button->setText(tr("Select")); list_take_button->setFocusPolicy(Qt::NoFocus); connect(list_take_button,SIGNAL(clicked()),this,SLOT(takeButtonData())); @@ -259,7 +216,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_head_button=new QPushButton(this); list_head_button->setGeometry(10,sizeHint().height()-113,80,50); list_head_button->setFont(bigButtonFont()); - list_head_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_head_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_head_button->setText(tr("Audition\nHead")); list_head_button->setFocusPolicy(Qt::NoFocus); connect(list_head_button,SIGNAL(clicked()),this,SLOT(headButtonData())); @@ -273,7 +231,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_tail_button=new QPushButton(this); list_tail_button->setGeometry(90,sizeHint().height()-113,80,50); list_tail_button->setFont(bigButtonFont()); - list_tail_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_tail_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_tail_button->setText(tr("Audition\nTail")); list_tail_button->setFocusPolicy(Qt::NoFocus); connect(list_tail_button,SIGNAL(clicked()),this,SLOT(tailButtonData())); @@ -287,7 +246,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_play_button=new QPushButton(this); list_play_button->setGeometry(10,sizeHint().height()-55,80,50); list_play_button->setFont(bigButtonFont()); - list_play_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_play_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_play_button->setText(tr("Start")); list_play_button->setDisabled(true); list_play_button->setFocusPolicy(Qt::NoFocus); @@ -299,7 +259,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_next_button=new QPushButton(this); list_next_button->setGeometry(90,sizeHint().height()-55,80,50); list_next_button->setFont(bigButtonFont()); - list_next_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_next_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_next_button->setText(tr("Make\nNext")); list_next_button->setDisabled(true); list_next_button->setFocusPolicy(Qt::NoFocus); @@ -311,7 +272,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_modify_button=new QPushButton(this); list_modify_button->setGeometry(170,sizeHint().height()-55,80,50); list_modify_button->setFont(bigButtonFont()); - list_modify_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_modify_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_modify_button->setText(tr("Modify")); list_modify_button->setDisabled(true); list_modify_button->setFocusPolicy(Qt::NoFocus); @@ -323,7 +285,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_scroll_button=new QPushButton(this); list_scroll_button->setGeometry(250,sizeHint().height()-55,80,50); list_scroll_button->setFont(bigButtonFont()); - list_scroll_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_scroll_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_scroll_button->setText(tr("Scroll")); list_scroll_button->setFocusPolicy(Qt::NoFocus); connect(list_scroll_button,SIGNAL(clicked()),this,SLOT(scrollButtonData())); @@ -335,7 +298,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_refresh_button=new QPushButton(this); list_refresh_button->setGeometry(330,sizeHint().height()-55,80,50); list_refresh_button->setFont(bigButtonFont()); - list_refresh_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_refresh_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_refresh_button->setText(tr("Refresh\nLog")); list_refresh_button->setDisabled(true); list_refresh_button->setFocusPolicy(Qt::NoFocus); @@ -349,7 +313,8 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, list_load_button->setGeometry(sizeHint().width()-90,sizeHint().height()-55, 80,50); list_load_button->setFont(bigButtonFont()); - list_load_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); + list_load_button-> + setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color))); list_load_button->setText(tr("Select\nLog")); list_load_button->setFocusPolicy(Qt::NoFocus); connect(list_load_button,SIGNAL(clicked()),this,SLOT(loadButtonData())); @@ -382,9 +347,6 @@ ListLog::ListLog(RDLogPlay *log,int id,bool allow_pause, this,SLOT(auditionStoppedData(int))); setBackgroundColor(QColor(system_mid_color)); - - RefreshList(); - UpdateTimes(); } @@ -400,37 +362,12 @@ QSizePolicy ListLog::sizePolicy() const } -void ListLog::refresh() -{ - RefreshList(); - UpdateTimes(); -} - - -void ListLog::refresh(int line) -{ - RefreshList(line); - UpdateTimes(); -} - - -void ListLog::setStatus(int line,RDLogLine::Status status) -{ - RDListViewItem *next=GetItem(line); - if(next==NULL) { - return; - } - next->setText(16,QString().sprintf("%d",status)); -} - - void ListLog::setOpMode(RDAirPlayConf::OpMode mode) { if(mode==list_op_mode) { return; } list_op_mode=mode; - UpdateTimes(); } @@ -449,8 +386,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) } switch(mode) { case RDAirPlayConf::Normal: - list_log_list->setSelectionMode(Q3ListView::Extended); - list_log_list->setPalette(palette()); + list_log_view->setSelectionMode(QAbstractItemView::ContiguousSelection); + list_log_view->setPalette(palette()); list_take_button->hide(); list_play_button->show(); list_next_button->show(); @@ -461,8 +398,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::AddTo: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_to_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_to_color); list_take_button->setText(ADD_TO_MODE_TITLE); list_take_button->setPalette(list_to_color); list_take_button->show(); @@ -475,8 +412,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::DeleteFrom: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_from_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_from_color); list_take_button->setText(DELETE_FROM_MODE_TITLE); list_take_button->setPalette(list_from_color); list_take_button->show(); @@ -489,8 +426,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::MoveFrom: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_from_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_from_color); list_take_button->setText(MOVE_FROM_MODE_TITLE); list_take_button->setPalette(list_from_color); list_take_button->show(); @@ -503,8 +440,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::MoveTo: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_to_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_to_color); list_take_button->setText(MOVE_TO_MODE_TITLE); list_take_button->setPalette(list_to_color); list_take_button->show(); @@ -517,8 +454,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::CopyFrom: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_from_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_from_color); list_take_button->setText(COPY_FROM_MODE_TITLE); list_take_button->setPalette(list_from_color); list_take_button->show(); @@ -531,8 +468,8 @@ void ListLog::setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum) break; case RDAirPlayConf::CopyTo: - list_log_list->setSelectionMode(Q3ListView::Single); - list_log_list->setPalette(list_list_to_color); + list_log_view->setSelectionMode(QAbstractItemView::SingleSelection); + list_log_view->setPalette(list_list_to_color); list_take_button->setText(COPY_TO_MODE_TITLE); list_take_button->setPalette(list_to_color); list_take_button->show(); @@ -566,9 +503,9 @@ void ListLog::setTimeMode(RDAirPlayConf::TimeMode mode) return; } list_hour_selector->setTimeMode(mode); + list_log->setTimeMode(mode); list_time_mode=mode; - UpdateTimes(); - RefreshList(); + list_log_view->resizeColumnToContents(0); } @@ -581,17 +518,9 @@ void ListLog::userChanged(bool add_allowed,bool delete_allowed, void ListLog::selectHour(int hour) { - RDListViewItem *item=(RDListViewItem *)list_log_list->firstChild(); - while(item!=NULL) { - if(PredictedStartHour(item)==hour) { - list_log_list->clearSelection(); - // Always start from the bottom so visible item is at the top - list_log_list->ensureItemVisible(list_log_list->lastItem()); - list_log_list->ensureItemVisible(item); - list_log_list->setSelected(item,true); - return; - } - item=(RDListViewItem *)item->nextSibling(); + int row=list_log->startOfHour(hour); + if(row>=0) { + list_log_view->selectRow(row); } } @@ -613,13 +542,13 @@ void ListLog::takeButtonData() return; default: - line=list_log_list->currentItem()->text(15).toInt(); + line=CurrentLine(); break; } break; case RDAirPlayConf::CopyFrom: - line=list_log_list->currentItem()->text(15).toInt(); + line=CurrentLine(); if(list_log->logLine(line)!=NULL) { switch(list_log->logLine(line)->type()) { case RDLogLine::Marker: @@ -647,7 +576,7 @@ void ListLog::takeButtonData() return; default: - line=list_log_list->currentItem()->text(15).toInt(); + line=CurrentLine(); break; } break; @@ -660,7 +589,7 @@ void ListLog::takeButtonData() return; default: - line=list_log_list->currentItem()->text(15).toInt(); + line=CurrentLine(); // Don't try delete "end of log" or other invalid log entries. if (line<0) { return; @@ -672,6 +601,7 @@ void ListLog::takeButtonData() default: break; } + emit selectClicked(list_id,line,status); } @@ -767,33 +697,38 @@ void ListLog::playButtonData() void ListLog::modifyButtonData() { - RDListViewItem *item=(RDListViewItem *)list_log_list->currentItem(); - if((item==NULL)|| - ((item->text(16).toInt()!=RDLogLine::Scheduled)&& - (item->text(16).toInt()!=RDLogLine::Paused)&& - (item->text(16).toInt()!=RDLogLine::NoCart)&& - (item->text(16).toInt()!=RDLogLine::NoCut))) { + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); + + if(rows.size()==0) { return; } - int line=item->text(15).toInt(); - if(list_event_edit->exec(line)==0) { - list_log->lineModified(line); + if(rows.size()==1) { + RDLogLine *ll=list_log->logLine(rows.first().row()); + if(ll!=NULL) { + if((ll->status()!=RDLogLine::Scheduled)&& + (ll->status()!=RDLogLine::Paused)&& + (ll->state()!=RDLogLine::NoCart)&& + (ll->state()!=RDLogLine::NoCut)) { + return; + } + } } - if(line==1) { + if(list_event_edit->exec(rows.first().row())==0) { + list_log->lineModified(rows.first().row()); + } + if(rows.first().row()==1) { return; } - refresh(line); ClearSelection(); } -void ListLog::doubleclickedData(Q3ListViewItem *,const QPoint &,int) +void ListLog::doubleClickedData(const QModelIndex &index) { modifyButtonData(); } - void ListLog::scrollButtonData() { if(list_scroll) { @@ -816,13 +751,17 @@ void ListLog::refreshButtonData() void ListLog::nextButtonData() { - if((list_log_list->currentItem()==NULL)|| - (list_log_list->currentItem()->text(16).toInt()!=RDLogLine::Scheduled)) { - return; + RDLogLine *ll=NULL; + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); + + if(rows.size()==1) { + if((ll=list_log->logLine(rows.first().row()))!=NULL) { + if(ll->status()==RDLogLine::Scheduled) { + list_log->makeNext(rows.first().row()); + ClearSelection(); + } + } } - int line=list_log_list->currentItem()->text(15).toInt(); - list_log->makeNext(line); - ClearSelection(); } @@ -871,124 +810,42 @@ void ListLog::loadButtonData() } -void ListLog::logReloadedData() +void ListLog::selectionChangedData(const QItemSelection &new_sel, + const QItemSelection &old_sel) { - RefreshList(); - UpdateTimes(); - selectionChangedData(); -} + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); - -void ListLog::logPlayedData(int line) -{ - setStatus(line,RDLogLine::Playing); - UpdateTimes(); -} - - -void ListLog::logPausedData(int line) -{ - setStatus(line,RDLogLine::Paused); - UpdateTimes(); -} - - -void ListLog::logStoppedData(int line) -{ - setStatus(line,RDLogLine::Finished); - UpdateTimes(); -} - - -void ListLog::logInsertedData(int line) -{ - bool appended=false; - - if(line>=list_log->lineCount()) { - line=list_log->lineCount()-1; - } - if(line>=list_log->lineCount()-1) { - appended=true; - } - int count; - RDListViewItem *item=GetItem(line+1); - while(item!=NULL) { - if((count=item->text(15).toInt())>=0) { - item->setText(15,QString().sprintf("%d",count+1)); - } - item=(RDListViewItem *)item->nextSibling(); - } - item=new RDListViewItem(list_log_list); - list_log->logLine(line)->setListViewItem(item); - RefreshItem(item,line); - if(appended) { - if((item=(RDListViewItem *)list_log_list->findItem("-2",13))!=NULL) { - list_log_list->ensureItemVisible(item); - } - } - list_log_list->sort(); -} - - -void ListLog::logRemovedData(int line,int num,bool moving) -{ - int count; - RDListViewItem *item=GetItem(line+num); - while(item!=NULL) { - if((count=item->text(15).toInt())>=0) { - item->setText(15,QString().sprintf("%d",count-num)); - } - item=(RDListViewItem *)item->nextSibling(); - } - for(int i=line;i<(line+num);i++) { - delete GetItem(i); - } - if(!moving) { - UpdateTimes(line,num); - } - list_log_list->sort(); -} - - -void ListLog::selectionChangedData() -{ - int count=0; - RDListViewItem *item=NULL; - RDListViewItem *next=(RDListViewItem *)list_log_list->firstChild(); - int start_line=-1; - int end_line=-1; - - while(next!=NULL) { - if(list_log_list->isSelected(next)) { - item=next; - if((start_line<0)&&(next->text(14).toInt()!=END_MARKER_ID)) { - start_line=next->text(15).toInt(); - } - if(next->text(12).toInt()!=END_MARKER_ID) { - end_line=next->text(15).toInt(); - } - count++; - } - next=(RDListViewItem *)next->nextSibling(); - } - if(count!=1) { + if(rows.size()!=1) { list_endtime_edit->setText(""); list_stoptime_label->setText(tr("Selected:")); SetPlaybuttonMode(ListLog::ButtonDisabled); list_modify_button->setDisabled(true); list_next_button->setDisabled(true); - if(start_line>=0) { - list_stoptime_edit->setText(RDGetTimeLength(list_log-> - length(start_line,end_line+1),true,false)); + if(rows.size()>0) { + int last_line=rows.last().row(); + if(last_line>=list_log->lineCount()) { + last_line=list_log->lineCount()-1; + } + list_stoptime_edit-> + setText(RDGetTimeLength(list_log-> + length(rows.first().row(),last_line+1), + true,false)); } return; } switch(CurrentStatus()) { case RDLogLine::Scheduled: case RDLogLine::Paused: - SetPlaybuttonMode(ListLog::ButtonPlay); - list_modify_button->setEnabled(true); - list_next_button->setEnabled(true); + if(rows.first().row()>=list_log->lineCount()) { //End marker! + SetPlaybuttonMode(ListLog::ButtonDisabled); + list_modify_button->setDisabled(true); + list_next_button->setDisabled(true); + } + else { + SetPlaybuttonMode(ListLog::ButtonPlay); + list_modify_button->setEnabled(true); + list_next_button->setEnabled(true); + } break; case RDLogLine::Playing: @@ -1006,11 +863,12 @@ void ListLog::selectionChangedData() default: break; } - if(item->text(15).toInt()>=0) { - list_endtime_edit->setText(RDGetTimeLength(list_log-> - length(item->text(15).toInt(),list_log->lineCount()),true,false)); + if((rows.size()==1)&&(rows.first().row()lineCount())) { + list_endtime_edit-> + setText(RDGetTimeLength(list_log-> + length(rows.last().row(),list_log->lineCount()),true,false)); list_stoptime_label->setText(tr("Next Stop:")); - int stoplen=list_log->lengthToStop(item->text(15).toInt()); + int stoplen=list_log->lengthToStop(rows.last().row()); if(stoplen>=0) { list_stoptime_edit->setText(RDGetTimeLength(stoplen,true,false)); } @@ -1029,24 +887,16 @@ void ListLog::transportChangedData() { int transport_line[TRANSPORT_QUANTITY]; - SetColor(); - list_log->transportEvents(transport_line); - for(int i=0;i=0)) { ScrollTo(transport_line[0]); } } -void ListLog::modifiedData(int line) +void ListLog::modelResetData() { - RefreshList(line); - UpdateTimes(); + list_log_view->resizeColumnsToContents(); } @@ -1062,407 +912,63 @@ void ListLog::cartDroppedData(int line,RDLogLine *ll) } -void ListLog::RefreshList() +int ListLog::CurrentLine() { - RDListViewItem *l; - RDLogLine *logline; + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); - list_log_list->clear(); - l=new RDListViewItem(list_log_list); - l->setText(5,tr("--- end of log ---")); - l->setText(15,QString().sprintf("%d",END_MARKER_ID)); - l->setText(14,QString().sprintf("%d",list_log->lineCount())); - for(int i=list_log->lineCount()-1;i>=0;i--) { - if((logline=list_log->logLine(i))!=NULL) { - l=new RDListViewItem(list_log_list); - logline->setListViewItem(l); - } - RefreshItem(l,i); + if(rows.size()==1) { + return rows.first().row(); } + + return -1; } -void ListLog::RefreshList(int line) +RDLogLine::Status ListLog::CurrentStatus() { - RDListViewItem *next=(RDListViewItem *)list_log_list->firstChild(); - while((next!=NULL)&&next->text(15).toInt()!=line) { - next=(RDListViewItem *)next->nextSibling(); - } - if(next!=NULL) { - RefreshItem(next,line); - } -} + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); - -void ListLog::RefreshItem(RDListViewItem *l,int line) -{ - int lines[TRANSPORT_QUANTITY]; - bool is_next=false; - - RDLogLine *log_line=list_log->logLine(line); - if(log_line==NULL) { - return; - } - switch(log_line->timeType()) { - case RDLogLine::Hard: - l->setText(1,QString("T")+ - TimeString(log_line->startTime(RDLogLine::Logged))); - l->setText(8,QString("T")+ - TimeString(log_line->startTime(RDLogLine::Logged))); - for(int i=0;icolumns();i++) { - l->setTextColor(i,LOG_HARDTIME_TEXT_COLOR,QFont::Bold); - } - l->setText(14,"N"); - break; - - default: - if(!log_line->startTime(RDLogLine::Logged).isNull()) { - l->setText(8,TimeString(log_line->startTime(RDLogLine::Logged))); + if(rows.size()==1) { + RDLogLine *ll=list_log->logLine(rows.first().row()); + if(ll==NULL) { + return RDLogLine::Scheduled; } else { - l->setText(8,""); - } - for(int i=0;icolumns();i++) { - l->setTextColor(i,LOG_RELATIVE_TEXT_COLOR,QFont::Normal); - } - l->setText(14,""); - break; - } - switch(log_line->transType()) { - case RDLogLine::Play: - l->setText(3,tr("PLAY")); - l->setTextColor(3,l->textColor(2),QFont::Normal); - break; - - case RDLogLine::Stop: - l->setText(3,tr("STOP")); - l->setTextColor(3,l->textColor(2),QFont::Normal); - break; - - case RDLogLine::Segue: - l->setText(3,tr("SEGUE")); - if(log_line->hasCustomTransition()) { - l->setTextColor(3,RD_CUSTOM_TRANSITION_COLOR,QFont::Bold); - } - else { - if(log_line->timeType()==RDLogLine::Hard) { - l->setTextColor(3,l->textColor(2),QFont::Bold); - } - else { - l->setTextColor(3,l->textColor(2),QFont::Normal); - } - } - break; - - default: - break; - } - switch(log_line->type()) { - case RDLogLine::Cart: - switch(log_line->source()) { - case RDLogLine::Tracker: - l->setPixmap(0,*list_track_cart_map); - break; - - default: - l->setPixmap(0,*list_playout_map); - break; - } - l->setText(2,RDGetTimeLength(log_line->effectiveLength(),false,false)); - l->setText(4,QString(). - sprintf("%06u",log_line->cartNumber())); - if((log_line->source()!=RDLogLine::Tracker)|| - log_line->originUser().isEmpty()|| - (!log_line->originDateTime().isValid())) { - l->setText(5,log_line->title()); - } - else { - l->setText(5,log_line->title()+" -- "+log_line->originUser()+" "+ - log_line->originDateTime().toString("M/d hh:mm")); - } - l->setText(6,log_line->artist()); - l->setText(7,log_line->groupName()); - l->setTextColor(7,log_line->groupColor(),QFont::Bold); - l->setText(9,log_line->album()); - l->setText(10,log_line->label()); - l->setText(11,log_line->client()); - l->setText(12,log_line->agency()); - break; - - case RDLogLine::Macro: - l->setPixmap(0,*list_macro_map); - l->setText(2,RDGetTimeLength(log_line->forcedLength(),false,false)); - l->setText(4,QString(). - sprintf("%06u",log_line->cartNumber())); - l->setText(5,log_line->title()); - l->setText(6,log_line->artist()); - l->setText(7,log_line->groupName()); - l->setTextColor(7,log_line->groupColor(),QFont::Bold); - l->setText(9,log_line->album()); - l->setText(10,log_line->label()); - l->setText(11,log_line->client()); - l->setText(12,log_line->agency()); - break; - - case RDLogLine::Marker: - l->setPixmap(0,*list_notemarker_map); - l->setText(2,"00:00"); - l->setText(4,tr("MARKER")); - l->setText(5,RDTruncateAfterWord(log_line->markerComment(),5,true)); - l->setText(13,log_line->markerLabel()); - break; - - case RDLogLine::Track: - l->setPixmap(0,*list_mic16_map); - l->setText(2,"00:00"); - l->setText(4,tr("TRACK")); - l->setText(5,RDTruncateAfterWord(log_line->markerComment(),5,true)); - break; - - case RDLogLine::MusicLink: - l->setPixmap(0,*list_music_map); - l->setText(2,"00:00"); - l->setText(4,tr("LINK")); - l->setText(5,tr("[music import]")); - break; - - case RDLogLine::TrafficLink: - l->setPixmap(0,*list_traffic_map); - l->setText(2,"00:00"); - l->setText(4,tr("LINK")); - l->setText(5,tr("[traffic import]")); - break; - - case RDLogLine::Chain: - l->setPixmap(0,*list_chain_map); - l->setText(2,""); - l->setText(4,tr("CHAIN TO")); - l->setText(5,log_line->markerLabel()); - l->setText(6,RDTruncateAfterWord(log_line->markerComment(),5,true)); - break; - - default: - break; - } - l->setText(14,QString().sprintf("%d",log_line->id())); - l->setText(15,QString().sprintf("%d",line)); - l->setText(16,QString().sprintf("%d",log_line->status())); - SetPlaybuttonMode(ListLog::ButtonDisabled); - list_modify_button->setDisabled(true); - switch(log_line->state()) { - case RDLogLine::NoCart: - if(log_line->type()==RDLogLine::Cart) { - l->setPixmap(0,NULL); - if(log_line->startTime(RDLogLine::Logged).isNull()) { - l->setText(8,""); - } - else { - l->setText(8, - log_line->startTime(RDLogLine::Logged).toString("hh:mm:ss")); - } - l->setText(3,""); - l->setText(5,tr("[CART NOT FOUND]")); - } - break; - - case RDLogLine::NoCut: - if(log_line->type()==RDLogLine::Cart) { - l->setText(6,tr("[NO VALID CUT AVAILABLE]")); - } - break; - - default: - if((log_line->type()==RDLogLine::Cart)&& - (log_line->effectiveLength()==0)) { - l->setText(6,tr("[NO AUDIO AVAILABLE]")); - } - break; - } - list_log->transportEvents(lines); - for(int i=0;istatus(); } } - UpdateColor(line,is_next); + return RDLogLine::Finished; } -RDListViewItem *ListLog::GetItem(int line) +RDLogLine::State ListLog::CurrentState() { - RDLogLine *logline; - if((logline=list_log->logLine(line))==NULL) { - return NULL; + QModelIndexList rows=list_log_view->selectionModel()->selectedRows(); + + if(rows.size()==1) { + RDLogLine *ll=list_log->logLine(rows.first().row()); + if(ll!=NULL) { + return ll->state(); + } } - return logline->listViewItem(); -} - - -int ListLog::CurrentLine() { - RDListViewItem *item; - - if((item=(RDListViewItem *)list_log_list->currentItem())==NULL) { - return -1; - } - if(!list_log_list->isSelected(item)) { - return -1; - } - return list_log_list->currentItem()->text(15).toInt(); -} - - -RDLogLine::Status ListLog::CurrentStatus() { - if(list_log_list->currentItem()==NULL) { - return RDLogLine::Finished; - } - return (RDLogLine::Status)list_log_list->currentItem()->text(16).toInt(); -} - - -RDLogLine::State ListLog::CurrentState() { - if(list_log_list->currentItem()==NULL) { - return RDLogLine::NoCart; - } - return list_log-> - logLine(list_log_list->currentItem()->text(14).toInt())->state(); + return RDLogLine::NoCart; } void ListLog::ClearSelection() { - list_log_list->clearSelection(); + list_log_view->clearSelection(); SetPlaybuttonMode(ListLog::ButtonDisabled); list_modify_button->setDisabled(true); list_next_button->setDisabled(true); } -void ListLog::UpdateTimes(int removed_line,int num_lines) -{ - QTime time; - QTime end_time; - int line; - RDLogLine *logline; - - RDListViewItem *next=(RDListViewItem *)list_log_list->firstChild(); - for(int i=0;i<(list_log_list->childCount()-1);i++) { - if((line=next->text(15).toInt())>=removed_line) { - line+=num_lines; - } - if((logline=list_log->logLine(line))!=NULL) { - switch((RDLogLine::Status)next->text(16).toInt()) { - case RDLogLine::Scheduled: - case RDLogLine::Paused: - switch(logline->timeType()) { - case RDLogLine::Hard: - next->setText(1,QString(tr("T"))+ - TimeString(logline->startTime(RDLogLine::Logged))); - break; - - default: - if(!logline->startTime(RDLogLine::Predicted).isNull()) { - next->setText(1, - TimeString(logline->startTime(RDLogLine::Predicted))); - } - else { - next->setText(1,""); - } - break; - } - break; - - default: - next->setText(1,TimeString(logline->startTime(RDLogLine::Actual))); - break; - } - next=(RDListViewItem *)next->nextSibling(); - } - } - UpdateHourSelector(); -} - - void ListLog::ScrollTo(int line) { - RDListViewItem *item=GetItem(line); - - list_log_list->ensureVisible(0,list_log_list->itemPos(item), - 0,list_log_list->size().height()/2); - list_log_list->setCurrentItem(item); - list_log_list->clearSelection(); -} - - -void ListLog::UpdateColor(int line,bool next) -{ - RDLogLine *logline; - if((logline=list_log->logLine(line))==NULL) { - return; - } - RDListViewItem *item=GetItem(line); - if(item==NULL) { - return; - } - switch(logline->status()) { - case RDLogLine::Scheduled: - case RDLogLine::Auditioning: - if((logline->type()==RDLogLine::Cart)&& - (logline->state()==RDLogLine::NoCart)) { - item->setBackgroundColor(QColor(LOG_ERROR_COLOR)); - } - else { - if(((logline->cutNumber()<0)&&(logline->type()==RDLogLine::Cart))|| - (logline->state()==RDLogLine::NoCut)) { - item->setBackgroundColor(QColor(LOG_ERROR_COLOR)); - item->setText(6,tr("[NO VALID CUT AVAILABLE]")); - } - else { - if(next) { - if(logline->evergreen()) { - item->setBackgroundColor(QColor(LOG_EVERGREEN_COLOR)); - } - else { - item->setBackgroundColor(QColor(LOG_NEXT_COLOR)); - } - } - else { - if(logline->evergreen()) { - item->setBackgroundColor(QColor(LOG_EVERGREEN_COLOR)); - } - else { - item->setBackgroundColor(QColor(LOG_SCHEDULED_COLOR)); - } - } - } - } - break; - - case RDLogLine::Playing: - case RDLogLine::Finishing: - item->setBackgroundColor(QColor(LOG_PLAYING_COLOR)); - break; - - case RDLogLine::Paused: - item->setBackgroundColor(QColor(LOG_PAUSED_COLOR)); - break; - - case RDLogLine::Finished: - if(logline->state()==RDLogLine::Ok) { - item->setBackgroundColor(QColor(LOG_FINISHED_COLOR)); - } - else { - item->setBackgroundColor(QColor(LOG_ERROR_COLOR)); - } - break; - } -} - - -void ListLog::SetColor() -{ - for(int i=0;ilineCount();i++) { - UpdateColor(i); - } + list_log_view-> + scrollTo(list_log->index(line,0),QAbstractItemView::PositionAtCenter); + list_log_view->clearSelection(); } @@ -1512,37 +1018,3 @@ QString ListLog::TimeString(const QTime &time) const } return ret; } - - -void ListLog::UpdateHourSelector() -{ - bool found[24]={false}; - RDListViewItem *item=(RDListViewItem *)list_log_list->firstChild(); - int hour=-1; - - while(item!=NULL) { - if((hour=PredictedStartHour(item))>=0) { - found[hour]=true; - } - item=(RDListViewItem *)item->nextSibling(); - } - list_hour_selector->updateHours(found); -} - - -int ListLog::PredictedStartHour(RDListViewItem *item) -{ - bool ok=false; - - if(item==NULL) { - return -1; - } - QStringList item_fields=item->text(1).split(":"); - if(item_fields.size()==3) { - int item_hour=item_fields[0].replace("T","").toInt(&ok); - if(ok) { - return item_hour; - } - } - return -1; -} diff --git a/rdairplay/list_log.h b/rdairplay/list_log.h index 1f0bea1c..ba5f4770 100644 --- a/rdairplay/list_log.h +++ b/rdairplay/list_log.h @@ -1,6 +1,6 @@ // list_log.h // -// The full log list widget for RDAirPlay. +// The full log widget for RDAirPlay. // // (C) Copyright 2002-2020 Fred Gleason // @@ -21,14 +21,14 @@ #ifndef LIST_LOG_H #define LIST_LOG_H +#include #include #include "edit_event.h" #include "hourselector.h" #include "lib_listview.h" #include "list_logs.h" - -#define END_MARKER_ID -2 +#include "logtableview.h" class ListLog : public RDWidget { @@ -38,9 +38,6 @@ class ListLog : public RDWidget QWidget *parent=0); QSize sizeHint() const; QSizePolicy sizePolicy() const; - void refresh(); - void refresh(int line); - void setStatus(int line,RDLogLine::Status status); RDAirPlayConf::ActionMode actionMode() const; void setActionMode(RDAirPlayConf::ActionMode mode,int *cartnum=0); void setOpMode(RDAirPlayConf::OpMode mode); @@ -62,43 +59,29 @@ class ListLog : public RDWidget void takeButtonData(); void playButtonData(); void modifyButtonData(); - void doubleclickedData(Q3ListViewItem *,const QPoint &,int); + void doubleClickedData(const QModelIndex &index); void scrollButtonData(); void refreshButtonData(); void nextButtonData(); void loadButtonData(); - void logReloadedData(); - void logPlayedData(int line); - void logPausedData(int line); - void logStoppedData(int line); - void logInsertedData(int line); - void logRemovedData(int line,int num,bool moving); - void selectionChangedData(); + void selectionChangedData(const QItemSelection &new_sel, + const QItemSelection &old_sel); void transportChangedData(); - void modifiedData(int line); + void modelResetData(); void refreshabilityChangedData(bool state); void cartDroppedData(int line,RDLogLine *ll); private: enum PlayButtonMode {ButtonDisabled=0,ButtonPlay=1,ButtonStop=2}; - void RefreshList(); - void RefreshList(int line); - void RefreshItem(RDListViewItem *l,int line); int CurrentLine(); RDLogLine::Status CurrentStatus(); RDLogLine::State CurrentState(); void ClearSelection(); - RDListViewItem *GetItem(int line); - void UpdateTimes(int removed_line=-1,int num_lines=0); void ScrollTo(int line); - void UpdateColor(int line,bool next=false); - void SetColor(); void SetPlaybuttonMode(ListLog::PlayButtonMode mode); QString TimeString(const QTime &time) const; - void UpdateHourSelector(); - int PredictedStartHour(RDListViewItem *item); HourSelector *list_hour_selector; - LibListView *list_log_list; + LogTableView *list_log_view; RDLogPlay *list_log; ListLogs *list_logs_dialog; RDAirPlayConf::ActionMode list_action_mode; @@ -128,14 +111,6 @@ class ListLog : public RDWidget bool list_scroll; bool list_suspended_scroll; QPalette list_scroll_color[2]; - QPixmap *list_playout_map; - QPixmap *list_macro_map; - QPixmap *list_chain_map; - QPixmap *list_track_cart_map; - QPixmap *list_mic16_map; - QPixmap *list_notemarker_map; - QPixmap *list_traffic_map; - QPixmap *list_music_map; bool list_pause_allowed; bool list_audition_head_playing; bool list_audition_tail_playing; diff --git a/rdairplay/logtableview.cpp b/rdairplay/logtableview.cpp new file mode 100644 index 00000000..f593a729 --- /dev/null +++ b/rdairplay/logtableview.cpp @@ -0,0 +1,56 @@ +// logtableview.cpp +// +// TableView widget for RDAirPlay +// +// (C) Copyright 2002-2020 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 +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// +// + +#include +#include + +#include "logtableview.h" + +LogTableView::LogTableView(QWidget *parent) + : QTableView(parent) +{ + setAcceptDrops(true); +} + + +void LogTableView::dragEnterEvent(QDragEnterEvent *e) +{ + e->accept(RDCartDrag::canDecode(e)); +} + + +void LogTableView::dragMoveEvent(QDragMoveEvent *e) +{ + e->accept(RDCartDrag::canDecode(e)); +} + + +void LogTableView::dropEvent(QDropEvent *e) +{ + RDLogLine ll; + int line=-1; + int y_pos=e->pos().y(); + + if(RDCartDrag::decode(e,&ll)) { + line=rowAt(y_pos); + emit cartDropped(line,&ll); + } +} diff --git a/rdairplay/logtableview.h b/rdairplay/logtableview.h new file mode 100644 index 00000000..72019b9f --- /dev/null +++ b/rdairplay/logtableview.h @@ -0,0 +1,47 @@ +// logtableview.h +// +// The Log TableView widget for RDAirPlay +// +// (C) Copyright 2002-2020 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 +// published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public +// License along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// +// + +#ifndef LOGTABLEVIEW_H +#define LOGTABLEVIEW_H + +#include +#include +#include + +#include + +class LogTableView : public QTableView +{ + Q_OBJECT + public: + LogTableView(QWidget *parent); + + signals: + void cartDropped(int line,RDLogLine *ll); + + protected: + void dragEnterEvent(QDragEnterEvent *e); + void dragMoveEvent(QDragMoveEvent *e); + void dropEvent(QDropEvent *e); +}; + + +#endif // LOGTABLEVIEW_H diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index bcf5b3b4..aa0d5c57 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -23,9 +23,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -39,7 +39,6 @@ // // Global Resources // -RDAudioPort *rdaudioport_conf; RDEventPlayer *rdevent_player; RDCartDialog *rdcart_dialog; MainWidget *prog_ptr; @@ -1447,7 +1446,7 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(air_log[id]->lineCount()-1)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(air_log[id]->lineCount()-1); + air_log[id]->update(air_log[id]->lineCount()-1); } else { air_log[id]-> @@ -1455,7 +1454,7 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(line)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(line); + air_log[id]->update(line); } SetActionMode(StartButton::Stop); break; @@ -1484,14 +1483,14 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) if(air_source_id==id) { if(line<0) { air_log[id]->move(air_copy_line,air_log[id]->lineCount()); - air_log_list[id]->refresh(air_log[id]->lineCount()-1); + air_log[id]->update(air_log[id]->lineCount()-1); } else { if(line>air_copy_line) { line--; } air_log[id]->move(air_copy_line,line); - air_log_list[id]->refresh(line); + air_log[id]->update(line); } } else { @@ -1499,12 +1498,12 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) if(line<0) { air_log[id]-> insert(air_log[id]->lineCount(),air_add_cart,RDLogLine::Play); - air_log_list[id]->refresh(air_log[id]->lineCount()-1); + air_log[id]->update(air_log[id]->lineCount()-1); } else { air_log[id]-> insert(line,air_add_cart,air_log[id]->nextTransType(line)); - air_log_list[id]->refresh(line); + air_log[id]->update(line); } } SetActionMode(StartButton::Stop); @@ -1540,7 +1539,7 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(air_log[id]->lineCount()-1)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(air_log[id]->lineCount()-1); + air_log[id]->update(air_log[id]->lineCount()-1); } else { air_log[id]-> @@ -1548,7 +1547,7 @@ void MainWidget::selectClickedData(int id,int line,RDLogLine::Status status) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(line)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(line); + air_log[id]->update(line); } } SetActionMode(StartButton::Stop); @@ -1612,7 +1611,7 @@ void MainWidget::cartDroppedData(int id,int line,RDLogLine *ll) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(air_log[id]->lineCount()-1)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(air_log[id]->lineCount()-1); + air_log[id]->update(air_log[id]->lineCount()-1); } else { air_log[id]-> @@ -1620,7 +1619,7 @@ void MainWidget::cartDroppedData(int id,int line,RDLogLine *ll) rda->airplayConf()->defaultTransType()); air_log[id]->logLine(line)-> setTransType(rda->airplayConf()->defaultTransType()); - air_log_list[id]->refresh(line); + air_log[id]->update(line); } } } diff --git a/rdairplay/rdairplay.pro b/rdairplay/rdairplay.pro index 97993d3d..f12052fd 100644 --- a/rdairplay/rdairplay.pro +++ b/rdairplay/rdairplay.pro @@ -28,6 +28,7 @@ x11 { SOURCES += list_logs.cpp SOURCES += local_macros.cpp SOURCES += loglinebox.cpp + SOURCES += logtableview.cpp SOURCES += mode_display.cpp SOURCES += pie_counter.cpp SOURCES += post_counter.cpp @@ -46,6 +47,7 @@ x11 { HEADERS += list_log.h HEADERS += list_logs.h HEADERS += loglinebox.h + HEADERS += logtableview.h HEADERS += mode_display.h HEADERS += pie_counter.h HEADERS += post_counter.h diff --git a/rdairplay/rdairplay_cs.ts b/rdairplay/rdairplay_cs.ts index fe74b7f2..a9388e12 100644 --- a/rdairplay/rdairplay_cs.ts +++ b/rdairplay/rdairplay_cs.ts @@ -301,59 +301,59 @@ zápis --- end of log --- - --- konec zápisu --- + --- konec zápisu --- PLAY - PŘEHRÁT + PŘEHRÁT STOP - ZASTAVIT + ZASTAVIT SEGUE - PŘECHOD + PŘECHOD MARKER - ZNAČKA + ZNAČKA TRACK - STOPA + STOPA LINK - ODKAZ + ODKAZ [music import] - [zavedení hudby] + [zavedení hudby] [traffic import] - [zavedení přenosu] + [zavedení přenosu] CHAIN TO - ŘETĚZ K + ŘETĚZ K [CART NOT FOUND] - [VOZÍK NENALEZEN] + [VOZÍK NENALEZEN] [NO VALID CUT AVAILABLE] - [ŽÁDNÝ PLATNÝ ZÁBĚR NENÍ DOSTUPNÝ] + [ŽÁDNÝ PLATNÝ ZÁBĚR NENÍ DOSTUPNÝ] [NO AUDIO AVAILABLE] - [ŽÁDNÝ ZVUK NENÍ DOSTUPNÝ] + [ŽÁDNÝ ZVUK NENÍ DOSTUPNÝ] T - T + T Pause @@ -381,7 +381,7 @@ zápis Selected: - Vybráno: + Vybráno: Audition @@ -399,70 +399,6 @@ poslechu Error - - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time - - ListLogs diff --git a/rdairplay/rdairplay_de.ts b/rdairplay/rdairplay_de.ts index 09d039f2..ec84fcf6 100644 --- a/rdairplay/rdairplay_de.ts +++ b/rdairplay/rdairplay_de.ts @@ -301,59 +301,59 @@ auswählen --- end of log --- - --- ende des Logs --- + --- ende des Logs --- PLAY - PLAY + PLAY STOP - STOP + STOP SEGUE - SEGUE + SEGUE MARKER - MARKER + MARKER TRACK - TRACK + TRACK LINK - LINK + LINK [music import] - [musikimport] + [musikimport] [traffic import] - [traffic import] + [traffic import] CHAIN TO - CHAIN TO + CHAIN TO [CART NOT FOUND] - [CART NICHT GEFUNDEN] + [CART NICHT GEFUNDEN] [NO VALID CUT AVAILABLE] - [KEIN GÜLTIGER CUT VERFÜGBAR] + [KEIN GÜLTIGER CUT VERFÜGBAR] [NO AUDIO AVAILABLE] - [KEIN AUDIO VERFÜGBAR] + [KEIN AUDIO VERFÜGBAR] T - T + T Pause @@ -381,7 +381,7 @@ auswählen Selected: - Ausgewählt: + Ausgewählt: Audition @@ -399,70 +399,6 @@ vorhören Error - - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time - - ListLogs diff --git a/rdairplay/rdairplay_es.ts b/rdairplay/rdairplay_es.ts index bc3822af..3fd4de76 100644 --- a/rdairplay/rdairplay_es.ts +++ b/rdairplay/rdairplay_es.ts @@ -291,47 +291,47 @@ Lista --- end of log --- - --- fin de la lista --- + --- fin de la lista --- PLAY - REPRO + REPRO STOP - PARAR + PARAR SEGUE - SEGUE + SEGUE MARKER - MARCADOR + MARCADOR CHAIN TO - ENCADENAR A + ENCADENAR A [CART NOT FOUND] - [CARTUCHO NO ENCONTRADO] + [CARTUCHO NO ENCONTRADO] [NO VALID CUT AVAILABLE] - [NO HAY AUDIOS VÁLIDOS] + [NO HAY AUDIOS VÁLIDOS] T - T + T [NO AUDIO AVAILABLE] - [NO HAY AUDIO DISPONIBLE] + [NO HAY AUDIO DISPONIBLE] TRACK - PISTA + PISTA LEN @@ -339,15 +339,15 @@ Lista LINK - ENLACE + ENLACE [music import] - [importar música] + [importar música] [traffic import] - [importar tráfico] + [importar tráfico] EST TIME @@ -381,7 +381,7 @@ Lista Selected: - Selecc.: + Selecc.: Audition @@ -399,70 +399,6 @@ Final Error - - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time - - ListLogs diff --git a/rdairplay/rdairplay_fr.ts b/rdairplay/rdairplay_fr.ts index 94e4b967..d810b530 100644 --- a/rdairplay/rdairplay_fr.ts +++ b/rdairplay/rdairplay_fr.ts @@ -301,59 +301,59 @@ un Log --- end of log --- - -- fin du log -- + -- fin du log -- PLAY - LANCER + LANCER STOP - STOPPER + STOPPER SEGUE - ENCHAINER + ENCHAINER MARKER - MARQUE + MARQUE TRACK - TRACK + TRACK LINK - LIEN + LIEN [music import] - [import musique] + [import musique] [traffic import] - [import pub] + [import pub] CHAIN TO - LIER A + LIER A [CART NOT FOUND] - [CART INCONNU] + [CART INCONNU] [NO VALID CUT AVAILABLE] - [PAS DE CUT DISPONIBLE] + [PAS DE CUT DISPONIBLE] [NO AUDIO AVAILABLE] - [PAS DE SON DISPONIBLE] + [PAS DE SON DISPONIBLE] T - T + T Pause @@ -381,7 +381,7 @@ un Log Selected: - Sélection: + Sélection: Audition @@ -403,70 +403,6 @@ la Fin Error - - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time - - ListLogs diff --git a/rdairplay/rdairplay_nb.ts b/rdairplay/rdairplay_nb.ts index a367a80a..d713e6c3 100644 --- a/rdairplay/rdairplay_nb.ts +++ b/rdairplay/rdairplay_nb.ts @@ -305,19 +305,19 @@ logg --- end of log --- - --- slutt på loggen --- + --- slutt på loggen --- PLAY - SPEL + SPEL STOP - STOPP + STOPP SEGUE - OVERGANG + OVERGANG OVERLAP @@ -325,43 +325,43 @@ logg MARKER - MARKØR + MARKØR TRACK - SPOR + SPOR LINK - LENKJE + LENKJE [music import] - [musikkimport] + [musikkimport] [traffic import] - [trafikkimport] + [trafikkimport] CHAIN TO - LENK TIL + LENK TIL [CART NOT FOUND] - [FANN IKKJE KORG] + [FANN IKKJE KORG] [NO VALID CUT AVAILABLE] - [GYLDIG KUTT FINST IKKJE + [GYLDIG KUTT FINST IKKJE [NO AUDIO AVAILABLE] - [LYD FINST IKKJE] + [LYD FINST IKKJE] T - S + S Pause @@ -397,76 +397,12 @@ Tail Start Start - - Selected: - - Error - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time + Selected: diff --git a/rdairplay/rdairplay_nn.ts b/rdairplay/rdairplay_nn.ts index a367a80a..d713e6c3 100644 --- a/rdairplay/rdairplay_nn.ts +++ b/rdairplay/rdairplay_nn.ts @@ -305,19 +305,19 @@ logg --- end of log --- - --- slutt på loggen --- + --- slutt på loggen --- PLAY - SPEL + SPEL STOP - STOPP + STOPP SEGUE - OVERGANG + OVERGANG OVERLAP @@ -325,43 +325,43 @@ logg MARKER - MARKØR + MARKØR TRACK - SPOR + SPOR LINK - LENKJE + LENKJE [music import] - [musikkimport] + [musikkimport] [traffic import] - [trafikkimport] + [trafikkimport] CHAIN TO - LENK TIL + LENK TIL [CART NOT FOUND] - [FANN IKKJE KORG] + [FANN IKKJE KORG] [NO VALID CUT AVAILABLE] - [GYLDIG KUTT FINST IKKJE + [GYLDIG KUTT FINST IKKJE [NO AUDIO AVAILABLE] - [LYD FINST IKKJE] + [LYD FINST IKKJE] T - S + S Pause @@ -397,76 +397,12 @@ Tail Start Start - - Selected: - - Error - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time + Selected: diff --git a/rdairplay/rdairplay_pt_BR.ts b/rdairplay/rdairplay_pt_BR.ts index 2c496f2e..963345dd 100644 --- a/rdairplay/rdairplay_pt_BR.ts +++ b/rdairplay/rdairplay_pt_BR.ts @@ -330,63 +330,63 @@ Log Selected: - Selecionado: + Selecionado: --- end of log --- - Fim da Lista + Fim da Lista PLAY - TOQUE + TOQUE STOP - PARE + PARE SEGUE - SOBRE + SOBRE MARKER - MARCADOR + MARCADOR TRACK - PISTA + PISTA LINK - LINK + LINK [music import] - [importar música] + [importar música] [traffic import] - [importar tráfego] + [importar tráfego] CHAIN TO - CORRENTE PARA + CORRENTE PARA [CART NOT FOUND] - [CART NÃO ENCONTRADO] + [CART NÃO ENCONTRADO] [NO VALID CUT AVAILABLE] - [NÃO HÁ CONTEÚDO VÁLIDO] + [NÃO HÁ CONTEÚDO VÁLIDO] [NO AUDIO AVAILABLE] - [NÃO HÁ ÁUDIO VÁLIDO] + [NÃO HÁ ÁUDIO VÁLIDO] T - T + T Pause @@ -400,70 +400,6 @@ Log Error - - Len - - - - Trans - - - - Cart - - - - Title - - - - Artist - - - - Group - - - - Album - - - - Label - - - - Client - - - - Agency - - - - Marker - - - - Line ID - - - - Count - - - - Status - - - - Est. Time - - - - Sch. Time - - ListLogs diff --git a/rdlogedit/edit_log.cpp b/rdlogedit/edit_log.cpp index 5881447e..4769afa3 100644 --- a/rdlogedit/edit_log.cpp +++ b/rdlogedit/edit_log.cpp @@ -710,7 +710,7 @@ void EditLog::insertCartButtonData() edit_log_model,line,this); int ret=edit->exec(); if(ret>=0) { - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } else { @@ -744,7 +744,7 @@ void EditLog::insertMarkerButtonData() edit_marker=new EditMarker(edit_log_model->logLine(line),this); ret=edit_marker->exec(); if(ret>=0) { - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } else { @@ -761,7 +761,7 @@ void EditLog::insertMarkerButtonData() edit_track=new EditTrack(edit_log_model->logLine(line),this); ret=edit_track->exec(); if(ret>=0) { - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } else { @@ -776,7 +776,7 @@ void EditLog::insertMarkerButtonData() edit_chain=new EditChain(edit_log_model->logLine(line),this); ret=edit_chain->exec(); if(ret>=0) { - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } else { @@ -854,7 +854,7 @@ void EditLog::editButtonData() edit_schedcode,edit_service_box->currentText(), edit_log_model,line,this); if(edit_cart->exec()>=0) { - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } delete edit_cart; @@ -995,7 +995,7 @@ void EditLog::cartDroppedData(int line,RDLogLine *ll) edit_log_model->logLine(line)->setTransType(edit_default_trans); edit_log_model->logLine(line)->setFadeupGain(-3000); edit_log_model->logLine(line)->setFadedownGain(-3000); - edit_log_model->refresh(line); + edit_log_model->update(line); SetLogModified(true); } diff --git a/rdlogedit/logmodel.cpp b/rdlogedit/logmodel.cpp index cc02c137..1771744f 100644 --- a/rdlogedit/logmodel.cpp +++ b/rdlogedit/logmodel.cpp @@ -72,7 +72,7 @@ void LogModel::setServiceName(const QString &str) } -QColor LogModel::backgroundColor(int line,RDLogLine *ll) const +QColor LogModel::rowBackgroundColor(int row,RDLogLine *ll) const { QDateTime now=QDateTime(QDate::currentDate(),QTime::currentTime()); @@ -82,7 +82,7 @@ QColor LogModel::backgroundColor(int line,RDLogLine *ll) const case RDCart::AlwaysValid: if(d_group_list->groupIsValid(ll->groupName())|| ll->groupName().isEmpty()) { - return RDLogModel::backgroundColor(line,ll); + return RDLogModel::rowBackgroundColor(row,ll); } return RD_CART_INVALID_SERVICE_COLOR; @@ -102,9 +102,9 @@ QColor LogModel::backgroundColor(int line,RDLogLine *ll) const default: if(d_group_list->groupIsValid(ll->groupName())||ll->groupName().isEmpty()) { - return RDLogModel::backgroundColor(line,ll); + return RDLogModel::rowBackgroundColor(row,ll); } return RD_CART_INVALID_SERVICE_COLOR; } - return RDLogModel::backgroundColor(line,ll); + return RDLogModel::rowBackgroundColor(row,ll); } diff --git a/rdlogedit/logmodel.h b/rdlogedit/logmodel.h index 56f2945a..2e33dc42 100644 --- a/rdlogedit/logmodel.h +++ b/rdlogedit/logmodel.h @@ -38,7 +38,7 @@ class LogModel : public RDLogModel void setServiceName(const QString &str); protected: - QColor backgroundColor(int line,RDLogLine *ll) const; + QColor rowBackgroundColor(int row,RDLogLine *ll) const; private: RDGroupList *d_group_list; diff --git a/rdlogedit/voice_tracker.cpp b/rdlogedit/voice_tracker.cpp index bc339cdf..0115472e 100644 --- a/rdlogedit/voice_tracker.cpp +++ b/rdlogedit/voice_tracker.cpp @@ -1019,7 +1019,7 @@ void VoiceTracker::resetData() return; } if(d_loaded) { - d_log_model->refresh(line); + d_log_model->update(line); d_tracks++; } LoadBlockLength(d_track_line); @@ -1074,7 +1074,7 @@ void VoiceTracker::insertData(int line,RDLogLine *logline,bool warn) d_log_model->logLine(line)->setType(RDLogLine::Track); d_log_model->logLine(line)->setTransType(RDLogLine::Segue); d_log_model->logLine(line)->setMarkerComment(tr("Voice Track")); - d_log_model->refresh(line); + d_log_model->update(line); d_tracks++; d_size_altered=true; diff --git a/utils/rdclilogedit/operations.cpp b/utils/rdclilogedit/operations.cpp index 4929fe02..38557167 100644 --- a/utils/rdclilogedit/operations.cpp +++ b/utils/rdclilogedit/operations.cpp @@ -36,7 +36,7 @@ void MainObject::Addcart(int line,unsigned cartnum) edit_log_model->logLine(line)->setFadeupGain(-3000); edit_log_model->logLine(line)->setFadedownGain(-3000); edit_log_model->logLine(line)->setCartNumber(cartnum); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } @@ -51,7 +51,7 @@ void MainObject::Addchain(int line,const QString &logname) edit_log_model->logLine(line)-> setTransType(rda->airplayConf()->defaultTransType()); edit_log_model->logLine(line)->setMarkerLabel(logname); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } @@ -67,7 +67,7 @@ void MainObject::Addmarker(int line) setTransType(rda->airplayConf()->defaultTransType()); edit_log_model->logLine(line)->setMarkerLabel(tr("Label")); edit_log_model->logLine(line)->setMarkerComment(tr("Marker Comment")); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } @@ -82,7 +82,7 @@ void MainObject::Addtrack(int line) edit_log_model->logLine(line)-> setTransType(rda->airplayConf()->defaultTransType()); edit_log_model->logLine(line)->setMarkerComment(tr("Voice Track")); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } @@ -462,7 +462,7 @@ void MainObject::Setcart(int line,unsigned cartnum) if((logline->type()==RDLogLine::Cart)|| (logline->type()==RDLogLine::Macro)) { logline->setCartNumber(cartnum); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } else { @@ -482,7 +482,7 @@ void MainObject::Setcomment(int line,const QString &str) if((logline->type()==RDLogLine::Marker)|| (logline->type()==RDLogLine::Track)) { logline->setMarkerComment(str); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } else { @@ -516,7 +516,7 @@ void MainObject::Setlabel(int line,const QString &str) if((logline->type()==RDLogLine::Chain)|| (logline->type()==RDLogLine::Marker)) { logline->setMarkerLabel(str); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; } else { @@ -562,7 +562,7 @@ void MainObject::Settime(int line,RDLogLine::TimeType type,const QTime &time) void MainObject::Settrans(int line,RDLogLine::TransType type) { edit_log_model->logLine(line)->setTransType(type); - edit_log_model->refresh(line); + edit_log_model->update(line); edit_modified=true; }