From: | Oliver Roberts |
Date: | 23 Apr 2001 at 19:08:08 |
Subject: | Re: Datatypes |
Hi Joris,
On 23-Apr-01 10:09:53 BST, Joris Kempen wrote:
> I need some explaination on datatypes:
>
> How do they work? You have two dirs: Classes/Datatypes and
> Devs/Datatypes. What is the difference between them and how do they work
> together.
>
> I guess that Classes/Datatypes/somedatatype.datatype is the file that
> handles the datatype, how go give back the data of it to an application.
Correct. These files contain the actual program code that is executed
to decode/read different filetypes.
> And the Devs/Datatypes/somedatatype determines what kind of it datatype
> it is and what makes it different from other datatypes.
Yep - the files in this directory are more commonly known as datatype
descriptors. These contain the filetype recognition code for each
datatype, a group id (e.g. picture, sound, text, etc) and also a "pointer"
to the datatype in SYS:Classes/Datatypes which handles that filetype.
> What is the relation between them? Does datatype in Devs/datatypes have a
> fixed "partner" in Classes/Datatypes? How to combine them?
Yes. Basically, when a file matches a datatype descriptor's recognition
information, the datatype system then passes the file onto the .datatype
file that is located in SYS:Classes/Datatypes.
For example... say you run something like "multiview test.jpg". The
datatypes system will then scan it's filetype database (built-up from
the files in DEVS:Datatypes) and when it finds a matching descriptor,
it'll then pass the info onto jpeg.datatype (or whatever name was
defined in the descriptor), loading it from SYS:Classes/Datatypes into
memory, if necessary.
> And what if you install multiple datatypes from different authors? Two
> different versions of a jpg datatype... which one will be used?
You can keep as many different files in SYS:Classes/Datatypes as you wish.
What matters is the files in DEVS:Datatypes - generally, you should not
have more than one descriptor in there that matches a certain type of
file. So, if you had two different JPEG descriptors in there (e.g.
JFIF for akJFIF and JPEG for WarpJPEG), the datatype that will actually
get used (akJFIF or WarpJPEG) will be whatever C:AddDatatypes happens
to find first in DEVS:Datatypes while scanning the directory.
> And programs that make use of datatypes: let's say i use Cyberwindow and
> it uses Datatypes, when i have mpeg datatype installed, can Cyberwindow
> display my mpeg files? Or let's say and WAVE datatype.... will
> Cyberwindow be able to play sounds? AFAIK is cyberwindow a graphics
No, because programs can specify which types of files (matching the
group ids given in the datatype descriptor files) they want to be
able to load. So, something like CyberWindow will specifically ask to
only receive pictures from the datatypes system. Whereas, Multiview
does not impose any restrictions and can therefore be used to view all
types of files (for which there are datatypes available).
> I use CGFX3.0 in combo with AmigaOS3.1 and i never know what datatypes to
> get for aminet or whereever. Any recommendations? I have the 24bit
> picture.datatype but what do i need more?
Just install the ones that you think you'll need... Generally, the
newer the datatype is, the better it will be (i.e. a newer JPEG
datatype, is better than using some ancient old one form Aminet :)
Shameless plug coming up :) Click on the URL below, and you'll find some
great datatypes for JPEG, PNG, BMP and PSD images.
Quote carefully and read all ADMIN:README mails
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/