2021-01-07 Fred Gleason <fredg@paravelsystems.com>

* Restored support for scheduling cuts by specified order in
	the 'Edit Cut' dialog in rdlibrary(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-01-07 19:57:31 -05:00
parent 76cba34653
commit 2f9fe673b6
15 changed files with 272 additions and 804 deletions

View File

@ -20763,3 +20763,6 @@
* Added a 'RDCutListModel' class. * Added a 'RDCutListModel' class.
* Refactored the 'Edit Cart' dialog in rdlibrary(1) to use the * Refactored the 'Edit Cart' dialog in rdlibrary(1) to use the
model-based API. model-based API.
2021-01-07 Fred Gleason <fredg@paravelsystems.com>
* Restored support for scheduling cuts by specified order in
the 'Edit Cut' dialog in rdlibrary(1).

View File

@ -908,9 +908,30 @@ bool RDCut::copyTo(RDStation *station,RDUser *user,
"TALK_END_POINT,"+ // 18 "TALK_END_POINT,"+ // 18
"ISRC,"+ // 19 "ISRC,"+ // 19
"ISCI,"+ // 20 "ISCI,"+ // 20
"RECORDING_MBID,"+ // 21 "RECORDING_MBID,"+ // 21
"RELEASE_MBID "+ // 22 "RELEASE_MBID,"+ // 22
"EVERGREEN,"+ // 23
"SHA1_HASH,"+ // 24
"ORIGIN_DATETIME,"+ // 25
"START_DATETIME,"+ // 26
"END_DATETIME,"+ // 27
"START_DAYPART,"+ // 28
"END_DAYPART,"+ // 29
"ORIGIN_NAME,"+ // 30
"ORIGIN_LOGIN_NAME,"+ // 31
"SOURCE_HOSTNAME,"+ // 32
"WEIGHT,"+ // 33
"PLAY_ORDER,"+ // 34
"UPLOAD_DATETIME,"+ // 35
"VALIDITY,"+ // 36
"SUN,"+ // 37
"MON,"+ // 38
"TUE,"+ // 39
"WED,"+ // 40
"THU,"+ // 41
"FRI,"+ // 42
"SAT "+ // 43
"from CUTS where "+ "from CUTS where "+
"CUT_NAME=\""+RDEscapeString(cut_name)+"\""; "CUT_NAME=\""+RDEscapeString(cut_name)+"\"";
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
@ -920,7 +941,6 @@ bool RDCut::copyTo(RDStation *station,RDUser *user,
"DESCRIPTION=\""+RDEscapeString(q->value(0).toString())+"\","+ "DESCRIPTION=\""+RDEscapeString(q->value(0).toString())+"\","+
"OUTCUE=\""+RDEscapeString(q->value(1).toString())+"\","+ "OUTCUE=\""+RDEscapeString(q->value(1).toString())+"\","+
QString().sprintf("LENGTH=%u,",q->value(2).toUInt())+ QString().sprintf("LENGTH=%u,",q->value(2).toUInt())+
"ORIGIN_DATETIME=now(),"+
"ORIGIN_NAME=\""+RDEscapeString(station->name())+"\","+ "ORIGIN_NAME=\""+RDEscapeString(station->name())+"\","+
QString().sprintf("CODING_FORMAT=%u,",q->value(3).toUInt())+ QString().sprintf("CODING_FORMAT=%u,",q->value(3).toUInt())+
QString().sprintf("SAMPLE_RATE=%u,",q->value(4).toUInt())+ QString().sprintf("SAMPLE_RATE=%u,",q->value(4).toUInt())+
@ -941,7 +961,32 @@ bool RDCut::copyTo(RDStation *station,RDUser *user,
"ISRC=\""+RDEscapeString(q->value(19).toString())+"\","+ "ISRC=\""+RDEscapeString(q->value(19).toString())+"\","+
"ISCI=\""+RDEscapeString(q->value(20).toString())+"\","+ "ISCI=\""+RDEscapeString(q->value(20).toString())+"\","+
"RECORDING_MBID=\""+RDEscapeString(q->value(21).toString())+"\","+ "RECORDING_MBID=\""+RDEscapeString(q->value(21).toString())+"\","+
"RELEASE_MBID=\""+RDEscapeString(q->value(22).toString())+"\" "+ "RELEASE_MBID=\""+RDEscapeString(q->value(22).toString())+"\","+
"EVERGREEN=\""+q->value(23).toString()+"\","+
"SHA1_HASH=\""+RDEscapeString(q->value(24).toString())+"\","+
"ORIGIN_DATETIME="+
RDCheckDateTime(q->value(25).toDateTime(),"yyyy-MM-dd hh:mm:ss")+","+
"START_DATETIME="+
RDCheckDateTime(q->value(26).toDateTime(),"yyyy-MM-dd hh:mm:ss")+","+
"END_DATETIME="+
RDCheckDateTime(q->value(27).toDateTime(),"yyyy-MM-dd hh:mm:ss")+","+
"START_DAYPART="+RDCheckDateTime(q->value(28).toTime(),"hh:mm:ss")+","+
"END_DAYPART="+RDCheckDateTime(q->value(29).toTime(),"hh:mm:ss")+","+
"ORIGIN_NAME=\""+RDEscapeString(q->value(30).toString())+"\","+
"ORIGIN_LOGIN_NAME=\""+RDEscapeString(q->value(31).toString())+"\","+
"SOURCE_HOSTNAME=\""+RDEscapeString(q->value(32).toString())+"\","+
QString().sprintf("WEIGHT=%u,",q->value(33).toUInt())+
QString().sprintf("PLAY_ORDER=%d,",q->value(34).toUInt())+
"UPLOAD_DATETIME="+
RDCheckDateTime(q->value(35).toDateTime(),"yyyy-MM-dd hh:mm:ss")+","+
QString().sprintf("VALIDITY=%u,",q->value(36).toUInt())+
"SUN=\""+q->value(37).toString()+"\","+
"MON=\""+q->value(38).toString()+"\","+
"TUE=\""+q->value(39).toString()+"\","+
"WED=\""+q->value(40).toString()+"\","+
"THU=\""+q->value(41).toString()+"\","+
"FRI=\""+q->value(42).toString()+"\","+
"SAT=\""+q->value(43).toString()+"\" "+
"where CUT_NAME=\""+RDEscapeString(cutname)+"\""; "where CUT_NAME=\""+RDEscapeString(cutname)+"\"";
} }
delete q; delete q;

View File

@ -134,7 +134,7 @@ QVariant RDCutListModel::data(const QModelIndex &index,int role) const
if(row<d_texts.size()) { if(row<d_texts.size()) {
switch((Qt::ItemDataRole)role) { switch((Qt::ItemDataRole)role) {
case Qt::DisplayRole: case Qt::DisplayRole:
return d_texts.at(row).at(col); return d_texts.at(d_row_index.at(row)).at(col);
case Qt::TextAlignmentRole: case Qt::TextAlignmentRole:
return d_alignments.at(col); return d_alignments.at(col);
@ -147,7 +147,7 @@ QVariant RDCutListModel::data(const QModelIndex &index,int role) const
break; break;
case Qt::BackgroundRole: case Qt::BackgroundRole:
return d_colors.at(row); return d_colors.at(d_row_index.at(row));
default: default:
break; break;
@ -160,7 +160,7 @@ QVariant RDCutListModel::data(const QModelIndex &index,int role) const
QString RDCutListModel::cutName(int row) const QString RDCutListModel::cutName(int row) const
{ {
return d_texts.at(row).at(12).toString(); return d_texts.at(d_row_index.at(row)).at(12).toString();
} }
@ -168,7 +168,7 @@ int RDCutListModel::addCut(const QString &name)
{ {
QList<QVariant> list; QList<QVariant> list;
beginInsertRows(QModelIndex(),d_texts.size(),d_texts.size()); beginResetModel();
for(int i=0;i<columnCount();i++) { for(int i=0;i<columnCount();i++) {
list.push_back(QString()); list.push_back(QString());
@ -176,21 +176,33 @@ int RDCutListModel::addCut(const QString &name)
list[12]=name; list[12]=name;
d_texts.push_back(list); d_texts.push_back(list);
d_colors.push_back(d_palette.color(QPalette::Background)); d_colors.push_back(d_palette.color(QPalette::Background));
d_row_index.push_back(d_row_index.size());
refresh(d_texts.size()-1); refresh(d_texts.size()-1);
endInsertRows(); sortRows(d_use_weighting);
endResetModel();
return d_texts.size()-1; for(int i=0;i<d_row_index.size();i++) {
if(d_row_index.at(i)==(d_row_index.size()-1)) {
return i;
}
}
return -1;
} }
void RDCutListModel::removeCut(int row) void RDCutListModel::removeCut(int row)
{ {
beginRemoveRows(QModelIndex(),row,row); beginResetModel();
d_texts.removeAt(d_row_index.at(row));
d_texts.removeAt(row); d_colors.removeAt(d_row_index.at(row));
d_colors.removeAt(row); d_row_index.removeAt(row);
for(int i=0;i<d_row_index.size();i++) {
endRemoveRows(); if(d_row_index.at(i)>row) {
d_row_index[i]--;
}
}
sortRows(d_use_weighting);
endResetModel();
} }
@ -209,12 +221,14 @@ void RDCutListModel::refresh(int row)
{ {
if(row<d_texts.size()) { if(row<d_texts.size()) {
QString sql=sqlFields()+ QString sql=sqlFields()+
"where CUT_NAME=\""+RDEscapeString(d_texts.at(row).at(12).toString())+ "where CUT_NAME=\""+RDEscapeString(d_texts.at(d_row_index.at(row)).at(12).toString())+
"\""; "\"";
RDSqlQuery *q=new RDSqlQuery(sql); RDSqlQuery *q=new RDSqlQuery(sql);
if(q->first()) { if(q->first()) {
beginResetModel();
updateRow(row,q); updateRow(row,q);
emit dataChanged(createIndex(row,0),createIndex(row,columnCount())); sortRows(d_use_weighting);
endResetModel();
} }
} }
} }
@ -223,7 +237,7 @@ void RDCutListModel::refresh(int row)
void RDCutListModel::refresh(const QString &cutname) void RDCutListModel::refresh(const QString &cutname)
{ {
for(int i=0;i<d_texts.size();i++) { for(int i=0;i<d_texts.size();i++) {
if(d_texts.at(i).at(12)==cutname) { if(d_texts.at(d_row_index.at(i)).at(12)==cutname) {
refresh(i); refresh(i);
return; return;
} }
@ -237,12 +251,45 @@ unsigned RDCutListModel::cartNumber() const
} }
int RDCutListModel::row(const QString &cutname) const
{
for(int i=0;i<d_row_index.size();i++) {
if(d_texts.at(d_row_index.at(i)).at(12).toString()==cutname) {
return i;
}
}
return -1;
}
bool RDCutListModel::playOrderDuplicates(QList<int> *values) const
{
if(d_use_weighting) {
return false;
}
values->clear();
for(int i=0;i<d_row_index.size();i++) {
for(int j=1;j<d_row_index.size();j++) {
if(i!=j) {
if(d_texts.at(i).at(0)==d_texts.at(j).at(0)) {
if(!values->contains(d_texts.at(j).at(0).toInt())) {
values->push_back(d_texts.at(j).at(0).toInt());
}
}
}
}
}
return values->size()>0;
}
void RDCutListModel::setCartNumber(unsigned cartnum) void RDCutListModel::setCartNumber(unsigned cartnum)
{ {
if(cartnum!=d_cart_number) { if(cartnum!=d_cart_number) {
beginResetModel(); beginResetModel();
d_texts.clear(); d_texts.clear();
d_colors.clear(); d_colors.clear();
d_row_index.clear();
QList<QVariant> text; QList<QVariant> text;
for(int i=0;i<columnCount();i++) { for(int i=0;i<columnCount();i++) {
text.push_back(QVariant()); text.push_back(QVariant());
@ -255,9 +302,11 @@ void RDCutListModel::setCartNumber(unsigned cartnum)
sql+="order by PLAY_ORDER"; sql+="order by PLAY_ORDER";
} }
RDSqlQuery *q=new RDSqlQuery(sql); RDSqlQuery *q=new RDSqlQuery(sql);
int row=0;
while(q->next()) { while(q->next()) {
d_texts.push_back(text); d_texts.push_back(text);
d_colors.push_back(d_palette.color(QPalette::Background)); d_colors.push_back(d_palette.color(QPalette::Background));
d_row_index.push_back(row++);
updateRow(d_texts.size()-1,q); updateRow(d_texts.size()-1,q);
} }
d_cart_number=cartnum; d_cart_number=cartnum;
@ -279,295 +328,99 @@ void RDCutListModel::updateRow(int row,RDSqlQuery *q)
// Text Values // Text Values
// //
if(d_use_weighting) { if(d_use_weighting) {
d_texts[row][0]=QString().sprintf("%d",q->value(1).toInt()); d_texts[d_row_index.at(row)][0]=QString().sprintf("%d",q->value(1).toInt());
} }
else { else {
d_texts[row][0]=QString().sprintf("%d",q->value(0).toInt()); d_texts[d_row_index.at(row)][0]=QString().sprintf("%d",q->value(0).toInt());
} }
d_texts[row][1]=q->value(2); d_texts[d_row_index.at(row)][1]=q->value(2);
d_texts[row][2]=RDGetTimeLength(q->value(3).toUInt()); d_texts[d_row_index.at(row)][2]=RDGetTimeLength(q->value(3).toUInt());
if(q->value(5).toUInt()>0) { if(q->value(5).toUInt()>0) {
d_texts[row][3]=q->value(4).toDateTime().toString("M/d/yy"); d_texts[d_row_index.at(row)][3]=q->value(4).toDateTime().toString("M/d/yy");
} }
else { else {
d_texts[row][3]=tr("Never"); d_texts[d_row_index.at(row)][3]=tr("Never");
} }
d_texts[row][4]=q->value(5).toString(); d_texts[d_row_index.at(row)][4]=q->value(5).toString();
QString user=q->value(8).toString()+"@"; QString user=q->value(8).toString()+"@";
if(q->value(8).toString().isEmpty()) { if(q->value(8).toString().isEmpty()) {
user=""; user="";
} }
if(q->value(9).toString().isEmpty()) { if(q->value(9).toString().isEmpty()) {
d_texts[row][5]="["+tr("unknown")+"]"; d_texts[d_row_index.at(row)][5]="["+tr("unknown")+"]";
} }
else { else {
d_texts[row][5]=user+q->value(9).toString(); d_texts[d_row_index.at(row)][5]=user+q->value(9).toString();
} }
if(!q->value(6).toDateTime().isNull()) { if(!q->value(6).toDateTime().isNull()) {
d_texts[row][6]=q->value(7).toString()+" - "+ d_texts[d_row_index.at(row)][6]=q->value(7).toString()+" - "+
q->value(6).toDateTime().toString("M/d/yy hh:mm:ss"); q->value(6).toDateTime().toString("M/d/yy hh:mm:ss");
} }
d_texts[row][7]=q->value(10).toString(); d_texts[d_row_index.at(row)][7]=q->value(10).toString();
if(!q->value(14).toDateTime().isNull()) { if(!q->value(14).toDateTime().isNull()) {
d_texts[row][8]=q->value(14).toDateTime().toString("M/d/yyyy hh:mm:ss"); d_texts[d_row_index.at(row)][8]=
q->value(14).toDateTime().toString("M/d/yyyy hh:mm:ss");
} }
else { else {
d_texts[row][8]=tr("None"); d_texts[d_row_index.at(row)][8]=tr("None");
} }
if(!q->value(15).toDateTime().isNull()) { if(!q->value(15).toDateTime().isNull()) {
d_texts[row][9]=q->value(15).toDateTime().toString("M/d/yyyy hh:mm:ss"); d_texts[d_row_index.at(row)][9]=q->value(15).toDateTime().toString("M/d/yyyy hh:mm:ss");
} }
else { else {
d_texts[row][9]=tr("None"); d_texts[d_row_index.at(row)][9]=tr("None");
} }
if(!q->value(17).isNull()) { if(!q->value(17).isNull()) {
d_texts[row][10]=q->value(16).toTime().toString("hh:mm:ss"); d_texts[d_row_index.at(row)][10]=q->value(16).toTime().toString("hh:mm:ss");
d_texts[row][11]=q->value(17).toTime().toString("hh:mm:ss"); d_texts[d_row_index.at(row)][11]=q->value(17).toTime().toString("hh:mm:ss");
} }
else { else {
d_texts[row][10]=tr("None"); d_texts[d_row_index.at(row)][10]=tr("None");
d_texts[row][11]=tr("None"); d_texts[d_row_index.at(row)][11]=tr("None");
} }
d_texts[row][12]=q->value(11).toString(); d_texts[d_row_index.at(row)][12]=q->value(11).toString();
if(q->value(25).toString().isEmpty()) { if(q->value(25).toString().isEmpty()) {
d_texts[row][13]="["+tr("not available")+"]"; d_texts[d_row_index.at(row)][13]="["+tr("not available")+"]";
} }
else { else {
d_texts[row][13]=q->value(25).toString(); d_texts[d_row_index.at(row)][13]=q->value(25).toString();
} }
// //
// Background Color // Background Color
// //
if(d_use_weighting&&(q->value(1).toInt()==0)){// zero weight if(d_use_weighting&&(q->value(1).toInt()==0)){// zero weight
d_colors[row]=RD_CART_ERROR_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_ERROR_COLOR);
//if(pass==0) {
// err=true;
//}
} }
else { else {
/*
RDCart::Validity validity=ValidateCut(q,12,RDCart::NeverValid,current_datetime);
printf("validity[%d]: %d\n",row,validity);
switch(validity) {
*/
switch(ValidateCut(q,12,RDCart::NeverValid,current_datetime)) { switch(ValidateCut(q,12,RDCart::NeverValid,current_datetime)) {
case RDCart::NeverValid: case RDCart::NeverValid:
d_colors[row]=RD_CART_ERROR_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_ERROR_COLOR);
//if(pass==0) {
//err=true;
//}
break; break;
case RDCart::ConditionallyValid: case RDCart::ConditionallyValid:
if((!q->value(13).isNull())&& if((!q->value(13).isNull())&&
(q->value(13).toDateTime()<current_datetime)) { (q->value(13).toDateTime()<current_datetime)) {
d_colors[row]=RD_CART_ERROR_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_ERROR_COLOR);
} }
else { else {
d_colors[row]=RD_CART_CONDITIONAL_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_CONDITIONAL_COLOR);
} }
//if(pass==0) {
//err=true;
//}
break; break;
case RDCart::FutureValid: case RDCart::FutureValid:
d_colors[row]=RD_CART_FUTURE_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_FUTURE_COLOR);
//if(pass==0) {
//err=true;
//}
break; break;
case RDCart::EvergreenValid: case RDCart::EvergreenValid:
d_colors[row]=RD_CART_EVERGREEN_COLOR; d_colors[d_row_index.at(row)]=QColor(RD_CART_EVERGREEN_COLOR);
//if(pass==0) {
//err=true;
//}
break; break;
case RDCart::AlwaysValid: case RDCart::AlwaysValid:
d_colors[row]=d_palette.color(QPalette::Background); d_colors[d_row_index.at(row)]=d_palette.color(QPalette::Background);
break; break;
} }
} }
/*
if(q->value(5).toUInt()>0) {
l->setText(3,q->value(4).toDateTime().toString("M/d/yy"));
}
else {
l->setText(3,tr("Never"));
}
l->setText(4,q->value(5).toString());
QString user=q->value(8).toString()+"@";
if(q->value(8).toString().isEmpty()) {
user="";
}
if(q->value(9).toString().isEmpty()) {
l->setText(5,"["+tr("unknown")+"]");
}
else {
l->setText(5,user+q->value(9).toString());
}
if(!q->value(6).toDateTime().isNull()) {
l->setText(6,q->value(7).toString()+" - "+
q->value(6).toDateTime().toString("M/d/yy hh:mm:ss"));
}
l->setText(7,q->value(10).toString());
if(!q->value(14).toDateTime().isNull()) {
l->setText(8,q->value(14).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
l->setText(8,tr("None"));
}
if(!q->value(15).toDateTime().isNull()) {
l->setText(9,q->value(15).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
l->setText(9,tr("None"));
}
if(!q->value(17).isNull()) {
l->setText(10,q->value(16).toTime().toString("hh:mm:ss"));
l->setText(11,q->value(17).toTime().toString("hh:mm:ss"));
}
else {
l->setText(10,tr("None"));
l->setText(11,tr("None"));
}
l->setText(12,q->value(11).toString());
if(q->value(25).toString().isEmpty()) {
l->setText(13,"["+tr("not available")+"]");
}
else {
l->setText(13,q->value(25).toString());
}
total_length+=q->value(3).toUInt();
pass++;
}
if(q->size()>0) {
rdcart_average_length=total_length/q->size();
}
else {
rdcart_average_length=0;
}
delete q;
if(((l=(RDListViewItem *)rdcart_cut_list->firstChild())!=NULL)&&
((!err)||rdcart_select_cut)) {
rdcart_cut_list->setSelected(l,true);
rdcart_select_cut=false;
}
*/
/*
QList<QVariant> texts;
QList<QVariant> icons;
// Log Name
texts.push_back(q->value(0));
if((q->value(7).toInt()==q->value(8).toInt())&&
((q->value(9).toInt()==0)||(q->value(10).toString()=="Y"))&&
((q->value(11).toInt()==0)||(q->value(12).toString()=="Y"))) {
icons.push_back(d_log_icons->listIcon(RDLogIcons::GreenCheck));
}
else {
icons.push_back(d_log_icons->listIcon(RDLogIcons::RedX));
}
// Description
texts.push_back(q->value(1));
icons.push_back(QVariant());
// Service
texts.push_back(q->value(2));
icons.push_back(QVariant());
// Music State
texts.push_back(QString());
if(q->value(9).toInt()==0) {
icons.push_back(d_log_icons->listIcon(RDLogIcons::WhiteBall));
}
else {
if(q->value(10).toString()=="Y") {
icons.push_back(d_log_icons->listIcon(RDLogIcons::GreenBall));
}
else {
icons.push_back(d_log_icons->listIcon(RDLogIcons::RedBall));
}
}
// Traffic State
texts.push_back(QString());
if(q->value(11).toInt()==0) {
icons.push_back(d_log_icons->listIcon(RDLogIcons::WhiteBall));
}
else {
if(q->value(12).toString()=="Y") {
icons.push_back(d_log_icons->listIcon(RDLogIcons::GreenBall));
}
else {
icons.push_back(d_log_icons->listIcon(RDLogIcons::RedBall));
}
}
// Tracks
texts.push_back(QString().sprintf("%d / %d",
q->value(7).toInt(),
q->value(8).toInt()));
if(q->value(8).toInt()==0) {
icons.push_back(d_log_icons->listIcon(RDLogIcons::WhiteBall));
}
else {
if(q->value(8).toInt()==q->value(7).toInt()) {
icons.push_back(d_log_icons->listIcon(RDLogIcons::GreenBall));
}
else {
icons.push_back(d_log_icons->listIcon(RDLogIcons::RedBall));
}
}
// Start Date
if(q->value(3).toDate().isNull()) {
texts.push_back(tr("Always"));
}
else {
texts.push_back(q->value(3).toDate().toString("MM/dd/yyyy"));
}
icons.push_back(QVariant());
// End Date
if(q->value(4).toDate().isNull()) {
texts.push_back(tr("Always"));
}
else {
texts.push_back(q->value(4).toDate().toString("MM/dd/yyyy"));
}
icons.push_back(QVariant());
// Auto Refresh
texts.push_back(q->value(15));
icons.push_back(QVariant());
// Origin
texts.push_back(q->value(5).toString()+QString(" - ")+
q->value(6).toDateTime().toString("MM/dd/yyyy - hh:mm:ss"));
icons.push_back(QVariant());
// Last Linked
texts.push_back(q->value(13).toDateTime().
toString("MM/dd/yyyy - hh:mm:ss"));
icons.push_back(QVariant());
// Last Modified
texts.push_back(q->value(14).toDateTime().
toString("MM/dd/yyyy - hh:mm:ss"));
icons.push_back(QVariant());
d_texts[row]=texts;
d_icons[row]=icons;
*/
} }
@ -608,6 +461,37 @@ QString RDCutListModel::sqlFields() const
} }
void RDCutListModel::sortRows(int use_weighting)
{
if(use_weighting==1) { // Sort by cutname
bool modified;
do {
modified=false;
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);
modified=true;
}
}
} while(modified);
}
else { // Sort by play order
bool modified;
do {
modified=false;
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);
modified=true;
}
}
} while(modified);
}
}
RDCart::Validity RDCutListModel::ValidateCut(RDSqlQuery *q,unsigned offset, RDCart::Validity RDCutListModel::ValidateCut(RDSqlQuery *q,unsigned offset,
RDCart::Validity prev_validity, RDCart::Validity prev_validity,
const QDateTime &datetime) const QDateTime &datetime)

