MantisBT - MPfm
View Issue Details
0000284MPfmUI | Custom Controls | Windows (WinForms)public2012-02-07 19:292012-02-15 19:39
ycastonguay 
ycastonguay 
immediatemajoralways
resolvedfixed 
0.5.1.0 
0.5.2.10.5.2.1 
0000284: Cache font objects in every control
When changing to the EmbeddedFont structure in the 0.5.1.0 version, I forgot to cache the font objects. This has an impact on CPU for updating song position because the OnPaint event is called every 10ms (see related issue).
No tags attached.
related to 0000283resolved ycastonguay The CPU usage is way too high when updating the UI with the current song position 
Issue History
2012-02-07 19:29ycastonguayNew Issue
2012-02-07 19:29ycastonguayStatusnew => assigned
2012-02-07 19:29ycastonguayAssigned To => ycastonguay
2012-02-07 19:29ycastonguayRelationship addedrelated to 0000283
2012-02-07 21:02ycastonguayTarget Version0.5.2.0 => 0.5.2.1
2012-02-15 19:38svnCheckin
2012-02-15 19:38svnNote Added: 0000417
2012-02-15 19:39ycastonguayNote Added: 0000418
2012-02-15 19:39ycastonguayStatusassigned => resolved
2012-02-15 19:39ycastonguayFixed in Version => 0.5.2.1
2012-02-15 19:39ycastonguayResolutionopen => fixed
2012-04-17 19:10ycastonguayCategoryControls => Windows Controls
2012-04-24 20:59ycastonguayCategoryWindows Controls => UI | Windows | Custom Controls
2012-04-24 20:59ycastonguayCategoryUI | Windows | Custom Controls => Custom Controls | Windows
2012-04-24 21:00ycastonguayCategoryCustom Controls | Windows => UI | Custom Controls | Windows
2012-04-24 21:01ycastonguayCategoryUI | Custom Controls | Windows => UI | Custom Controls | Windows (WinForms)

Notes
(0000417)
svn   
2012-02-15 19:38   
The user admin has checked in files related to this issue (revision 309).

Comment:
MPfm 0.5.2.1
- Added a font cache to every control. This further optimizes CPU usage when refreshing the UI often.

Related to issue 0000284.

Files modified:
U MPfm/branches/current/MPfm.WindowsControls/Audio/OutputMeter.cs
U MPfm/branches/current/MPfm.WindowsControls/Audio/WaveFormDisplay.cs
U MPfm/branches/current/MPfm.WindowsControls/Buttons-Toolbars/Button.cs
U MPfm/branches/current/MPfm.WindowsControls/Labels/Label.cs
U MPfm/branches/current/MPfm.WindowsControls/Labels/LinkLabel.cs
U MPfm/branches/current/MPfm.WindowsControls/Library/SongGridView.cs
U MPfm/branches/current/MPfm.WindowsControls/Panel-Forms/Panel.cs

(0000418)
ycastonguay   
2012-02-15 19:39   
A further optimization could be to share the font resources between instances of the controls, but I'm not sure if this is possible.