|
|
|
@ -23,52 +23,27 @@ |
|
|
|
|
#include "board/UBBoardController.h" |
|
|
|
|
#include "frameworks/UBFileSystemUtils.h" |
|
|
|
|
|
|
|
|
|
class UBAudioPresentationWidget : public QWidget |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
int mBorderSize; |
|
|
|
|
int mTitleSize; |
|
|
|
|
QString mTitle; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class UBGraphicsMediaItem : public UBGraphicsProxyWidget |
|
|
|
|
{ |
|
|
|
|
Q_OBJECT |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
class UBAudioPresentationWidget : public QWidget |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
|
UBAudioPresentationWidget(QWidget *parent = NULL) |
|
|
|
|
:QWidget(parent) |
|
|
|
|
, mBorderSize(10) |
|
|
|
|
, mTitleSize(10) |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int mBorderSize; |
|
|
|
|
int mTitleSize; |
|
|
|
|
QString mTitle; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
typedef enum{ |
|
|
|
|
mediaType_Video, |
|
|
|
@ -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())); |
|
|
|
|