From 4e8a2c19f1e1bd355cfc5fa564b0676a928d6832 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Oct 2014 17:28:17 +0000 Subject: [PATCH] Slightly better timer interval management (with global const variable). --- MM.h | 3 +++ MainWindow.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MM.h b/MM.h index 3f7d52e..22fc5aa 100644 --- a/MM.h +++ b/MM.h @@ -57,6 +57,9 @@ public: static const qreal VERTEX_STICK_RADIUS = 10; static const qreal VERTEX_SELECT_RADIUS = 10; static const qreal VERTEX_SELECT_STROKE_WIDTH = 1; + + // Time. + static const float FRAMES_PER_SECOND = 29.97f; }; #endif diff --git a/MainWindow.cpp b/MainWindow.cpp index 0a28922..ff19f9e 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -65,7 +65,7 @@ MainWindow::MainWindow() // Create and start timer. videoTimer = new QTimer(this); - videoTimer->setInterval(1000/30); + videoTimer->setInterval( int( 1000 / MM::FRAMES_PER_SECOND ) ); connect(videoTimer, SIGNAL(timeout()), this, SLOT(updateCanvases())); videoTimer->start();