mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-08 17:37:09 +01: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
|
* Added a 'saveas' command to rdclilogedit(1) in
|
||||||
'utils/rdclilogedit/rdclilogedit.cpp' and
|
'utils/rdclilogedit/rdclilogedit.cpp' and
|
||||||
'utils/rdclilogedit/rdclilogedit.h'.
|
'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 {
|
else {
|
||||||
QString verb=cmds[1].lower();
|
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")) {
|
if((verb=="bye")||(verb=="exit")||(verb=="quit")) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" %s\n",(const char *)cmds[1]);
|
printf(" %s\n",(const char *)cmds[1]);
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ MainObject::MainObject(QObject *parent)
|
|||||||
exit(256);
|
exit(256);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// RDAirPlay Configuration
|
||||||
|
//
|
||||||
|
edit_airplay_conf=new RDAirPlayConf(edit_config->stationName(),"RDAIRPLAY");
|
||||||
|
|
||||||
//
|
//
|
||||||
// RIPC Connection
|
// RIPC Connection
|
||||||
//
|
//
|
||||||
@@ -137,6 +142,25 @@ void MainObject::inputActivatedData(int sock)
|
|||||||
|
|
||||||
void MainObject::Addcart(int line,unsigned cartnum)
|
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;
|
int line;
|
||||||
bool ok=false;
|
bool ok=false;
|
||||||
|
|
||||||
if(verb=="setcart") {
|
if(verb=="addcart") {
|
||||||
if(cmds.size()==3) {
|
if(cmds.size()==3) {
|
||||||
line=cmds[1].toInt(&ok);
|
line=cmds[1].toInt(&ok);
|
||||||
if(ok&&(line>=0)) {
|
if(ok&&(line>=0)) {
|
||||||
unsigned cartnum=cmds[2].toUInt(&ok);
|
unsigned cartnum=cmds[2].toUInt(&ok);
|
||||||
if(ok&&(cartnum<=RD_MAX_CART_NUMBER)) {
|
if(ok&&(cartnum<=RD_MAX_CART_NUMBER)) {
|
||||||
Setcart(line,cartnum);
|
Addcart(line,cartnum);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr,"addcart: invalid cart number\n");
|
fprintf(stderr,"addcart: invalid cart number\n");
|
||||||
@@ -365,6 +389,28 @@ void MainObject::DispatchCommand(const QString &cmd)
|
|||||||
processed=true;
|
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") {
|
if(verb=="unload") {
|
||||||
Unload();
|
Unload();
|
||||||
processed=true;
|
processed=true;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
#include <qsocketnotifier.h>
|
#include <qsocketnotifier.h>
|
||||||
|
|
||||||
|
#include <rdairplay_conf.h>
|
||||||
#include <rdconfig.h>
|
#include <rdconfig.h>
|
||||||
#include <rdcut.h>
|
#include <rdcut.h>
|
||||||
#include <rddb.h>
|
#include <rddb.h>
|
||||||
@@ -63,6 +64,7 @@ class MainObject : public QObject
|
|||||||
RDLogEvent *edit_log_event;
|
RDLogEvent *edit_log_event;
|
||||||
RDUser *edit_user;
|
RDUser *edit_user;
|
||||||
RDRipc *edit_ripc;
|
RDRipc *edit_ripc;
|
||||||
|
RDAirPlayConf *edit_airplay_conf;
|
||||||
RDConfig *edit_config;
|
RDConfig *edit_config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user