getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: zkhcohen on July 14, 2018, 11:55:11 AM

Title: [RELEASED] - Spectrogram Panel Plugin
Post by: zkhcohen on July 14, 2018, 11:55:11 AM
Update: Released Here (https://getmusicbee.com/forum/index.php?topic=25944)


Hey Folks, Steven,

I've created a panel plugin which displays the spectrum of the song that's currently playing. For the past decade, the only option for a spectrogram in MusicBee was to use a VST plugin. This one is actually integrated in the program as a panel plugin!

I'm still in the process of ironing out some kinks so I have two questions:

1. Does the API include click-position detection? If not, I'd love an escalation to detect the X (or X-Y) position of a mouse click within a panel, relative to its scale. This would enable me to turn the spectrogram into a seek bar.

2. The spectrogram is an image that is automatically generated by ffmpeg and imported as a picture into the panel. At the moment, I have the scale set to a static value. Is there a way to see the current dynamic/user-adjusted size of a panel? I'd like to scale my images relative to the size of the panel.

Here's a picture of what it looks like in its current state:

(https://i.imgur.com/ue1anvb.png)


Thanks for your help!  :)
Title: Re: [In Progress] - Spectrogram Panel Plugin
Post by: Steven on July 14, 2018, 02:11:27 PM
i assume you are using the MB_AddPanel API function. The returned panel inherits from the "Control" class, so you can add standard event handlers from within your plugin such as "MouseClick".
To see the size just look at the Bounds property and Resize event to dynamically detect if its resized
Title: Re: [In Progress] - Spectrogram Panel Plugin
Post by: zkhcohen on July 14, 2018, 09:24:57 PM
i assume you are using the MB_AddPanel API function. The returned panel inherits from the "Control" class, so you can add standard event handlers from within your plugin such as "MouseClick".
To see the size just look at the Bounds property and Resize event to dynamically detect if its resized

Thanks! With your advice I just resolved those two issues.

I'm working on cleaning up the code a bit, then I'll submit it for release. Feel free to host it on the official Plugins page if you feel like it's appropriate.
Title: Re: [In Progress] - Spectrogram Panel Plugin
Post by: Steven on July 15, 2018, 08:20:45 AM
When your ready create a topic in the Plugins board, and Submit it via your Dashboard so it gets added to the Plugins page