Add function to determine if the program is busy.

This commit is contained in:
Bartosz Taudul 2024-03-24 17:38:45 +01:00
parent 630effe8fa
commit 9f9cd04761
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 9 additions and 0 deletions

View File

@ -196,6 +196,13 @@ static void SetupScaleCallback( float scale )
RunOnMainThread( []{ SetupDPIScale(); }, true ); RunOnMainThread( []{ SetupDPIScale(); }, true );
} }
static int IsBusy()
{
if( loadThread.joinable() ) return 2;
if( view && !view->IsBackgroundDone() ) return 1;
return 0;
}
static void LoadConfig() static void LoadConfig()
{ {
const auto fn = tracy::GetSavePath( "tracy.ini" ); const auto fn = tracy::GetSavePath( "tracy.ini" );

View File

@ -152,6 +152,8 @@ public:
bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset ); bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset );
bool DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset, bool hasCpuData ); bool DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset, bool hasCpuData );
bool IsBackgroundDone() const { return m_worker.IsBackgroundDone(); }
bool m_showRanges = false; bool m_showRanges = false;
Range m_statRange; Range m_statRange;
Range m_waitStackRange; Range m_waitStackRange;