Author Topic: MusicBee Mirror (Windows Remote Control...using MusicBee)  (Read 2242 times)

minotza

  • Newbie
  • *
  • Posts: 2
First off let me just say thank you Steven, this application is amazing. I've been using it for 10+ years now and I'm guilty of not having come here sooner to thank you for developing it.

I started developing a plugin called MusicBee Mirror (https://github.com/zachminot/MusicBee-Mirror) that I hope can be of use to people who are in a similar situation:
Music is on your main personal PC, which is always on. This PC is plugged directly to your speaker system.
You have extra Windows 10 devices (laptops, Surface tablets) that can utilize MusicBee as a remote for your main computer's instance of MusicBee.

The barebones of this is working, with some issues that are probably easily addressed/bypassed:
The plugin has two modes: Client or Server
My plugin relies on the user copying their exact Library folder across (and preserving the filepaths) from the Server MusicBee instance (Your main PC) to the Client MusicBee instance (Your Windows 10 tablet). I will automate this step with a button in a future release.

So far, I haven't needed to actually copy any music files across to the client device, and I'd like to keep it that way to avoid using a network share.  
The side effect of this is that I get the warnings and red exclamations on the client side. Also interesting is that for some of the client instance files I get an Error popup "source could not be found" (Exclamation mark  doesn't show up for these files), but for others I get a Confirmation popup  "source could not be found, would you like to locate it?" (Exclamation mark shows up for these files).

It would be awesome if there was a MusicBee API native way to handle and suppress these errors, and also an option to turn off the red exclamation marks and source checking that is occurring. Ideally I could register to a FileNotFound event and dismiss / ignore the popups if possible.

I'm currently trying to use Win32 APIs to attach to the main MusicBee thread and dismiss any new Forms or MessageBox popup windows, but it's not easy.

Please let me know if this is already possible, or something that is easily implemented. Thank you!
Last Edit: March 14, 2023, 06:38:04 AM by minotza

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
are you sure the file paths are exactly the same from the client instance? If you are copying musicbeelibrary.mbl and the paths have changed, then i would expect that behaviour

minotza

  • Newbie
  • *
  • Posts: 2
are you sure the file paths are exactly the same from the client instance? If you are copying musicbeelibrary.mbl and the paths have changed, then i would expect that behaviour

Thanks for replying Steven!

To be clear, the file paths are the exact same in both MusicBee instances, however the actual files do not exist on the client instance. They only exist on the server instance.

The source not found warnings are valid, however I'd like to suppress them as they aren't relevant in my plugin's case:

Only the server MusicBee should have access to the file paths in the Library.mbl as My Windows desktop PC contains the Music and my Windows tablet does not. The client MusicBee will only have access to the Library.mbl file itself.


In future releases I was planning on using a dummy audio file on the client instance that I would dynamically generate and tag, based on the selected file for playback. So if a user selects a music file in their library for playback in the client instance of MusicBee, I would send that file path and request to the server instance of MusicBee to process/play it. I would try and trick the client instance of MusicBee to somehow mirror the server instance of MusicBee (full mirror mode), even though the client physical file doesn't exist. If the file absolutely does need to exist in order to get full mirror mode working, I would need to go down the route of creating a dummy clone of the server's music folder with all it's files and folders, and shell audio files so that the remote and local seeks sync up.

I'm trying to use a Windows Hook procedure to intercept and dismiss the popups but it's not properly hooking into the main MusicBee window. I was going to try superclassing next but it's looking like I won't be able to to intercept the file source warning popups without you exposing the event in the API.

edit: Trying DLL injection now...can you confirm if the source project is a .Net Forms application? And Can you also tell me perhaps if the dialog boxes that MusicBee creates are MessageBox objects, or Forms objects? Thank you Steven!
Last Edit: March 15, 2023, 12:38:15 AM by minotza

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
MB is a ,NET application using WinForms. The popups are based on forms