Author Topic: [RELEASED] - Spectrogram Panel Plugin  (Read 4211 times)

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
Update: Released Here


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:




Thanks for your help!  :)
Last Edit: November 16, 2018, 11:22:15 PM by zkhcohen

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34348
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

zkhcohen

  • Sr. Member
  • ****
  • Posts: 346
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.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34348
When your ready create a topic in the Plugins board, and Submit it via your Dashboard so it gets added to the Plugins page