Author Topic: MusicBee API  (Read 285406 times)

zorexx

  • Jr. Member
  • **
  • Posts: 36
I see, ok, I'll just use the API from this thread then. Thanks.

MiDWaN

  • Jr. Member
  • **
  • Posts: 78
While working on a plugin I noticed a small typo, you might want to know:

- the method/function calls to "Initialise" should be named "Initialize" as is the correctly spelled word. :)

Though this might be a breaking change if everything refers to it by that name (including existing plugins for example).

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
Initialise is the correct spelling and no plans to change it

MiDWaN

  • Jr. Member
  • **
  • Posts: 78
Well, actually BOTH are correct if you look them up in dictionaries:
- Initialise is the British English version
- Initialize is the American English version

I just brought this up because from my experience it's usually called "Initialize" in documentation, code samples and production code.

No big deal really, just struck me as something that may had been missed.

Pingaware

  • Sr. Member
  • ****
  • Posts: 1110
Steven is British, so he uses British spellings across his codebase.
Bold words in my posts are links unless expressly stated otherwise.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9299
Steven is British, so he uses British spellings across his codebase.
But the redesigned website, per Steven's request, will use US English rather than UK English.  As it gets closer to going live, I will be proofreading it to accommodate Steven's request.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

boroda

  • Sr. Member
  • ****
  • Posts: 4595
What is the format of 'imageData' in api call:

MbApiInterface.Library_SetArtworkEx(sourceFileUrl, 0, imageData);

i tried to convert Bitmap to byte[]:

Code
                    System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(typeof(Bitmap));
                    Bitmap pic = (Bitmap)tc.ConvertFrom(Convert.FromBase64String(value));
                    byte[] imageData = (byte[])tc.ConvertTo(pic, typeof(byte[]));

                    return MbApiInterface.Library_SetArtworkEx(sourceFileUrl, 0, imageData);

but this doesn't do anything.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
its the raw data encoded as JPEG or PNG that you would find in an image file on your PC.
So if your starting point is an in-memory bitmap, then you could
- create a memoryStream
- bitmapImage.Save(memoryStream,Imaging.ImageFormat.Jpeg)
- memoryStream.ToArray() and pass that data


BioBiro

  • Newbie
  • *
  • Posts: 3
Hellooo~,

Could I request to have some delicious equaliser methods in the API, to get and set the bands? I know you can manually pull them out of Roaming/MusicBee/MusicBee3Settings.xml - <PlayerManualEqualiser> - but that's probably not going to be very forwards-compatible.

Mebbe something like dis':

Code
public Player_GetEqualiserBandsDelegate Player_GetEqualiserBands;
public Player_SetEqualiserBandsDelegate Player_SetEqualiserBands;

public delegate bool Player_GetEqualiserBands(ref float[] bands);
public delegate bool Player_SetEqualiserBands(float[] bands);

e-motiv

  • Full Member
  • ***
  • Posts: 188
Can anyone set me in the right direction to do something x seconds before the current tracks is about to stop, please?

What I specifically want to evade is, when setting a timer on the startplaying event, that it will run much too soon when meanwhile the user has paused or rewind or some other action that would desynchronize that timer. In other words, if a timer is necessary, is there a shorter or more clever way to do this without paying attention to all the possible events happening?
Thanks a lot!!

P.S. This is to finish my re-release of Speak Back plugin. I want her to remind the user to rate the current track a couple of seconds before the track ends.

Thanks again!
  Developing @ e-motiv.net       --       Musicbee plugins: Speak Back - Ghost Tracks - Radio Dig

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
query the duration of the track when the plugin receives a track change event and using a timer query the play position via the api every second for example

e-motiv

  • Full Member
  • ***
  • Posts: 188
OK. Thank you!
  Developing @ e-motiv.net       --       Musicbee plugins: Speak Back - Ghost Tracks - Radio Dig

e-motiv

  • Full Member
  • ***
  • Posts: 188
Can anyone help me with a storage question, please? --> sqlite3.dll - How to target this library in .NET?
I really want to choose the right choice before programming again. Thank you!
  Developing @ e-motiv.net       --       Musicbee plugins: Speak Back - Ghost Tracks - Radio Dig

slivlight

  • Newbie
  • *
  • Posts: 1
Just found out NowPlaying_GetSpectrumData can't return low to high frequency range on 3.1, it return centered frequency range now.
Anyway to fix it? :'(