mirror of
				https://github.com/ElvishArtisan/rivendell.git
				synced 2025-10-30 17:23:53 +01:00 
			
		
		
		
	2014-10-25 Fred Gleason <fredg@paravelsystems.com>
* Implemented '--set-string-*=' options for rdimport(1) in 'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'.
This commit is contained in:
		| @@ -14590,3 +14590,6 @@ | ||||
| 2014-10-25 Fred Gleason <fredg@paravelsystems.com> | ||||
| 	* Added fade markers to the 'MarkerSet::dump()' method in | ||||
| 	'utils/rdimport/markerset.cpp'. | ||||
| 2014-10-25 Fred Gleason <fredg@paravelsystems.com> | ||||
| 	* Implemented '--set-string-*=' options for rdimport(1) in | ||||
| 	'utils/rdimport/rdimport.cpp' and 'utils/rdimport/rdimport.h'. | ||||
|   | ||||
| @@ -214,11 +214,57 @@ Set a start marker to a given offset value.  See the discussion of the | ||||
| \fB--set-marker-end-<marker>\fP option above for a description of the | ||||
| <\fImarker\fP> and <\fIoffset\fP> parameters. | ||||
|  | ||||
| .TP | ||||
| .B --set-string-<\fIfield\fP>=<\fIstring\fP> | ||||
| Set the cart label field <\fIfield\fP> to <\fIstring\fP>.  This will override | ||||
| any other values --e.g. from \fB--metadata-pattern\fP.  Values recognized | ||||
| for <\fIfield\fP> are: | ||||
| .RS | ||||
| .TP | ||||
| .B agency | ||||
| Agency Name | ||||
| .TP | ||||
| .B album | ||||
| Album Name | ||||
| .TP | ||||
| .B artist | ||||
| Artist Name | ||||
| .TP | ||||
| .B bpm | ||||
| Beats per Minute (integer numeric) | ||||
| .TP | ||||
| .B client | ||||
| Client Name | ||||
| .TP | ||||
| .B composer | ||||
| Music Composer Name | ||||
| .TP | ||||
| .B conductor | ||||
| Conductor Name | ||||
| .TP | ||||
| .B publisher | ||||
| Music Publisher (rights holder) | ||||
| .TP | ||||
| .B label | ||||
| Record Label Name (rights holder) | ||||
| .TP | ||||
| .B song-id | ||||
| Song ID | ||||
| .TP | ||||
| .B title | ||||
| Title | ||||
| .TP | ||||
| .B user-defined | ||||
| Miscelaneous Information | ||||
| .TP | ||||
| .B year | ||||
| Year Released (four digit numeric) | ||||
| .RE | ||||
| .RE | ||||
|  | ||||
| .TP | ||||
| .B --set-user-defined=<\fIstr\fP> | ||||
| Set the User Defined field for the target cart to <\fIstr\fP>.  This will | ||||
| override any value that might otherwise be set --e.g. by using the | ||||
| \fB--metadata-pattern\fP option. | ||||
| Deprecated.  Use the \fB--set-string-user-defined\fP option instead. | ||||
|  | ||||
| .TP | ||||
| .B --single-cart | ||||
|   | ||||
| @@ -87,6 +87,8 @@ MainObject::MainObject(QObject *parent,const char *name) | ||||
|   import_create_dates=false; | ||||
|   import_create_startdate_offset=0; | ||||
|   import_create_enddate_offset=0; | ||||
|   import_string_bpm=0; | ||||
|   import_string_year=0; | ||||
|  | ||||
|   // | ||||
|   // Read Command Options | ||||
| @@ -245,6 +247,71 @@ MainObject::MainObject(QObject *parent,const char *name) | ||||
|       } | ||||
|       import_create_dates=true; | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-agency") { | ||||
|       import_string_agency=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-album") { | ||||
|       import_string_album=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-artist") { | ||||
|       import_string_artist=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-bpm") { | ||||
|       import_string_bpm=import_cmd->value(i).toInt(&ok); | ||||
|       if(!ok) { | ||||
| 	fprintf(stderr,"rdimport: invalid value for --set-string-bpm\n"); | ||||
| 	exit(255); | ||||
|       } | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-client") { | ||||
|       import_string_client=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-composer") { | ||||
|       import_string_composer=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-conductor") { | ||||
|       import_string_conductor=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-publisher") { | ||||
|       import_string_publisher=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-label") { | ||||
|       import_string_label=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-song-id") { | ||||
|       import_string_song_id=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-title") { | ||||
|       if(import_cmd->value(i).isEmpty()) { | ||||
| 	fprintf(stderr,"title field cannot be empty\n"); | ||||
| 	exit(255); | ||||
|       } | ||||
|       import_string_title=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-user-defined") { | ||||
|       import_string_user_defined=import_cmd->value(i); | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|     if(import_cmd->key(i)=="--set-string-year") { | ||||
|       import_string_year=import_cmd->value(i).toInt(&ok); | ||||
|       if(!ok) { | ||||
| 	fprintf(stderr,"rdimport: invalid value for --set-string-year\n"); | ||||
| 	exit(255); | ||||
|       } | ||||
|       import_cmd->setProcessed(i,true); | ||||
|     } | ||||
|  | ||||
|   } | ||||
|   import_cut_markers=new MarkerSet(); | ||||
|   import_cut_markers->loadMarker(import_cmd,"cut"); | ||||
| @@ -520,6 +587,46 @@ MainObject::MainObject(QObject *parent,const char *name) | ||||
|     if(import_persistent_dropbox_id>=0) { | ||||
|       printf(" Persistent DropBox ID = %d\n",import_persistent_dropbox_id); | ||||
|     } | ||||
|     if(!import_string_agency.isNull()) { | ||||
|       printf(" Agency set to: %s\n",(const char *)import_string_agency); | ||||
|     } | ||||
|     if(!import_string_album.isNull()) { | ||||
|       printf(" Album set to: %s\n",(const char *)import_string_album); | ||||
|     } | ||||
|     if(!import_string_artist.isNull()) { | ||||
|       printf(" Artist set to: %s\n",(const char *)import_string_artist); | ||||
|     } | ||||
|     if(import_string_bpm!=0) { | ||||
|       printf(" BPM set to: %d\n",import_string_bpm); | ||||
|     } | ||||
|     if(!import_string_client.isNull()) { | ||||
|       printf(" Client set to: %s\n",(const char *)import_string_client); | ||||
|     } | ||||
|     if(!import_string_composer.isNull()) { | ||||
|       printf(" Composer set to: %s\n",(const char *)import_string_composer); | ||||
|     } | ||||
|     if(!import_string_conductor.isNull()) { | ||||
|       printf(" Conductor set to: %s\n",(const char *)import_string_conductor); | ||||
|     } | ||||
|     if(!import_string_label.isNull()) { | ||||
|       printf(" Label set to: %s\n",(const char *)import_string_label); | ||||
|     } | ||||
|     if(!import_string_publisher.isNull()) { | ||||
|       printf(" Publisher set to: %s\n",(const char *)import_string_publisher); | ||||
|     } | ||||
|     if(!import_string_song_id.isNull()) { | ||||
|       printf(" Song ID set to: %s\n",(const char *)import_string_song_id); | ||||
|     } | ||||
|     if(!import_string_title.isNull()) { | ||||
|       printf(" Title set to: %s\n",(const char *)import_string_title); | ||||
|     } | ||||
|     if(!import_string_user_defined.isNull()) { | ||||
|       printf(" User Defined set to: %s\n", | ||||
| 	     (const char *)import_string_user_defined); | ||||
|     } | ||||
|     if(import_string_year!=0) { | ||||
|       printf(" Year set to: %d\n",import_string_year); | ||||
|     } | ||||
|     import_cut_markers->dump(); | ||||
|     import_talk_markers->dump(); | ||||
|     import_hook_markers->dump(); | ||||
| @@ -908,9 +1015,16 @@ MainObject::Result MainObject::ImportFile(const QString &filename, | ||||
| 	     (const char *)RDGetBasePart(filename).utf8(),*cartnum); | ||||
|     } | ||||
|     else { | ||||
|       printf(" Importing file \"%s\" [%s] to cart %06u ... ", | ||||
| 	     (const char *)RDGetBasePart(filename).utf8(), | ||||
| 	     (const char *)wavedata->title().stripWhiteSpace(),*cartnum); | ||||
|       if(import_string_title.isNull()) { | ||||
| 	printf(" Importing file \"%s\" [%s] to cart %06u ... ", | ||||
| 	       (const char *)RDGetBasePart(filename).utf8(), | ||||
| 	       (const char *)wavedata->title().stripWhiteSpace(),*cartnum); | ||||
|       } | ||||
|       else { | ||||
| 	printf(" Importing file \"%s\" [%s] to cart %06u ... ", | ||||
| 	       (const char *)RDGetBasePart(filename).utf8(), | ||||
| 	       (const char *)import_string_title.stripWhiteSpace(),*cartnum); | ||||
|       } | ||||
|     } | ||||
|     fflush(stdout); | ||||
|   } | ||||
| @@ -1016,9 +1130,48 @@ MainObject::Result MainObject::ImportFile(const QString &filename, | ||||
|   for(unsigned i=0;i<import_add_scheduler_codes.size();i++) { | ||||
|     cart->addSchedCode(import_add_scheduler_codes[i]); | ||||
|   } | ||||
|   if(!import_string_agency.isNull()) { | ||||
|     cart->setAgency(import_string_agency); | ||||
|   } | ||||
|   if(!import_string_album.isNull()) { | ||||
|     cart->setAlbum(import_string_album); | ||||
|   } | ||||
|   if(!import_string_artist.isNull()) { | ||||
|     cart->setArtist(import_string_artist); | ||||
|   } | ||||
|   if(import_string_bpm!=0) { | ||||
|     cart->setBeatsPerMinute(import_string_bpm); | ||||
|   } | ||||
|   if(!import_string_client.isNull()) { | ||||
|     cart->setClient(import_string_client); | ||||
|   } | ||||
|   if(!import_string_composer.isNull()) { | ||||
|     cart->setComposer(import_string_composer); | ||||
|   } | ||||
|   if(!import_string_conductor.isNull()) { | ||||
|     cart->setConductor(import_string_conductor); | ||||
|   } | ||||
|   if(!import_string_label.isNull()) { | ||||
|     cart->setLabel(import_string_label); | ||||
|   } | ||||
|   if(!import_string_publisher.isNull()) { | ||||
|     cart->setPublisher(import_string_publisher); | ||||
|   } | ||||
|   if(!import_string_song_id.isNull()) { | ||||
|     cart->setSongId(import_string_song_id); | ||||
|   } | ||||
|   if(!import_string_title.isNull()) { | ||||
|     cart->setTitle(import_string_title); | ||||
|   } | ||||
|   if(!import_set_user_defined.isEmpty()) { | ||||
|     cart->setUserDefined(import_set_user_defined); | ||||
|   } | ||||
|   if(!import_string_user_defined.isNull()) { | ||||
|     cart->setUserDefined(import_string_user_defined); | ||||
|   } | ||||
|   if(import_string_year!=0) { | ||||
|     cart->setYear(import_string_year); | ||||
|   } | ||||
|   if((!import_dayparts[0].isNull())||(!import_dayparts[1].isNull())) { | ||||
|     cut->setStartDaypart(import_dayparts[0],true); | ||||
|     cut->setEndDaypart(import_dayparts[1],true); | ||||
|   | ||||
| @@ -118,6 +118,19 @@ class MainObject : public QObject | ||||
|   int import_segue_length; | ||||
|   unsigned import_cart_number; | ||||
|   QString import_metadata_pattern; | ||||
|   QString import_string_agency; | ||||
|   QString import_string_album; | ||||
|   QString import_string_artist; | ||||
|   int import_string_bpm; | ||||
|   QString import_string_client; | ||||
|   QString import_string_composer; | ||||
|   QString import_string_conductor; | ||||
|   QString import_string_publisher; | ||||
|   QString import_string_label; | ||||
|   QString import_string_song_id; | ||||
|   QString import_string_title; | ||||
|   QString import_string_user_defined; | ||||
|   int import_string_year; | ||||
|   struct DropboxList { | ||||
|     QString filename; | ||||
|     unsigned size; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user