Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Viewing Files With Plugins
From: Daniel Stenberg (daniel_at_haxx.se)
Date: 2004-01-08


Hi friends,

I bounced around a new design idea with Björn, and here's what we came up
with. I'm interested in feedback. Would this system be an improvement?

Viewing a File

  When a file is PLAYed, the following will be made in order to figure out
  what to do with the particular file:

  1. Internally recognized extensions (.mp3) (like today)

  2. Extension config file ".rockbox/view.config". A config file lists
     extensions and what plugin (file name) that should be ran to view that
     particular file.

  3. Check if ".rockbox/viewer/[extension]-[anything].rock" exists, and if it
     does: use that.

  4. If none of the above worked, the file type is unsupported.

No Rebuild Needed

  This enables users to add, remove or replace viewers at will with no
  rebuilds at all necessary, and without Rockbox even being aware of what
  plugins that exist or not.

View With

  The "on play" screen can then get a "view with..." option that offers the
  user to view the currently selected file using one of the viewers present in
  the ".rockbox/viewer" directory. This would enable for example .m3u files to
  get viewed by the text viewer, or sending an mp3 file to a hex-editor etc.

  The concept of "view supported" files will break, so we should probably
  remove that.

Icons

  There's currently no solution here for how to make particular files get
  custom icons in the dir browser. We could probably let the existing icons
  remain until we think of a system to fix this.

Build System

  We would add a separate config file in the build system that makes viewer
  plugins get a suitable name for the viewer-directory when built. So that
  viewer.c becomes txt-viewer.rock and chip8.c becomes ch8-chip8.rock etc. If
  the plugin is not mentioned in this file, it would be named like today.

What did we forget? What should be added? What should be removed?

-- 
 Daniel Stenberg -- http://rockbox.haxx.se/ -- http://daniel.haxx.se/



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa