mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-02 09:02:34 +02:00
2014-10-26 Fred Gleason <fredg@paravelsystems.com>
* Implemented '--set-datetimes' option for rdimport(1) in 'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'.
This commit is contained in:
parent
c6b756fcad
commit
0091c531d4
@ -14597,3 +14597,6 @@
|
|||||||
* Implemented '--set-string-description' and '--set-string-outcue'
|
* Implemented '--set-string-description' and '--set-string-outcue'
|
||||||
options for rdimport(1) in 'utils/rdimport/rdimport.cpp' and
|
options for rdimport(1) in 'utils/rdimport/rdimport.cpp' and
|
||||||
'utils/rdimport/rdimport.h'.
|
'utils/rdimport/rdimport.h'.
|
||||||
|
2014-10-26 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Implemented '--set-datetimes' option for rdimport(1) in
|
||||||
|
'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'.
|
||||||
|
@ -167,9 +167,13 @@ Length of the added segue in msecs. See \fB--segue-level\fP below.
|
|||||||
Specify the threshold level to use for setting the segue markers, in dBFS.
|
Specify the threshold level to use for setting the segue markers, in dBFS.
|
||||||
Default action is not to create segue markers.
|
Default action is not to create segue markers.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B --set-datetimes=<\fIstart-datetime\fP>,<\fIend-datetime\fP>
|
||||||
|
Set the cut start and end datetimes, in the format YYYYMMDD-HHMMSS.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --set-daypart-times=<\fIstart-time\fP>,<\fIend-time\fP>
|
.B --set-daypart-times=<\fIstart-time\fP>,<\fIend-time\fP>
|
||||||
Set the start and end daypart times, in the format HHMMSS.
|
Set the cut start and end daypart times, in the format HHMMSS.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --set-marker-end-<\fImarker\fP>=<\fIoffset\fP>
|
.B --set-marker-end-<\fImarker\fP>=<\fIoffset\fP>
|
||||||
@ -223,45 +227,59 @@ for <\fIfield\fP> are:
|
|||||||
.TP
|
.TP
|
||||||
.B agency
|
.B agency
|
||||||
Agency Name
|
Agency Name
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B album
|
.B album
|
||||||
Album Name
|
Album Name
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B artist
|
.B artist
|
||||||
Artist Name
|
Artist Name
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B bpm
|
.B bpm
|
||||||
Beats per Minute (integer numeric)
|
Beats per Minute (integer numeric)
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B client
|
.B client
|
||||||
Client Name
|
Client Name
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B composer
|
.B composer
|
||||||
Music Composer Name
|
Music Composer Name
|
||||||
.TP
|
|
||||||
.B description
|
|
||||||
Cut Description
|
|
||||||
.TP
|
|
||||||
.B outcue
|
|
||||||
Cut Outcue
|
|
||||||
.TP
|
.TP
|
||||||
.B conductor
|
.B conductor
|
||||||
Conductor Name
|
Conductor Name
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B publisher
|
.B description
|
||||||
Music Publisher (rights holder)
|
Cut Description
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B label
|
.B label
|
||||||
Record Label Name (rights holder)
|
Record Label Name (rights holder)
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B outcue
|
||||||
|
Cut Outcue
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B publisher
|
||||||
|
Music Publisher (rights holder)
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B song-id
|
.B song-id
|
||||||
Song ID
|
Song ID
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B title
|
.B title
|
||||||
Title
|
Title
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B user-defined
|
.B user-defined
|
||||||
Miscelaneous Information
|
Miscelaneous Information
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B year
|
.B year
|
||||||
Year Released (four digit numeric)
|
Year Released (four digit numeric)
|
||||||
|
@ -164,6 +164,58 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
exit(256);
|
exit(256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(import_cmd->key(i)=="--set-datetimes") {
|
||||||
|
QStringList f0=QStringList().split(",",import_cmd->value(i));
|
||||||
|
if(f0.size()!=2) {
|
||||||
|
fprintf(stderr,"rdimport: invalid argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
for(unsigned j=0;j<2;j++) {
|
||||||
|
if((f0[j].length()!=15)||(f0[j].mid(8,1)!="-")) {
|
||||||
|
fprintf(stderr,"rdimport: invalid argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned year=f0[j].left(4).toUInt(&ok);
|
||||||
|
if(!ok) {
|
||||||
|
fprintf(stderr,"rdimport: invalid year argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned month=f0[j].mid(4,2).toUInt(&ok);
|
||||||
|
if((!ok)||(month>12)) {
|
||||||
|
fprintf(stderr,"rdimport: invalid month argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned day=f0[j].mid(6,2).toUInt(&ok);
|
||||||
|
if((!ok)||(day>31)) {
|
||||||
|
fprintf(stderr,"rdimport: invalid day argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned hour=f0[j].mid(9,2).toUInt(&ok);
|
||||||
|
if((!ok)||(hour>23)) {
|
||||||
|
fprintf(stderr,"rdimport: invalid hour argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned min=f0[j].mid(11,2).toUInt(&ok);
|
||||||
|
if((!ok)||(min>59)) {
|
||||||
|
fprintf(stderr,"rdimport: invalid minute argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
unsigned sec=f0[j].right(2).toUInt(&ok);
|
||||||
|
if((!ok)||(sec>59)) {
|
||||||
|
fprintf(stderr,"rdimport: invalid seconds argument to --set-datetimes\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
import_datetimes[j]=QDateTime(QDate(year,month,day),
|
||||||
|
QTime(hour,min,sec));
|
||||||
|
if(!import_datetimes[j].isValid()) {
|
||||||
|
fprintf(stderr,"rdimport: invalid argument to --set-datetimes\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(import_datetimes[0]>=import_datetimes[1]) {
|
||||||
|
fprintf(stderr,"rdimport: datetime cannot end before it begins\n");
|
||||||
|
exit(256);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(import_cmd->key(i)=="--set-daypart-times") {
|
if(import_cmd->key(i)=="--set-daypart-times") {
|
||||||
QStringList f0=QStringList().split(",",import_cmd->value(i));
|
QStringList f0=QStringList().split(",",import_cmd->value(i));
|
||||||
if(f0.size()!=2) {
|
if(f0.size()!=2) {
|
||||||
@ -577,6 +629,12 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
printf(" End Daypart = %s\n",
|
printf(" End Daypart = %s\n",
|
||||||
(const char *)import_dayparts[1].toString("hh:mm:ss"));
|
(const char *)import_dayparts[1].toString("hh:mm:ss"));
|
||||||
}
|
}
|
||||||
|
if((!import_datetimes[0].isNull())||(!import_datetimes[1].isNull())) {
|
||||||
|
printf(" Start DateTime = %s\n",
|
||||||
|
(const char *)import_datetimes[0].toString("MM/dd/yyyy hh:mm:ss"));
|
||||||
|
printf(" End DateTime = %s\n",
|
||||||
|
(const char *)import_datetimes[1].toString("MM/dd/yyyy hh:mm:ss"));
|
||||||
|
}
|
||||||
if(import_fix_broken_formats) {
|
if(import_fix_broken_formats) {
|
||||||
printf(" Broken format workarounds are ENABLED\n");
|
printf(" Broken format workarounds are ENABLED\n");
|
||||||
}
|
}
|
||||||
@ -1196,6 +1254,10 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
|||||||
cut->setStartDaypart(import_dayparts[0],true);
|
cut->setStartDaypart(import_dayparts[0],true);
|
||||||
cut->setEndDaypart(import_dayparts[1],true);
|
cut->setEndDaypart(import_dayparts[1],true);
|
||||||
}
|
}
|
||||||
|
if((!import_datetimes[0].isNull())||(!import_datetimes[1].isNull())) {
|
||||||
|
cut->setStartDatetime(import_datetimes[0],true);
|
||||||
|
cut->setEndDatetime(import_datetimes[1],true);
|
||||||
|
}
|
||||||
import_cut_markers->setAudioLength(wavefile->getExtTimeLength());
|
import_cut_markers->setAudioLength(wavefile->getExtTimeLength());
|
||||||
if(import_cut_markers->hasStartValue()) {
|
if(import_cut_markers->hasStartValue()) {
|
||||||
cut->setStartPoint(import_cut_markers->startValue());
|
cut->setStartPoint(import_cut_markers->startValue());
|
||||||
|
@ -104,6 +104,7 @@ class MainObject : public QObject
|
|||||||
bool import_create_dates;
|
bool import_create_dates;
|
||||||
int import_create_startdate_offset;
|
int import_create_startdate_offset;
|
||||||
int import_create_enddate_offset;
|
int import_create_enddate_offset;
|
||||||
|
QDateTime import_datetimes[2];
|
||||||
QTime import_dayparts[2];
|
QTime import_dayparts[2];
|
||||||
bool import_fix_broken_formats;
|
bool import_fix_broken_formats;
|
||||||
int import_persistent_dropbox_id;
|
int import_persistent_dropbox_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user