|
|
|
@ -23,51 +23,26 @@ |
|
|
|
|
#include "board/UBBoardController.h" |
|
|
|
|
#include "frameworks/UBFileSystemUtils.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UBGraphicsMediaItem : public UBGraphicsProxyWidget |
|
|
|
|
class UBAudioPresentationWidget : public QWidget |
|
|
|
|
{ |
|
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
class UBAudioPresentationWidget : public QWidget |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
UBAudioPresentationWidget(QWidget *parent = NULL) |
|
|
|
|
:QWidget(parent) |
|
|
|
|
, mBorderSize(10) |
|
|
|
|
, mTitleSize(10) |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
int borderSize() |
|
|
|
|
{ |
|
|
|
|
return mBorderSize; |
|
|
|
|
} |
|
|
|
|
UBAudioPresentationWidget(QWidget *parent = NULL); |
|
|
|
|
|
|
|
|
|
int borderSize() {return mBorderSize;} |
|
|
|
|
void setTitle(QString title = QString()){mTitle = title;} |
|
|
|
|
QString getTitle(){return mTitle;} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
virtual void paintEvent(QPaintEvent *event) |
|
|
|
|
{ |
|
|
|
|
QPainter painter(this); |
|
|
|
|
painter.fillRect(rect(), QBrush(Qt::black)); |
|
|
|
|
|
|
|
|
|
if (QString() != mTitle) |
|
|
|
|
{ |
|
|
|
|
painter.setPen(QPen(Qt::white));
|
|
|
|
|
QRect titleRect = rect(); |
|
|
|
|
titleRect.setX(mBorderSize); |
|
|
|
|
titleRect.setY(2); |
|
|
|
|
titleRect.setHeight(15); |
|
|
|
|
painter.drawText(titleRect, mTitle); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QWidget::paintEvent(event); |
|
|
|
|
} |
|
|
|
|
private: |
|
|
|
|
virtual void paintEvent(QPaintEvent *event); |
|
|
|
|
|
|
|
|
|
int mBorderSize; |
|
|
|
|
int mTitleSize; |
|
|
|
|
QString mTitle; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class UBGraphicsMediaItem : public UBGraphicsProxyWidget |
|
|
|
|
{ |
|
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
typedef enum{ |
|
|
|
@ -122,7 +97,7 @@ public: |
|
|
|
|
|
|
|
|
|
virtual void setSourceUrl(const QUrl &pSourceUrl) |
|
|
|
|
{ |
|
|
|
|
UBGraphicsMediaItem::UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBGraphicsMediaItem::UBAudioPresentationWidget*>(mAudioWidget); |
|
|
|
|
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget); |
|
|
|
|
if (pAudioWidget) |
|
|
|
|
{ |
|
|
|
|
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile())); |
|
|
|
|