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: How to differentiate a query-based autoplaylist and the others (Read 1338 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to differentiate a query-based autoplaylist and the others

To not pollute the other topic:
https://hydrogenaud.io/index.php/topic,62218.msg1046990.html#msg1046990

I want to check if a playlist is an Autoplaylist and also if it has a query associated or not.

This always returns 'Autoplaylist' in both cases.
Code: [Select]
playlist_manager::get()->playlist_lock_query_name(idx, component)

And this always return true.
Code: [Select]
autoplaylist_manager::get()->is_client_present(idx)

As you can see on the images, both are identified as autoplaylist but have different features available. How to do it in SDK?

Re: How to differentiate a query-based autoplaylist and the others

Reply #1
The implementer of the autoplaylist client... now you... needs to set the name.

In that component source facets_autoplaylist_client.h, it derives from autoplaylist_client

Code: [Select]
class foo_autoplaylist_client : public autoplaylist_client

If you update that to autoplaylist_client_v2, you have to implement these 3 extra methods, one of them doing what you want...

https://github.com/marc2k3/foobar2000-sdk/blob/76b762b974a6e6a6a50e912909e156da128ce5fc/foobar2000/SDK/autoplaylist.h#L50-L64

Re: How to differentiate a query-based autoplaylist and the others

Reply #2
So I just checked and the autoplaylist client in httpcontrol does not survive a fb2k restart so that is something that needs to be addressed first.

Re: How to differentiate a query-based autoplaylist and the others

Reply #3
Yep, also noticed it.

The playlist in such case is reused by matching the name, since it is not locked anymore.