|
|
@ -66,8 +66,8 @@ MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
delete ui;
|
|
|
|
|
|
|
|
|
|
|
|
if (moveResizeTimer)
|
|
|
|
//if (moveResizeTimer)
|
|
|
|
delete moveResizeTimer;
|
|
|
|
// delete moveResizeTimer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::closeEvent(QCloseEvent *event)
|
|
|
|
void MainWindow::closeEvent(QCloseEvent *event)
|
|
|
@ -86,50 +86,50 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::resizeEvent(QResizeEvent *)
|
|
|
|
void MainWindow::resizeEvent(QResizeEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (vcrFlag != VCR_PLAY)
|
|
|
|
//if (vcrFlag != VCR_PLAY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QRect rect;
|
|
|
|
QRect rect;
|
|
|
|
|
|
|
|
|
|
|
|
getVdoGeometry(&rect);
|
|
|
|
getVdoGeometry(&rect);
|
|
|
|
interface->sendGeometry(rect);
|
|
|
|
interface->sendGeometry(rect);
|
|
|
|
return;
|
|
|
|
//return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface->setVcrOp(VCR_PAUSE);
|
|
|
|
//interface->setVcrOp(VCR_PAUSE);
|
|
|
|
vcrFlag = VCR_PAUSE;
|
|
|
|
//vcrFlag = VCR_PAUSE;
|
|
|
|
|
|
|
|
|
|
|
|
if (!moveResizeTimer)
|
|
|
|
//if (!moveResizeTimer)
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
moveResizeTimer = new QTimer;
|
|
|
|
// moveResizeTimer = new QTimer;
|
|
|
|
connect(moveResizeTimer, SIGNAL(timeout()),
|
|
|
|
// connect(moveResizeTimer, SIGNAL(timeout()),
|
|
|
|
this, SLOT(onMoveCompleted()));
|
|
|
|
// this, SLOT(onMoveCompleted()));
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }");
|
|
|
|
//lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }");
|
|
|
|
moveResizeTimer->start(1000);
|
|
|
|
//moveResizeTimer->start(1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::moveEvent(QMoveEvent *)
|
|
|
|
void MainWindow::moveEvent(QMoveEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (vcrFlag != VCR_PLAY)
|
|
|
|
//if (vcrFlag != VCR_PLAY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QRect rect;
|
|
|
|
QRect rect;
|
|
|
|
|
|
|
|
|
|
|
|
getVdoGeometry(&rect);
|
|
|
|
getVdoGeometry(&rect);
|
|
|
|
interface->sendGeometry(rect);
|
|
|
|
interface->sendGeometry(rect);
|
|
|
|
return;
|
|
|
|
//return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface->setVcrOp(VCR_PAUSE);
|
|
|
|
//interface->setVcrOp(VCR_PAUSE);
|
|
|
|
vcrFlag = VCR_PAUSE;
|
|
|
|
//vcrFlag = VCR_PAUSE;
|
|
|
|
|
|
|
|
|
|
|
|
if (!moveResizeTimer)
|
|
|
|
//if (!moveResizeTimer)
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
moveResizeTimer = new QTimer;
|
|
|
|
// moveResizeTimer = new QTimer;
|
|
|
|
connect(moveResizeTimer, SIGNAL(timeout()),
|
|
|
|
// connect(moveResizeTimer, SIGNAL(timeout()),
|
|
|
|
this, SLOT(onMoveCompleted()));
|
|
|
|
// this, SLOT(onMoveCompleted()));
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }");
|
|
|
|
//lblVideo->setStyleSheet("QLabel { background-color : black; color : blue; }");
|
|
|
|
moveResizeTimer->start(1000);
|
|
|
|
//moveResizeTimer->start(1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::onVolSliderValueChanged(int value)
|
|
|
|
void MainWindow::onVolSliderValueChanged(int value)
|
|
|
@ -253,10 +253,17 @@ void MainWindow::openMediaFile()
|
|
|
|
|
|
|
|
|
|
|
|
if (filename.length() == 0)
|
|
|
|
if (filename.length() == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/* no previous selection - open user's home folder TODO */
|
|
|
|
/* no previous selection - open user's home folder TODO */
|
|
|
|
// TODO filename = QFileDialog::getOpenFileName(this, "Select Media File", "/");
|
|
|
|
// TODO filename = QFileDialog::getOpenFileName(this, "Select Media File", "/");
|
|
|
|
|
|
|
|
//filename = QFileDialog::getOpenFileName(this, "Select Media File",
|
|
|
|
|
|
|
|
// QDir::currentPath());
|
|
|
|
|
|
|
|
|
|
|
|
filename = QFileDialog::getOpenFileName(this, "Select Media File",
|
|
|
|
filename = QFileDialog::getOpenFileName(this, "Select Media File",
|
|
|
|
QDir::currentPath());
|
|
|
|
QDir::currentPath(),
|
|
|
|
|
|
|
|
"Media *.mov *.mp4 *.mkv (*.mov *.mp4 *.mkv)");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -302,13 +309,19 @@ void MainWindow::clearDisplay()
|
|
|
|
void MainWindow::on_actionOpen_Media_File_triggered()
|
|
|
|
void MainWindow::on_actionOpen_Media_File_triggered()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (vcrFlag != 0)
|
|
|
|
if (vcrFlag != 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
onBtnStopClicked(true);
|
|
|
|
onBtnStopClicked(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* if media was specified on cmd line, use it just once */
|
|
|
|
/* if media was specified on cmd line, use it just once */
|
|
|
|
if (gotMediaOnCmdline)
|
|
|
|
if (gotMediaOnCmdline)
|
|
|
|
|
|
|
|
{
|
|
|
|
gotMediaOnCmdline = false;
|
|
|
|
gotMediaOnCmdline = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
openMediaFile();
|
|
|
|
openMediaFile();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (filename.length() == 0)
|
|
|
|
if (filename.length() == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -327,10 +340,10 @@ void MainWindow::on_actionOpen_Media_File_triggered()
|
|
|
|
interface->initRemoteClient();
|
|
|
|
interface->initRemoteClient();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
playVideo = interface->getPlayVideoInstance();
|
|
|
|
demuxMedia = interface->getDemuxMediaInstance();
|
|
|
|
if (playVideo)
|
|
|
|
if (demuxMedia)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
connect(playVideo, SIGNAL(onElapsedtime(int)),
|
|
|
|
connect(demuxMedia, SIGNAL(onElapsedtime(int)),
|
|
|
|
this, SLOT(onElapsedTime(int)));
|
|
|
|
this, SLOT(onElapsedTime(int)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -355,7 +368,7 @@ void MainWindow::onBtnPlayClicked(bool)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (vcrFlag == 0)
|
|
|
|
if (vcrFlag == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/* first time play button has been clicked */
|
|
|
|
/* first time play button3 has been clicked */
|
|
|
|
on_actionOpen_Media_File_triggered();
|
|
|
|
on_actionOpen_Media_File_triggered();
|
|
|
|
btnPlay->setText("Pause");
|
|
|
|
btnPlay->setText("Pause");
|
|
|
|
vcrFlag = VCR_PLAY;
|
|
|
|
vcrFlag = VCR_PLAY;
|
|
|
@ -385,8 +398,8 @@ void MainWindow::onBtnPlayClicked(bool)
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::onBtnRewindClicked(bool)
|
|
|
|
void MainWindow::onBtnRewindClicked(bool)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (playVideo)
|
|
|
|
//if (playVideo)
|
|
|
|
playVideo->onMediaSeek(0);
|
|
|
|
// playVideo->onMediaSeek(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::onBtnStopClicked(bool)
|
|
|
|
void MainWindow::onBtnStopClicked(bool)
|
|
|
@ -401,6 +414,8 @@ void MainWindow::onBtnStopClicked(bool)
|
|
|
|
|
|
|
|
|
|
|
|
/* clear screen by filling it with black */
|
|
|
|
/* clear screen by filling it with black */
|
|
|
|
clearDisplay();
|
|
|
|
clearDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
btnPlay->setChecked(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::onMediaDurationInSeconds(int duration)
|
|
|
|
void MainWindow::onMediaDurationInSeconds(int duration)
|
|
|
@ -479,8 +494,10 @@ void MainWindow::onSliderValueChanged(int value)
|
|
|
|
if (acceptSliderMove)
|
|
|
|
if (acceptSliderMove)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
acceptSliderMove = false;
|
|
|
|
acceptSliderMove = false;
|
|
|
|
if (playVideo)
|
|
|
|
if (demuxMedia != NULL)
|
|
|
|
playVideo->onMediaSeek(value / 100);
|
|
|
|
{
|
|
|
|
|
|
|
|
demuxMedia->onMediaSeek(value / 100);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -503,6 +520,7 @@ void MainWindow::onSliderActionTriggered(int action)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// not called
|
|
|
|
void MainWindow::onMoveCompleted()
|
|
|
|
void MainWindow::onMoveCompleted()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QRect rect;
|
|
|
|
QRect rect;
|
|
|
@ -512,7 +530,7 @@ void MainWindow::onMoveCompleted()
|
|
|
|
|
|
|
|
|
|
|
|
interface->setVcrOp(VCR_PLAY);
|
|
|
|
interface->setVcrOp(VCR_PLAY);
|
|
|
|
vcrFlag = VCR_PLAY;
|
|
|
|
vcrFlag = VCR_PLAY;
|
|
|
|
moveResizeTimer->stop();
|
|
|
|
//moveResizeTimer->stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_actionAbout_triggered()
|
|
|
|
void MainWindow::on_actionAbout_triggered()
|
|
|
|