30 , vbox(new QVBoxLayout(this))
31 , menu(new QMenuBar(this))
33 , player(new
openshot::QtPlayer(video->GetRenderer()))
35 setWindowTitle(
"OpenShot Player");
37 menu->setNativeMenuBar(
false);
39 QAction *action = NULL;
40 action = menu->addAction(
"Choose File");
41 connect(action, SIGNAL(triggered(
bool)),
this, SLOT(open(
bool)));
43 vbox->addWidget(menu, 0);
44 vbox->addWidget(video, 1);
51 setFocusPolicy(Qt::StrongFocus);
70 if (event->key() == Qt::Key_Space || event->key() == Qt::Key_K) {
81 if (player->Speed() == 0)
91 else if (event->key() == Qt::Key_J) {
92 if (player->Speed() - 1 != 0)
93 player->Speed(player->Speed() - 1);
95 player->Speed(player->Speed() - 2);
100 else if (event->key() == Qt::Key_L) {
101 if (player->Speed() + 1 != 0)
102 player->Speed(player->Speed() + 1);
104 player->Speed(player->Speed() + 2);
110 else if (event->key() == Qt::Key_Left) {
111 if (player->Speed() != 0)
113 player->Seek(player->Position() - 1);
115 else if (event->key() == Qt::Key_Right) {
116 if (player->Speed() != 0)
118 player->Seek(player->Position() + 1);
120 else if (event->key() == Qt::Key_Escape) {
121 QWidget *pWin = QApplication::activeWindow();
126 QApplication::quit();
130 QWidget::keyPressEvent(event);