2015-02-06 Fred Gleason <fredg@paravelsystems.com>

* Added a '--auto-segue' switch to rdmarkerset(8) in
	'utils/rdmarkerset.cpp' and 'utils/rdmarkerset.h'.
	* Created a man page for rdmarkerset(8).
	* Added a reference to rdmarkerset(8) in the rdimport(1) man page.
This commit is contained in:
Fred Gleason
2015-02-06 14:00:29 -05:00
parent 4da946e36f
commit 10b626983f
7 changed files with 141 additions and 6 deletions

View File

@@ -14738,3 +14738,8 @@
string to be evaluated as invalid. string to be evaluated as invalid.
2015-01-29 Fred Gleason <fredg@paravelsystems.com> 2015-01-29 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 2.10.2int03. * Incremented the package version to 2.10.2int03.
2015-02-06 Fred Gleason <fredg@paravelsystems.com>
* Added a '--auto-segue' switch to rdmarkerset(8) in
'utils/rdmarkerset.cpp' and 'utils/rdmarkerset.h'.
* Created a man page for rdmarkerset(8).
* Added a reference to rdmarkerset(8) in the rdimport(1) man page.

View File

@@ -19,7 +19,8 @@
## ##
## Use automake to process this into a Makefile.in ## Use automake to process this into a Makefile.in
man_MANS = rdimport.1 man_MANS = rdimport.1\
rdmarkerset.8
EXTRA_DIST = $(man_MANS) EXTRA_DIST = $(man_MANS)
CLEANFILES = *~ CLEANFILES = *~

View File

@@ -1,4 +1,4 @@
.TH rdimport 1 "October 2014" Linux "Rivendell Radio Automation System" .TH rdimport 1 "February 2015" Linux "Rivendell Radio Automation System"
.SH NAME .SH NAME
rdimport \- Audio importation tool for the Rivendell Radio Automation System rdimport \- Audio importation tool for the Rivendell Radio Automation System
@@ -355,6 +355,7 @@ appropriate for use with the \fB--normalization-level\fP option.
.SH AUTHOR .SH AUTHOR
Fred Gleason <fredg@paravelsystems.com> Fred Gleason <fredg@paravelsystems.com>
.SH "SEE ALSO" .SH "SEE ALSO"
.BR rdmarkerset(8),
.BR http://www.cartchunk.org/ .BR http://www.cartchunk.org/

45
docs/man/rdmarkerset.8 Normal file
View File

@@ -0,0 +1,45 @@
.TH rdmarkerset 8 "February 2015" Linux "Rivendell Radio Automation System"
.SH NAME
rdmarkerset \- Tool for mass altering Rivendell audio cut markers
.SH SYNOPSIS
rdmarkerset [OPTIONS]
.SH DESCRIPTION
\fBRdmarkerset\fP is a command-line tool for setting or altering audio cut
markers in the Rivendell Radio Automation System.
.SH OPTIONS
.TP
.B --group=<\fIgroup-name\fP>
Apply marker changes to the audio cuts belonging to <\fIgroup\fP>. This
option may be given multiple times. Use of this option is mutually
exclusive with the \fB--all-groups\fP option, below.
.TP
.B --all-groups
Apply marker changes to ALL audio cuts in the Library. Use of this option
is mutually exclusive with the \fB--group\fP option, above. Use with caution!
.TP
.B --auto-trim=<\fIlevel\fP>
Auto-trim the specified cuts to the level indicated by <\fIlevel\fP> dBFS.
Specifying a '0' for <\fIlevel\fP> will remove auto-trim --i.e. move the
Start and End markers to the extreme start and end of the audio data.
Default action is to leave the Start and End markers unaltered.
.TP
.B --auto-segue=<\fIlevel\fP>
Set the Segue Start marker on the specified cuts to the level indicated
by <\fIlevel\fP> dBFS and the Segue End marker to the position of the End
marker. Specifying a '0' for <\fIlevel\fP> will remove the segue markers.
Default action is to leave the segue markers unaltered.
.TP
.B --verbose
Print messages to STDOUT describing progress.
.SH AUTHOR
Fred Gleason <fredg@paravelsystems.com>
.SH "SEE ALSO"
.BR rdimport(1)

