Author Topic: 3DBee (Cover Flow) Plugin  (Read 25774 times)

BoringName

  • Full Member
  • ***
  • Posts: 201
well, fonts don't arise the issues. i'm not sure which fonts are actually used by plugin for cyrillic letters, but replacing provided fonts, by windows unicode fonts doesn't change anything. i'm still thinking that skin.ini files should use utf-8 encoding instead of ansi, but it's also, not my problem at the moment.

the real problem is last 3 lines in skin.ini (at least for coverflow skin). i've commented them:

Code
]#movehorizscene = 0.000000
#movevertiscene = 0.200000
#zoomscene = 0.000000

There is something wrong with the quick reply box on this forum. Whenever I try and use it my post just disappears to the ether. I have to click the reply button first and post that way.

and plugin is working now fine and without any error messages. if i uncomment any of these 3 lines, the plugin (silently, without error messages, and without writing anything to mb error log) displays an empty panel.

Those 3 settings adjust the position of the flow within the panel. So yours will be positioned slightly lower with that movevertiscene commented out.

Those 3 settings get read in as a string and then converted to a float. They are the only settings converted to float so something is going wrong there on your machine. What happens if you take away the trailing zeroes so they are just 2 decimal places? It shouldn't make a difference but there must be something odd going on with the conversion.
Code
#movehorizscene = 0.00
#movevertiscene = 0.20
#zoomscene = 0.00

edit: The problem with openGL is you don't know there was an error unless you specifically query it with gl.geterror() constantly. It will just silently shit itself and give you unexpected results. I suspect some weird conversion is happening with the float values causing GL to error but It's strange the actual conversion didn't produce an error. Maybe it's converting it to a float successfully but to a number outside of the range OpenGL is expecting. It's hard for me to test because it works on my machine....
Last Edit: January 29, 2023, 07:40:45 AM by BoringName

boroda

  • Sr. Member
  • ****
  • Posts: 4595
i'll test it right now, but i'm already sure that the problem is localized decimal point, which is comma, not dot, for russian localization (and, i suspect, that for many, if not most, european localizations). i'm using the following workaround in my tag tools plugin to read floats always using US notation, independently of windows regional settings:

Code
const char localizedDecimalPoint = (0.5).ToString()[1]; //global declaration
...
//code inside some function
string number = "0.22"; //it's just input example

number = number.Replace('.', localizedDecimalPoint);

float fpNumber = float.Parse(number);
...

boroda

  • Sr. Member
  • ****
  • Posts: 4595
yes, replacing dots by commas in floats in skin.ini completely solved the problem.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
it seems that option "Use MusicBee default font" doesn't work. see screenshot below, album artist name in column browser is displayed correctly, but in plugin panel is not:


BoringName

  • Full Member
  • ***
  • Posts: 201
yes, replacing dots by commas in floats in skin.ini completely solved the problem.

Well done. I'll see if I can implement your solution for localisation issues.

it seems that option "Use MusicBee default font" doesn't work. see screenshot below, album artist name in column browser is displayed correctly, but in plugin panel is not:

It should using the right font (it does for me). You need to restart musicbee for the change to take effect with that setting. I need to state on the config panel which settings require a restart to take effect.

Also moving 3DBee to different panels can mess up the fonts so a restart is needed to fix it when that happens.

If it isn't any of those issues I suspect its a problem with the drawtext function sharpGL uses to display fonts. Looks like I might have to edit some of SharpGL's source code..... Can you please copy and paste that artist name in here so I can test out the characters on my machine.
Thanks.

Edit: Nevermind, I grabbed them from the bands wikipedia page :) They don't show up properly for me either. I'll see what I can do.
Last Edit: January 29, 2023, 08:26:33 AM by BoringName

hiccup

  • Sr. Member
  • ****
  • Posts: 7785
2.
Would it be an option to have the background adapt to the panel background of a skin?
And if the fonts would also follow the font colour of the active skin,
The context menu background and font should already follow the colour of the active skin. Although I haven't tested the font out. It's set to follow the foreground colour of the TrackandArtistPanel which I think sets the font colour. I could add an option in the skin.ini file to create a background that matches the current skin.
It doesn't for me. For my skins it always has a black background (0,0,0) and white text (255,255,255)
Maybe I am overlooking some setting?