View File

@ -51,6 +51,8 @@ class RDCutListModel : public QAbstractTableModel
void refresh(int row); void refresh(int row);
void refresh(const QString &cutname); void refresh(const QString &cutname);
unsigned cartNumber() const; unsigned cartNumber() const;
int row(const QString &cutname) const;
bool playOrderDuplicates(QList<int> *values) const;
public slots: public slots:
void setCartNumber(unsigned cartnum); void setCartNumber(unsigned cartnum);
@ -59,6 +61,7 @@ class RDCutListModel : public QAbstractTableModel
protected: protected:
void updateRow(int row,RDSqlQuery *q); void updateRow(int row,RDSqlQuery *q);
QString sqlFields() const; QString sqlFields() const;
void sortRows(int use_weighting);
private: private:
RDCart::Validity ValidateCut(RDSqlQuery *q,unsigned offset, RDCart::Validity ValidateCut(RDSqlQuery *q,unsigned offset,
@ -70,6 +73,7 @@ class RDCutListModel : public QAbstractTableModel
QList<QVariant> d_alignments; QList<QVariant> d_alignments;
QList<QList<QVariant> > d_texts; QList<QList<QVariant> > d_texts;
QList<QVariant> d_colors; QList<QVariant> d_colors;
QList<int> d_row_index;
unsigned d_cart_number; unsigned d_cart_number;
bool d_use_weighting; bool d_use_weighting;
}; };

