mirror of
				https://github.com/ElvishArtisan/rivendell.git
				synced 2025-10-31 06:03:51 +01:00 
			
		
		
		
	2017-08-28 Fred Gleason <fredg@paravelsystems.com>
* Added verbose messages for non-audio events to rdrender(1).
This commit is contained in:
		| @@ -35,7 +35,6 @@ int MainObject::MainLoop() | ||||
| { | ||||
|   float *pcm=NULL; | ||||
|   QTime current_time=render_start_time; | ||||
|   //  QDate current_date=render_start_date; | ||||
|   QString warnings=""; | ||||
|  | ||||
|   // | ||||
| @@ -78,13 +77,13 @@ int MainObject::MainLoop() | ||||
|   // | ||||
|   for(unsigned i=0;i<lls.size();i++) { | ||||
|     if(lls.at(i)->transType()==RDLogLine::Stop) { | ||||
|       Verbose(current_time,i,"STOP "+lls.at(i)->summary()); | ||||
|       Verbose(current_time,i,"STOP ",lls.at(i)->summary()); | ||||
|       warnings+= | ||||
| 	QString().sprintf("log render halted at line %d due to STOP\n",i); | ||||
|       break; | ||||
|     } | ||||
|     if(lls.at(i)->open(current_time)) { | ||||
|       Verbose(current_time,i,RDLogLine::transText(lls.at(i)->transType())+ | ||||
|       Verbose(current_time,i,RDLogLine::transText(lls.at(i)->transType()), | ||||
| 	      QString().sprintf(" cart %06u [",lls.at(i)->cartNumber())+ | ||||
| 	      lls.at(i)->title()+"]"); | ||||
|       sf_count_t frames=0; | ||||
| @@ -116,18 +115,18 @@ int MainObject::MainLoop() | ||||
|     else { | ||||
|       if(i<(lls.size()-1)) { | ||||
| 	if(lls.at(i)->type()==RDLogLine::Cart) { | ||||
| 	  Verbose(current_time,i,"unable to start "+lls.at(i)->summary()+ | ||||
| 	  Verbose(current_time,i,"FAIL",lls.at(i)->summary()+ | ||||
| 		  " (NO AUDIO AVAILABLE)"); | ||||
| 	  warnings+= | ||||
| 	    lls.at(i)->summary()+QString(). | ||||
| 	    sprintf("at line %d failed to play (NO AUDIO AVAILABLE)\n",i); | ||||
| 	} | ||||
| 	else { | ||||
| 	  Verbose(current_time,i,"SKIP "+lls.at(i)->summary()); | ||||
| 	  Verbose(current_time,i,"SKIP",lls.at(i)->summary()); | ||||
| 	} | ||||
|       } | ||||
|       else { | ||||
| 	Verbose(current_time,lls.size()-1,"--- end of log ---"); | ||||
| 	Verbose(current_time,lls.size()-1,"STOP","--- end of log ---"); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   | ||||
| @@ -42,8 +42,6 @@ MainObject::MainObject(QObject *parent) | ||||
| { | ||||
|   render_verbose=false; | ||||
|   render_channels=RDRENDER_DEFAULT_CHANNELS; | ||||
|   render_start_date=QDate::currentDate(); | ||||
|   render_start_time=QTime::currentTime(); | ||||
|  | ||||
|   // | ||||
|   // Read Command Options | ||||
| @@ -74,15 +72,6 @@ MainObject::MainObject(QObject *parent) | ||||
|       } | ||||
|       cmd->setProcessed(i,true); | ||||
|     } | ||||
|     /* | ||||
|     if(cmd->key(i)=="--start-date") { | ||||
|       render_start_date=QDate::fromString(cmd->value(i),Qt::ISODate); | ||||
|       if(!render_start_date.isValid()) { | ||||
| 	fprintf(stderr,"rdrender: invalid --start-date\n"); | ||||
| 	exit(1); | ||||
|       } | ||||
|       cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(cmd->key(i)=="--start-time") { | ||||
|       render_start_time=QTime::fromString(cmd->value(i)); | ||||
|       if(!render_start_time.isValid()) { | ||||
| @@ -91,7 +80,6 @@ MainObject::MainObject(QObject *parent) | ||||
|       } | ||||
|       cmd->setProcessed(i,true); | ||||
|     } | ||||
|     */ | ||||
|     if(!cmd->processed(i)) { | ||||
|       fprintf(stderr,"rdrender: unrecognized option\n"); | ||||
|       exit(256); | ||||
| @@ -99,6 +87,9 @@ MainObject::MainObject(QObject *parent) | ||||
|   } | ||||
|   render_logname=cmd->key(cmd->keys()-2); | ||||
|   render_output_filename=cmd->key(cmd->keys()-1); | ||||
|   if(render_start_time.isNull()) { | ||||
|     render_start_time=QTime(0,0,0,1); | ||||
|   } | ||||
|  | ||||
|   // | ||||
|   // Read Configuration | ||||
| @@ -171,12 +162,6 @@ uint64_t MainObject::FramesFromMsec(uint64_t msec) | ||||
| } | ||||
|  | ||||
|  | ||||
| void MainObject::Warning(const QTime &time,int line,const QString &msg) const | ||||
| { | ||||
|   fprintf(stderr,"%s\n",(const char *)(QString().sprintf("%04d : ",line)+msg)); | ||||
| } | ||||
|  | ||||
|  | ||||
| void MainObject::Verbose(const QString &msg) | ||||
| { | ||||
|   if(render_verbose) { | ||||
| @@ -185,10 +170,14 @@ void MainObject::Verbose(const QString &msg) | ||||
| } | ||||
|  | ||||
|  | ||||
| void MainObject::Verbose(const QTime &time,int line,const QString &msg) | ||||
| void MainObject::Verbose(const QTime &time,int line,const QString &trans, | ||||
| 			 const QString &msg) | ||||
| { | ||||
|   if(render_verbose) { | ||||
|     Warning(time,line,msg); | ||||
|     fprintf(stderr,"%s\n", | ||||
| 	    (const char *)(QString().sprintf("%04d : ",line)+ | ||||
| 			   time.toString("hh:mm:ss")+" : "+ | ||||
| 			   QString().sprintf("%-5s",(const char *)trans)+msg)); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -53,9 +53,9 @@ class MainObject : public QObject | ||||
|   int MainLoop(); | ||||
|   void Sum(float *pcm_out,LogLine *ll,sf_count_t frames); | ||||
|   uint64_t FramesFromMsec(uint64_t msec); | ||||
|   void Warning(const QTime &time,int line,const QString &msg) const; | ||||
|   void Verbose(const QString &msg); | ||||
|   void Verbose(const QTime &time,int line,const QString &msg); | ||||
|   void Verbose(const QTime &time,int line,const QString &trans, | ||||
| 	       const QString &msg); | ||||
|   bool GetCutFile(const QString &cutname,int start_pt,int end_pt, | ||||
| 		  QString *dest_filename) const; | ||||
|   void DeleteCutFile(const QString &dest_filename) const; | ||||
| @@ -63,7 +63,6 @@ class MainObject : public QObject | ||||
|   QString render_logname; | ||||
|   QString render_output_filename; | ||||
|   unsigned render_channels; | ||||
|   QDate render_start_date; | ||||
|   QTime render_start_time; | ||||
|   RDRipc *render_ripc; | ||||
|   RDStation *render_station; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user