BoringName

  • Full Member
  • ***
  • Posts: 201
It doesn't for me. For my skins it always has a black background (0,0,0) and white text (255,255,255)
Maybe I am overlooking some setting?

The plugin currently grabs the background colour of the skin element SkinTrackAndArtistPanel and uses that for the background of the context menu. The text is always set to white currently. I was going to change that to use the foreground colour of the panel which should be the font colour but haven't done it yet.

So because everything always has to be hard - I altered the source code of SharpGL and recompiled it....
SharpGL.dll

This file is for Boroda. Just save that in the plugin folder. On my system it will display the Prāta Vētra band name correctly from your screenshot, well kind of, it converted the accented characters to a and e but that's better than a bunch of square blocks. Other unicode characters are showing up as question marks. I'm hoping that is just a locale issue in windows and they should display correctly for you. Let me know how that goes.

hiccup

  • Sr. Member
  • ****
  • Posts: 7785
The plugin currently grabs the background colour of the skin element SkinTrackAndArtistPanel and uses that for the background of the context menu.
I don't know that skinning element, and have no skins that have it.
Are you sure that is the correct name?

boroda

  • Sr. Member
  • ****
  • Posts: 4595
The context menu background and font should already follow the colour of the active skin. Although I haven't tested the font out. It's set to follow the foreground colour of the TrackandArtistPanel which I think sets the font colour. I could add an option in the skin.ini file to create a background that matches the current skin.
It doesn't for me. For my skins it always has a black background (0,0,0) and white text (255,255,255)
Maybe I am overlooking some setting?
context menu of panel follows mb skin colors for me.

-------------

BoringName, i didn't understand what does the option "use musicbee foreground color for progress bar"? what is "progress bar"? scrollbar under cover-flow is determined by skin, not by this setting.

-------------

