
       Here's some of my ideas on how the plugins should be organized.
       ---------------------------------------------------------------

  There are three types of plugins: input, filter and output.

  To create a chain you need to select one of the input plugins, one of the 
output plugins and some (or even none) filters. All plugins connected with
each other. Data is passed from input plugin through filter to output plugin.
This creates a chain which can be represented like this:

    inputPlugin -> filterPlugin -> filterPlugin -> .... -> outputPlugin

  One may say that there's a stream of data passed between the plugins.
Stream type is a mimetype that this stream passes over itself.
  Every mimetype should be somehow associated with file extensions
(database/registry ?). E.g. the mimetype image/jpeg should be associated with
the following extensions "jpeg,jpg,jpe,jfif,pjpeg,pjp". This will allow
automatic selection of plugin on file load.
  Every mimetype also has predefined data type (class, structure, etc..). So
if one plugin produces some mimetype and another accepts this mimetype, the
first one will pass some wellknown data type to the second (e.g. 'char *' for
'text/plain').

 The types of streams could be:

  * text/plain          - Raw text
  * text/directory      - File list
  * image/jpeg          - JPEG data (possible output from some 'input filter')
  * image/qt            - QImage (possible output from some filter)
  * audio/raw           - Audio raw PCM (possible input for 'output filter')
  * ...


  Here's a short description of each plugin type:
  
  1. Input plugin:

      Input plugin handles the retreival or creation of data. It should
    define one or more possible output streams.
      Input plugin is the one who activates the whole chain by transmiting
    more data each time.

  2. Filter plugin:
      
      Every filter has a list of input streams it can receive from one side
    and a list of output streams it can produce on the other side. It would
    be good if e.g. a filter with the name mpeg3 will be able to accept MP3
    and produce raw audio (decoding) as well as accept raw audio and produce
    MP3 (encoding).
      Filter may also receive/produce more than one stream simultaneously.
    E.g. QuickTime decoder will produce two streams - video and audio.

  3. Output plugin:

      Every output plugin has list of input streams it can receive. There
    should also be a way to pass some output device to this plugin (e.g. 
    QWindow or QIODevice).

  It's also convenient to assign a human readable name to each plugin.
It will be handy when we'll want to create a registry for plugins. I'm also
thinking about some app that will allow you to test different combinations of
plugins using graphics interface (e.g. each plugin is a box and you just
connect them any way you want and see the results :).


  The directory tree under $KDEDIR/plugins:

  input/
        file             - Local file
        ftp              - FTP protocol
        http             - HTTP protocol
        nntp             - News protocol
        url              - Replaces all the above (are they needed at all ?)
        ...

  filter/
         audio/
               au        - ULAW (Sun) format (ulaw <-> raw)
               wav       - WAV (MS) format   (wav <-> raw)
               mp3       - MPEG3 format      (mpeg <-> raw)
               ...
         video/
               mpg       - MPEG format       (mpeg <-> qimage stream)
               avi       - AVI (MS) format   (avi <-> qimage stream)
               ...
         image/
               gif       - GIF format       (gif <-> qimage)
               jpg       - JPEG format      (jpg <-> qimage)
               ...
         text/
              tar        - TAR format       (tar <-> directory list)
              gz         - GNU zip format   (gz  <-> raw data)
              rpm        - Redhat Package format (rpm <-> dir list,
                                                  rpm -> dependencies)
              dirlist    - Directory listing (dir -> html)
              html       - HTML code (html <-> raw text)
              ...
         ...
   
  output/
         display/
                 html    - Display HTML
                 qimage  - Draw QImage into specified QWindow
                 video   - Same, but may use double-buffering
                 ...
         audio/
               pcm       - Play raw audio
               midi      - Play midi instruments
               mixer     - Control audio device
               ...
         url/
               file      - Output to some file
               ftp       - Send over ftp
               http      - Send over http
               ...
         printer/
               ps        - Print postscript
               text      - Print raw ascii text



  We'll have to create plugin registry. This will be handy for developers and
for the users. I guess someone should maintain it too (accept updates from
plugin developers, update mimetype.h etc..). It would be nice to have a 
dedicated homepage for this too.


--
  If you have more ideas or don't like something about my design - please
tell me.

  All comments are highly welcome.

-----------------------------
Vladimir Lobak (vels@vdo.net)
