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

BoringName

  • Sr. Member
  • ****
  • Posts: 916
bro im sure coding makes ur mind go poof sumtimes
umm another suggestion btw i got was that u could maybe make it so that the album and artist text take the album art colors?
and the background as well rn its jus a black screen right instead of that make it so that it blurs the album art and uses that as the background?
sorry if im jus piling stuff on ya rn :'(
if i could lend a hand i certainly would but idk anything bout coding oof

It can be pretty nuts. I've been down some god awful rabbit holes at times.

I spent pretty much all day yesterday on this antialiasing stuff. I got a shader working with FXAA but it only works on the internals of the image, not the edges which is the biggest problem. I really need multisampling for that. There is nothing on the internet about SharpGL and multisampling except people commenting they can't do it. Nothing in the documentation or samples, it's like they just completely ignored that functionality which is pretty bizarre. It's frustrating.

I've got one more thing left to try and then I'll give up on it and maybe just do the best workaround I can in the shader. At least that's one plus of updating to modern GL, I have options to manipulate the image via a shader which I couldn't do before. I'm not porting all this code to a different library, the jaggies will just have to stay if I can't figure it out. I tried adding a transparent border around the covers which did make a marginal difference, I might have to settle for that.

Making the background a blur of the album covers is a good idea, I'll see what I can do there. As I stated in the previous post, it doesn't have to be black, you can make it whatever colour you want in the Skin.ini file.

At this stage it is very unlikely I will do it for the album/artist info. I might be able to make them an averaged colour of the album cover colours but every letter would be that one colour and I don't think that's what you mean. I think I know a way it could be done but it's pretty complicated and will cause issues with transparency of the box they are drawn into.

I don't know how appealing it will be though. It might not be an issue when manually scrolling but if it's setup to scroll to the cover when the playing song changes, different backgrounds and lettering colours for each cover is going to strobe like crazy when shifting covers....I guess I could put a delay in updating the background so it's less abrupt. We'll see.
Last Edit: April 03, 2024, 05:24:00 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
New Version 2.0 - 3DBee_2.0

This is a pretty big update and a major rewrite of the code. All my testing is on a fairly new system with NVME drives and a 3060TI so I have no idea how it will run on old hardware. I expect an old spinning rust drive will be particularly slow. I’ll just put the link here for now and leave the addon link as the old version and case people want to roll back and didn’t backup the old dll.

It now targets framework 4.6.2. This might cause issues with windows 7 and Vista users. I believe you can install 4.6.2 on windows 7 but I don’t know about Vista.

Changes below with more in depth explanations further down.

- Complete rewrite of all the OpenGL code to modern methods.[1]
- Improved fade in/out transitions
- Improved Artist/album text display quality.
- Added an option to antialias album/artist text.[2]
- Prevent double click from queuing an album when the mouse cursor is on the scrollbar.
- Save settings confirmation box now appears near the mouse cursor
- Settings can now be accessed from the right click context menu.
- Improvements to Settings panel appearance.[3]
- Added tooltips to the settings panels.
- Improved startup to handle settings file problems.
- Targeting framework 4.6.2, windows vista and 7 will probably not work.[4]
- Added an option to adjust the animation speed. Lower numbers go faster. 15 is default, 1 is instant.
- Removed jaggies on album cover display.[5]
- Fixed a bug that caused some display anomalies when album buffer set below 50.
- Fixed a bug that caused some covers to not display when adding songs to the library with loadallcovers enabled.
- Added options for Fast Approximate Anti-Aliasing (FXAA)[6] .
- Sort options added to the context menu.[7]
- Added options to allow limiting the flow to displaying specific playlists in playlist config.
- Better handling of when song tags are changed. Changing Album artwork now updates in the flow on the fly without reloading.
- updated the Readme.txt file.

1. Custom adjustments in the skin.ini files will need to be adjusted by approx 15x. Angle settings in the skin.ini files no longer work. I'll look at re-implementing them when I integrate ini files into the plugin. I doubt anyone was using them anyway as they just caused graphical issues. I tried my best to get the different flows to be the same as they were with the old methods but you may notice some small differences in size/orientation and how the albums fade in and out.
2. I had mixed results depending on the font, font size and colours used for the font and background.
3. Most elements on the settings panels now use skin colours. Settings panels no longer lockout the main screen when open which should make it easier when experimenting with different settings. It does mean they can lose focus. You can refocus with alt-tab or if you just click the settings option again they will be brought to the front.
4. 4.6.2 can be added to windows 7, not sure about Vista (surely no one is using this anymore?)
5. Because I can’t use multisampling I had to do a workaround in the shader. Unfortunately this method leaves a grey line when the background colour is set to white. I haven’t found a workaround to fix it yet.
6. I’m not sure it's even worth it but I spent a lot of time on it so I here it is. I had a lot of inconsistencies with edge detection on different album covers. The quality of the image and colours used change the outcome considerably. As such it's hard to get Luma settings that work for everything. The AA provided is very mild to the point I could only really tell when I copied the images into an editor and zoomed in but maybe other peoples eyes are better than mine. Setting the subpixel sampling higher than 1 is noticeable but introduces artifacts and distortions. It might be more consistent with better quality images, most of mine are quite bad quality. It needs more work.
7. Selecting the same option again will change the sort from ascending to descending. Sort Mask is the Album Artist sort mask plus the first 3 digits of the album sort mask. Artist uses the "albumartist" field.

Some things still trigger a full reload so if you have loadallcovers enabled, you might want to disable that when importing or deleting lots of songs. At least it’s easier now as you can just right click the flow and click settings to get to the options.

You may need to move the mouse over the flow to see the effect of changing settings, like when enabling antialiasing of the album/artist text.

Updating to modern OpenGL didn't really fix any of the blank cover display issues as it's evident that loading covers from the HDD/SDD is the bottleneck. So it looks like the buffers are here to stay. If you don't like seeing blank covers when the flow is moving fast. Consider using the playlist options to buffer albums in VRAM and/or limiting what the flow displays to playlists. Also reduce the Animation Threshold setting to reduce scrolling. Reducing the animation speed may also reduce the appearance of blank covers.

Hopefully I didn't break anything for anybody.....

boroda

  • Hero Member
  • *****
  • Posts: 5206
@BoringName, thanks a lot. will try new version right now. i have a rather old notebook DELL (Intel Core i7-7700HQ, 16GB RAM, Nvidia GTX 1050Ti, Samsung 970 EVO Plus), so i'll report you how fast (or slow) new plugin version works for me.

as for .NET. the last .NET version available for win7 is 4.8 (but not 4.8.1). i don't know anything about Vista.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
@BoringName, thanks a lot. will try new version right now. i have a rather old notebook DELL (Intel Core i7-7700HQ, 16GB RAM, Nvidia GTX 1050Ti, Samsung 970 EVO Plus), so i'll report you how fast (or slow) new plugin version works for me.

as for .NET. the last .NET version available for win7 is 4.8 (but not 4.8.1). i don't know anything about Vista.

You will probably go alright with that device. The hard drive is definitely the bottleneck for displaying the covers. The rest shouldn't be too demanding I don't think.

Strange about 4.6.2, I'm sure I read somewhere it wasn't officially supported on windows 7 but you could still install it. I can't find that info now. Anyway, that's good news.

Forgot to mention for anyone that might want to roll back to the previous version, you will need to make sure you restore a back up of the XML settings file or just delete it before opening MusicBee. The new version has settings that don't exist in the old one and it will probably just crap itself because it wasn't setup to deal with that happening. I've fixed that in the new version.

boroda

  • Hero Member
  • *****
  • Posts: 5206
Strange about 4.6.2, I'm sure I read somewhere it wasn't officially supported on windows 7 but you could still install it. I can't find that info now. Anyway, that's good news.

maybe it wasn't supported in the past?

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

