1

Topic: Plugins

What is the status and future of Cog plugins?

If it is going to be implemented thogoughly I suggest moving Last.fm and perhaps even some codecs (what would I need video-game support for if I don't have any such files?) to plugins.

Within a month or so (when FreeBSD 7.0 RC1 is out to be precise) I will have my server up and running again and with it MusicPD. I would like to write a MPD plugin that loads the filelist of MPD into the file-drawer (or sidebar). It would be nice if it could have a search-field, but that is perhaps more of a future thing.

Re: Plugins

First a disclaimer: the plugin API is nowhere near stable and will be prone to rampant changing.

With that said, Cog currently has 3 types of plugins:
  Container: Used for loading a set of entries from a file. Playlists and cue sheets, and files with multiple tracks.
  Source: Used for reading streams. There is currently only a file source and a http source.
  Decoder: Used for the various file types.

Game formats are already a plugin. They are just bundled with the app at the moment.

Your idea isn't possible yet, but will be if I ever get around to actually implementing my ideas for the future.

Future changes I'd like to make:
  * Interaction with the UI. Currently, Cog plugins have no way of interacting with the user interface. I'm hoping making the UI toolbar-based will make this a lot easier, so plugins can provide their own toolbar items (and menu items). I'd also like for plugins to be able to provide a preference pane and add drawers to the main cog window or their own windows.
 
  *Events plugins (Likely to be called General plugins). These would receive events about what's going on. They can get info about the currently playing song and playlist entries, and get notified on track changes and all that (Last.fm and Growl would be this type of plugin).

  *Effects plugins. For things like equalizers or a plugin for applying audiounit effects.

  *Output plugins. This is basically there, I just haven't moved the code into a plugin or created the plugin type yet.

  *I'm also not entirely satisfied with the way the cue sheet plugin works. It creates a wrapper for a decoder, so I'm looking for a way to fix that. A similar problem would be handling zip files. Currently, zip files would be implemented by making a source that would create another source, which is rather ugly. I'm thinking maybe a PassThroughSource and PassThroughDecoder type, but I'm not entirely certain.
 
  *Configurable plugin system. Something similar to quicksilver where you can download/install/remove plugins on-the-fly.

I'm currently shooting for 0.10 to be "the plugin" release, which would have all the available plugins types, though there are no guarentees that it will be true

Re: Plugins

i think a good type will be "Data source plugin" - data readers, i.e. http source, icecast source etc.
i think a one little thing in ideology should be changed - now plugin itself opens file and feeds output with decoded data, but more universal way is asking the decoder to decode some more data (without having it knowing anything about output, effects or whether file is on the moon and in rar archive actually smile )
also events for decoder to raise are needed - for example, metadata change...

Re: Plugins

Er, it's already done that way. You're "Data source plugin" is actually the source plugins. A decoder's open method gets called with a source, they don't open the file itself (Well, there are a couple of exceptions for codecs that don't support callbacks: core audio, and shn). It works basically like you described.

Re: Plugins

Re: Plugins

Container plugins currently do not use sources. This was mainly done because I didn't feel like porting the existing code to something source-based. The files they reference however, are source based. I'm still trying to come up with a clean solution for formats like cuesheets, but I haven't come up with anything yet.

Re: Plugins