getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: imak101 on December 07, 2021, 11:18:11 PM

Title: MusicBee-UserCosmetics
Post by: imak101 on December 07, 2021, 11:18:11 PM
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 (https://imgur.com/a/T73CbdG). However, small GIFS under 2mbs load almost instantly so this isn't a huge problem.

GitHub repo and installation instructions here (https://github.com/imak101/MusicBee-UserCosmetics), hope you enjoy!!
Title: Re: MusicBee-UserCosmetics
Post by: Steven on December 08, 2021, 06:52:36 AM
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
Title: Re: MusicBee-UserCosmetics
Post by: imak101 on December 08, 2021, 05:01:54 PM
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.
Title: Re: MusicBee-UserCosmetics
Post by: Doc Nice on November 18, 2023, 07:12:05 PM
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!