Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - BoringName

Pages: 1
Plugins / 3DBee (Cover Flow) Plugin
« on: January 27, 2023, 04:20:45 AM »
I haven't submitted the addon yet. There is a lot to unpack so I wanted to have this page up first to link to. I'll submit it when I'm done here.

It's now available -

First off some credits. This is based on the source code from a program called CoverJuke by Mikaël Le Berre.

It was written in C++ and I planned to just translate it to C# but I ended re-writing most of it as the code is quite outdated. But the formulas that make the covers spin around are all the original author and this plugin would not have happened without that source code to base it off.

I also used some icon artwork from hiccup in the Musicbee skin I created and the plugin icon I'm going to use on the addon page.


Make sure you are on Musicbee version 3.5.8402 or later. It will not work on earlier versions.
The zip contains 4 x DLL files and a "3DBee" folder. The "3Dbee" folder needs to go into the persistent storage folder of Musicbee, the plugin will not work without this folder present.
On my computer its in C:\Users\BoringName\AppData\Roaming\MusicBee

If you are not sure, it should be the same folder the Musicbee settings file is in, so just search for MusicBee3Settings.ini and place the 3DBee folder in the same folder.

Place the DLL files in the usual plugin folder, something like C:\Program Files (x86)\MusicBee\Plugins

When you first open Musicbee you may have to enable the plugin before you can see it in the arrange panels section. Edit Preferences->Plugins and click enable for 3DBee. Hopefully it works. There is a configuration button here that displays some settings, I will go through that later.

Once enabled, go to View->Arrange Panels. There should be a 3dbee element on the right hand side that you can drag to any panel you want. When placed in certain spots, the height cannot be adjusted, eg) the top panel or above the files element in the main panel. This patched version allows 3DBee to be resized when placed above the files element in the main panel -
 I tried implementing a way to set the height but they all caused graphical issues. The easiest way is to place the 3dbee element in a spot that lets you set the height, like under the files element in the main panel. Adjust the height to what you want and then place it back to the original location, it will maintain the adjusted height.
When moving the element around to different panels, you may notice the track and artist info will disappear or start displaying gibberish. I'm not sure on the cause of this but just restarting Musicbee will fix it. It's only a problem when moving the panel around to different places. Better font handling is on the to do list.


Edit Preferences->Plugins-> configure button under 3DBee will give you access to most of the 3DBee settings. There are also skin settings I will go through later.

Move flow when playing track changes - When enabled the flow will navigate to the album cover of the current track playing.
Move flow on selection - When enabled the flow will navigate to the album cover of the song you selected in the main file list. If you select multiple files it just goes to the first one in the selection.
Use Musicbee no image artwork - When enabled, albums without cover art will display with Musicbee's no cover artwork. When disabled it uses the nocoverCD.jpg/nocoverCD.png file located in the currently active skin folder.
Disable no artwork image - When set, albums without artwork will not display an image in the flow, it will just leave an empty gap. It will also leave you with an empty screen if the flow is moving too fast to load the images, more on that in the how it works and limitations section below.
Use Musicbee default Font - When enabled 3DBee will use whatever font is currently set in MusicBee. This setting overrides any font names listed in the 3DBee skin configuration file.
Use Musicbee foreground colour for progress bar - When enabled the progress bar "should" be the same colour as the current Musicbee text. This overrides the current 3DBee skin configuration settings.
Maintain Cover Aspect Ratio - When enabled, covers will be displayed with their current aspect ratio. This can look a little janky if covers are inconsistent sizes. But so do distorted covers...
View Scrollbar - Sets the visibility of the scrollbar.
Mouse scrolling - Enables the flow to be swiped across with the mouse (like swiping with your finger). It's a bit clunky if you try and do it too quickly. I found it easier to just click between the scrollbar button and one of the arrows, that skips forward or back 20 albums at a time. But I left this in case someone wanted it.....Enabling this setting disables the View scrollbar setting.
Load all covers in memory  - When enabled 3Dbee will attempt to load all covers into GPU memory for a better experience. Be careful with this setting. More info about this in the how it works and limitations section below.
Album Buffer - How many albums to keep in GPU memory. This setting has no effect if "Load all covers into memory" is enabled.
Max framerate - The maximum framerate 3DBee will attempt to run at. Anything over 100 is probably a waste. The higher it's set, the more CPU will be used when the flow is active.
Animation Threshold - If the selected album minus the current album is greater than this threshold, it will immediately jump to within that threshold and continue scrolling to the selected album. It reduces scrolling considerably on large libraries. To disable it, set the number to a value greater than the number of albums in the library.

How to use