View File

@ -2,7 +2,7 @@
// //
// The audio cart editor for RDLibrary. // The audio cart editor for RDLibrary.
// //
// (C) Copyright 2002-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -31,7 +31,6 @@
#include "cdripper.h" #include "cdripper.h"
#include "globals.h" #include "globals.h"
#include "record_cut.h" #include "record_cut.h"
#include "validate_cut.h"
bool import_active=false; bool import_active=false;
@ -104,7 +103,7 @@ AudioCart::AudioCart(AudioControls *controls,RDCart *cart,QString *path,
rdcart_cut_view=new QTableView(this); rdcart_cut_view=new QTableView(this);
rdcart_cut_view->setGeometry(100,0,430,sizeHint().height()); rdcart_cut_view->setGeometry(100,0,430,sizeHint().height());
rdcart_cut_view->setSelectionBehavior(QAbstractItemView::SelectRows); rdcart_cut_view->setSelectionBehavior(QAbstractItemView::SelectRows);
rdcart_cut_view->setSelectionMode(QAbstractItemView::SingleSelection); rdcart_cut_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
rdcart_cut_view->setShowGrid(false); rdcart_cut_view->setShowGrid(false);
rdcart_cut_view->setSortingEnabled(false); rdcart_cut_view->setSortingEnabled(false);
rdcart_cut_view->setWordWrap(false); rdcart_cut_view->setWordWrap(false);
@ -112,72 +111,6 @@ AudioCart::AudioCart(AudioControls *controls,RDCart *cart,QString *path,
connect(rdcart_cut_view,SIGNAL(doubleClicked(const QModelIndex &)), connect(rdcart_cut_view,SIGNAL(doubleClicked(const QModelIndex &)),
this,SLOT(doubleClickedData(const QModelIndex &))); this,SLOT(doubleClickedData(const QModelIndex &)));
/*
connect(list_filter_widget,SIGNAL(filterChanged(const QString &)),
rdcart_cut_model,SLOT(setFilterSql(const QString &)));
connect(rdcart_cut_model,SIGNAL(modelReset()),this,SLOT(modelResetData()));
*/
/*
rdcart_cut_list=new RDListView(this);
rdcart_cut_list->setGeometry(100,0,430,sizeHint().height());
rdcart_cut_list->setAllColumnsShowFocus(true);
rdcart_cut_list->setSelectionMode(Q3ListView::Extended);
rdcart_cut_list->setItemMargin(5);
rdcart_cut_list->setSorting(12);
connect(rdcart_cut_list,
SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
this,
SLOT(doubleClickedData(Q3ListViewItem *,const QPoint &,int)));
rdcart_cut_list->addColumn(tr("Wt"));
rdcart_cut_list->setColumnAlignment(0,Qt::AlignHCenter);
rdcart_cut_list->setColumnSortType(0,RDListView::NumericSort);
rdcart_cut_list->addColumn(tr("Description"));
rdcart_cut_list->setColumnAlignment(1,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("Length"));
rdcart_cut_list->setColumnAlignment(2,Qt::AlignRight);
rdcart_cut_list->setColumnSortType(2,RDListView::TimeSort);
rdcart_cut_list->addColumn(tr("Last Played"));
rdcart_cut_list->setColumnAlignment(3,Qt::AlignHCenter);
rdcart_cut_list->addColumn(tr("# of Plays"));
rdcart_cut_list->setColumnAlignment(4,Qt::AlignHCenter);
rdcart_cut_list->addColumn(tr("Source"));
rdcart_cut_list->setColumnAlignment(5,Qt::AlignHCenter);
rdcart_cut_list->addColumn(tr("Ingest"));
rdcart_cut_list->setColumnAlignment(6,Qt::AlignHCenter);
rdcart_cut_list->addColumn(tr("Outcue"));
rdcart_cut_list->setColumnAlignment(7,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("Start Date"));
rdcart_cut_list->setColumnAlignment(8,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("End Date"));
rdcart_cut_list->setColumnAlignment(9,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("Daypart Start"));
rdcart_cut_list->setColumnAlignment(10,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("Daypart End"));
rdcart_cut_list->setColumnAlignment(11,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("Name"));
rdcart_cut_list->setColumnAlignment(12,Qt::AlignLeft);
rdcart_cut_list->addColumn(tr("SHA1"));
rdcart_cut_list->setColumnAlignment(13,Qt::AlignLeft);
RefreshList();
*/
// //
// Record Cut Button // Record Cut Button
// //
@ -273,6 +206,12 @@ QSizePolicy AudioCart::sizePolicy() const
} }
RDCutListModel *AudioCart::cutListModel()
{
return rdcart_cut_model;
}
void AudioCart::changeCutScheduling(int sched) void AudioCart::changeCutScheduling(int sched)
{ {
RDCutListModel *old_model=rdcart_cut_model; RDCutListModel *old_model=rdcart_cut_model;
@ -293,29 +232,6 @@ void AudioCart::changeCutScheduling(int sched)
} }
rdcart_use_weighting=sched!=0; rdcart_use_weighting=sched!=0;
/*
QString sql;
RDSqlQuery *q;
RDListViewItem *item=(RDListViewItem *)rdcart_cut_list->firstChild();
while(item!=NULL) {
sql=QString("select PLAY_ORDER,WEIGHT from CUTS where ")+
"CUT_NAME=\""+item->text(12)+"\"";
q=new RDSqlQuery(sql);
if(q->first()) {
item->setText(0,QString().sprintf("%d",q->value(sched).toInt()));
}
item=(RDListViewItem *)item->nextSibling();
}
if(sched) {
rdcart_cut_list->setColumnText(0,tr("Wt"));
rdcart_cut_list->setSortColumn(12);
}
else {
rdcart_cut_list->setColumnText(0,tr("Ord"));
rdcart_cut_list->setSortColumn(0);
}
*/
} }
@ -553,7 +469,8 @@ void AudioCart::recordCutData()
RecordCut *cut=new RecordCut(rdcart_cart,cutname,rdcart_use_weighting,this); RecordCut *cut=new RecordCut(rdcart_cart,cutname,rdcart_use_weighting,this);
cut->exec(); cut->exec();
delete cut; delete cut;
rdcart_cut_model->refresh(row); rdcart_cut_model->refresh(cutname);
rdcart_cut_view->selectRow(rdcart_cut_model->row(cutname));
if(cut_clipboard==NULL) { if(cut_clipboard==NULL) {
paste_cut_button->setDisabled(true); paste_cut_button->setDisabled(true);
} }
@ -694,12 +611,6 @@ void AudioCart::importCutData()
} }
void AudioCart::doubleClickedData(Q3ListViewItem *,const QPoint &,int)
{
recordCutData();
}
void AudioCart::copyProgressData(const QVariant &step) void AudioCart::copyProgressData(const QVariant &step)
{ {
rdcart_progress_dialog->setValue(step.toInt()); rdcart_progress_dialog->setValue(step.toInt());
@ -714,267 +625,3 @@ int AudioCart::SingleSelectedLine() const
} }
return rdcart_cut_view->selectionModel()->selectedRows().first().row(); return rdcart_cut_view->selectionModel()->selectedRows().first().row();
} }
RDListViewItem *AudioCart::SelectedCuts(std::vector<QString> *cutnames)
{
/*
RDListViewItem *ret=NULL;
RDListViewItem *item=(RDListViewItem *)rdcart_cut_list->firstChild();
while(item!=NULL) {
if(item->isSelected()) {
cutnames->push_back(item->text(12));
ret=item;
}
item=(RDListViewItem *)item->nextSibling();
}
if(cutnames->size()==1) {
return ret;
}
return NULL;
*/
return NULL;
}
void AudioCart::RefreshList()
{
/*
RDSqlQuery *q;
QString sql;
RDListViewItem *l;
unsigned total_length=0;
QDateTime current_datetime=
QDateTime(QDate::currentDate(),QTime::currentTime());
int pass=0;
bool err=false;
rdcart_cut_list->clear();
sql=ValidateCutFields()+
QString().sprintf(" where CART_NUMBER=%u",rdcart_cart->number());
q=new RDSqlQuery(sql);
while(q->next()) {
l=new RDListViewItem(rdcart_cut_list);
// l->setText(0,q->value(0).toString());
l->setText(1,q->value(2).toString());
l->setText(2,RDGetTimeLength(q->value(3).toUInt()));
if(rdcart_use_weighting&&(q->value(1).toInt()==0)){// zero weight
l->setBackgroundColor(RD_CART_ERROR_COLOR);
if(pass==0) {
err=true;
}
}
else {
switch(ValidateCut(q,12,RDCart::NeverValid,current_datetime)) {
case RDCart::NeverValid:
l->setBackgroundColor(RD_CART_ERROR_COLOR);
if(pass==0) {
err=true;
}
break;
case RDCart::ConditionallyValid:
if((!q->value(13).isNull())&&
(q->value(13).toDateTime()<current_datetime)) {
l->setBackgroundColor(RD_CART_ERROR_COLOR);
}
else {
l->setBackgroundColor(RD_CART_CONDITIONAL_COLOR);
}
if(pass==0) {
err=true;
}
break;
case RDCart::FutureValid:
l->setBackgroundColor(RD_CART_FUTURE_COLOR);
if(pass==0) {
err=true;
}
break;
case RDCart::EvergreenValid:
l->setBackgroundColor(RD_CART_EVERGREEN_COLOR);
if(pass==0) {
err=true;
}
break;
case RDCart::AlwaysValid:
break;
}
}
if(q->value(5).toUInt()>0) {
l->setText(3,q->value(4).toDateTime().toString("M/d/yy"));
}
else {
l->setText(3,tr("Never"));
}
l->setText(4,q->value(5).toString());
QString user=q->value(8).toString()+"@";
if(q->value(8).toString().isEmpty()) {
user="";
}
if(q->value(9).toString().isEmpty()) {
l->setText(5,"["+tr("unknown")+"]");
}
else {
l->setText(5,user+q->value(9).toString());
}
if(!q->value(6).toDateTime().isNull()) {
l->setText(6,q->value(7).toString()+" - "+
q->value(6).toDateTime().toString("M/d/yy hh:mm:ss"));
}
l->setText(7,q->value(10).toString());
if(!q->value(14).toDateTime().isNull()) {
l->setText(8,q->value(14).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
l->setText(8,tr("None"));
}
if(!q->value(15).toDateTime().isNull()) {
l->setText(9,q->value(15).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
l->setText(9,tr("None"));
}
if(!q->value(17).isNull()) {
l->setText(10,q->value(16).toTime().toString("hh:mm:ss"));
l->setText(11,q->value(17).toTime().toString("hh:mm:ss"));
}
else {
l->setText(10,tr("None"));
l->setText(11,tr("None"));
}
l->setText(12,q->value(11).toString());
if(q->value(25).toString().isEmpty()) {
l->setText(13,"["+tr("not available")+"]");
}
else {
l->setText(13,q->value(25).toString());
}
total_length+=q->value(3).toUInt();
pass++;
}
if(q->size()>0) {
rdcart_average_length=total_length/q->size();
}
else {
rdcart_average_length=0;
}
delete q;
if(((l=(RDListViewItem *)rdcart_cut_list->firstChild())!=NULL)&&
((!err)||rdcart_select_cut)) {
rdcart_cut_list->setSelected(l,true);
rdcart_select_cut=false;
}
*/
}
void AudioCart::RefreshLine(RDListViewItem *item)
{
QString sql;
unsigned total_length=0;
QDateTime current_datetime=
QDateTime(QDate::currentDate(),QTime::currentTime());
QString cut_name=item->text(12);
sql=ValidateCutFields()+
QString().sprintf(" where (CART_NUMBER=%u)&&",rdcart_cart->number())+
"(CUT_NAME=\""+RDEscapeString(cut_name)+"\")";
RDSqlQuery *q=new RDSqlQuery(sql);
if(q->first()) {
item->setText(0,q->value(rdcart_use_weighting).toString());
item->setText(1,q->value(2).toString());
item->setText(2,RDGetTimeLength(q->value(3).toUInt()));
if(rdcart_use_weighting&&(q->value(1).toInt()==0)){ //zero weight
item->setBackgroundColor(RD_CART_ERROR_COLOR);
}
else {
switch(ValidateCut(q,12,RDCart::NeverValid,current_datetime)) {
case RDCart::NeverValid:
item->setBackgroundColor(RD_CART_ERROR_COLOR);
break;
case RDCart::ConditionallyValid:
if((!q->value(14).isNull())&&
(q->value(14).toDateTime()<current_datetime)) {
item->setBackgroundColor(RD_CART_ERROR_COLOR);
}
else {
item->setBackgroundColor(RD_CART_CONDITIONAL_COLOR);
}
break;
case RDCart::FutureValid:
item->setBackgroundColor(RD_CART_FUTURE_COLOR);
break;
case RDCart::EvergreenValid:
item->setBackgroundColor(RD_CART_EVERGREEN_COLOR);
break;
case RDCart::AlwaysValid:
item->setBackgroundColor(backgroundColor());
break;
}
}
if(q->value(5).toUInt()>0) {
item->setText(3,q->value(4).toDateTime().toString("M/d/yy"));
}
else {
item->setText(3,tr("Never"));
}
item->setText(4,q->value(5).toString());
if(!q->value(6).toDateTime().isNull()) {
item->setText(6,q->value(7).toString()+" - "+
q->value(6).toDateTime().toString("M/d/yy hh:mm:ss"));
}
QString user=q->value(8).toString()+"@";
if(q->value(8).toString().isEmpty()) {
user="";
}
if(q->value(9).toString().isEmpty()) {
item->setText(5,"["+tr("unknown")+"]");
}
else {
item->setText(5,user+q->value(9).toString());
}
item->setText(7,q->value(10).toString());
if(!q->value(14).toDateTime().isNull()) {
item->setText(8,q->value(14).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
item->setText(8,tr("None"));
}
if(!q->value(15).toDateTime().isNull()) {
item->setText(9,q->value(15).toDateTime().toString("M/d/yyyy hh:mm:ss"));
}
else {
item->setText(9,tr("None"));
}
if(!q->value(17).isNull()) {
item->setText(10,q->value(16).toTime().toString("hh:mm:ss"));
item->setText(11,q->value(17).toTime().toString("hh:mm:ss"));
}
else {
item->setText(10,tr("None"));
item->setText(11,tr("None"));
}
item->setText(12,q->value(11).toString());
if(q->value(25).toString().isEmpty()) {
item->setText(13,"["+tr("not available")+"]");
}
else {
item->setText(13,q->value(25).toString());
}
total_length+=q->value(3).toUInt();
}
if(q->size()>0) {
rdcart_average_length=total_length/q->size();
}
else {
rdcart_average_length=0;
}
delete q;
}

View File

@ -25,7 +25,6 @@
#include <QTableView> #include <QTableView>
#include <rdcart.h> #include <rdcart.h>
//#include <rdlistviewitem.h>
#include <rdcutlistmodel.h> #include <rdcutlistmodel.h>
#include <rdwidget.h> #include <rdwidget.h>
@ -42,6 +41,7 @@ class AudioCart : public RDWidget
bool profile_rip,QWidget *parent=0); bool profile_rip,QWidget *parent=0);
QSize sizeHint() const; QSize sizeHint() const;
QSizePolicy sizePolicy() const; QSizePolicy sizePolicy() const;
RDCutListModel *cutListModel();
public slots: public slots:
void changeCutScheduling(int sched); void changeCutScheduling(int sched);
@ -62,7 +62,6 @@ class AudioCart : public RDWidget
* cut of audio. * cut of audio.
**/ **/
void extEditorCutData(); void extEditorCutData();
void doubleClickedData(Q3ListViewItem *,const QPoint &,int);
void copyProgressData(const QVariant &step); void copyProgressData(const QVariant &step);
signals: signals:
@ -71,12 +70,7 @@ class AudioCart : public RDWidget
private: private:
int SingleSelectedLine() const; int SingleSelectedLine() const;
RDListViewItem *SelectedCuts(std::vector<QString> *cutnames);
void RefreshList();
void RefreshLine(RDListViewItem *item);
unsigned NextCut();
RDCart *rdcart_cart; RDCart *rdcart_cart;
// RDListView *rdcart_cut_list;
QTableView *rdcart_cut_view; QTableView *rdcart_cut_view;
RDCutListModel *rdcart_cut_model; RDCutListModel *rdcart_cut_model;
unsigned rdcart_average_length; unsigned rdcart_average_length;

