Author Topic: MusicBee-UserCosmetics  (Read 6291 times)

imak101

  • Newbie
  • *
  • Posts: 2
Hello MusicBee forums!! This is my first ever real code project (senior in high school) so please throw all of your constructive criticism at me. I am so eager to learn more!!

MusicBee-UserCosmetics is a program that allows a user to configure a "profile" and display it on the main view of the application with a panel. The goal of this project was to replicate a similar functionality in Spotify that just shows a profile picture as well as a username in the top right of corner. I wanted to take it one step further and add support for GIF images and it all worked out! I use MusicBee exclusively on it's own monitor so any way to make it more personal was a must and this plugin totally scratches that itch.

The functionality of this plugin is quite small but honestly, the amount of programming concepts and techniques learned while developing this application was so much more broad than the scope of this project. Huge respect for the MusicBee developers and community, working on this plugin was a blast.

Known Issues:
- GIFs or images that are fairly large (≥5MB) may cause a delay (usually under a second) when MusicBee has to redraw it's surfaces, i.e. opening window from taskbar.  Looks like this this. However, small GIFS under 2mbs load almost instantly so this isn't a huge problem.

GitHub repo and installation instructions here, hope you enjoy!!

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34350
Just regarding locking up the GUI thread, can you not load the image file in a background thread, so only the rendering is done in the GUI thread? You could run ImageHandler() in a background thread and then invoke to the GUI thread when you assign the image to the _pfp image (using Form.FromHandle(api.MB_GetWindowHandle()) to get an object to invoke to)
Having a quick look at the code, I also recommend you also dispose the image parameter at the end of the Resize() function
Last Edit: December 08, 2021, 08:13:33 AM by Steven

imak101

  • Newbie
  • *
  • Posts: 2
Just regarding locking up the GUI thread, can you not load the image file in a background thread, so only the rendering is done in the GUI thread? You could run ImageHandler() in a background thread and then invoke to the GUI thread when you assign the image to the _pfp image (using Form.FromHandle(api.MB_GetWindowHandle()) to get an object to invoke to)
Having a quick look at the code, I also recommend you also dispose the image parameter at the end of the Resize() function

Would you recommend BackgroundWorker class to achieve this? I attempted to make ImageHandler() async right before I released this and it was a disaster.
Also, disposing of the image parameter is an amazing catch, thank you very much.

Doc Nice

  • Jr. Member
  • **
  • Posts: 31
Hey guys,

First off, this is a super cool add-on!

The only thing I would ask is that a user could adjust the size of the picture chosen.

Other than that, I love it. Thanks so much for all your work!
Life flows on within you & without you.