Once 3Dbee is loaded up you will see a display of your album covers, depending on the settings you choose you can navigate this display in different ways.
Rolling the mouse wheel when the pointer is in the 3DBee window or clicking the arrows on the scrollbar will move the album cover left or right by 1 album
Clicking between the scrollbar button and one of the arrows will move the album covers left or right by 20 albums.
Clicking the scrollbar button and dragging it left or right will navigate across the whole collection.
If mouse scrolling is active you can click and drag across the covers, depending on how fast you drag will determine how many albums it scrolls through. It needs some work...
Depending on settings, the flow will automatically navigate to current playing albums or whatever you select in the files list.

If you right click in the 3DBee window, a context menu will display. This lets you choose between 6 different flow styles and select any installed skins.


3DBee comes with 4 skins. 3 came with the source code and I made a Musicbee theme for a bit of fun. You can add as many as you want or edit the existing ones. The skins are located in the skin folder inside the 3DBee folder you copied during install. They allow the user to fully customize the appearance of the 3DBee window.
Each skin folder contains a "skin.ini" file that handles the configuration with the following settings
favoriteplugin - this sets which flow will be used when you select this skin, you can change it afterwards.
nbleftalbum - How many albums to display left of the current selected album.
nbrightalbum - How many albums to dislplay right of the current selected album. These 2 settings only apply to certain flows eg) both work with coverflow but vista has the left album hard coded to zero because there are no visible albums to the left on that flow.
reflectheight - how tall to make the reflection.
direction - Currently no effect but future versions will allow you to set which direction the flow moves.
backimage - Which image in the skin's wallpaper folder to use for the background. Use the full name with file extension. If this is set to none or doesn't match a file it will display a background that matches the settings below.
reflecttransparent - Sets the transparency of the reflections.
spacetextscrollbar - sets the space between the artist info and the scrollbar- this setting is actually redundant as the text can be placed where ever you want using the offset options.
There is a bunch of font settings for different things. The fontname has no effect if using Musicbee default font option.
*fontname - Needs to match a TTF font file located in the skin's font folder.
*fontheight - Sets the size of the font.
*fontoffsetX - Adjusts the font position on the screen.
*fontoffsetY - As above.
centerInfoFont - Specifies whether the album and artist font is centered or left justified.
backgreen - The colour of the background if no image is set.
tablegreen - secondary colour of the background. If different to the back settings it will create a horizon with a gradient transition.
fontartistgreen - sets the artist font colour.
fontartistshadow - sets whether the artist font is shadowed.
fontalbumgreen - you probably have these figured out.
loadbargreen - Sets the progress bar colour for load all albums mode. Overridden by the use mb skin colour setting.
horizontalangle - these settings manage where the flow is on the screen. I actually haven't played with the angle settings to see what they do....
movehorizscene - moves the flow left or right on the screen.
movevertiscene - moves the flow up or down on the screen.
zoomscene - zooms in or out on the flow. If you zoom in to much it will disappear because the viewpoint is behind the flow.

If you want to add your own skin, just copy an existing skin folder and rename it to whatever you want. When you reload Musicbee it will automatically add the folder name to the skin selection list when you right click the 3DBee window. Then just edit the skin.ini and replace any image files. Just make sure to keep the same file names for the images.

How it operates and limitations

3DBee grabs album artwork from Musicbee (effectively your hard drive) and uploads to GPU memory so it can be displayed in a 3D environment. This process can have a few limitations, mostly being hardware related.
Uploading textures to the GPU is a little slow.  It could be faster if all the album covers were the same size but they rarely are. It could also be the SharpGL library I'm using and the fact I'm basically embedding a full application inside Musicbee....
If you don't use the "load all into memory" option, you will notice it struggles to keep up with displaying the covers when you move the flow quickly, it will just display no cover artwork if you move really fast. Basically because it can't read them from the HDD and upload them to the GPU fast enough to display them.

When it's all loaded into memory it works perfectly. All covers display no matter how fast you go, but the problem is how much memory you have. I've tested it on 2 systems, 1 with 345 albums with crappy artwork running from an NVME and another with over 2000 albums with decent artwork running from a mechanical drive. The first one uses over 1gb of GPU memory and the second uses over 6gb of GPU memory.

But both have the issue of the covers not loading fast enough if they are not in memory so I'm pretty sure the bottleneck is the texture upload. Then again, both of my test computers are pushing 5 years old so others might not notice an issue.

The album buffer setting attempts to alleviate this problem somewhat. It will keep the specified number of albums in GPU memory. if it's set to 50 it will keep 25 to the right and left of the selected album in memory. Once they have been loaded the first time you browse the covers you will be able to browse through these smoothly until the covers go outside of the buffer range and get unloaded from memory. So if you can't load them all into memory you can play around with this setting and see what works best. You can see how much GPU memory is used with task manager on the performance tab.