View File

@ -2,7 +2,7 @@
// //
// Edit a Rivendell Cart // Edit a Rivendell Cart
// //
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -201,21 +201,6 @@ EditCart::EditCart(unsigned number,QString *path,bool new_cart,bool profile_rip,
rdcart_controls.forced_length_edit->hide(); rdcart_controls.forced_length_edit->hide();
} }
//
// Cart Preserve Pitch
//
rdcart_preserve_pitch_button=new QCheckBox(this);
rdcart_preserve_pitch_button->setGeometry(430,38,20,15);
rdcart_preserve_pitch_label=
new QLabel(rdcart_preserve_pitch_button,tr("Preserve Pitch"),this);
rdcart_preserve_pitch_label->setGeometry(450,38,140,21);
rdcart_preserve_pitch_label->setFont(labelFont());
rdcart_preserve_pitch_label->
setAlignment(Qt::AlignLeft|Qt::AlignVCenter|Qt::TextShowMnemonic);
// ???????????????????????????????
rdcart_preserve_pitch_button->hide();
rdcart_preserve_pitch_label->hide();
// //
// Cart Title // Cart Title
// //
@ -627,13 +612,6 @@ EditCart::EditCart(unsigned number,QString *path,bool new_cart,bool profile_rip,
setTime(QTime().addMSecs(rdcart_cart->forcedLength())); setTime(QTime().addMSecs(rdcart_cart->forcedLength()));
rdcart_forced_length_ledit-> rdcart_forced_length_ledit->
setText(rdcart_controls.forced_length_edit->time().toString("hh:mm:ss")); setText(rdcart_controls.forced_length_edit->time().toString("hh:mm:ss"));
if(rdcart_cart->preservePitch()) {
rdcart_preserve_pitch_button->setChecked(true);
}
rdcart_preserve_pitch_button->
setEnabled(rdcart_controls.enforce_length_box->isChecked());
rdcart_preserve_pitch_label->
setEnabled(rdcart_controls.enforce_length_box->isChecked());
rdcart_controls.title_edit->setText(rdcart_cart->title()); rdcart_controls.title_edit->setText(rdcart_cart->title());
if(!rdcart_cart->startDateTime().isNull()) { if(!rdcart_cart->startDateTime().isNull()) {
rdcart_start_date_edit-> rdcart_start_date_edit->
@ -827,28 +805,13 @@ void EditCart::okData()
} }
} }
if(rdcart_cut_sched_box->currentItem()==0) { if(rdcart_cut_sched_box->currentItem()==0) {
std::vector<int> play_orders; QList<int> dup_values;
std::vector<int> order_duplicates; if(rdcart_audio_cart->cutListModel()->playOrderDuplicates(&dup_values)) {
sql=QString("select PLAY_ORDER from CUTS where ")+
QString().sprintf("CART_NUMBER=%u",rdcart_cart->number());
q=new RDSqlQuery(sql);
while(q->next()) {
play_orders.push_back(q->value(0).toInt());
}
delete q;
for(unsigned i=0;i<play_orders.size();i++) {
for(unsigned j=i;j<play_orders.size();j++) {
if((i!=j)&&(play_orders[i]==play_orders[j])) {
order_duplicates.push_back(play_orders[j]);
}
}
}
if(order_duplicates.size()>0) {
QString msg= QString msg=
tr("The following cut order values are assigned more than once")+ tr("The following cut order values are assigned more than once")+
":\n"; ":\n";
for(unsigned i=0;i<order_duplicates.size();i++) { for(int i=0;i<dup_values.size();i++) {
msg+=QString().sprintf("%d, ",order_duplicates[i]); msg+=QString().sprintf("%d, ",dup_values.at(i));
} }
msg=msg.left(msg.length()-2)+"."; msg=msg.left(msg.length()-2)+".";
QMessageBox::warning(this,"RDLibrary - "+tr("Duplicate Cut Order"),msg); QMessageBox::warning(this,"RDLibrary - "+tr("Duplicate Cut Order"),msg);
@ -873,7 +836,6 @@ void EditCart::okData()
setForcedLength(RDSetTimeLength(rdcart_average_length_edit->text())); setForcedLength(RDSetTimeLength(rdcart_average_length_edit->text()));
rdcart_cart->setEnforceLength(false); rdcart_cart->setEnforceLength(false);
} }
rdcart_cart->setPreservePitch(rdcart_preserve_pitch_button->isChecked());
rdcart_cart->setTitle(rdcart_controls.title_edit->text()); rdcart_cart->setTitle(rdcart_controls.title_edit->text());
if(rdcart_controls.year_edit->text().toInt()==0) { if(rdcart_controls.year_edit->text().toInt()==0) {
rdcart_cart->setYear(); rdcart_cart->setYear();

View File

@ -72,8 +72,6 @@ class EditCart : public RDDialog
QLineEdit *rdcart_average_length_edit; QLineEdit *rdcart_average_length_edit;
QLabel *rdcart_forced_length_label; QLabel *rdcart_forced_length_label;
QLineEdit *rdcart_forced_length_ledit; QLineEdit *rdcart_forced_length_ledit;
QCheckBox *rdcart_preserve_pitch_button;
QLabel *rdcart_preserve_pitch_label;
unsigned rdcart_average_length; unsigned rdcart_average_length;
unsigned rdcart_length_deviation; unsigned rdcart_length_deviation;
AudioCart *rdcart_audio_cart; AudioCart *rdcart_audio_cart;
@ -89,5 +87,4 @@ class EditCart : public RDDialog
bool rdcart_profile_rip; bool rdcart_profile_rip;
}; };
#endif #endif // EDIT_CART_H

View File

@ -159,11 +159,11 @@ Přesto pokračovat?</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Nikdy</translation> <translation type="obsolete">Nikdy</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Žádný</translation> <translation type="obsolete">Žádný</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -181,14 +181,6 @@ Přesto pokračovat?</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation>V záběru není přítomen žádný zvuk!</translation> <translation>V záběru není přítomen žádný zvuk!</translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">Naposledy přehráno</translation> <translation type="obsolete">Naposledy přehráno</translation>
@ -713,7 +705,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Zachovat výšku tónu</translation> <translation type="obsolete">Zachovat výšku tónu</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -900,14 +892,6 @@ poznámky</translation>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -920,6 +904,14 @@ poznámky</translation>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -159,11 +159,11 @@ Trotzdem fortfahren?</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Nie</translation> <translation type="obsolete">Nie</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Keine</translation> <translation type="obsolete">Keine</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -181,14 +181,6 @@ Trotzdem fortfahren?</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">ZUL. GESPIELT</translation> <translation type="obsolete">ZUL. GESPIELT</translation>
@ -712,7 +704,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Pitch schützen</translation> <translation type="obsolete">Pitch schützen</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -888,14 +880,6 @@ Notes</source>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -908,6 +892,14 @@ Notes</source>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -111,11 +111,11 @@ Do you still want to proceed?</source>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Nunca</translation> <translation type="obsolete">Nunca</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Ninguno</translation> <translation type="obsolete">Ninguno</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -181,14 +181,6 @@ Audio</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation>¡No hay audios en este cut!</translation> <translation>¡No hay audios en este cut!</translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">Últ. Reprod</translation> <translation type="obsolete">Últ. Reprod</translation>
@ -705,7 +697,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Preservar pitch</translation> <translation type="obsolete">Preservar pitch</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -889,14 +881,6 @@ Notas</translation>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -909,6 +893,14 @@ Notas</translation>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -74,26 +74,10 @@ Do you want to proceed?</source>
<source>[new cart]</source> <source>[new cart]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Never</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>RDLibrary - Edit Cart</source> <source>RDLibrary - Edit Cart</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -531,10 +515,6 @@ Selection</source>
<source>Forced Length:</source> <source>Forced Length:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Preserve Pitch</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -694,14 +674,6 @@ Notes</source>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -714,6 +686,14 @@ Notes</source>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -158,11 +158,11 @@ Vil du halda fram?</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Aldri</translation> <translation type="obsolete">Aldri</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Ingen</translation> <translation type="obsolete">Ingen</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -172,14 +172,6 @@ Vil du halda fram?</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">Sist spelt</translation> <translation type="obsolete">Sist spelt</translation>
@ -705,7 +697,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Hald tonehøgd</translation> <translation type="obsolete">Hald tonehøgd</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -880,14 +872,6 @@ Notes</source>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -900,6 +884,14 @@ Notes</source>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -158,11 +158,11 @@ Vil du halda fram?</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Aldri</translation> <translation type="obsolete">Aldri</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Ingen</translation> <translation type="obsolete">Ingen</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -172,14 +172,6 @@ Vil du halda fram?</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">Sist spelt</translation> <translation type="obsolete">Sist spelt</translation>
@ -705,7 +697,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Hald tonehøgd</translation> <translation type="obsolete">Hald tonehøgd</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -880,14 +872,6 @@ Notes</source>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -900,6 +884,14 @@ Notes</source>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>

View File

@ -159,11 +159,11 @@ Você quer proceder?</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
<translation>Nunca</translation> <translation type="obsolete">Nunca</translation>
</message> </message>
<message> <message>
<source>None</source> <source>None</source>
<translation>Nenhum</translation> <translation type="obsolete">Nenhum</translation>
</message> </message>
<message> <message>
<source>1 Cut</source> <source>1 Cut</source>
@ -173,14 +173,6 @@ Você quer proceder?</translation>
<source>No audio is present in the cut!</source> <source>No audio is present in the cut!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>unknown</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Last Played</source> <source>Last Played</source>
<translation type="obsolete">Última vez Executada</translation> <translation type="obsolete">Última vez Executada</translation>
@ -706,7 +698,7 @@ Selection</source>
</message> </message>
<message> <message>
<source>Preserve Pitch</source> <source>Preserve Pitch</source>
<translation>Preservar Pitch</translation> <translation type="obsolete">Preservar Pitch</translation>
</message> </message>
<message> <message>
<source>&amp;Title:</source> <source>&amp;Title:</source>
@ -882,14 +874,6 @@ limite do sistema! Você ainda quer salvar?</translation>
<source>Schedule Cuts</source> <source>Schedule Cuts</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Edit Carts [multiple]</source> <source>Edit Carts [multiple]</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -902,6 +886,14 @@ limite do sistema! Você ainda quer salvar?</translation>
<source>Use RDLogManager Length for PAD Updates</source> <source>Use RDLogManager Length for PAD Updates</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>The following cut order values are assigned more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Cut Order</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>EditMacro</name> <name>EditMacro</name>