mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 17:13:47 +02:00
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
* Added an 'addcart' command to rdclilogedit(1) in 'utils/rdclilogedit/rdclilogedit.cpp' and 'utils/rdclilogedit/rdclilogedit.h'.
This commit is contained in:
@@ -15318,3 +15318,7 @@
|
||||
* Added a 'saveas' command to rdclilogedit(1) in
|
||||
'utils/rdclilogedit/rdclilogedit.cpp' and
|
||||
'utils/rdclilogedit/rdclilogedit.h'.
|
||||
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an 'addcart' command to rdclilogedit(1) in
|
||||
'utils/rdclilogedit/rdclilogedit.cpp' and
|
||||
'utils/rdclilogedit/rdclilogedit.h'.
|
||||
|
@@ -36,6 +36,14 @@ void MainObject::Help(const QStringList &cmds) const
|
||||
}
|
||||
else {
|
||||
QString verb=cmds[1].lower();
|
||||
if(verb=="addcart") {
|
||||
printf("\n");
|
||||
printf(" addcart <line> <cart-num>\n");
|
||||
printf("\n");
|
||||
printf("Add a new cart event before line <line> using cart <cart-num>.\n");
|
||||
printf("\n");
|
||||
processed=true;
|
||||
}
|
||||
if((verb=="bye")||(verb=="exit")||(verb=="quit")) {
|
||||
printf("\n");
|
||||
printf(" %s\n",(const char *)cmds[1]);
|
||||
|
@@ -73,6 +73,11 @@ MainObject::MainObject(QObject *parent)
|
||||
exit(256);
|
||||
}
|
||||
|
||||
//
|
||||
// RDAirPlay Configuration
|
||||
//
|
||||
edit_airplay_conf=new RDAirPlayConf(edit_config->stationName(),"RDAIRPLAY");
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
//
|
||||
@@ -137,6 +142,25 @@ void MainObject::inputActivatedData(int sock)
|
||||
|
||||
void MainObject::Addcart(int line,unsigned cartnum)
|
||||
{
|
||||
if(edit_log_event==NULL) {
|
||||
fprintf(stderr,"addcart: no log loaded\n");
|
||||
return;
|
||||
}
|
||||
if(edit_user->addtoLog()) {
|
||||
if(line>edit_log_event->size()) {
|
||||
line=edit_log_event->size();
|
||||
}
|
||||
edit_log_event->insert(line,1);
|
||||
edit_log_event->logLine(line)->
|
||||
setTransType(edit_airplay_conf->defaultTransType());
|
||||
edit_log_event->logLine(line)->setFadeupGain(-3000);
|
||||
edit_log_event->logLine(line)->setFadedownGain(-3000);
|
||||
edit_log_event->logLine(line)->setCartNumber(cartnum);
|
||||
edit_log_event->refresh(line);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"addcart: insufficient privileges [Add Log Items]\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -296,13 +320,13 @@ void MainObject::DispatchCommand(const QString &cmd)
|
||||
int line;
|
||||
bool ok=false;
|
||||
|
||||
if(verb=="setcart") {
|
||||
if(verb=="addcart") {
|
||||
if(cmds.size()==3) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
if(ok&&(line>=0)) {
|
||||
unsigned cartnum=cmds[2].toUInt(&ok);
|
||||
if(ok&&(cartnum<=RD_MAX_CART_NUMBER)) {
|
||||
Setcart(line,cartnum);
|
||||
Addcart(line,cartnum);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"addcart: invalid cart number\n");
|
||||
@@ -365,6 +389,28 @@ void MainObject::DispatchCommand(const QString &cmd)
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="setcart") {
|
||||
if(cmds.size()==3) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
if(ok&&(line>=0)&&(line<edit_log_event->size())) {
|
||||
unsigned cartnum=cmds[2].toUInt(&ok);
|
||||
if(ok&&(cartnum<=RD_MAX_CART_NUMBER)) {
|
||||
Setcart(line,cartnum);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcart: invalid cart number\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcart: invalid line number\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"setcart: invalid command arguments\n");
|
||||
}
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="unload") {
|
||||
Unload();
|
||||
processed=true;
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include <qobject.h>
|
||||
#include <qsocketnotifier.h>
|
||||
|
||||
#include <rdairplay_conf.h>
|
||||
#include <rdconfig.h>
|
||||
#include <rdcut.h>
|
||||
#include <rddb.h>
|
||||
@@ -63,6 +64,7 @@ class MainObject : public QObject
|
||||
RDLogEvent *edit_log_event;
|
||||
RDUser *edit_user;
|
||||
RDRipc *edit_ripc;
|
||||
RDAirPlayConf *edit_airplay_conf;
|
||||
RDConfig *edit_config;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user