Author Topic: MusicBee API  (Read 320625 times)

boroda

  • Hero Member
  • *****
  • Posts: 5173

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34974
i have added support for these SkinElement enums
Code
            SkinElementPanel = 15,
            SkinTrackDetailsPanel = 16,
            SkinArtworkPanel = 17,
for SkinElementPanel, it falls back to SkinSubPanel if not defined


BoringName

  • Sr. Member
  • ****
  • Posts: 916
Just curious if there is a way for this command to return the number of channels instead of "Mono", "Stereo" etc...
Code
Library_GetFileProperty (url, Plugin.FilePropertyType.Channels)

I noticed the VB code for the UPnP plugin has some negative operators for this declaration
Code
Private Shared ReadOnly queryFields() As Plugin.MetaDataType = DirectCast(New Integer() {MetaDataType.Url, MetaDataType.Category, MetaDataType.Artist, MetaDataType.ArtistPeople, MetaDataType.AlbumArtist, MetaDataType.Composer, MetaDataType.Conductor, MetaDataType.TrackTitle, MetaDataType.Album, MetaDataType.TrackNo, MetaDataType.DiscNo, MetaDataType.DiscCount, MetaDataType.YearOnly, MetaDataType.Genre, MetaDataType.Publisher, MetaDataType.Rating, -MetaDataType.Duration, -MetaDataType.FileSize, -MetaDataType.Bitrate, -MetaDataType.SampleRate, -MetaDataType.Channels, -MetaDataType.DateAdded, -MetaDataType.PlayCount, -MetaDataType.DateLastPlayed, -MetaDataType.ReplayGainTrack, 0}, Plugin.MetaDataType())

I had a bit of trouble converting this particular declaration to C#. I got it sorted so everything works but I couldn't implement those negative operators and it made me wonder if that was a way for certain Metadata to return alternate values. Like the Channels property and SampleRate, It returns values like "44.1 khz". For the UPnP plugin to work correctly I had to convert the results to a suitable format. eg) "Stereo" to "2", "44.1 khz" to "441000".

Am I on the right track or did they previously return different formats? As they are now,  SampleRate would not have parsed to an Int which would have triggered an encode every time in the UPnP plugin.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34974
yes, using the negative of the field will return the raw data in many cases.
If you are having trouble getting c# to apply the negative, just edit the MetaDataType enum definition and add for example
ChannelsRaw = -8

BoringName

  • Sr. Member
  • ****
  • Posts: 916
yes, using the negative of the field will return the raw data in many cases.
If you are having trouble getting c# to apply the negative, just edit the MetaDataType enum definition and add for example
ChannelsRaw = -8

Good to know I'm not crazy. Although taking on this plugin will probably get me there...

That works and makes some of the date handling a lot easier. Thanks.

hiccup

  • Hero Member
  • *****
  • Posts: 9109
Good to know I'm not crazy. Although taking on this plugin will probably get me there...
I will come visit you. (and strangle Nurse Ratched)