#ifndef MDEXTERN_H
#define MDEXTERN_H

/* Common parts not dependent on MD8.0/8.2+ version */

#define MDAPI_GET_TRANSPONDER        0x01020000
#define MDAPI_SET_TRANSPONDER        0x01020001

#define MDAPI_GET_PROGRAMM           0x01020010
#define MDAPI_SET_PROGRAMM           0x01020011
#define MDAPI_RESCAN_PROGRAMM        0x01020012
#define MDAPI_SAVE_PROGRAMM          0x01020013
#define MDAPI_GET_PROGRAMM_NUMMER    0x01020014
#define MDAPI_SET_PROGRAMM_NUMMER    0x01020015

#define MDAPI_START_FILTER           0x01020020
#define MDAPI_STOP_FILTER            0x01020021

#define MDAPI_SCAN_CURRENT_TP        0x01020030
#define MDAPI_SCAN_CURRENT_CAT       0x01020031

#define MDAPI_START_OSD              0x01020040
#define MDAPI_OSD_DRAWBLOCK          0x01020041
#define MDAPI_OSD_SETFONT            0x01020042
#define MDAPI_OSD_TEXT               0x01020043
#define MDAPI_SEND_OSD_KEY           0x01020044
#define MDAPI_STOP_OSD               0x01020049

#define MDAPI_DVB_COMMAND            0x01020060

extern HINSTANCE	MultiDecInstance;
extern HINSTANCE	DLLInstance;
extern HWND    		MultiDecWindow;
extern BOOL    		MultiDecLog;
extern int          MultiDec_DLL_ID;
  

typedef struct TPIDFilters {
         char FilterName[5];
		 unsigned char FilterId;
		 unsigned short PID;
} TPIDFilters;

typedef enum
{
	RECPLAY_PLAY=1,
	RECPLAY_RECORD=2,
	RECPLAY_STOP=3
} RECPLAY_t;

struct TTransponder {
		int ttk;
        int power;
		int diseqc;
        unsigned int freq;
        int volt;
        int qam;
        unsigned int srate;
        int fec;
    	int sync;              /* sync from decoder */
    	int afc;               /* frequency offset in Hz */
	    unsigned short agc;             /* gain */
	    unsigned short nest;            /* noise estimation */
        unsigned int vber;            /* viterbi bit error rate */
        unsigned short ts_id;
    	unsigned int sig;               
    	unsigned int err;               
	};


struct TProgrammNummer {
	    int RealNummer;
		int VirtNummer;
};


struct TTPCat {
    unsigned char  TAG;
    unsigned char  DesLen;
	unsigned short CA_ID;
	unsigned short EMM;
	unsigned short BufferLen;
    unsigned char  Buffer[64];
};

#define TPSIZE   256

struct TOSD_START {
        int DLL_Id;
	    unsigned char BitTiefe;
	    int x1;
	    int y1;
	    int x2;
	    int y2;
		BOOL Input;
};


struct TOSD_DRAW {
	unsigned short x;
	unsigned short y;
	unsigned short Sizex;
	unsigned short Sizey;
    unsigned short Color;
};

struct TOSD_SETFONT {
	unsigned short Typ;
	unsigned short Fg_Color;
	unsigned short Bg_Color;
};

struct TOSD_SETEXT {
	unsigned short x;
	unsigned short y;
	char Zeile[128];
};

struct TSTART_FILTER {
	unsigned short DLL_ID;
	unsigned short Filter_ID;
	unsigned short Pid;
	unsigned char Name[32];
	DWORD Irq_Call_Adresse;
	int Running_ID;
	DWORD m_ExtSize;
	byte m_SectionMask;
	byte m_SectionData;
	bool m_185Mode;
};


struct TDVB_COMMAND{
	unsigned short Cmd_laenge;
	unsigned short Cmd_Buffer[32];
};


#include "MDExtern80.h"
#include "MDExtern82.h"

#endif