mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-29 15:12:34 +02:00
2021-02-09 Fred Gleason <fredg@paravelsystems.com>
* Removed 'RD3CartDrag' dependency from rdairplay(1). * Removed 'RD3CartDrag' dependency from rdcartslots(1). * Removed 'RD3CartDrag' dependency from rdlogedit(1). * Removed 'RD3CartDrag' dependency from rdpanel(1). * Removed 'RD3CartDrag'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
26352326f0
commit
17ed26f066
@ -21071,3 +21071,9 @@
|
||||
* Removed 'RD3EmptyCart' dependency from rdlogmanager(1).
|
||||
* Removed 'RD3EmptyCart' dependency from rdpanel(1).
|
||||
* Removed the 'RD3EmptyCart' widget.
|
||||
2021-02-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed 'RD3CartDrag' dependency from rdairplay(1).
|
||||
* Removed 'RD3CartDrag' dependency from rdcartslots(1).
|
||||
* Removed 'RD3CartDrag' dependency from rdlogedit(1).
|
||||
* Removed 'RD3CartDrag' dependency from rdpanel(1).
|
||||
* Removed 'RD3CartDrag'.
|
||||
|
@ -59,7 +59,6 @@ dist_librd_la_SOURCES = dbversion.h\
|
||||
export_technical.cpp\
|
||||
export_textlog.cpp\
|
||||
rd.h\
|
||||
rd3cartdrag.cpp rd3cartdrag.h\
|
||||
rdadd_cart.cpp rdadd_cart.h\
|
||||
rdadd_log.cpp rdadd_log.h\
|
||||
rdairplay_conf.cpp rdairplay_conf.h\
|
||||
|
@ -38,7 +38,6 @@ SOURCES += export_soundex.cpp
|
||||
SOURCES += export_technical.cpp
|
||||
SOURCES += export_textlog.cpp
|
||||
SOURCES += html_gpl2.cpp
|
||||
SOURCES += rd3cartdrag.cpp
|
||||
SOURCES += rdadd_log.cpp
|
||||
SOURCES += rdadd_cart.cpp
|
||||
SOURCES += rdairplay_conf.cpp
|
||||
@ -214,7 +213,6 @@ SOURCES += schedruleslist.cpp
|
||||
HEADERS += schedcartlist.h
|
||||
HEADERS += schedruleslist.h
|
||||
HEADERS += rd.h
|
||||
HEADERS += rd3cartdrag.h
|
||||
HEADERS += rdadd_cart.h
|
||||
HEADERS += rdadd_log.h
|
||||
HEADERS += rdairplay_conf.h
|
||||
|
@ -1,139 +0,0 @@
|
||||
// rd3cartdrag.cpp
|
||||
//
|
||||
// Stored value drag object for Rivendell carts.
|
||||
//
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <qstringlist.h>
|
||||
|
||||
#include "rd.h"
|
||||
#include "rd3cartdrag.h"
|
||||
#include "rdcart.h"
|
||||
#include "rdprofile.h"
|
||||
|
||||
//
|
||||
// Icons
|
||||
//
|
||||
#include "../icons/play.xpm"
|
||||
#include "../icons/rml5.xpm"
|
||||
#include "../icons/trashcan-32x32.xpm"
|
||||
#include "../icons/trashcan-16x16.xpm"
|
||||
|
||||
RD3CartDrag::RD3CartDrag(unsigned cartnum,const QPixmap *icon,const QColor &color,
|
||||
QWidget *src)
|
||||
: Q3StoredDrag(RDMIMETYPE_CART,src)
|
||||
{
|
||||
SetData(cartnum,color,QString());
|
||||
if(icon==NULL) {
|
||||
RDCart *cart=new RDCart(cartnum);
|
||||
switch(cart->type()) {
|
||||
case RDCart::Audio:
|
||||
setPixmap(QPixmap(play_xpm));
|
||||
break;
|
||||
|
||||
case RDCart::Macro:
|
||||
setPixmap(QPixmap(rml5_xpm));
|
||||
break;
|
||||
|
||||
case RDCart::All:
|
||||
break;
|
||||
}
|
||||
delete cart;
|
||||
}
|
||||
else {
|
||||
setPixmap(*icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RD3CartDrag::RD3CartDrag(unsigned cartnum,const QString &title,
|
||||
const QColor &color,QWidget *src)
|
||||
: Q3StoredDrag(RDMIMETYPE_CART,src)
|
||||
{
|
||||
SetData(cartnum,color,title);
|
||||
if(cartnum==0) {
|
||||
setPixmap(QPixmap(trashcan_32x32_xpm));
|
||||
}
|
||||
else {
|
||||
RDCart *cart=new RDCart(cartnum);
|
||||
switch(cart->type()) {
|
||||
case RDCart::Audio:
|
||||
setPixmap(QPixmap(play_xpm));
|
||||
break;
|
||||
|
||||
case RDCart::Macro:
|
||||
setPixmap(QPixmap(rml5_xpm));
|
||||
break;
|
||||
|
||||
case RDCart::All:
|
||||
break;
|
||||
}
|
||||
delete cart;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool RD3CartDrag::canDecode(QMimeSource *e)
|
||||
{
|
||||
return e->provides(RDMIMETYPE_CART);
|
||||
}
|
||||
|
||||
|
||||
bool RD3CartDrag::decode(QMimeSource *e,unsigned *cartnum,QColor *color,
|
||||
QString *title)
|
||||
{
|
||||
RDProfile *p=new RDProfile();
|
||||
p->setSourceString(QString::fromUtf8(e->encodedData(RDMIMETYPE_CART)));
|
||||
*cartnum=p->intValue("Rivendell-Cart","Number");
|
||||
if(color!=NULL) {
|
||||
color->setNamedColor(p->stringValue("Rivendell-Cart","Color"));
|
||||
}
|
||||
if(title!=NULL) {
|
||||
*title=p->stringValue("Rivendell-Cart","ButtonText");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool RD3CartDrag::decode(QMimeSource *e,RDLogLine *ll,
|
||||
RDLogLine::TransType next_trans,int log_mach,
|
||||
bool timescale,RDLogLine::TransType trans)
|
||||
{
|
||||
unsigned cartnum;
|
||||
|
||||
RD3CartDrag::decode(e,&cartnum);
|
||||
ll->loadCart(cartnum,next_trans,log_mach,timescale,trans);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void RD3CartDrag::SetData(unsigned cartnum,const QColor &color,const QString &title)
|
||||
{
|
||||
QString str="[Rivendell-Cart]\n";
|
||||
str+="Number="+QString().sprintf("%06u",cartnum)+"\n";
|
||||
if(color.isValid()) {
|
||||
str+="Color="+color.name()+"\n";
|
||||
}
|
||||
if(!title.isEmpty()) {
|
||||
str+="ButtonText="+title+"\n";
|
||||
}
|
||||
setEncodedData(str.toUtf8());
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
// rd3cartdrag.h
|
||||
//
|
||||
// Stored value drag object for Rivendell carts.
|
||||
//
|
||||
// (C) Copyright 2013-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef RD3CARTDRAG_H
|
||||
#define RD3CARTDRAG_H
|
||||
|
||||
#include <qcolor.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#include <q3dragobject.h>
|
||||
|
||||
#include <rdcart.h>
|
||||
#include <rdlog_line.h>
|
||||
|
||||
class RD3CartDrag : public Q3StoredDrag
|
||||
{
|
||||
public:
|
||||
RD3CartDrag(unsigned cartnum,const QPixmap *icon,const QColor &color,
|
||||
QWidget *src=0);
|
||||
RD3CartDrag(unsigned cartnum,const QString &title,const QColor &color,
|
||||
QWidget *src=0);
|
||||
static bool canDecode(QMimeSource *e);
|
||||
static bool decode(QMimeSource *e,unsigned *cartnum,QColor *color=NULL,
|
||||
QString *title=NULL);
|
||||
static bool decode(QMimeSource *e,RDLogLine *ll,
|
||||
RDLogLine::TransType next_trans=RDLogLine::Segue,
|
||||
int log_mach=0,bool timescale=false,
|
||||
RDLogLine::TransType trans=RDLogLine::NoTrans);
|
||||
|
||||
private:
|
||||
void SetData(unsigned cartnum,const QColor &color,const QString &title);
|
||||
};
|
||||
|
||||
|
||||
#endif // RD3CARTDRAG_H
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include <qpainter.h>
|
||||
|
||||
#include <rd3cartdrag.h>
|
||||
#include <rdcartdrag.h>
|
||||
#include <rdconf.h>
|
||||
|
||||
#include "rdpanel_button.h"
|
||||
@ -366,10 +366,23 @@ void RDPanelButton::mouseMoveEvent(QMouseEvent *e)
|
||||
button_move_count--;
|
||||
if(button_move_count==0) {
|
||||
QPushButton::mouseReleaseEvent(e);
|
||||
if(button_allow_drags) {
|
||||
RD3CartDrag *d=new RD3CartDrag(button_cart,button_text,button_color,this);
|
||||
d->dragCopy();
|
||||
QDrag *drag=new QDrag(this);
|
||||
RDCartDrag *cd=new RDCartDrag(button_cart,button_text,button_color);
|
||||
drag->setMimeData(cd);
|
||||
RDCart *cart=new RDCart(button_cart);
|
||||
switch(cart->type()) {
|
||||
case RDCart::Audio:
|
||||
drag->setPixmap(rda->iconEngine()->typeIcon(RDLogLine::Cart));
|
||||
break;
|
||||
|
||||
case RDCart::Macro:
|
||||
drag->setPixmap(rda->iconEngine()->typeIcon(RDLogLine::Macro));
|
||||
break;
|
||||
|
||||
case RDCart::All:
|
||||
break;
|
||||
}
|
||||
drag->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@ -383,7 +396,7 @@ void RDPanelButton::mouseReleaseEvent(QMouseEvent *e)
|
||||
|
||||
void RDPanelButton::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e)&&button_allow_drags&&
|
||||
e->accept(RDCartDrag::canDecode(e)&&button_allow_drags&&
|
||||
((button_play_deck==NULL)||(button_play_deck->state()==RDPlayDeck::Stopped)));
|
||||
}
|
||||
|
||||
@ -394,7 +407,7 @@ void RDPanelButton::dropEvent(QDropEvent *e)
|
||||
QColor color;
|
||||
QString title;
|
||||
|
||||
if(RD3CartDrag::decode(e,&cartnum,&color,&title)) {
|
||||
if(RDCartDrag::decode(e,&cartnum,&color,&title)) {
|
||||
emit cartDropped(button_row,button_col,cartnum,color,title);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// The SoundPanel Button for RDAirPlay.
|
||||
//
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -122,4 +122,4 @@ class RDPanelButton : public RDPushButton
|
||||
int button_move_count;
|
||||
bool button_allow_drags;
|
||||
};
|
||||
#endif
|
||||
#endif // RDPANEL_BUTTON_H
|
||||
|
@ -18,6 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include "rdcartdrag.h"
|
||||
#include "rdconf.h"
|
||||
#include "rdslotbox.h"
|
||||
|
||||
@ -497,11 +498,14 @@ void RDSlotBox::mousePressEvent(QMouseEvent *e)
|
||||
|
||||
if((line_logline!=NULL)&&(line_mode==RDSlotOptions::CartDeckMode)&&
|
||||
line_allow_drags) {
|
||||
RD3CartDrag *d=new RD3CartDrag(line_logline->cartNumber(),
|
||||
line_icon_label->pixmap(),
|
||||
line_group_label->palette().
|
||||
color(QColorGroup::Foreground),this);
|
||||
d->dragCopy();
|
||||
QDrag *drag=new QDrag(this);
|
||||
RDCartDrag *cd=
|
||||
new RDCartDrag(line_logline->cartNumber(),line_logline->title(),
|
||||
line_group_label->
|
||||
palette().color(QColorGroup::Foreground));
|
||||
drag->setMimeData(cd);
|
||||
drag->setPixmap(*line_icon_label->pixmap());
|
||||
drag->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@ -526,7 +530,7 @@ void RDSlotBox::paintEvent(QPaintEvent *e)
|
||||
|
||||
void RDSlotBox::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e)&&
|
||||
e->accept(RDCartDrag::canDecode(e)&&
|
||||
(line_mode==RDSlotOptions::CartDeckMode)&&
|
||||
(line_deck->state()==RDPlayDeck::Stopped));
|
||||
}
|
||||
@ -536,7 +540,7 @@ void RDSlotBox::dropEvent(QDropEvent *e)
|
||||
{
|
||||
unsigned cartnum;
|
||||
|
||||
if(RD3CartDrag::decode(e,&cartnum)) {
|
||||
if(RDCartDrag::decode(e,&cartnum)) {
|
||||
emit cartDropped(cartnum);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Cart slot label widget for RDCartSlot
|
||||
//
|
||||
// (C) Copyright 2012-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2012-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// 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
|
||||
@ -31,7 +31,6 @@
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <rdairplay_conf.h>
|
||||
#include <rd3cartdrag.h>
|
||||
#include <rdlog_line.h>
|
||||
#include <rdplaymeter.h>
|
||||
#include <rdplay_deck.h>
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
#include <rdcartdrag.h>
|
||||
#include <rdconf.h>
|
||||
|
||||
#include "colors.h"
|
||||
@ -793,11 +794,14 @@ void LogLineBox::mouseMoveEvent(QMouseEvent *e)
|
||||
line_move_count--;
|
||||
if(line_move_count==0) {
|
||||
if(line_allow_drags&&(line_logline!=NULL)) {
|
||||
RD3CartDrag *d=
|
||||
new RD3CartDrag(line_logline->cartNumber(),line_icon_label->pixmap(),
|
||||
line_group_label->palette().
|
||||
color(QColorGroup::Foreground),this);
|
||||
d->dragCopy();
|
||||
QDrag *drag=new QDrag(this);
|
||||
RDCartDrag *cd=new RDCartDrag(line_logline->cartNumber(),
|
||||
line_logline->title(),
|
||||
line_group_label->palette().
|
||||
color(QColorGroup::Foreground));
|
||||
drag->setMimeData(cd);
|
||||
drag->setPixmap(*(line_icon_label->pixmap()));
|
||||
drag->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -834,7 +838,7 @@ void LogLineBox::paintEvent(QPaintEvent *e)
|
||||
|
||||
void LogLineBox::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e)&&
|
||||
e->accept(RDCartDrag::canDecode(e)&&
|
||||
((line_status==RDLogLine::Scheduled)||
|
||||
(line_status==RDLogLine::Paused)));
|
||||
}
|
||||
@ -844,7 +848,7 @@ void LogLineBox::dropEvent(QDropEvent *e)
|
||||
{
|
||||
RDLogLine ll;
|
||||
|
||||
if(RD3CartDrag::decode(e,&ll)) {
|
||||
if(RDCartDrag::decode(e,&ll)) {
|
||||
emit cartDropped(log_line,&ll);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <qprogressbar.h>
|
||||
|
||||
#include <rdairplay_conf.h>
|
||||
#include <rd3cartdrag.h>
|
||||
#include <rdlog_line.h>
|
||||
#include <rdwidget.h>
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include <rd3cartdrag.h>
|
||||
#include <rdcartdrag.h>
|
||||
#include <rdlogplay.h>
|
||||
|
||||
#include "logtableview.h"
|
||||
@ -33,13 +33,13 @@ LogTableView::LogTableView(QWidget *parent)
|
||||
|
||||
void LogTableView::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e));
|
||||
e->accept(RDCartDrag::canDecode(e));
|
||||
}
|
||||
|
||||
|
||||
void LogTableView::dragMoveEvent(QDragMoveEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e));
|
||||
e->accept(RDCartDrag::canDecode(e));
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ void LogTableView::dropEvent(QDropEvent *e)
|
||||
int line=-1;
|
||||
int y_pos=e->pos().y();
|
||||
|
||||
if(RD3CartDrag::decode(e,&ll)) {
|
||||
if(RDCartDrag::decode(e,&ll)) {
|
||||
line=rowAt(y_pos);
|
||||
emit cartDropped(line,&ll);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#include <rd3cartdrag.h>
|
||||
#include <rdcartdrag.h>
|
||||
|
||||
#include "logtableview.h"
|
||||
#include "logmodel.h"
|
||||
@ -52,13 +52,13 @@ LogTableView::LogTableView(QWidget *parent)
|
||||
|
||||
void LogTableView::dragEnterEvent(QDragEnterEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e));
|
||||
e->accept(RDCartDrag::canDecode(e));
|
||||
}
|
||||
|
||||
|
||||
void LogTableView::dragMoveEvent(QDragMoveEvent *e)
|
||||
{
|
||||
e->accept(RD3CartDrag::canDecode(e));
|
||||
e->accept(RDCartDrag::canDecode(e));
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ void LogTableView::dropEvent(QDropEvent *e)
|
||||
int line=-1;
|
||||
int y_pos=e->pos().y();
|
||||
|
||||
if(RD3CartDrag::decode(e,&ll)) {
|
||||
if(RDCartDrag::decode(e,&ll)) {
|
||||
line=rowAt(y_pos);
|
||||
emit cartDropped(line,&ll);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user