mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-05 08:10:21 +01:00
2016-06-15 Fred Gleason <fredg@paravelsystems.com>
* Added an '--xml' switch to rdexport(1) in 'utils/rdexport/rdexport.cpp' and 'utils/rdexport/rdexport.h'.
This commit is contained in:
@@ -15240,3 +15240,6 @@
|
|||||||
* Added '--bitrate=', '--channels=', '--format=', '--quality='
|
* Added '--bitrate=', '--channels=', '--format=', '--quality='
|
||||||
and '--samplerate=' to rdexport(1) in 'utils/rdexport/rdexport.cpp'
|
and '--samplerate=' to rdexport(1) in 'utils/rdexport/rdexport.cpp'
|
||||||
and 'utils/rdexport/rdexport.h'.
|
and 'utils/rdexport/rdexport.h'.
|
||||||
|
2016-06-15 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added an '--xml' switch to rdexport(1) in
|
||||||
|
'utils/rdexport/rdexport.cpp' and 'utils/rdexport/rdexport.h'.
|
||||||
|
|||||||
@@ -380,6 +380,18 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>--xml</option>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Generate an XML file for each generated audio file containing
|
||||||
|
its cart/cut metadata.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|||||||
@@ -971,7 +971,7 @@ bool RDCart::validateLengths(int len) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString RDCart::xml(bool include_cuts) const
|
QString RDCart::xml(bool include_cuts,int cutnum) const
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
return QString();
|
return QString();
|
||||||
@@ -1040,15 +1040,24 @@ QString RDCart::xml(bool include_cuts) const
|
|||||||
case RDCart::Audio:
|
case RDCart::Audio:
|
||||||
if(include_cuts) {
|
if(include_cuts) {
|
||||||
ret+="<cutList>\n";
|
ret+="<cutList>\n";
|
||||||
sql=QString().sprintf("select CUT_NAME from CUTS where CART_NUMBER=%u",
|
if(cutnum<0) {
|
||||||
cart_number);
|
sql=QString("select CUT_NAME from CUTS where ")+
|
||||||
q1=new RDSqlQuery(sql);
|
QString().sprintf("(CART_NUMBER=%u)",cart_number);
|
||||||
while(q1->next()) {
|
q1=new RDSqlQuery(sql);
|
||||||
cut=new RDCut(q1->value(0).toString());
|
while(q1->next()) {
|
||||||
ret+=cut->xml();
|
cut=new RDCut(q1->value(0).toString());
|
||||||
|
ret+=cut->xml();
|
||||||
|
delete cut;
|
||||||
|
}
|
||||||
|
delete q1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cut=new RDCut(RDCut::cutName(cart_number,cutnum));
|
||||||
|
if(cut->exists()) {
|
||||||
|
ret+=cut->xml();
|
||||||
|
}
|
||||||
delete cut;
|
delete cut;
|
||||||
}
|
}
|
||||||
delete q1;
|
|
||||||
ret+="</cutList>\n";
|
ret+="</cutList>\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class RDCart
|
|||||||
bool validateLengths(int len) const;
|
bool validateLengths(int len) const;
|
||||||
void getMetadata(RDWaveData *data) const;
|
void getMetadata(RDWaveData *data) const;
|
||||||
void setMetadata(const RDWaveData *data);
|
void setMetadata(const RDWaveData *data);
|
||||||
QString xml(bool include_cuts) const;
|
QString xml(bool include_cuts,int cutnum=-1) const;
|
||||||
void updateLength();
|
void updateLength();
|
||||||
void updateLength(bool enforce_length,unsigned length);
|
void updateLength(bool enforce_length,unsigned length);
|
||||||
void resetRotation() const;
|
void resetRotation() const;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ MainObject::MainObject(QObject *parent)
|
|||||||
export_bitrate=0;
|
export_bitrate=0;
|
||||||
export_channels=0;
|
export_channels=0;
|
||||||
export_quality=3;
|
export_quality=3;
|
||||||
|
export_xml=false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read Command Options
|
// Read Command Options
|
||||||
@@ -178,6 +179,10 @@ MainObject::MainObject(QObject *parent)
|
|||||||
export_verbose=true;
|
export_verbose=true;
|
||||||
cmd->setProcessed(i,true);
|
cmd->setProcessed(i,true);
|
||||||
}
|
}
|
||||||
|
if(cmd->key(i)=="--xml") {
|
||||||
|
export_xml=true;
|
||||||
|
cmd->setProcessed(i,true);
|
||||||
|
}
|
||||||
if(!cmd->processed(i)) {
|
if(!cmd->processed(i)) {
|
||||||
fprintf(stderr,"rdexport: unrecognized option\n");
|
fprintf(stderr,"rdexport: unrecognized option\n");
|
||||||
exit(256);
|
exit(256);
|
||||||
@@ -419,7 +424,22 @@ void MainObject::ExportCut(RDCart *cart,RDCut *cut)
|
|||||||
conv->setEnableMetadata(true);
|
conv->setEnableMetadata(true);
|
||||||
|
|
||||||
if((export_err=conv->runExport(export_user->name(),export_user->password(),
|
if((export_err=conv->runExport(export_user->name(),export_user->password(),
|
||||||
&conv_err))!=RDAudioExport::ErrorOk) {
|
&conv_err))==RDAudioExport::ErrorOk) {
|
||||||
|
if(export_xml) {
|
||||||
|
FILE *f=NULL;
|
||||||
|
QStringList f0=f0.split(".",conv->destinationFile(),true);
|
||||||
|
QString filename;
|
||||||
|
for(unsigned i=0;i<f0.size()-1;i++) {
|
||||||
|
filename+=f0[i]+".";
|
||||||
|
}
|
||||||
|
filename+="xml";
|
||||||
|
if((f=fopen(filename,"w"))!=NULL) {
|
||||||
|
fprintf(f,"%s\n",(const char *)cart->xml(true,cut->cutNumber()));
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
fprintf(stderr,"rdexport: exporter error for output file \"%s\" [%s]\n",
|
fprintf(stderr,"rdexport: exporter error for output file \"%s\" [%s]\n",
|
||||||
(const char *)conv->destinationFile(),
|
(const char *)conv->destinationFile(),
|
||||||
(const char *)RDAudioExport::errorText(export_err,conv_err));
|
(const char *)RDAudioExport::errorText(export_err,conv_err));
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class MainObject : public QObject
|
|||||||
unsigned export_bitrate;
|
unsigned export_bitrate;
|
||||||
unsigned export_channels;
|
unsigned export_channels;
|
||||||
int export_quality;
|
int export_quality;
|
||||||
|
bool export_xml;
|
||||||
RDConfig *export_config;
|
RDConfig *export_config;
|
||||||
RDRipc *export_ripc;
|
RDRipc *export_ripc;
|
||||||
RDStation *export_station;
|
RDStation *export_station;
|
||||||
|
|||||||
Reference in New Issue
Block a user