there is a problem: album artist/album name are not shown at all, if they are too long to fit the width of the plugin panel (i'm now using plugin panel in mb right panel, above track info, right panel is not very wide). not sure, maybe truncate them in this case, appending "..." to truncated text?

-------------

font is very pixelated. can this be somehow fixed? i think just rendering text using current dpi could be sufficient, antialiasing may be not required.

-------------
switching to another library raises this exception (and crashes mb):


MusicBee v3.5.8429.28833P  (Win10.0), 29 янв 2023 16:00:

System.ArgumentOutOfRangeException: Индекс за пределами диапазона. Индекс должен быть положительным числом, а его размер не должен превышать размер коллекции.
Имя параметра: index
   в System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   в System.Collections.Generic.List`1.get_Item(Int32 index)
   в MusicBeePlugin.AlbumTextures.threadAlbumTexture()
   в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   в System.Threading.ThreadHelper.ThreadStart()


it's impossible to switch library when plugin is enabled. mb library remains unchanged on mb restart ater crash.

-----------------

and finally great news!

new SharpGL.dll has completely fixed all issues with Russian text (current windows locale), previously russian text was displayed as some mix of question marks, latin letters and numbers. but diacritic marks are simply removed (for some european characters, russian language doesn't use diacritics). maybe it's possible to leave them if russian letters are now shown properly - i hope that now any unicode text can be handled, no?
Last Edit: January 29, 2023, 02:28:43 PM by boroda

boroda

  • Sr. Member
  • ****
  • Posts: 4595
BoringName, here is example of russian (album) artist, just in case if you want to test displaying russian tags using not russian windows locale:

Веня д'ркин

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
Using 1.2 I needed to temporarily disable 3DBee to test for a conflict with something else. (Preferences > Plugins > 3DBee > disable.) Closed and restarted MB, did my tests, enabled 3DBee and it was gone from the panel arrangement. I feel it should remain persistent. The settings (floating panel, location of panel, last album played, etc. were all persistent. It just was no longer enabled as a panel.
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

hiccup

  • Sr. Member
  • ****
  • Posts: 7785
It doesn't for me. For my skins it always has a black background (0,0,0) and white text (255,255,255)
Maybe I am overlooking some setting?
context menu of panel follows mb skin colors for me.
So you are not getting a pitch black background, irrespective of the skin you are using?


About the ragged font, perhaps activating cleartype (and/or respecting Windows' settings for it) would solve that?

BoringName

  • Full Member
  • ***
  • Posts: 201
I don't know that skinning element, and have no skins that have it.
Are you sure that is the correct name?

The musicbee api has the following elements listed that I can grab the background, border and foreground colours. I tried different elements but they all came back with the same colours on my machine so I just went with the trackandartist panel.
SkinSubPanel
SkinInputControl
SkinInputPanel
SkinInputPanelLabel
SkinTrackAndArtistPanel

BoringName, i didn't understand what does the option "use musicbee foreground color for progress bar"? what is "progress bar"? scrollbar under cover-flow is determined by skin, not by this setting.

there is a problem: album artist/album name are not shown at all, if they are too long to fit the width of the plugin panel (i'm now using plugin panel in mb right panel, above track info, right panel is not very wide). not sure, maybe truncate them in this case, appending "..." to truncated text?


It's only used if you set the "load all into memory" option. A progress bar will be displayed above the covers showing the loading progress.

Yes, it is set to hide if it won't fit. You could try setting the font size lower but I will look into truncating options.

font is very pixelated. can this be somehow fixed? i think just rendering text using current dpi could be sufficient, antialiasing may be not required.


I had noticed that, I think that is also a SharpGL issue with not scaling fonts properly. I will see if there are ways around it.... I might have to revert to rendering them myself instead of relying on SharpGL's drawtext function.

switching to another library raises this exception (and crashes mb):

That's a big oversight on my part, I'll try and get a fix out for that today.

and finally great news!

I'll look into the diacritic marks. I'm not sure if all unicode characters will be displayed. All this character encoding stuff is new to me so I need to do a bit of research. The fix I did for SharpGL was a solution someone else found, There was a few values set to 255 instead of 256. I think they were basing it on an array of 0-255 having a length of 256 (including the zero) but the way they coded it made them 255 and unicode needs 256.

Using 1.2 I needed to temporarily disable 3DBee to test for a conflict with something else. (Preferences > Plugins > 3DBee > disable.) Closed and restarted MB, did my tests, enabled 3DBee and it was gone from the panel arrangement. I feel it should remain persistent. The settings (floating panel, location of panel, last album played, etc. were all persistent. It just was no longer enabled as a panel.

I'll check it out but I don't think that's something I have any control over. I think musicbee removes the panel if the plugin is disabled.

BoringName

  • Full Member
  • ***
  • Posts: 201
So it wasn't a complete oversight on my part, it is configured to reload on library change but I hadn't set it to clear one of the lists which is what caused the issue.

I have updated the addon with a fix. It's the same version number. I have also included the new SharpGL.dll

BoringName

  • Full Member
  • ***
  • Posts: 201

So you are not getting a pitch black background, irrespective of the skin you are using?


About the ragged font, perhaps activating cleartype (and/or respecting Windows' settings for it) would solve that?

I was specifically talking about the context menu that appears when you right click the 3DBee window. The background can be changed by editing the skin.ini file for that particular skin. It should be in  3DBee\skin\Coverflow\skin.ini
You can place an image file in 3DBee\skin\Coverflow\wallpaper

Lets say you put an image file in there called Background.png

In the ini file change the following line.
backimage = Background.png

There is a bug if you remove all the characters after the = sign so if you don't want to use an image just set this to none or leave the empty space it currently has.

If the backimage setting is blank or set to a file that it can't find in the wallpaper folder, it will revert to to using the following settings to draw the background.
backred=0
backgreen=0
backblue=0

tablered=0
tablegreen=0
tableblue=0

The back colours will be used for the top half of the screen and the table colours will be used for the bottom half. If you set them the same it will be one flat colour. it's currently black because they are all set to zero. If the back and table are set to different colours there will be a gradient transition in the middle of the screen between the 2.
This is what happens if you leave the back colours as zero and set the table colours to 255.


As for the fonts, I've been down a 3 hour rabbit hole of shit today. I recompiled SharpGL to force it to use the best quality rendering of the fonts and it made zero difference, I tried the Graphics class of System.Drawing and that was just as pixelated although it did do some anti-aliasing with the background that was slightly better. I think my only option is going to be rendering them myself, maybe at double the size and scaling them down. OpenGL does have multisampling but I don't really want to mess around with that yet.