Simplified CLOCKS_PER_SEC calculations for Qt GUI.

This commit is contained in:
mjbudd77 2021-12-29 21:02:00 -05:00
parent be81d1870c
commit 9fd2bf559c
8 changed files with 19 additions and 16 deletions

View File

@ -104,7 +104,7 @@ enum PIANO_ROLL_COLUMNS
#define HEADER_LIGHT_HOLD 5 #define HEADER_LIGHT_HOLD 5
#define HEADER_LIGHT_MOUSEOVER_SEL 3 #define HEADER_LIGHT_MOUSEOVER_SEL 3
#define HEADER_LIGHT_MOUSEOVER 0 #define HEADER_LIGHT_MOUSEOVER 0
#define HEADER_LIGHT_UPDATE_TICK (40 * (CLOCKS_PER_SEC / 1000)) // 25FPS #define HEADER_LIGHT_UPDATE_TICK (CLOCKS_PER_SEC / 25) // 25FPS
struct NewProjectParameters struct NewProjectParameters
{ {

View File

@ -42,7 +42,7 @@ enum BOOKMARK_COMMANDS
#define ITEM_UNDER_MOUSE_CLOUD (-1) #define ITEM_UNDER_MOUSE_CLOUD (-1)
#define ITEM_UNDER_MOUSE_FIREBALL (TOTAL_BOOKMARKS) #define ITEM_UNDER_MOUSE_FIREBALL (TOTAL_BOOKMARKS)
#define BOOKMARKS_FLASH_TICK (100 * CLOCKS_PER_SEC / 1000) // in milliseconds #define BOOKMARKS_FLASH_TICK (CLOCKS_PER_SEC / 10) // 10 Hz
// listview columns // listview columns
enum enum

View File

@ -388,7 +388,8 @@ void BRANCHES::update()
// teleport // teleport
cornersCursorX = playbackCursorX; cornersCursorX = playbackCursorX;
cornersCursorY = playbackCursorY; cornersCursorY = playbackCursorY;
} else }
else
{ {
// advance // advance
double speed = sqrt(distance); double speed = sqrt(distance);
@ -403,10 +404,12 @@ void BRANCHES::update()
mustRedrawBranchesBitmap = true; mustRedrawBranchesBitmap = true;
lastItemUnderMouse = bookmarks->itemUnderMouse; lastItemUnderMouse = bookmarks->itemUnderMouse;
} }
if (mustRedrawBranchesBitmap) //printf("Draw Clock: %lu \n", nextAnimationTime );
{ mustRedrawBranchesBitmap = true;
redrawBranchesBitmap(); //if (mustRedrawBranchesBitmap)
} //{
// redrawBranchesBitmap();
//}
} }
} }
if ( mustRedrawBranchesBitmap ) if ( mustRedrawBranchesBitmap )

View File

@ -8,7 +8,7 @@
#include <QTimer> #include <QTimer>
#include <QWidget> #include <QWidget>
#define BRANCHES_ANIMATION_TICK (40 * CLOCKS_PER_SEC / 1000) // animate at 25FPS #define BRANCHES_ANIMATION_TICK (CLOCKS_PER_SEC / 25) // animate at 25FPS
#define BRANCHES_TRANSITION_MAX 12 #define BRANCHES_TRANSITION_MAX 12
#define CURSOR_MIN_DISTANCE 1.0 #define CURSOR_MIN_DISTANCE 1.0
#define CURSOR_MAX_DISTANCE 256.0 #define CURSOR_MAX_DISTANCE 256.0

View File

@ -7,7 +7,7 @@
#define GREENZONE_ID_LEN 10 #define GREENZONE_ID_LEN 10
#define TIME_BETWEEN_CLEANINGS (10000 * (CLOCKS_PER_SEC / 1000)) // in milliseconds #define TIME_BETWEEN_CLEANINGS (10 * CLOCKS_PER_SEC)
// Greenzone cleaning masks // Greenzone cleaning masks
#define EVERY16TH 0xFFFFFFF0 #define EVERY16TH 0xFFFFFFF0

View File

@ -8,10 +8,10 @@
#include "Qt/TasEditor/bookmark.h" #include "Qt/TasEditor/bookmark.h"
#include "Qt/TasEditor/snapshot.h" #include "Qt/TasEditor/snapshot.h"
#define UNDO_HINT_TIME (200 * (CLOCKS_PER_SEC / 1000)) // in milliseconds #define UNDO_HINT_TIME (CLOCKS_PER_SEC / 5) // in milliseconds
#define SAVING_HISTORY_PROGRESSBAR_UPDATE_RATE 10 #define SAVING_HISTORY_PROGRESSBAR_UPDATE_RATE 10
#define TIME_BETWEEN_AUTOCOMPRESSIONS (500 * (CLOCKS_PER_SEC / 1000)) // in milliseconds #define TIME_BETWEEN_AUTOCOMPRESSIONS (CLOCKS_PER_SEC / 2) // in milliseconds
#define HISTORY_LIST_WIDTH 500 #define HISTORY_LIST_WIDTH 500

View File

@ -6,10 +6,10 @@
#define PROGRESSBAR_WIDTH 200 #define PROGRESSBAR_WIDTH 200
#define PAUSEFRAME_BLINKING_PERIOD_WHEN_SEEKING (100 * (CLOCKS_PER_SEC / 1000)) #define PAUSEFRAME_BLINKING_PERIOD_WHEN_SEEKING (CLOCKS_PER_SEC / 10)
#define PAUSEFRAME_BLINKING_PERIOD_WHEN_PAUSED (250 * (CLOCKS_PER_SEC / 1000)) #define PAUSEFRAME_BLINKING_PERIOD_WHEN_PAUSED (CLOCKS_PER_SEC / 4)
#define BUTTON_HOLD_REPEAT_DELAY (250 * (CLOCKS_PER_SEC / 1000)) // in milliseconds #define BUTTON_HOLD_REPEAT_DELAY (CLOCKS_PER_SEC / 4) // in milliseconds
class UpperMarkerNoteEdit : public QLineEdit class UpperMarkerNoteEdit : public QLineEdit
{ {

View File

@ -1312,7 +1312,7 @@ int fceuWrapperUpdate( void )
// sleep to allow request to be serviced. // sleep to allow request to be serviced.
if ( mutexPending > 0 ) if ( mutexPending > 0 )
{ {
msleep( 100 ); msleep( 16 );
} }
lock_acq = fceuWrapperTryLock( __FILE__, __LINE__, __func__ ); lock_acq = fceuWrapperTryLock( __FILE__, __LINE__, __func__ );
@ -1323,7 +1323,7 @@ int fceuWrapperUpdate( void )
{ {
printf("Error: Emulator Failed to Acquire Mutex\n"); printf("Error: Emulator Failed to Acquire Mutex\n");
} }
msleep( 100 ); msleep( 16 );
return -1; return -1;
} }