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: "Overriding" other input services? (Read 3287 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

"Overriding" other input services?

First of all, I wanna say that I'm doing this for my own purposes only, so I believe I'm not violating rule #15. If I am, then please remove this thread.

I want to make a plugin that "handles" all filetypes. To be more accurate, it would to do a certain operation and then pass the input service function calls forward to the service that actually handles them. Kind of an intermediate layer between foobar and normal input services, mainly for filtering the metadata that gets written to or reloaded from files. (I really got tired of the way foobar's database works.) And it only needs to be done for local files (file://, unpack://).

As has been discussed here, it would perhaps require changing the component loading order, so that my plugin is able to register filetypes first. So how can I change this? Is it the same as the order of the dll files in the directory table? Or alphabetical order? And does loading order guarantee that input services are called in this same order?

Another option would be to use is_our_content_type(), which gets called for all services before any calls to test_filename(). But does foobar always call it, even when the content type is not defined and other situations like that?

Well, obviously I can test these things, but I still couldn't be 100% sure about foobar's internal behavior, so I thould I'd ask if anyone knows. Anyway, thanks.

"Overriding" other input services?

Reply #1
Overriding other input services is not supported. The only solutions to implementing a tag filter is to use proxy files (like APL does) or to decorate the path (example: "file://C:\whatever.mp3" -> "tag-filter:|file://C:\whatever.mp3|"). The important point about the latter is to use both a prefix and a postfix, so that other inputs will not recognize the decorated path as their own no matter if they are checking for URL scheme or file extension. Of course, decorating the path breaks massrenamer and the like.

"Overriding" other input services?

Reply #2
Quote
Overriding other input services is not supported.

Is there any real technical reason for this besides the calling order? Anyway, it might not be "supported", but it seems to be working fine enough for me. I still haven't figured out that calling order thing, which depends on the dll filenames in a totally awkward way.. But I can still always override at least the filetypes I need, cause it somehow prioritizes those services that don't need a reader object.

Quote
The only solutions to implementing a tag filter is to use proxy files (like APL does) or to decorate the path (example: "file://C:\whatever.mp3" -> "tag-filter:|file://C:\whatever.mp3|"). The important point about the latter is to use both a prefix and a postfix, so that other inputs will not recognize the decorated path as their own no matter if they are checking for URL scheme or file extension. Of course, decorating the path breaks massrenamer and the like.

Blah.. This solution ain't good enough.  No advantages over the APL file method i've been using so far.

"Overriding" other input services?

Reply #3
Quote
Quote
Overriding other input services is not supported.

Is there any real technical reason for this besides the calling order? Anyway, it might not be "supported", but it seems to be working fine enough for me. I still haven't figured out that calling order thing, which depends on the dll filenames in a totally awkward way.. But I can still always override at least the filetypes I need, cause it somehow prioritizes those services that don't need a reader object.
[{POST_SNAPBACK}][/a]

It might work well enough for you, but you are about to meet [a href="http://www.hydrogenaudio.org/forums/index.php?act=ST&f=24&t=5308]rule #15[/url] when you try to release your "component".
Microsoft Windows: We can't script here, this is bat country.