View Single Post
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#321
Originally Posted by sakya View Post
I also noticed a higher cpu usage than the stock media player.
Play a track, stay in the now playing window, execute top: the mediaplayer uses 7-10% of the cpu (the stock media player is at 2-3%).
Leaving the player on the list window drops the % usage of the cpu to 3-4%

I don't know if this is the cause (I didn't make any test):
Code:
connect(positionTimer, SIGNAL(timeout()), mafwrenderer, SLOT(getPosition()));
Tha player is asking for the current time every second. It would be probably better to just add one second to the current position on the timer timeout and ask the renderer for the current position only when the state changes (play/pause/stop).

For the music window performance: I think that using a ListView/TableView and QAbstractListModel/QAbstractTableModel would be a lot faster than a QListWidget.

Just my two cents.

Other than that, many thanks for all the work and efforts in developing this player.
The stock player does this too, but it suspends updates when you're not on the task switcher and the media player is not the focused window.
The actual CPU usage is probably from the progress bar, rather than the updates themselves.

I've never been successful with models, that's why I don't use them.
 

The Following User Says Thank You to MohammadAG For This Useful Post: