Author Topic: How to get a library selection event?  (Read 8768 times)

codingduo

  • Newbie
  • *
  • Posts: 19
Hi there,

we're developing a plugin which creates a panel with moods which allows the user to select the moods he wants to add to his files by simply clicking a checkbox (see screenshot below).

We can update the panel by playing a file (double clicking in the library panel). Now we want to listen to a single selection event on the same panel.

To be more concrete:

The user selects a file in the library panel and we want our moodtagger panel to update.

Do you have any solution for this?

Thank you in advance!



Screenshot:

https://imgur.com/1EcP9rv

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
Seems an obvious thing to have but its not supported. I will add an event to the next v3.4 beta

codingduo

  • Newbie
  • *
  • Posts: 19
Thank you for the quick response! Looking forward to the next beta.  :)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
If you add the following void function to the Plugin class, MB will detect it and call it whenever the selected file changes

Code
public void OnSelectedFilesChanged(string[] filenames) {
}

https://getmusicbee.com/patches/MusicBee34_Patched.zip
unzip and replace the existing musicbee application files

codingduo

  • Newbie
  • *
  • Posts: 19

codingduo

  • Newbie
  • *
  • Posts: 19
Everything works as expected except for the deselection (e.g. CTRL+Mouseclick) of list entries in the library. We appreciate if you can add this as well. Thank you in advance.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
I am not able to reproduce any issues with de-selection and see no reason for it not to work.
If you are sure it is not working, then can you provide a set of steps with a screenshot as well

codingduo

  • Newbie
  • *
  • Posts: 19
Hi. So we implemented the OnSelectedFilesChanged method and added a breakpoint. And in debug mode, we did not get a break at this point when we deselect one of the entries on the library panel. We recorded a short GIF for you. Hopefully it makes things clearer to you.

https://i.imgur.com/QFQBibX.gif

Kind regards

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34344
I still cant reproduce this. Can you send a link to your settings file (help/ support/ view settings)