+ // Need to execute 1 frames' worth of DSP thread as well :-/
+#warning "!!! Need to execute the DSP thread for 1 frame too !!!"
+}
+
+
+void MainWin::SetFullScreen(bool state/*= true*/)
+{
+ if (state)
+ {
+ mainWinPosition = pos();
+ menuBar()->hide();
+ statusBar()->hide();
+ toolbar->hide();
+
+ if (debugbar)
+ debugbar->hide();
+
+ showFullScreen();
+ // This is needed because the fullscreen may happen on a different
+ // screen than screen 0:
+ int screenNum = QApplication::desktop()->screenNumber(videoWidget);
+// QRect r = QApplication::desktop()->availableGeometry(screenNum);
+ QRect r = QApplication::desktop()->screenGeometry(screenNum);
+ double targetWidth = (double)VIRTUAL_SCREEN_WIDTH,
+ targetHeight = (double)(vjs.hardwareTypeNTSC ? VIRTUAL_SCREEN_HEIGHT_NTSC : VIRTUAL_SCREEN_HEIGHT_PAL);
+ double aspectRatio = targetWidth / targetHeight;
+ // NOTE: Really should check here to see which dimension constrains the
+ // other. Right now, we assume that height is the constraint.
+ int newWidth = (int)(aspectRatio * (double)r.height());
+ videoWidget->offset = (r.width() - newWidth) / 2;
+ videoWidget->fullscreen = true;
+ videoWidget->outputWidth = newWidth;
+ videoWidget->setFixedSize(r.width(), r.height());
+ showFullScreen();
+ }
+ else
+ {
+ // Reset the video widget to windowed mode
+ videoWidget->offset = 0;
+ videoWidget->fullscreen = false;
+ menuBar()->show();
+ statusBar()->show();
+ toolbar->show();
+
+ if (debugbar)
+ debugbar->show();
+
+ showNormal();
+ ResizeMainWindow();
+ move(mainWinPosition);
+ }
+}
+
+
+void MainWin::ToggleFullScreen(void)
+{
+ fullScreen = !fullScreen;
+ SetFullScreen(fullScreen);