I wasn't able to test what happens if the GPU memory fills up. I'm running a gtx 1060 and that has 6gb. it's probably going to take someone with a big library and old or onboard video card to test that out. I also don't know what happens if you load all your covers into GPU memory and then crank up a demanding game...

All my testing has been done with Nvidia graphics cards so I also have no idea how it will with other brands.

To Do List
Add a font picker
Add the ability to create/manage skins from within the UI.
Improve mouse scrolling to make it less janky.
More interactions with MusicBee like
- adding context menu items to play next/queue songs etc...
- filter displayed albums based on a search
- display all the songs for the currently selected cover in the files element.
Add a panel showing current album/track information
Optimize the OpenGL code.

I'm just going to stick this here.
Buy me a Bourbon

I can be a pretty big procrastinator but I'll feel guilty dragging my feet if people put some hard earned down waiting for an update... and also, I put a lot of work into this thing, in any case, it's totally optional!

MusicBee API / Get unique Albums and Artwork
« on: January 11, 2023, 02:29:32 AM »
For the coverflow plugin I'm working on, I need to get a list of unique Albums with a source to their artwork so I can generate the scroll of albums.

At this stage my plan was to use Library_QueryFilesEx and iterate through it to grab all the unique albums and use the first song of each unique album found as a reference to link to the artwork for that album.
Changing the query to only grab files with a track and disc number of 1 would be perfect but it falls over if the those fields are blank.
I tried grabbing all files with a track and disc number less than 2. This grabs all the track number 1 songs and those with blank fields but obviously this still needs to be iterated over to remove duplicate albums.

Is there a better way I'm missing?

Scoped storage was introduced with android 11. This changed how apps access the file system on android devices and has caused a problem with the Wifi Sync App. Usually resulting in an error about the selected music folder not being root. Some users have reported the app working ok on android 11 devices without having to make the below changes. I suspect the app was installed while the device was android 10 and was updated to android 11 with an OTA update and the OS kept the existing file permissions. Once the app is reinstalled or has it's data/cache cleared it will stop working.

Below are instructions on how to get the wifi app working with android 11+ devices.

Disclaimer – I’m not a programmer. I’ve been learning as I go so use the below instructions and the app at your own risk.

Install Android Studio. Easy to do, there are plenty of guides on the net for this.
Download the code for Music Bee Wifi on github and extract it to a folder.
Inside that folder, delete .idea\vcs.xml - it causes an error when importing it into Android Studio if you don't.
Open Android Studio
Select File->Open and open the folder you extracted above. It will take a while to build gradle, I’m not sure what this does but just be patient. It may prompt you to upgrade gradle. I opted to do that. Again you have to wait a little while.
Once it's loaded there will be a list of files on the left. Under Manifests, drag AndroidManifest.xml onto the right of the screen and it will display the contents.

Add the following line above line 5 in this file.
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

This change allows the app to have file permissions to all of the external storage. The app previously had this access level but scoped storage blocked it, so you are not giving it access to anything it couldn’t access previously. It’s just a work around to restore functionality.

