|
|
@ -35,6 +35,7 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name) |
|
|
|
mSeekerLayout.addWidget(mpPlayStopButton, 0); |
|
|
|
mSeekerLayout.addWidget(mpPlayStopButton, 0); |
|
|
|
mSeekerLayout.addWidget(mpPauseButton, 0); |
|
|
|
mSeekerLayout.addWidget(mpPauseButton, 0); |
|
|
|
mSeekerLayout.addWidget(mpSlider, 1); |
|
|
|
mSeekerLayout.addWidget(mpSlider, 1); |
|
|
|
|
|
|
|
mSeekerLayout.setContentsMargins(0, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
connect(mpPlayStopButton, SIGNAL(clicked()), this, SLOT(onPlayStopClicked())); |
|
|
|
connect(mpPlayStopButton, SIGNAL(clicked()), this, SLOT(onPlayStopClicked())); |
|
|
|
connect(mpPauseButton, SIGNAL(clicked()), this, SLOT(onPauseClicked())); |
|
|
|
connect(mpPauseButton, SIGNAL(clicked()), this, SLOT(onPauseClicked())); |
|
|
@ -74,9 +75,9 @@ void UBMediaWidget::createMediaPlayer() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(eMediaType_Video == mType){ |
|
|
|
if(eMediaType_Video == mType){ |
|
|
|
mpVideoWidget = new Phonon::VideoWidget(this); |
|
|
|
mpVideoWidget = new Phonon::VideoWidget(this); |
|
|
|
mpVideoWidget->setStyleSheet(QString("margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;")); |
|
|
|
|
|
|
|
mpVideoContainer = new QWidget(this); |
|
|
|
mpVideoContainer = new QWidget(this); |
|
|
|
mpVideoContainer->setObjectName("UBMediaVideoContainer"); |
|
|
|
mpVideoContainer->setObjectName("UBMediaVideoContainer"); |
|
|
|
|
|
|
|
mVideoLayout.setContentsMargins(10, 10, 25, 10); |
|
|
|
mpVideoContainer->setLayout(&mVideoLayout); |
|
|
|
mpVideoContainer->setLayout(&mVideoLayout); |
|
|
|
mVideoLayout.addWidget(mpVideoWidget, 1); |
|
|
|
mVideoLayout.addWidget(mpVideoWidget, 1); |
|
|
|
Phonon::createPath(mpMediaObject, mpVideoWidget); |
|
|
|
Phonon::createPath(mpMediaObject, mpVideoWidget); |
|
|
@ -93,13 +94,13 @@ void UBMediaWidget::createMediaPlayer() |
|
|
|
|
|
|
|
|
|
|
|
void UBMediaWidget::adaptSizeToVideo() |
|
|
|
void UBMediaWidget::adaptSizeToVideo() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpVideoWidget){ |
|
|
|
if(NULL != mpVideoContainer){ |
|
|
|
int origW = mpVideoWidget->width(); |
|
|
|
int origW = mpVideoContainer->width(); |
|
|
|
int origH = mpVideoWidget->height(); |
|
|
|
int origH = mpVideoContainer->height(); |
|
|
|
int newW = width(); |
|
|
|
int newW = width(); |
|
|
|
float scaleFactor = (float)origW/(float)newW; |
|
|
|
float scaleFactor = (float)origW/(float)newW; |
|
|
|
int newH = origH/scaleFactor; |
|
|
|
int newH = origH/scaleFactor; |
|
|
|
resize(width(), height() + newH); |
|
|
|
resize(newW, height() + newH); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -185,7 +186,7 @@ UBMediaButton::UBMediaButton(QWidget *parent, const char *name):QLabel(parent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
resize(UBMEDIABUTTON_SIZE, UBMEDIABUTTON_SIZE); |
|
|
|
resize(UBMEDIABUTTON_SIZE, UBMEDIABUTTON_SIZE); |
|
|
|
setStyleSheet(QString("padding:0px 0px 0px 0px;")); |
|
|
|
setStyleSheet(QString("padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBMediaButton::~UBMediaButton() |
|
|
|
UBMediaButton::~UBMediaButton() |
|
|
|