Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [fb2k v2] Vital Bookmarks (Read 22726 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: [fb2k v2] Vital Bookmarks

Reply #100
I glad it worked!
Yes, the latest patch won´t work in Wine as I am using Windows 'setlocale' function.
Better than nothing I suppose.
You are welcome and thanks a lot for the feedback!


Re: [fb2k v2] Vital Bookmarks

Reply #101
da yuyu, The foobar2000 keyboard shortcuts I set up  work fine in Columns UI with your component now. Thank you for fixing that, and thank you to marc2k3 for his detective work on that issue.

In an earlier post I mentioned that a predecessor of your component:

"allow bookmarking tracks that have only been selected, and are not in an active playing state."

I am posting to let you know I no longer desire to have that feature in your component. I had wanted that feature as an easy way of keeping track of where I had left off playing in a sequence of files.

I found a better way of keeping track that suits me fine. And even if I did want to use your component for that, it would have been easy enough for me to just start a file playing, then put it on pause, and set a bookmark for it.

Anyway, I withdraw my previous request.


 

Re: [fb2k v2] Vital Bookmarks

Reply #102
Yes, the latest patch won´t work in Wine as I am using Windows 'setlocale' function.
Better than nothing I suppose.

Having peeked at your code on github, I didn't even know doing that was a thing.

fb2k itself and most components are using pfc for utf8->wide string conversions.

https://github.com/marc2k3/foobar2000-sdk/blob/main/pfc/string-conv-lite.h

Code: [Select]
pfc::string8 path = ...
auto wpath = pfc::wideFromUTF8(path);
auto fs_path = std::filesystem::path(wpath.c_str());

Re: [fb2k v2] Vital Bookmarks

Reply #103
Hi cwb, I agree that bookmarking selected tracks is not that crucial.
Even so, if I had found it trivial to implement I would have done it.
Thanks for your feedback!


...
fb2k itself and most components are using pfc for utf8->wide string conversions.
...

Glups...
I may be wrong, but I understand that the solution above does not apply to fopen.
And the alternatives to set_locale and fopens will be quite costly now... what a bummer.
fopen not good, fopen bad  :)

Re: [fb2k v2] Vital Bookmarks

Reply #104
Why don't you use foobar2000 file I/O so you don't have to do anything to UTF-8 encoded strings? If you for some weird reason must use fopen then at the very least use the _wfopen that takes the widechar string and won't stop working if user doesn't stick to ascii character set.

Re: [fb2k v2] Vital Bookmarks

Reply #105
Hi Case,
It is Jansson 2.14, the JSON library, included in three of my repos.
I should have been avoiding these two that use fopen internally:
Code: [Select]
int json_dump_file(const json_t *json, const char *path, size_t flags) and
json_t *json_load_file(const char *path, size_t flags, json_error_t *error)

There are alt interfaces taking FILE* and stream* as parameters. I guess there will be some extra work
ahead with buffers, callbacks... maybe I should take the opportunity to move to another JSON library, IDK.
 

Re: [fb2k v2] Vital Bookmarks

Reply #106
Welcome back @da yuyu
Thanks a lot for the new release.

Is there a way to backup and restore bookmarks?
I tried overwriting "foo_vbookmark.dll.dat" in configuration folder with a backup file, but when I restart foobar, Vital Bookmarks becomes empty.

Re: [fb2k v2] Vital Bookmarks

Reply #107
Yes, it is nice to be back again :)
The file replacement you mentioned above should be working.
Are you sure you are keeping the double extension .dll.dat?
The only requirement,  as you say, is to close fb2k first.

There is a new release out, you may try it to check if still fails to load them.

v1.3.8

Change log:

- Last UTF patch revision - removed setlocale function calls

Re: [fb2k v2] Vital Bookmarks

Reply #108
I tried it and it loaded properly. Thanks!

I have two suggestions for context menu options,
1. Reset description and date formats to the ones defined in preferences page.
2. Assign active track. This would be useful if track filename was changed.

Re: [fb2k v2] Vital Bookmarks

Reply #109
Glad it worked! I am also think that adding an import/export dialog will be useful.
You already might have noticed that the date format is converted to the one in preferences the next time you run foobar 2000.
I will be considering both your suggestions, thanks!

Re: [fb2k v2] Vital Bookmarks

Reply #110
Thank you very much.

I found a bug in the latest release that happens if I remove one of the bookmarks.
Steps to reproduce:
1. Add multiple bookmarks and then remove one of them.
2. Restart foobar and Vital Bookmarks becomes empty.

I've noticed that the "dll.dat" file change to "dll.dat.bak" with incorrect JSON syntax at the end of the file.

Re: [fb2k v2] Vital Bookmarks

Reply #111
As you mention, the component creates a "dll.dat.bak" whenever it fails to load a .dat file.
It was originally conceived to recover bookmarks if something goes wrong after JSON manual edits.
Unfortunately, in this case, there was a bug saving files introduced in the last release... sorry about that.
Would you check if this release fixes it?

v.1.3.9:

Change log:
- Fixes foo_vbookmarks.dll.dat truncation bug.

Re: [fb2k v2] Vital Bookmarks

Reply #112
I've tested the release, and it appears to fix the issue. Thanks!

Re: [fb2k v2] Vital Bookmarks

Reply #113
You are welcome...
I greatly appreciate your help.

Re: [fb2k v2] Vital Bookmarks

Reply #114
I've tried the latest versions.
I have the same bug reported by MG240 with v1.3.8, and it's fixed with v.1.3.9 (I'm late).
I tried v.1.3.9 with Linux and Wine: it works now, the bookmarks are saved and reappear after restarting foobar, when the installation path contains "é è ê à ñ". Also works with "資料夾". It also works with Windows.

It's great. Thanks da yuyu!


Re: [fb2k v2] Vital Bookmarks

Reply #116
@MG240
Sorry it took so long.
This new version should fix it.

Vital Bookmarks v1.4

Change log:
- Show ms in std format
- Time column right alignment
- 'Reset time ms' menu option

Re: [fb2k v2] Vital Bookmarks

Reply #117
@da yuyu
Thank you! I really appreciate it. The new version looks great.

Re: [fb2k v2] Vital Bookmarks

Reply #118
I would like to express my appreciation to the creator of this component. For a long time I thought that in Windows 10 I won't be able to add bookmarks in foobar2000. The installation of foo_vbookmark - v1.4.fb2k-component fixed the issue.

Re: [fb2k v2] Vital Bookmarks

Reply #119
Hi, I thank you too.
I just come to report a bug; for unknown reason I can't explain or reproduce, today, my bookmarks disapeared.
If someone have a clue ?