I've added the Library_Query functions now so you can now get the selected files like this:
MB_QueryFiles("domain=SelectedFiles")
and then call
to get the files, just keep calling that function until it returns an empty string to get all selected files.
QueryGetAllFiles doesn't seem to work very well, maybe because the files are separated by null character? Not too sure, have not looked too much into it since it's already 3AM here >.<
ok, then the only way to get result is --
if exists mb_process
store MB_GetPlayState()
close mb app
endif
load_file appdata/MusicBeeSettings.ini to buffer
change xml node <PlayerStereoBalance>0</PlayerStereoBalance> (this is a eq window setting)
change xml node <PlayerDspState></PlayerDspState> (DSP states)
change xml node <PlayerManualEqualiser></PlayerManualEqualiser> (the eq preset name and freq settings)
save_file appdata/MusicBeeSettings.ini
load mb app
if exist last PlayState
restore PlayState
endif
is a solution until core improvement exist
i wonder if way exist to reload setting file while mb loaded
greetings
Yes, I am still supporting this.
I just tried the library_get_file_property and it seems to work for me.
You have to call
library_get_file_property(file_url, file_property)
where
file_url is the full path to the file and
file property is one of the following constants (found in enums.py under # MBFileProperty):
MBFP_Url
MBFP_Kind
MBFP_Format
MBFP_Size
MBFP_Channels
MBFP_SampleRate
MBFP_Bitrate
MBFP_DateModified
MBFP_DateAdded
MBFP_LastPlayed
MBFP_PlayCount
MBFP_SkipCount
MBFP_Duration
MBFP_NowPlayingListIndex
MBFP_ReplayGainTrack
MBFP_ReplayGainAlbum
If it still doesn't work, please show me the line where you called this function.
p/s: A little update on the Perl version:
Unfortunately, I hadn't got much time to work on it so there isn't a lot of progress so far, but I will start working on it again soon, hopefully releasing it within March.
Ahh, yes. My bad, it seems like I left out the 3rd parameter for that function in the java version. I'll get it fixed asap.
Meanwhile, if you don't mind recompiling it, try applying this simple fix:
In MusicBeeIPC.java, change:
public MBError library_setFileTag(String fileUrl, MetaData field)
{
return MBError.fromRepr(sendMessage(WM_COPYDATA, Command.Librapry_SetFileTag, pack(fileUrl, field.getRepr())));
}
To:
public MBError library_setFileTag(String fileUrl, MetaData field, String value)
{
return MBError.fromRepr(sendMessage(WM_COPYDATA, Command.Librapry_SetFileTag, pack(fileUrl, field.getRepr(), value)));
}
Note: I haven't tested this.
Well, still works like a charm! :-*
May I ask what made you use window msgs instead of sockets? Didn't actually thought about juggling hWnds around.
Probably because I'm coming from unix and Xlib is a mature pain in the butt... who knows ¯\_(ツ)_/¯
The only thing driving me nuts are the return values of
Library_GetArtworkUrl // which leaves me with a path to a *.tmp file
and
Library_GetArtwork // (which, I know, is deprecated) drops a base64 encoded image (at least looks like a base64 string)
Probably because all the covers are embedded into my music files? idk :o
Somebody got a clue on how to obtain something image-ish?
The last way would be to cycle through all the albums, grab the base64-img, decode it to some path, add an id and use the id to tag the album... mhm...
I'm open for any suggestion with that ;D
Last but not least,
great job on the IPC and also to the devs of MusicBee (even if its lacking docs :P )
cheers!
Edit: It is indeed a base64 encoded image. So basically decode->rename->tag album would do the trick
Edit2: Is there a char-limit on Tags? ???
Good to know it still works!
May I ask what made you use window msgs instead of sockets? Didn't actually thought about juggling hWnds around.
Couple of reasons, albeit not very good ones:
1. This library was primarily influenced by the ability to control Winamp via Window Messages.
2. Window Messages are easier to work with, to some extent
In hindsight, especially after porting it to so many other languages, I agree it wasn't a great choice. :-\
For that exact reason, I've been thinking of writing the next version from scratch, this time using, probably using protobuf via REST or gRPC or both.
I'm thinking of making something more universal and generalized, so that it works cross-platform.
The only thing driving me nuts are the return values of
Library_GetArtworkUrl // which leaves me with a path to a *.tmp file
and
Library_GetArtwork // (which, I know, is deprecated) drops a base64 encoded image (at least looks like a base64 string)
Probably because all the covers are embedded into my music files? idk :o
Somebody got a clue on how to obtain something image-ish?
I can't remember what it returns, but looking at the source code, all it does on the IPC side is call Library_GetArtworkUrl from the MusicBee plugin API.
Looking at the latest plugin API, there is a function called Library_GetArtworkEx (since api version 47):
bool Library_GetArtworkExDelegate(string sourceFileUrl, int index, bool retrievePictureData, ref PictureLocations pictureLocations, ref string pictureUrl, ref byte[] imageData);
This should do what you want, but unfortunately MusicBeeIPC is not updated for some time and doesn't support that function. (At the date of this writing, MusicBeeIPC only supports up to api version 33 :( )
I will take a look again soon at MusicBeeIPC's source code and see if I could update MusicBeeIPC to catch up with the latest plugin API. (Or if I should just get started working on the next revamped version)
Sorry if this is a really simple question, but how does one add ratings to the current track? I've tried
; Rate 1 star
CapsLock & Numpad1::
f := MB_GetFileUrl()
MB_Library_SetFileTag(ByRef "%f%", Rating, ByRef 1)
MB_Library_CommitTagsToFile(ByRef "%f%")
return
But that doesn't work. When I test it using
f := MB_GetFileUrl()
r := MB_GetFileTag(Rating)
MsgBox Now Playing: %f%. Rating: %r%.
The rating variable is blank, so clearly i'm using the wrong field. However I have no idea what the field is meant to be called. I've also tried "RATING", "Track Rating", "RatingTrack" and "POPM", but none of them work. Any help would be appreciated. Thanks!
p.s. I'm using FLAC files, if that is relevant.
EDIT: Managed to do what I wanted using AutoHotKey's ControlSend.