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

* Added support for cart notifications to Full Disc Ripper in
	rdlibrary(1).
This commit is contained in:
Fred Gleason 2018-03-21 17:01:08 -04:00
parent 471c6498fd
commit 3c94cae600
6 changed files with 26 additions and 17 deletions

View File

@ -16728,3 +16728,6 @@
2018-03-21 Fred Gleason <fredg@paravelsystems.com> 2018-03-21 Fred Gleason <fredg@paravelsystems.com>
* Added support for cart notifications to the RDXport service. * Added support for cart notifications to the RDXport service.
* Added support for notifications to rdimport(1). * Added support for notifications to rdimport(1).
2018-03-21 Fred Gleason <fredg@paravelsystems.com>
* Added support for cart notifications to Full Disc Ripper in
rdlibrary(1).

View File

@ -20,15 +20,6 @@
#include "rdnotification.h" #include "rdnotification.h"
RDNotification::RDNotification(RDNotification::Type type,
RDNotification::Action action,unsigned cartnum)
{
notify_type=type;
notify_action=action;
notify_id=QVariant(cartnum);
}
RDNotification::RDNotification(Type type,Action action,const QVariant &id) RDNotification::RDNotification(Type type,Action action,const QVariant &id)
{ {
notify_type=type; notify_type=type;

View File

@ -30,7 +30,6 @@ class RDNotification
enum Type {NullType=0,CartType=1,LastType=2}; enum Type {NullType=0,CartType=1,LastType=2};
enum Action {NoAction=0,AddAction=1,DeleteAction=2,ModifyAction=3, enum Action {NoAction=0,AddAction=1,DeleteAction=2,ModifyAction=3,
LastAction=4}; LastAction=4};
RDNotification(Type type,Action action,unsigned cartnum);
RDNotification(Type type,Action action,const QVariant &id); RDNotification(Type type,Action action,const QVariant &id);
RDNotification(); RDNotification();
Type type() const; Type type() const;

View File

@ -2,7 +2,7 @@
// //
// CD Ripper Dialog for Rivendell. // CD Ripper Dialog for Rivendell.
// //
// (C) Copyright 2002-2003,2010,2016-2017 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2003,2010,2016-2018 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -26,10 +26,12 @@
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <qcheckbox.h>
#include <qfiledialog.h> #include <qfiledialog.h>
#include <qmessagebox.h> #include <qmessagebox.h>
#include <qcheckbox.h> #include <qpushbutton.h>
#include <rd.h> #include <rd.h>
#include <rdapplication.h> #include <rdapplication.h>
@ -997,7 +999,7 @@ void DiskRipper::RipTrack(int track,int end_track,QString cutname,QString title)
// Create Cut // Create Cut
// //
RDCut::create(cutname); RDCut::create(cutname);
rip_done=false; rip_done=false;
rip_rip_aborted=false; rip_rip_aborted=false;
rip_track_number=track; rip_track_number=track;
@ -1067,6 +1069,7 @@ void DiskRipper::RipTrack(int track,int end_track,QString cutname,QString title)
cut->setDescription(rip_wave_datas[track-1]->title()); cut->setDescription(rip_wave_datas[track-1]->title());
cut->setIsrc(rip_cddb_record.isrc(rip_track_number-1)); cut->setIsrc(rip_cddb_record.isrc(rip_track_number-1));
cart->clearPending(); cart->clearPending();
SendNotification(RDNotification::AddAction,cart->number());
break; break;
default: default:
@ -1143,3 +1146,14 @@ QString DiskRipper::BuildTrackName(int start_track,int end_track) const
} }
return ret; return ret;
} }
void DiskRipper::SendNotification(RDNotification::Action action,
unsigned cartnum)
{
RDNotification *notify=
new RDNotification(RDNotification::CartType,action,QVariant(cartnum));
rda->ripc()->sendNotification(*notify);
qApp->processEvents();
delete notify;
}

View File

@ -37,11 +37,12 @@
#include <qcheckbox.h> #include <qcheckbox.h>
#include <qtextedit.h> #include <qtextedit.h>
#include <rdlistviewitem.h>
#include <rdtransportbutton.h>
#include <rdcdplayer.h> #include <rdcdplayer.h>
#include <rdcddbrecord.h> #include <rdcddbrecord.h>
#include <rdcddblookup.h> #include <rdcddblookup.h>
#include <rdlistviewitem.h>
#include <rdnotification.h>
#include <rdtransportbutton.h>
#include <rdwavedata_dialog.h> #include <rdwavedata_dialog.h>
#include <rdlibrary_conf.h> #include <rdlibrary_conf.h>
@ -87,6 +88,7 @@ class DiskRipper : public QDialog
void RipTrack(int track,int end_track,QString cutname,QString title); void RipTrack(int track,int end_track,QString cutname,QString title);
void UpdateRipButton(); void UpdateRipButton();
QString BuildTrackName(int start_track,int end_track) const; QString BuildTrackName(int start_track,int end_track) const;
void SendNotification(RDNotification::Action action,unsigned cartnum);
RDCdPlayer *rip_cdrom; RDCdPlayer *rip_cdrom;
RDCddbRecord rip_cddb_record; RDCddbRecord rip_cddb_record;
RDCddbLookup *rip_cddb_lookup; RDCddbLookup *rip_cddb_lookup;

View File

@ -1500,7 +1500,7 @@ void MainWidget::SendNotification(RDNotification::Action action,
unsigned cartnum) unsigned cartnum)
{ {
RDNotification *notify= RDNotification *notify=
new RDNotification(RDNotification::CartType,action,cartnum); new RDNotification(RDNotification::CartType,action,QVariant(cartnum));
rda->ripc()->sendNotification(*notify); rda->ripc()->sendNotification(*notify);
delete notify; delete notify;
} }