bad news (for me). fresh install of your plugin. i get error message "xml document (0,0) contains error" when i try to enable it in MB prefs (the message is in russian, so it's not the message from the plugin). both files "mb_3DBee.PlaylistSettingsPlaylists.xml" and "mb_3DBee.Settings.xml" have 0 size after this. but plugin is initialized despite this error.

and i get this error message when i try to save plugin settings:

MusicBee v3.6.8881.29272P  (Win10.0), 26 апр 2024 9:55:

Code
System.ArgumentOutOfRangeException: Индекс за пределами диапазона. Индекс должен быть положительным числом, а его размер не должен превышать размер коллекции.
Имя параметра: index
   в System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   в System.Collections.Generic.List`1.get_Item(Int32 index)
   в MusicBeePlugin.Plugin.SaveSettings()
   в MusicBeePlugin._3DBeeConfig.SaveButton_Click(Object sender, EventArgs e)
   в System.Windows.Forms.Control.OnClick(EventArgs e)
   в System.Windows.Forms.Button.OnClick(EventArgs e)
   в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   в System.Windows.Forms.Control.WndProc(Message& m)
   в System.Windows.Forms.ButtonBase.WndProc(Message& m)
   в System.Windows.Forms.Button.WndProc(Message& m)
   в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I'm 99.99% certain this is related to our old problem with the decimal point and commas that caused issues with the Skin.ini files a while back.

The old settings that got saved to the XML file didn't have any floats, the new settings for FXAA use floats and I didn't apply the method I used to fix the problem previously. I should be able to get this sorted out tomorrow.

edit: Actually, after thinking about it I'm not so sure. Commas shouldn't be used in XML files.

Can you try deleting the XML files and starting MusicBee. It should recreate blank files and fill them when musicbee closes or you save settings. I can see where that error might have happened if it crapped out opening the XML file although I don't understand why it would have had issues loading the old XML....

Also does the following folder exist with a skin.ini file in it?
AppData\Roaming\MusicBee\3DBee\skin\Coverflow

Edit: I should really setup a VM with the region settings set to russia for testing purposes.
Last Edit: April 26, 2024, 12:12:54 PM by BoringName

boroda

  • Hero Member
  • *****
  • Posts: 5206
Can you try deleting the XML files and starting MusicBee. It should recreate blank files and fill them when musicbee closes or you save settings. I can see where that error might have happened if it crapped out opening the XML file although I don't understand why it would have had issues loading the old XML....

this what i did. but i got the error message "xml document (0,0) contains error" (in russian) when i tried to enable plugin. i think (0,0) is char number and line number (settings file is empty). it seems that this error arises when plugin tries to read empty xml file. but why it creates empty settings file?

Also does the following folder exist with a skin.ini file in it?
AppData\Roaming\MusicBee\3DBee\skin\Coverflow

yes.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
this what i did. but i got the error message "xml document (0,0) contains error" (in russian) when i tried to enable plugin. i think (0,0) is char number and line number (settings file is empty). it seems that this error arises when plugin tries to read empty xml file. but why it creates empty settings file?

ok, the xml error is just because the xml is missing. I get the same thing on my machine. It's coded so if the xml is missing or any options are missing in the file, it will load defaults and create a new file but it doesn't save the file until you manually save the config in Musicbee or you close Musicbee. The reason it's blank is there is obviously something going wrong when it attempts to save to the file.

Which is probably the localisation problem with decimal points.

I tried setting up a VM with Virtualbox, after spending a few hours trying to figure out why the plugin wouldn't load at all, I found out virtualbox only supports OpenGL 2.1 which came out in 2006 and got replaced by 3.0 in 2008. I need at least 3.3. I do have a machine here I just use for video encoding, I might try changing the region settings on that and use it for troubleshooting.

Anyway, I'll have a crack at fixing the decimal point issue and hopefully that solves our problem.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
And my Encoding machine just died while trying to test it out.... do people just emit more static electricity around them as they get older? I've had so much tech go wrong in the last 12 months it's a bit disturbing.

Anyway, I was able to do a test with the system set to russian regional settings. I made sure it was set to use a comma as a decimal place and it all worked successfully.

So I've updated the link if you want to give it another shot 3DBee_2.0

I'm not too confident it will fix your issue but at least it will rule it out.

I also noticed 3DBee craps itself and causes Musicbee to crash if MusicBee has no music at all imported. I need to fix that. In that instance you need to delete the DLL out of the plugin folder, import some music and then reinstall the plugin.

boroda

  • Hero Member
  • *****
  • Posts: 5206
no, i get the same empty (not missing, but empty) settings file and the same error message with version 2 when try to enable plugin.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Third times a charm. Give this DLL a shot.
3DBee_Boroda.zip

If that doesn't fix it I'm going to be a bit stumped...

boroda

  • Hero Member
  • *****
  • Posts: 5206
this is already a bit strange. i've copied new version to "plugins" folder, have deleted 2 empty XML files in <mb appdata\3dbee>, restarted MB, and enabled the plugin. and have gotten the same error message "xml document (0,0) contains error". BUT! this time those 2 XML files have successfully created, were NOT empty, and were looking good in notepad++. i've disabled and re-enabled the plugin, and this time all went fine, without any error messages, and the plugin was fully functional. i was able to change and save plugin settings without any error messages.

i'll report later how fast the new version is working for my main (not test) library on my notebook.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
and have gotten the same error message "xml document (0,0) contains error".

This error is due to not being able to find the XML file. I need to either handle this silently or make it more clear to the user why this message is popping up. When this happens the plugin is coded to load default settings. I get the exact same message on my machine if I delete the XML files and start Musicbee.

I'm still not sure why you were having the index error though and why what I changed fixed it. The same code worked fine on my machine and I can't work out how any localization issues would have made it not work for you.

But it has made me realize the setting causing the issue is actually redundant. It was saving the current selected flow to reapply when Musicbee is started again. But that setting is overridden by the "favoriteplugin" setting in the skin.ini file.

So just to make sure everything is working ok. If you could startup musicbee, right click on the panel and select a different skin from the context menu like Xbox360. Close Musicbee and open it again. If it still displays the Xbox360 skin, I think everything is good and I can roll the fix into the main version.

Thanks for being a guinea pig.

boroda

  • Hero Member
  • *****
  • Posts: 5206
I'm still not sure why you were having the index error though and why what I changed fixed it. The same code worked fine on my machine and I can't work out how any localization issues would have made it not work for you.

actually, it may be not a localization issue, but, e.g. issue of the length of the path of some file. or something else specific to my machine.

So just to make sure everything is working ok. If you could startup musicbee, right click on the panel and select a different skin from the context menu like Xbox360. Close Musicbee and open it again. If it still displays the Xbox360 skin, I think everything is good and I can roll the fix into the main version.

yes, current skin is remembered on MB restart.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
actually, it may be not a localization issue, but, e.g. issue of the length of the path of some file. or something else specific to my machine.

No file paths involved, the cause was a variable that just stored an int. I can see where I had things around the wrong way that could cause that int to be less than zero which resulted in the error when trying to use that variable to reference a list. So it makes sense to me that you were getting that error, what doesn't make sense is why I wasn't getting that error on my machine because I absolutely should have. It's pretty strange, I'll have a play around with it today and see if I can figure it out.

yes, current skin is remembered on MB restart.

Nice. I've updated the 2.0 link with the changes so hopefully no else has the issue. Thanks for that.