mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2014-11-21 Fred Gleason <fredg@paravelsystems.com>
* Added a '--clear-datetimes' option to rdimport(1) in 'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'.
This commit is contained in:
@@ -14648,3 +14648,6 @@
|
|||||||
2014-11-10 Fred Gleason <fredg@paravelsystems.com>
|
2014-11-10 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Fixed a bug in 'rdlogedit/edit_log.cpp' that allowed GUID data
|
* Fixed a bug in 'rdlogedit/edit_log.cpp' that allowed GUID data
|
||||||
in the clipboard to be transferred between logs.
|
in the clipboard to be transferred between logs.
|
||||||
|
2014-11-21 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added a '--clear-datetimes' option to rdimport(1) in
|
||||||
|
'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'.
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ Specifying '0' will turn off autotrimming.
|
|||||||
Add <\fIoffset\fP> to the cart number as determined from metadata pattern
|
Add <\fIoffset\fP> to the cart number as determined from metadata pattern
|
||||||
or --use-cartchunk-cutid.
|
or --use-cartchunk-cutid.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B --clear-datetimes
|
||||||
|
Do not set the cut start and end datetimes, even if such are found in
|
||||||
|
the file's import metadata. Mutually exclusive with the \fB--set-datetimes\fP
|
||||||
|
option.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B --create-enddate-offset=<\fIdays\fP>
|
.B --create-enddate-offset=<\fIdays\fP>
|
||||||
If the imported file does not reference an end date, create with
|
If the imported file does not reference an end date, create with
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
import_create_enddate_offset=0;
|
import_create_enddate_offset=0;
|
||||||
import_string_bpm=0;
|
import_string_bpm=0;
|
||||||
import_string_year=0;
|
import_string_year=0;
|
||||||
|
import_clear_datetimes=false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read Command Options
|
// Read Command Options
|
||||||
@@ -164,6 +165,10 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
exit(256);
|
exit(256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(import_cmd->key(i)=="--clear-datetimes") {
|
||||||
|
import_clear_datetimes=true;
|
||||||
|
import_cmd->setProcessed(i,true);
|
||||||
|
}
|
||||||
if(import_cmd->key(i)=="--set-datetimes") {
|
if(import_cmd->key(i)=="--set-datetimes") {
|
||||||
QStringList f0=QStringList().split(",",import_cmd->value(i));
|
QStringList f0=QStringList().split(",",import_cmd->value(i));
|
||||||
if(f0.size()!=2) {
|
if(f0.size()!=2) {
|
||||||
@@ -372,6 +377,11 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
import_cmd->setProcessed(i,true);
|
import_cmd->setProcessed(i,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(import_datetimes[0].isValid()&&import_clear_datetimes) {
|
||||||
|
fprintf(stderr,"rdimport: --set-datetimes and --clear-datetimes are mutually exclusive\n");
|
||||||
|
exit(255);
|
||||||
|
}
|
||||||
|
|
||||||
import_cut_markers=new MarkerSet();
|
import_cut_markers=new MarkerSet();
|
||||||
import_cut_markers->loadMarker(import_cmd,"cut");
|
import_cut_markers->loadMarker(import_cmd,"cut");
|
||||||
import_talk_markers=new MarkerSet();
|
import_talk_markers=new MarkerSet();
|
||||||
@@ -635,6 +645,9 @@ MainObject::MainObject(QObject *parent,const char *name)
|
|||||||
printf(" End DateTime = %s\n",
|
printf(" End DateTime = %s\n",
|
||||||
(const char *)import_datetimes[1].toString("MM/dd/yyyy hh:mm:ss"));
|
(const char *)import_datetimes[1].toString("MM/dd/yyyy hh:mm:ss"));
|
||||||
}
|
}
|
||||||
|
if(import_clear_datetimes) {
|
||||||
|
printf(" Clearing datetimes\n");
|
||||||
|
}
|
||||||
if(import_fix_broken_formats) {
|
if(import_fix_broken_formats) {
|
||||||
printf(" Broken format workarounds are ENABLED\n");
|
printf(" Broken format workarounds are ENABLED\n");
|
||||||
}
|
}
|
||||||
@@ -1258,12 +1271,16 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
|||||||
cut->setStartDatetime(import_datetimes[0],true);
|
cut->setStartDatetime(import_datetimes[0],true);
|
||||||
cut->setEndDatetime(import_datetimes[1],true);
|
cut->setEndDatetime(import_datetimes[1],true);
|
||||||
}
|
}
|
||||||
|
if(import_clear_datetimes) {
|
||||||
|
cut->setStartDatetime(QDateTime(),false);
|
||||||
|
cut->setEndDatetime(QDateTime(),false);
|
||||||
|
}
|
||||||
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());
|
||||||
cut->setEndPoint(import_cut_markers->endValue());
|
cut->setEndPoint(import_cut_markers->endValue());
|
||||||
cut->setLength(cut->endPoint()-cut->startPoint());
|
cut->setLength(cut->endPoint()-cut->startPoint());
|
||||||
cart->updateLength();
|
// cart->updateLength();
|
||||||
}
|
}
|
||||||
int lo=cut->startPoint();
|
int lo=cut->startPoint();
|
||||||
int hi=cut->endPoint();
|
int hi=cut->endPoint();
|
||||||
@@ -1290,6 +1307,7 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
|
|||||||
if(import_fadeup_marker->hasFadeValue()) {
|
if(import_fadeup_marker->hasFadeValue()) {
|
||||||
cut->setFadeupPoint(import_fadeup_marker->fadeValue(lo,hi));
|
cut->setFadeupPoint(import_fadeup_marker->fadeValue(lo,hi));
|
||||||
}
|
}
|
||||||
|
cart->updateLength();
|
||||||
delete settings;
|
delete settings;
|
||||||
delete conv;
|
delete conv;
|
||||||
delete cut;
|
delete cut;
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ class MainObject : public QObject
|
|||||||
int import_create_startdate_offset;
|
int import_create_startdate_offset;
|
||||||
int import_create_enddate_offset;
|
int import_create_enddate_offset;
|
||||||
QDateTime import_datetimes[2];
|
QDateTime import_datetimes[2];
|
||||||
|
bool import_clear_datetimes;
|
||||||
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user