|-----------------------------------------------------------------------------|
| RADIATOR SDK (development kit)	28/04/2001      		      |
|-----------------------------------------------------------------------------|
| Freeware. Made in Czech Republic.   2001 Miroslav Flesko                   |
| http://flesko.cz   Any comments and suggestions: miroslav@flesko.cz         |
|-----------------------------------------------------------------------------|

PLUGINS DIRECTORY
-----------------
Plugins should be stored in Radiator's subdirectory Plugins 
(for example c:\Program Files\Radiator\Plugins.
If there are any file(s) that plugin needs they should be stored there also.
If plugin needs to save its configuration PREFERABLY USE plugins.ini file in
Plugins subdirectory.
Items should be stored in plugins.ini file in the folloving form:

[name of the module] 	;for example [sf16fmi] for sf16fmi.dll plugin
entry=value		;for example Port=$384

HOW TO DEVELOP OWN DRIVER (PLUGIN) FOR RADIATOR:
------------------------------------------------
The idea originally came from well-known MikeCrash. He made his own 
application (AFM radio) which was designed for BT878 based cards but his 
application could accept plugins for other cards as well.

Some time after we created the first proposal of the new plugins interface 
which included more functions and possibilities.

The Radiator plugins interface is strongly based on our given standard.

Interface:
----------
Here is the list of functions and procedures which the Radiator plugin exports.

Required in all plugins                         Description 
------------------------------------------------------------------------------
function GetModuleName: PChar; stdcall;         Exported name of the module. 
                                                Must not be empty for Radiator 
                                                to recognize the plugin. 
function GetModuleInfo: Cardinal; stdcall;      Gives info of plugin possibilities.
                                                The result are ORed "module supports"
                                                constants:
                                                eg. FM_TUNE or FM_MUTEUNMUTE
                                                which is the same as 
                                                FM_TUNE + FM_MUTEUNMUTE
                                                Result would be 1 + 4 = 5. 
function HWInit: Boolean; stdcall;              Initializes hardware. 
function HWDeInit: Boolean; stdcall;            Deinitializes hardware. 

Optional                                        Description 
------------------------------------------------------------------------------ 
function GetModuleComment: PChar; stdcall;      Description, copyright etc. 
procedure TuneFreq (Freq: LongInt); stdcall;    Matches FM_TUNE. Frequency is 
                                                given in kHz 
                                                (88.2 MHz -> 88200 kHz). 
procedure TuneFreqMuted (Freq: LongInt); stdcall;  Matches FM_TUNEMUTED. 
                                                Frequency is given in kHz 
                                                (88.2 MHz -> 88200 kHz). 
procedure SetMute (Mute: Boolean); stdcall;     Matches FM_MUTEUNMUTE. 
function ScanStation (DirectionUp:Boolean;      Radiator does not use it 
FreqToSearchFrom: LongInt): LongInt; stdcall;   yet. Matches FM_SCANSTATION. 
                                                Parameters are direction 
                                                (up to high range - True 
                                                or down to low range - False) 
                                                and current frequency to search from. 
                                                Returns new frequency. 

function GetVolume: Word; stdcall;              Radiator does not use it yet. 
                                                Matches GETVOLUME. 
procedure SetVolume (Left,Right: Word); stdcall; Radiator does not use it yet. 
                                                Matches FM_SETVOLUMEBYVALUE. 
procedure VolumeUpDown(Step: Integer); stdcall; Matches FM_SETVOLUMEUPDOWN. 
procedure SetBass(Bass: Word); stdcall;         Radiator does not use it yet. 
                                                Matches FM_BASSTREBLE. 
function GetBass: Word; stdcall;                Radiator does not use it yet. 
                                                Matches FM_BASSTREBLE. 
procedure SetTreble(Treble: Word); stdcall;     Radiator does not use it yet. 
                                                Matches FM_BASSTREBLE. 
function GetTreble: Word; stdcall;              Radiator does not use it yet. 
                                                Matches FM_BASSTREBLE. 
function IsStereo: Boolean; stdcall;            Radiator does not use it yet.
                                                Matches FM_ISSTEREO. 
procedure SetStereo (Stereo: Boolean); stdcall; Matches FM_SETSTEREO. 
function GetSignal: Word; stdcall;              Matches FM_GETSIGNAL. 
procedure ConfigurationDialog; stdcall;         Matches FM_CONFIGURATIONDIALOG. 

 
Functions to use for direct port access:
----------------------------------------
Direct access to port is performed by dlportio.dll shipped and installed with Radiator.
DO NOT USE YOUR OWN DRIVERS NOR DIRECT ASM PORT DIRECTIVES 
- IT WOULD BE UNNECESSARY AND REDUNDANT. 
Port access by asm directives does not work on NT based systems.
Default path where the plugins are installed is RADIATOR_PATH+PLUGINS_PATH 
(for example in c:\Program Files\Radiator\Plugins).
Dlportio.dll is always in RADIATOR_PATH directory, where it can be accessed.

function GetPortByte(Address : Word) : Byte;
procedure SetPortByte(Address : Word; Data : Byte);
function GetPortWord(Address : Word) : Word;
procedure SetPortWord(Address : Word; Data : Word);
function GetPortDWord(Address : Word) : Longword;
procedure SetPortDWord(Address : Word; Data : Longword);
function OpenDriver: Boolean;
procedure CloseDriver;


"Module supports" constants:
----------------------------
Constant                Decimal value           Description 
---------------------------------------------------------------------------
FM_TUNE= 1 shl 0;               1               Supports setting frequency. 
FM_TUNEMUTED= 1 shl 1;          2               Supports setting frequency 
                                                "silently". Output is muted, 
                                                but frequency is set. 
                                                Then just unmute to hear it. 
FM_MUTEUNMUTE= 1 shl 2;         4               Supports muting/unmuting. 
FM_GETVOLUME= 1 shl 3;          8               Supports GetVolume function. 
FM_SETVOLUMEBYVALUE= 1 shl 4;   16              Supports setting volume 
                                                "digitally" by setting a value. 
FM_SETVOLUMEUPDOWN= 1 shl 5;    32              Supports setting volume up 
                                                and down by discrete steps 
                                                (this is how Radiator works now). 
FM_BASSTREBLE= 1 shl 6;         64              Supports bass & treble. 
FM_ISSTEREO= 1 shl 7;           128             Supports stereo identification. 
FM_SETSTEREO= 1 shl 8;          256             Also called forced stereo or mono. 
FM_GETSIGNAL= 1 shl 9;          512             Station is/is not tuned to signal. 
FM_AMRANGE= 1 shl 10;           1024            Supports AM range 
                                                (not prepared in Radiator now). 
FM_RDS= 1 shl 11;               2048            Supports RDS - not prepared 
                                                in any way yet ;-). 
FM_SCANSTATION= 1 shl 12;       4096            Supports scanning - parameters are
                                                direction (up to high range - True 
                                                or down to low range - False) 
                                                and current frequency to 
                                                search from. Returns new frequency. 
FM_CONFIGURATIONDIALOG= 1 shl 16; 65536         Supports configuration dialog. 

There is sample sf16fmi plugin included in the developer pack togethet with its 
source code in Delphi (Object Pascal) so you can get inspiration from there.


HOW TO MAKE THE PLUGIN AVAILABLE FOR OTHER USERS OF RADIATOR:
-------------------------------------------------------------
Send it to miroslav@flesko.cz and I will add it for download :-)