mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02:00
Use wxGetUTCTimeMillis in preference to wxGetLocalTimeMillis
For internal time-difference test, it is significantly faster, and does not suffer from daylight-saving time shifts.
This commit is contained in:
@@ -168,7 +168,7 @@ enum TimeUnit {
|
||||
|
||||
struct SeekInfo
|
||||
{
|
||||
wxLongLong mLastSelectionAdjustment { ::wxGetLocalTimeMillis() };
|
||||
wxLongLong mLastSelectionAdjustment { ::wxGetUTCTimeMillis() };
|
||||
double mSeekShort{ 0.0 };
|
||||
double mSeekLong{ 0.0 };
|
||||
};
|
||||
@@ -183,7 +183,7 @@ void SeekWhenAudioActive(double seekStep, wxLongLong &lastSelectionAdjustment)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
lastSelectionAdjustment = ::wxGetLocalTimeMillis();
|
||||
lastSelectionAdjustment = ::wxGetUTCTimeMillis();
|
||||
|
||||
gAudioIO->SeekStream(seekStep);
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void SeekLeftOrRight
|
||||
|
||||
// If the last adjustment was very recent, we are
|
||||
// holding the key down and should move faster.
|
||||
const wxLongLong curtime = ::wxGetLocalTimeMillis();
|
||||
const wxLongLong curtime = ::wxGetUTCTimeMillis();
|
||||
enum { MIN_INTERVAL = 50 };
|
||||
const bool fast =
|
||||
(curtime - info.mLastSelectionAdjustment < MIN_INTERVAL);
|
||||
@@ -379,7 +379,7 @@ void DoCursorMove(
|
||||
}
|
||||
else
|
||||
{
|
||||
lastSelectionAdjustment = ::wxGetLocalTimeMillis();
|
||||
lastSelectionAdjustment = ::wxGetUTCTimeMillis();
|
||||
MoveWhenAudioInactive(project, seekStep, TIME_UNIT_SECONDS);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ void DoBoundaryMove(AudacityProject &project, int step, SeekInfo &info)
|
||||
|
||||
// If the last adjustment was very recent, we are
|
||||
// holding the key down and should move faster.
|
||||
wxLongLong curtime = ::wxGetLocalTimeMillis();
|
||||
wxLongLong curtime = ::wxGetUTCTimeMillis();
|
||||
int pixels = step;
|
||||
if( curtime - info.mLastSelectionAdjustment < 50 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user