On the left of the screen under the Java folder, drag WifiSyncBaseActivity to the right of the screen.
Change line 115 from this -
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.N || Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) && !PermissionsHandler.isUserSelectedPermissionsPathValid(WifiSyncServiceSettings.accessPermissionsUri.get())) {
To this -
if ((Build.VERSION.SDK_INT < Build.VERSION_CODES.N || Build.VERSION.SDK_INT >= 34) && !PermissionsHandler.isUserSelectedPermissionsPathValid(WifiSyncServiceSettings.accessPermissionsUri.get())) {

This change just stops it checking if it actually has permission to the folder you select. The code to check permissions has changed which caused the root folder error message.

This isn’t necessary but you can set a different version number.
Right click "app" in the left window and select Open Module Settings
I changed the version code to 75 (was 74) and Version number to 2.2 (was 2.1)

Now just build the APK.
From the menus at the top of the screen, select Build->Build Bundle(s)/APK(s)->Build APK(s)
This will create the following APK in the original folder

Copy this file to your phone.
Use a file browser to find the file on your phone and run it. It will state something about not being from the Play Store and it's unsigned, just install anyway.
Once you open it you will get a dialog to allow it to manage all files on the phone, click allow.
Before you do anything else, go out of the app and go to permission settings on the phone.
On mine I had to go to settings->apps->special app access->All files Access (This was on a redmi note 10 pro running a custom A12 AOSP rom)
Even though I had given it permission earlier, I found MusicBee Wifi Sync was set to "Not Allowed" in this menu. I changed it to Allowed.
Go back into the MusicBee app and you should be able to select a folder now without it popping up an error.

On first sync you may get an error about the playlist folder not being a child of the of the folder you selected, just hit sync more and try and sync again, it should work fine the second time. If you want to avoid this error just make sure there is a playlist folder in your selected music folder before you perform the first sync.

The changes above should allow the app to work on android 11 and above but if you are on android 11 and it’s not working, try the below changes. Don’t bother doing the below if you are on Android 12 or greater as it will just be ignored by the OS.

In the AndroidManifest.xml file, change the following code -
To this -

I have another version that handles permissions a bit better for the user and technically could be uploaded to the play store as it is targeting SDK 30. I will add this to the guide at a later date.

I'm trying to sync a FLAC file to iTunes (it doesn't support FLAC)

It doesn't matter what settings I use, even if I set it to convert all files,  MbApiInterface.Sync_FileStart() doesn't return a converted file. I've tried changing settings in the sync window and in Edit Preferences->Devices->iPod & iPhone Driver->Configure

If I trigger a convert by placing an album cover file in the folder and set it to imbed images, it returns an encoded file but its still a FLAC. Strangely when I set it up this way, it will obey the "convert to" setting but it doesn't actually convert to the specified format. The encoded file just becomes a FLAC file with it's extension changed to whatever is specified in the "convert to" field.  .mp3, m4a etc... and iTunes rejects it.

Ive added ALAC support via ffmpeg in file converter settings and set it to convert to ALAC (m4a) but that behaved the same way as the others.

Plugins / iPod & iPhone Driver Plugin 2.0
« on: June 14, 2022, 10:48:38 AM »
This is a fork of the original iPod & iPhone Driver Plugin 2.0 made by Boroda. Most of it is the original code, I've just changed the functionality enough that it deserves to be listed separately.

I will update this post with more info after I have finished uploading the plugin to website.

edit: Ok that's done.

Here are the main differences.
- An option form when you first activate the plugin to choose what you want to sync.
- Play counts and skip counts will be added to MB play/skip count total and be zeroed in iTunes. The original plugin overwrote values depending on last played date.
- The option to disable refreshing metadata from files in iTunes. This substantially increased the sync time on the library I used for testing. It was 36000 songs stored on a mechanical drive. Normal sync was 40-50min, with metadata refresh turned off this went down to 8 minutes.
It's only necessary if you change data for a song that is stored in the id3 tags. It's quicker to just delete the song out of itunes and let it get added in the next sync. Just be careful not to delete a song with play counts and if you have played the song on your device, click work offline instead of plugging in your device and do a sync. When it's finished sync your device with iTunes separately. Any play counts will get incremented the next time you sync with MB.
Obviously if you have changed a lot of songs then tick refresh meta and wait it out or if you have a smaller library it's probably worth leaving it ticked.
- Playlists are now deleted from iTunes and added straight back in to be repopulated. There was a bug (in iTunes 10 anyway) where the tracks wouldn't all get removed before repopulating which would result in double ups. It's a work around for the bug and means less api calls.

Clearly this means iTunes is no longer an exact sync of MB. It assumes iTunes is solely there to facilitate communications between MB and iDevices.

Not sure if it makes much difference but I deleted auto playlists out of iTunes. Recently added etc...

The progress information is all over the place but I think that is an MB issue. It will say "5 of No Files" instead of "5 of 36000". And the message bar at the bottom of the screen has incorrect percentages.

I have only tested this on an iPod Classic. I have no idea how it will go with an iPhone. I assume if the plugin doesn't play nice with it you can just click the work offline button, sync to iTunes and then sync your iPhone with iTunes separately. It's just the play counts will not get updated until you do another sync with MB.

I would recommend not syncing ratings from iTunes to MB. iTunes does that stupid pseudo rating thing with hollow stars and I'm not sure how that gets returned by the API. Use at your own risk.

Out of the 36000 songs, 5 failed to copy initially. If your library is big you have to wait a little while for MB to produce a summary window (just be patient). The screen isn't fun to navigate. It isn't obvious but you can click on the right side of the screen and scroll down. My issues seemed to be some really long files paths (109 characters) and a track with accented characters in name. Nāgá - In Hearts Wake.

This is the order that things occur assuming everything is enabled.
1. Any missing tracks are added to iTunes. If it's a playlist it gets deleted in iTunes and recreated (empty at this stage).
2. Any tracks that have been previously synced will refresh metadata from files, ratings will be synced to iTunes and the last played date in iTunes will be overwritten if MB is greater.
3. Playlists are repopulated with tracks. Any files not selected in the sync are removed from iTunes (if deleting missing items is checked)
4. Ratings, play counts and skip counts are synced back to MB (play/skip counts increment MB). If any of these options are enabled the last play date in MB will be overwritten if iTunes is greater. There is no progress indicator for this part, just a message at the bottom of the screen, just be patient, it took less than a minute on my library.

Once its done it will display a successful message at the bottom of the screen (assuming there were no copy fails in point 1.)

Pages: 1