2018-03-21 Fred Gleason <fredg@paravelsystems.com>

* Added support for cart notifications to the RDXport service.
	* Added support for notifications to rdimport(1).
This commit is contained in:
Fred Gleason
2018-03-21 15:54:50 -04:00
parent e3fb53d0cf
commit 471c6498fd
13 changed files with 96 additions and 3 deletions

View File

@@ -1339,6 +1339,12 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
cut->setFadeupPoint(import_fadeup_marker->fadeValue(lo,hi));
}
cart->updateLength();
if(cart_created) {
SendNotification(RDNotification::AddAction,cart->number());
}
else {
SendNotification(RDNotification::ModifyAction,cart->number());
}
delete settings;
delete conv;
delete cut;
@@ -2018,6 +2024,17 @@ void MainObject::ReadXmlFile(const QString &basename,RDWaveData *wavedata) const
}
void MainObject::SendNotification(RDNotification::Action action,
unsigned cartnum)
{
RDNotification *notify=
new RDNotification(RDNotification::CartType,action,QVariant(cartnum));
rda->ripc()->sendNotification(*notify);
qApp->processEvents();
delete notify;
}
int main(int argc,char *argv[])
{
QApplication a(argc,argv,false);

View File

@@ -29,11 +29,12 @@
#include <qfileinfo.h>
#include <qdatetime.h>
#include <rdwavedata.h>
#include <rdwavefile.h>
#include <rdgroup.h>
#include <rdcart.h>
#include <rdcut.h>
#include <rdgroup.h>
#include <rdnotification.h>
#include <rdwavedata.h>
#include <rdwavefile.h>
#include "markerset.h"
@@ -73,6 +74,7 @@ class MainObject : public QObject
void WriteTimestampCache(const QString &filename,const QDateTime &dt);
bool SchedulerCodeExists(const QString &code) const;
void ReadXmlFile(const QString &basename,RDWaveData *wavedata) const;
void SendNotification(RDNotification::Action action,unsigned cartnum);
unsigned import_file_key;
RDGroup *import_group;
bool import_verbose;