View File

@@ -284,6 +284,7 @@ rm -rf $RPM_BUILD_ROOT
/etc/pam.d/rdalsaconfig-root /etc/pam.d/rdalsaconfig-root
/etc/security/console.apps/rdalsaconfig-root /etc/security/console.apps/rdalsaconfig-root
%{_mandir}/man1/rdimport.1.gz %{_mandir}/man1/rdimport.1.gz
%{_mandir}/man8/rdmarkerset.8.gz
%doc AUTHORS %doc AUTHORS
%doc ChangeLog %doc ChangeLog
%doc COPYING %doc COPYING

View File

@@ -55,6 +55,8 @@ MainObject::MainObject(QObject *parent,const char *name)
set_all_groups=false; set_all_groups=false;
set_auto_trim=1; set_auto_trim=1;
set_verbose=false; set_verbose=false;
set_auto_trim=1;
set_auto_segue=1;
// //
// Read Command Options // Read Command Options
@@ -82,6 +84,14 @@ MainObject::MainObject(QObject *parent,const char *name)
} }
cmd->setProcessed(i,true); cmd->setProcessed(i,true);
} }
if(cmd->key(i)=="--auto-segue") {
set_auto_segue=cmd->value(i).toInt(&ok);
if((!ok)||(set_auto_segue>0)) {
fprintf(stderr,
"rdmarkerset: invalid level value specified for --auto-segue\n");
}
cmd->setProcessed(i,true);
}
if(cmd->key(i)=="--verbose") { if(cmd->key(i)=="--verbose") {
set_verbose=true; set_verbose=true;
cmd->setProcessed(i,true); cmd->setProcessed(i,true);
@@ -103,6 +113,10 @@ MainObject::MainObject(QObject *parent,const char *name)
fprintf(stderr,"rdmarkerset: the --all-groups and --group=<group> options are mutually exclusive\n"); fprintf(stderr,"rdmarkerset: the --all-groups and --group=<group> options are mutually exclusive\n");
exit(256); exit(256);
} }
if((set_auto_trim<0)&&(set_auto_segue<0)&&(set_auto_trim>set_auto_segue)) {
fprintf(stderr,"rdmarkerset: segue cannot be placed after the end marker\n");
exit(256);
}
// //
// Check for Root Perms // Check for Root Perms
@@ -218,9 +232,23 @@ void MainObject::ProcessGroup(const QString &group_name)
q->value(1).toString(),q->value(2).toString()); q->value(1).toString(),q->value(2).toString());
} }
else { else {
ClearAutoTrim(RDCut::cartNumber(q->value(0).toString()), if(set_auto_trim==0) {
RDCut::cutNumber(q->value(0).toString()), ClearAutoTrim(RDCut::cartNumber(q->value(0).toString()),
q->value(1).toString(),q->value(2).toString()); RDCut::cutNumber(q->value(0).toString()),
q->value(1).toString(),q->value(2).toString());
}
}
if(set_auto_segue<0) {
SetAutoSegue(RDCut::cartNumber(q->value(0).toString()),
RDCut::cutNumber(q->value(0).toString()),
q->value(1).toString(),q->value(2).toString());
}
else {
if(set_auto_segue==0) {
ClearAutoSegue(RDCut::cartNumber(q->value(0).toString()),
RDCut::cutNumber(q->value(0).toString()),
q->value(1).toString(),q->value(2).toString());
}
} }
} }
delete q; delete q;
@@ -333,6 +361,55 @@ void MainObject::ClearAutoTrim(unsigned cartnum,int cutnum,const QString &title,
} }
void MainObject::SetAutoSegue(unsigned cartnum,int cutnum,const QString &title,
const QString &desc)
{
RDTrimAudio::ErrorCode err;
RDCart *cart=new RDCart(cartnum);
RDCut *cut=new RDCut(cartnum,cutnum);
RDTrimAudio *trimmer=new RDTrimAudio(set_station,set_config,this);
trimmer->setCartNumber(cartnum);
trimmer->setCutNumber(cutnum);
trimmer->setTrimLevel(100*set_auto_segue);
if((err=trimmer->runTrim(set_user->name(),set_user->password()))==
RDTrimAudio::ErrorOk) {
int end=trimmer->endPoint();
if(end<cut->endPoint()) {
cut->setSegueStartPoint(end);
cut->setSegueEndPoint(cut->endPoint());
Print(QString().sprintf(" setting segue-start for %06u / %03d [",
cartnum,cutnum)+title+" / "+desc+
QString().sprintf("] at %d dBFS",set_auto_segue));
}
else {
Print(QString().sprintf(" segue-start for %06u / %03d [",
cartnum,cutnum)+title+" / "+desc+
"] cannot be set beyond end marker");
}
}
else {
if(err!=RDTrimAudio::ErrorNoAudio) {
fprintf(stderr,"rdmarkerset: cart %06u, cut %d trimmer error [%s]\n",
cartnum,cutnum,(const char *)RDTrimAudio::errorText(err));
exit(256);
}
}
delete trimmer;
delete cut;
delete cart;
}
void MainObject::ClearAutoSegue(unsigned cartnum,int cutnum,
const QString &title,const QString &desc)
{
RDCut *cut=new RDCut(cartnum,cutnum);
cut->setSegueStartPoint(-1);
cut->setSegueEndPoint(-1);
delete cut;
}
void MainObject::Print(const QString &msg) void MainObject::Print(const QString &msg)
{ {
if(set_verbose) { if(set_verbose) {

View File

@@ -37,7 +37,7 @@
#include <rdcmd_switch.h> #include <rdcmd_switch.h>
#include <rdstation.h> #include <rdstation.h>
#define RDMARKERSET_USAGE "[options]\nThe following options are recognized:\n\n--group=<group>\n Apply marker changes to the group specified by <group>. This\n option may be given multiple times.\n\n--all-groups\n Apply marker changes to ALL groups.\n\n--auto-trim=<level>\n Auto-trim the specified cuts to the level indicated by <level> dBFS.\n Specifying a '0' for <level> will remove auto-trim --i.e. move the\n Start and End markers to the extreme start and end of the audio data.\n\n--verbose\n Print messages to stdout describing progress.\n\n" #define RDMARKERSET_USAGE "[options]\nThe following options are recognized:\n\n--group=<group>\n Apply marker changes to the group specified by <group>. This\n option may be given multiple times.\n\n--all-groups\n Apply marker changes to ALL groups.\n\n--auto-trim=<level>\n Auto-trim the specified cuts to the level indicated by <level> dBFS.\n Specifying a '0' for <level> will remove auto-trim --i.e. move the\n Start and End markers to the extreme start and end of the audio data.\n Default action is to leave the Start and End markers unaltered.\n\n--auto-segue=<level>\n Set the Segue Start marker on the specified cuts to the level indicated\n by <level> dBFS and the Segue End marker to the position of the End\n marker. Specifying a '0' for <level> will remove the segue markers.\n Default action is to leave the segue markers unaltered.\n\n--verbose\n Print messages to stdout describing progress.\n\n"
class MainObject : public QObject class MainObject : public QObject
{ {
@@ -54,10 +54,15 @@ class MainObject : public QObject
const QString &desc); const QString &desc);
void ClearAutoTrim(unsigned cartnum,int cutnum,const QString &title, void ClearAutoTrim(unsigned cartnum,int cutnum,const QString &title,
const QString &desc); const QString &desc);
void SetAutoSegue(unsigned cartnum,int cutnum,const QString &title,
const QString &desc);
void ClearAutoSegue(unsigned cartnum,int cutnum,const QString &title,
const QString &desc);
void Print(const QString &msg); void Print(const QString &msg);
bool set_all_groups; bool set_all_groups;
std::vector<QString> set_group_names; std::vector<QString> set_group_names;
int set_auto_trim; int set_auto_trim;
int set_auto_segue;
bool set_verbose; bool set_verbose;
RDStation *set_station; RDStation *set_station;
RDRipc *set_ripc; RDRipc *set_ripc;