#include <InterfaceKit.h>
#include "Player.h"
#include "mikmod.h"
#include "ptform.h"
#include "ZSlider.h"

// Globals, MikMod needs these 

UNIMOD *mf=NULL;
CHAR *ERROR_OPENING_FILE=(CHAR *)"error";
CHAR *ERROR_OUT_OF_MEMORY=(CHAR *)"error";
CHAR *ERROR_END_OF_FILE=(CHAR *)"error";
CHAR *ERROR_DISK_FULL=(CHAR *)"error";
Object *dual_object;
char *glblfn;

// static data

static const uchar xm_large_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x00,
0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x13,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xff,0x00,0x00,0xfa,
0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0x00,0xfa,0xfa,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x00,0x13,0xff,0xff,
0xff,0x00,0x00,0xfa,0x00,0xfa,0x00,0x13,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,0xfa,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x2a,0x00,0x13,0xff,0xff,
0xff,0xff,0x00,0x00,0xfa,0x00,0x00,0x13,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,
0xff,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0xfa,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0xfa,0x00,0x13,0x00,0x13,0x00,0xfa,
0x00,0x13,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x13,0x00,0xfa,0x00,0x00,0xfa,0x00,0x13,0xff,0x13,0x00,0xfa,
0x00,0x13,0xff,0xff,0xff,0x00,0x5a,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x13,0x00,0xfa,0x00,0x00,0xfa,0x00,0x13,0xff,0xff,0x00,0xfa,
0x00,0x13,0xff,0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0xff,0xff,0x00,0x00,
0x00,0x13,0xff,0x00,0x3f,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0xff,0xff,0xff,0x13,
0x13,0x13,0x00,0x5a,0x3f,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x9c,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,
0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x9c,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x00,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x2a,0x2a,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x2a,0x2a,0x00,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x18,0xcd,0x00,0x9c,0x9c,0x00,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x2a,0x18,0x2a,0x1c,0x2f,0x00,0x00,0x07,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x9c,0x9c,0x00,0x1c,0xe0,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x2a,0x1c,0x7d,0x1c,0x7d,0x18,0xd1,0x00,0xff,0xff,
0xff,0xff,0x00,0x23,0x00,0x2a,0x2a,0x00,0x00,0x2a,0x2a,0x00,0x18,0xe0,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x7d,0x1c,0x7d,0x1c,0x7d,0x18,0x7d,0x18,0xd1,0x07,0xff,
0xff,0x00,0x72,0x18,0xd2,0x00,0x2a,0x2a,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x7d,0x1c,0x7d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x18,0x72,0x18,0x72,0x00,0x2a,0x2a,0x00,0x18,0x55,0x00,0x12,0x12,0x12,
0x12,0x12,0x12,0x00,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x00,0x12,
0xff,0x00,0x72,0x18,0x72,0x18,0x72,0x00,0x00,0x18,0x55,0x18,0x55,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x11,0x72,0x18,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x4b,
0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x5d,0x11,0x00,0x12,
0xff,0xff,0x07,0x11,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x35,0x13,
0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x11,0x00,0x12,0x12,
0xff,0xff,0xff,0x07,0x00,0x00,0x39,0x55,0x18,0x35,0x18,0x35,0x13,0x35,0x13,0x4b,
0x13,0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x00,0x00,0x00,0x12,0x12,0xff,
0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x39,0x13,0x35,0x13,0x35,0x13,
0x4b,0x13,0x4b,0x13,0xfa,0x18,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar xm_small_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xb2,0xb2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xd2,0xf2,0xff,0x00,0x00,0x00,
0x00,0xfa,0x00,0xf2,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xd2,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0x00,0xfa,0xfa,0x00,
0x00,0x00,0xfa,0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,
0xf2,0x00,0x00,0xfa,0x00,0x00,0x25,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0x00,0xfa,0x00,0x25,0x00,0x25,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,0x00,0xfa,0x00,0x25,0x25,0xd2,0x00,0xfa,0x00,
0x00,0xfa,0x00,0xf2,0x00,0xfa,0x00,0x00,0xfa,0x00,0x25,0xd2,0xf2,0x00,0xfa,0x00,
0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0xf2,0x11,0x00,0x00,0x00,
0xff,0x11,0x11,0x11,0xff,0x25,0x25,0x25,0x25,0x25,0x25,0x11,0xff,0xff,0x11,0x11,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar s3m_large_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,
0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0xfa,0xfa,0x00,0xfa,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x00,0x13,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x2a,0x00,0x13,0xff,0xff,
0xff,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0x11,0x00,0xfa,0x00,0x11,0x00,0xfa,0x00,0xfa,0x00,0x11,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0x11,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0x00,0x5a,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x11,0x00,0xfa,
0x00,0x11,0xff,0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,
0x00,0x11,0xff,0x00,0x3f,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0xff,0x11,
0x11,0x11,0x00,0x5a,0x3f,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x9c,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,
0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x9c,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x00,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x2a,0x2a,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x2a,0x2a,0x00,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x18,0xcd,0x00,0x9c,0x9c,0x00,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x2a,0x18,0x2a,0x1c,0x2f,0x00,0x00,0x07,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x9c,0x9c,0x00,0x1c,0xe0,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x2a,0x1c,0x7d,0x1c,0x7d,0x18,0xd1,0x00,0xff,0xff,
0xff,0xff,0x00,0x23,0x00,0x2a,0x2a,0x00,0x00,0x2a,0x2a,0x00,0x18,0xe0,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x7d,0x1c,0x7d,0x1c,0x7d,0x18,0x7d,0x18,0xd1,0x07,0xff,
0xff,0x00,0x72,0x18,0xd2,0x00,0x2a,0x2a,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x7d,0x1c,0x7d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x18,0x72,0x18,0x72,0x00,0x2a,0x2a,0x00,0x18,0x55,0x00,0x12,0x12,0x12,
0x12,0x12,0x12,0x00,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x00,0x12,
0xff,0x00,0x72,0x18,0x72,0x18,0x72,0x00,0x00,0x18,0x55,0x18,0x55,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x11,0x72,0x18,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x4b,
0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x5d,0x11,0x00,0x12,
0xff,0xff,0x07,0x11,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x35,0x13,
0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x11,0x00,0x12,0x12,
0xff,0xff,0xff,0x07,0x00,0x00,0x39,0x55,0x18,0x35,0x18,0x35,0x13,0x35,0x13,0x4b,
0x13,0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x00,0x00,0x00,0x12,0x12,0xff,
0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x39,0x13,0x35,0x13,0x35,0x13,
0x4b,0x13,0x4b,0x13,0xfa,0x18,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar s3m_small_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xb2,0xb2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0xfa,0xfa,0x00,0xfa,0xfa,0x00,
0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,0xfa,0x00,
0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,
0x25,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,
0xf2,0x25,0x25,0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,
0x00,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xfa,0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,
0x00,0xfa,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0x00,0x25,0x00,0xfa,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x00,
0xff,0x11,0x11,0x11,0x11,0x25,0x25,0x25,0x25,0x25,0x25,0x11,0xff,0xff,0x11,0x11,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar mod_large_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0x00,
0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x00,0x13,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x2a,0x00,0x13,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,
0x00,0x11,0xff,0xff,0xff,0x00,0x5a,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0x00,
0x00,0x11,0xff,0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x11,0x11,0xff,0x00,0x3f,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0xff,0x00,0x5a,0x3f,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x9c,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,
0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x9c,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x00,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x2a,0x2a,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x2a,0x2a,0x00,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x18,0xcd,0x00,0x9c,0x9c,0x00,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x2a,0x18,0x2a,0x1c,0x2f,0x00,0x00,0x07,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x9c,0x9c,0x00,0x1c,0xe0,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x2a,0x1c,0x7d,0x1c,0x7d,0x18,0xd1,0x00,0xff,0xff,
0xff,0xff,0x00,0x23,0x00,0x2a,0x2a,0x00,0x00,0x2a,0x2a,0x00,0x18,0xe0,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x7d,0x1c,0x7d,0x1c,0x7d,0x18,0x7d,0x18,0xd1,0x07,0xff,
0xff,0x00,0x72,0x18,0xd2,0x00,0x2a,0x2a,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x7d,0x1c,0x7d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x18,0x72,0x18,0x72,0x00,0x2a,0x2a,0x00,0x18,0x55,0x00,0x12,0x12,0x12,
0x12,0x12,0x12,0x00,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x00,0x12,
0xff,0x00,0x72,0x18,0x72,0x18,0x72,0x00,0x00,0x18,0x55,0x18,0x55,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x11,0x72,0x18,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x4b,
0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x5d,0x11,0x00,0x12,
0xff,0xff,0x07,0x11,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x35,0x13,
0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x11,0x00,0x12,0x12,
0xff,0xff,0xff,0x07,0x00,0x00,0x39,0x55,0x18,0x35,0x18,0x35,0x13,0x35,0x13,0x4b,
0x13,0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x00,0x00,0x00,0x12,0x12,0xff,
0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x39,0x13,0x35,0x13,0x35,0x13,
0x4b,0x13,0x4b,0x13,0xfa,0x18,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar mod_small_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xb2,0xb2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0x00,0x00,
0x00,0xfa,0xfa,0xfa,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,0xfa,0x00,0x00,0xfa,0x00,
0x00,0xfa,0x00,0x00,0xfa,0x00,0x00,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,
0xff,0x11,0x11,0x11,0x11,0x25,0x25,0x25,0x25,0x25,0x25,0x11,0x11,0x11,0x11,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar it_large_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x12,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x12,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x00,0x13,0xff,0xff,
0xff,0xff,0x12,0x00,0xfa,0x00,0x12,0x12,0x12,0x12,0x00,0xfa,0x00,0x12,0x12,0x12,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x2a,0x00,0x13,0xff,0xff,
0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,
0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xff,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0x00,0x5a,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x12,0xff,0x00,0xfa,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x12,0xff,0x00,0x00,0x00,0x12,0xff,0xff,
0xff,0xff,0xff,0x00,0x3f,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0x12,0x12,0x12,0xff,0xff,
0xff,0xff,0x00,0x5a,0x3f,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x5a,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x9c,0x5a,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
0x9c,0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x9c,
0x9c,0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x2a,0x9c,
0x00,0x13,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x00,0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x2a,0x2a,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x2a,0x2a,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00,0x2a,0x2a,0x00,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x18,0xcd,0x00,0x9c,0x9c,0x00,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x2a,0x18,0x2a,0x1c,0x2f,0x00,0x00,0x07,0xff,0xff,0xff,
0xff,0xff,0x00,0x00,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x9c,0x9c,0x00,0x1c,0xe0,0x1c,
0xe0,0x1e,0x2a,0x1c,0x2a,0x1c,0x2a,0x1c,0x7d,0x1c,0x7d,0x18,0xd1,0x00,0xff,0xff,
0xff,0xff,0x00,0x23,0x00,0x2a,0x2a,0x00,0x00,0x2a,0x2a,0x00,0x18,0xe0,0x1c,0xe0,
0x1c,0x2a,0x1e,0x2a,0x1c,0x7d,0x1c,0x7d,0x1c,0x7d,0x18,0x7d,0x18,0xd1,0x07,0xff,
0xff,0x00,0x72,0x18,0xd2,0x00,0x2a,0x2a,0x2a,0x2a,0x00,0x18,0xd2,0x00,0x00,0x00,
0x00,0x00,0x00,0x1c,0x7d,0x1c,0x7d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x18,0x72,0x18,0x72,0x00,0x2a,0x2a,0x00,0x18,0x55,0x00,0x12,0x12,0x12,
0x12,0x12,0x12,0x00,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x00,0x12,
0xff,0x00,0x72,0x18,0x72,0x18,0x72,0x00,0x00,0x18,0x55,0x18,0x55,0x00,0x00,0x00,
0x00,0x00,0x00,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x18,0x5d,0x18,0x5d,0x18,0x00,0x12,
0xff,0x00,0x11,0x72,0x18,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x4b,
0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x5d,0x5d,0x11,0x00,0x12,
0xff,0xff,0x07,0x11,0x72,0x18,0x55,0x18,0x55,0x18,0x55,0x18,0x35,0x13,0x35,0x13,
0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x18,0x11,0x00,0x12,0x12,
0xff,0xff,0xff,0x07,0x00,0x00,0x39,0x55,0x18,0x35,0x18,0x35,0x13,0x35,0x13,0x4b,
0x13,0x4b,0x13,0xfa,0x18,0xfa,0x18,0xfa,0x18,0xfa,0x00,0x00,0x00,0x12,0x12,0xff,
0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x39,0x13,0x35,0x13,0x35,0x13,
0x4b,0x13,0x4b,0x13,0xfa,0x18,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x12,0x12,0x12,0x12,0x12,0x12,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
static const uchar it_small_icon[] = {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xb2,0xb2,0xd2,0xf2,0xff,0xff,0xff,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x11,
0xff,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0x11,
0xff,0xf2,0x25,0x00,0xfa,0x00,0x25,0x25,0x25,0x25,0x00,0xfa,0x00,0x25,0x25,0x11,
0xf2,0xd2,0xb2,0x00,0xfa,0x00,0x25,0xb2,0xb2,0xb2,0x00,0xfa,0x00,0x25,0xd2,0xf2,
0xf2,0xd2,0xb2,0x00,0xfa,0x00,0x25,0xb2,0xb2,0xb2,0x00,0xfa,0x00,0x25,0xd2,0xf2,
0xff,0xf2,0xd2,0x00,0xfa,0x00,0x25,0xb2,0xb2,0xb2,0x00,0xfa,0x00,0x25,0xf2,0x11,
0xff,0x00,0x00,0x00,0xfa,0x00,0x00,0x00,0xb2,0xb2,0x00,0xfa,0x00,0x25,0x11,0xff,
0xff,0x00,0xfa,0xfa,0xfa,0xfa,0xfa,0x00,0x25,0xb2,0x00,0xfa,0x00,0x11,0xff,0xff,
0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25,0xb2,0x00,0x00,0x00,0x11,0xff,0xff,
0xff,0xff,0x11,0x11,0x11,0x25,0x25,0x25,0x25,0xd2,0xf2,0x11,0x11,0x11,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xd2,0xd2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf2,0xf2,0x11,0xff,0xff,0xff,0xff,0xff,0xff,
};

static const char *mimelist[]=
{
	"audio/xm",
	"audio/it",
	"audio/s3m",
	"audio/mod",
	NULL
};

// Misc defines

class MODView;
#define MIK_LOOP	'mklp'
#define MIK_EXT		'mkex'
#define MIK_BPM		'mkbm'
#define MIK_REVERB	'mkrb'
#define MIK_DELAY	'mkde'
#define MIK_PANNING 'mkpn'

// Instance of our object

struct instance_struct
{	
	BMessage *prefs;
	MODView *view;
};

class MODView : public BView
{
	private:
	
	BCheckBox 		*disallow;
	BCheckBox 		*extspd;
	BCheckBox 		*panning;
	
	instance_struct	*inst;

	public:
				MODView(instance_struct	*i):BView(BRect(0,0,199,179),"MODView",NULL,B_WILL_DRAW)
				{
					inst=i;
					
					disallow = new BCheckBox(BRect(0,0,199,10),"","Disallow loop effect",new BMessage(MIK_LOOP));
					AddChild(disallow);
					extspd = new BCheckBox(BRect(0,18,199,28),"","Extended speed flag",new BMessage(MIK_EXT));
					AddChild(extspd);
					panning = new BCheckBox(BRect(0,36,199,46),"","Enable DMP panning",new BMessage(MIK_PANNING));
					AddChild(panning);
				};
		
	void		Draw(BRect frame)
				{
					SetFont(be_plain_font);
					SetDrawingMode(B_OP_OVER);
					DrawString("©1997 by Jake Stine and Tinic Urou",BPoint(19,176));
					BView::Draw(frame);
				}
				
	void		AttachedToWindow(void)
				{
					Window()->Lock();
					if(inst->prefs)
					{
						disallow->SetValue(inst->prefs->FindBool("DisallowEffectLoop"));
						extspd->SetValue(inst->prefs->FindBool("ExtendedSpeed"));
						panning->SetValue(inst->prefs->FindBool("DMPPanning"));
					}
					disallow->SetTarget(this);
					extspd->SetTarget(this);
					panning->SetTarget(this);
					Window()->Unlock();
				};
	
	void 		MessageReceived(BMessage *msg)
				{
					switch(msg->what)
					{
						case	MIK_LOOP:
								if(inst->prefs)
								{
									inst->prefs->ReplaceBool("DisallowEffectLoop",disallow->Value());
									md_noloopeffect=inst->prefs->FindBool("DisallowEffectLoop");	
								}
								break;
						case	MIK_EXT:
								if(inst->prefs)
								{
									inst->prefs->ReplaceBool("ExtendedSpeed",extspd->Value());
									if(mf)
									{
										mf->extspd=inst->prefs->FindBool("ExtendedSpeed");	
									}
								}
						case	MIK_PANNING:
								if(inst->prefs)
								{
									inst->prefs->ReplaceBool("DMPPanning",panning->Value());
									if(mf)
									{
										mf->panflag=inst->prefs->FindBool("DMPPanning");	
									}
								}
								break;
					}
				};
					
};

static void tickhandler(void)
{
	MP_HandleTick();
}

long class_dispatcher(Class *c, Object *o, uint32 MethodID, uint32 *data)
{
	instance_struct *inst=(instance_struct *)o->Instance(c);

	o->SetError(B_NO_ERROR);

	switch(MethodID)
	{
		case	B_METHOD_CONSTRUCT:
				{
					md_mixfreq      =44100;       
					md_mode         =DMODE_16BITS|DMODE_STEREO; 
					md_device       =0;   
					md_pansep		=128;
					md_volume		=128;
					
					inst->prefs=NULL;

					ML_RegisterLoader(&load_it);   
					ML_RegisterLoader(&load_far);   
					ML_RegisterLoader(&load_med);
					ML_RegisterLoader(&load_mtm);
					ML_RegisterLoader(&load_s3m);
					ML_RegisterLoader(&load_stm);
					ML_RegisterLoader(&load_ult);
					ML_RegisterLoader(&load_xm);
					ML_RegisterLoader(&load_dsm);   
					ML_RegisterLoader(&load_mod);
					ML_RegisterLoader(&load_669);   
					ML_RegisterLoader(&load_m15);   
					
					MD_RegisterDriver(&drv_be);
					MD_RegisterPlayer(tickhandler);
					
					if(MD_Init()) 	o->SetError(B_ERROR);
					else			o->SetError(B_NO_ERROR);
					
					inst->view = new MODView(inst);

					BMimeType *mime = new BMimeType("audio/xm");
					if(!mime->IsInstalled())
					{
						BBitmap *large = new BBitmap(BRect(0,0,31,31),B_COLOR_8_BIT);
						large->SetBits(xm_large_icon,32*32,0,B_COLOR_8_BIT);
						BBitmap *mini = new BBitmap(BRect(0,0,15,15),B_COLOR_8_BIT);
						mini->SetBits(xm_small_icon,16*16,0,B_COLOR_8_BIT);

						BMessage *msg = new BMessage();
						msg->AddData("extensions",'MXTT',"xm",4);
						mime->SetIcon(large,B_LARGE_ICON);
						mime->SetIcon(mini,B_MINI_ICON);
						mime->SetFileExtensions((const BMessage *)msg);
						mime->SetPreferredApp("application/x-tinic.DualPlayer");
						mime->SetShortDescription("FastTracker module");
						mime->SetLongDescription("Module format with many features.");
						mime->Install();

						delete msg;
						delete large;
						delete mini;
					}
					delete mime;

					mime = new BMimeType("audio/s3m");
					if(!mime->IsInstalled())
					{
						BBitmap *large = new BBitmap(BRect(0,0,31,31),B_COLOR_8_BIT);
						large->SetBits(s3m_large_icon,32*32,0,B_COLOR_8_BIT);
						BBitmap *mini = new BBitmap(BRect(0,0,15,15),B_COLOR_8_BIT);
						mini->SetBits(s3m_small_icon,16*16,0,B_COLOR_8_BIT);

						BMessage *msg = new BMessage();
						msg->AddData("extensions",'MXTT',"s3m",4);
						mime->SetIcon(large,B_LARGE_ICON);
						mime->SetIcon(mini,B_MINI_ICON);
						mime->SetFileExtensions((const BMessage *)msg);
						mime->SetPreferredApp("application/x-tinic.DualPlayer");
						mime->SetShortDescription("ScreamTracker3 module");
						mime->SetLongDescription("Module format with many features.");
						mime->Install();

						delete msg;
						delete large;
						delete mini;
					}
					delete mime;

					mime = new BMimeType("audio/it");
					if(!mime->IsInstalled())
					{
						BBitmap *large = new BBitmap(BRect(0,0,31,31),B_COLOR_8_BIT);
						large->SetBits(it_large_icon,32*32,0,B_COLOR_8_BIT);
						BBitmap *mini = new BBitmap(BRect(0,0,15,15),B_COLOR_8_BIT);
						mini->SetBits(it_small_icon,16*16,0,B_COLOR_8_BIT);

						BMessage *msg = new BMessage();
						msg->AddData("extensions",'MXTT',"it",4);
						mime->SetIcon(large,B_LARGE_ICON);
						mime->SetIcon(mini,B_MINI_ICON);
						mime->SetFileExtensions((const BMessage *)msg);
						mime->SetPreferredApp("application/x-tinic.DualPlayer");
						mime->SetShortDescription("ImpulseTracker module");
						mime->SetLongDescription("State of the art module format.");
						mime->Install();

						delete msg;
						delete large;
						delete mini;
					}
					delete mime;

					mime = new BMimeType("audio/mod");
					if(!mime->IsInstalled())
					{
						BBitmap *large = new BBitmap(BRect(0,0,31,31),B_COLOR_8_BIT);
						large->SetBits(mod_large_icon,32*32,0,B_COLOR_8_BIT);
						BBitmap *mini = new BBitmap(BRect(0,0,15,15),B_COLOR_8_BIT);
						mini->SetBits(mod_small_icon,16*16,0,B_COLOR_8_BIT);

						BMessage *msg = new BMessage();
						msg->AddData("extensions",'MXTT',"mod",4);
						mime->SetIcon(large,B_LARGE_ICON);
						mime->SetIcon(mini,B_MINI_ICON);
						mime->SetFileExtensions((const BMessage *)msg);
						mime->SetPreferredApp("application/x-tinic.DualPlayer");
						mime->SetShortDescription("Music module");
						mime->SetLongDescription("ProTracker and various other formats.");
						mime->Install();

						delete msg;
						delete large;
						delete mini;
					}
					delete mime;
	
					return 0;
				}
				
		case	B_METHOD_DESTROY:
				{
					MD_Exit();
					return 0;
				}
				
		case	P_LOAD:				// int handle (char *filename)
				{				
					glblfn=(CHAR *)data[0];

					if(mf=ML_LoadFN((CHAR *)data[0],inst->prefs->FindInt32("MaxChannels")))
					{	
						extern MLOADER *glb_loader;
						
						if(glb_loader)
						{
							BNode *node = new BNode((CHAR *)data[0]);
							BNodeInfo *nodeinfo = new BNodeInfo(node);
							if(strcmp(glb_loader->type,"S3M")==0)
								nodeinfo->SetType("audio/s3m");
							else if(strcmp(glb_loader->type,"IT")==0)	
								nodeinfo->SetType("audio/it");
							else if(strcmp(glb_loader->type,"XM")==0)	
								nodeinfo->SetType("audio/xm");
							else
								nodeinfo->SetType("audio/mod");
							delete nodeinfo;
							delete node;
						}
															
						if(inst->prefs)
						{
							md_volume=inst->prefs->FindInt32("Boosting");
							mf->loop=inst->prefs->FindBool("Loop");
							mf->extspd=inst->prefs->FindBool("ExtendedSpeed");
							mf->panflag=inst->prefs->FindBool("DMPPanning");

							md_noloopeffect=inst->prefs->FindBool("DisallowEffectLoop");
							md_stereodelay=0; 
							md_reverb=0;  
							md_pansep=128;
						}
						else
						{
							md_volume=128;
							mf->loop=1;
							mf->extspd=1;
							mf->panflag = 1;
							
							md_noloopeffect=0;
							md_stereodelay=0; 
							md_reverb=0;  
							md_pansep=128;
						}
						if(_mm_error)
						{
							if(dual_object)
							{
								dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
							}
						}							
						MP_PlayStart(mf);
						if(_mm_error)
						{
							if(dual_object)
							{
								dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
							}
						}
						MD_Update();
						if(_mm_error)
						{
							if(dual_object)
							{
								dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
							}
						}
						else
						{
							if(dual_object)
							{
								dual_object->DoMethod(D_NEW_MESSAGE,"MikMod 3.00 beta3 player, by Jake Stine & Tinic Urou");
							}
						}
						return (long)mf;
					};
					if(_mm_error)
					{
						if(dual_object)
						{
							dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
						}
					}
					return 0;
				}
									
		case	P_FREE:				// void (int handle)
				{
					MP_PlayStop(mf);
					ML_Free(mf);
					mf=NULL;
					return 0;
				}
					
		case	P_SETUPSTREAM:		// void (BAudioSubscriber *auds)
				{
					return 0;
				}
				
		case	P_STREAM:			// bool (void *arg, char *buffer, int size)
				{
					if(!MP_Ready(mf))
					{
						VC_WriteBytes((SBYTE *)data[1],data[2]);
						if(_mm_error)
						{
							if(dual_object)
							{
								dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
							}
						}
						return 1; 
					}
					if(_mm_error)
					{
						if(dual_object)
						{
							dual_object->DoMethod(D_NEW_MESSAGE,_mm_error);
						}
					}
					return 0;
				}
								
		case	P_DRAWSTATUS:		// void (BView *view)
				{
					char str[1024];
					BView *view=(BView *)data[0];
					view->MovePenTo(BPoint(4, 11));
					view->DrawString("Modname");
					view->MovePenTo(BPoint(56, 11));
					sprintf(str,":  %s",(char *)mf->songname[0] ? (char *)mf->songname : "n.a.");
					view->DrawString((char *)str);
					view->MovePenTo(BPoint(4, 22));
					view->DrawString("Modtype");
					view->MovePenTo(BPoint(56, 22));
					sprintf(str,":  %s",(char *)mf->modtype[0] ? (char *)mf->modtype : "n.a.");
					view->DrawString((char *)str);
					view->MovePenTo(BPoint(4, 33));
					view->DrawString("Playmode");
					view->MovePenTo(BPoint(56, 33));
					sprintf(str,":  %d channels",mf->numchn);
					view->DrawString((char *)str);

					return 0;
				}
				
		case	P_CREATEINFO: 		// void (char ***info)
				{								
					char ***info=(char ***)data[0];
					char **out;
					int32 c=0;
	
					*info=out=(char **)malloc(sizeof(char *)*(mf->numsmp+16));
										
					out[c]=(char *)malloc(64);								
					if(mf->songname)sprintf(out[c++],"%.63s",mf->songname);
					else 			sprintf(out[c++]," ");

					out[c]=(char *)malloc(2);								
					sprintf(out[c++],"-");
					out[c]=(char *)malloc(50);
					sprintf(out[c++],"       Samples: %03d  Channels: %03d",mf->numsmp,mf->numchn);
					out[c]=(char *)malloc(50);
					sprintf(out[c++],"     Positions: %03d  Patterns: %03d",mf->numpos,mf->numpat);
					out[c]=(char *)malloc(2);								
					sprintf(out[c++],"-");
	
					for(int32 i=0;i<mf->numsmp;i++)
					{
						char tmp[256];
						SAMPLE *s;
						out[c]=(char *)malloc(50);
						s=&mf->samples[i];
						if(s->samplename)
						{
							sprintf(tmp,"%.28s                                                  ",s->samplename);
							sprintf(out[c++],"%02d: %.28s %7d",i,tmp,s->length<<1);
						}
						else sprintf(out[c++],"%02d: ",i);
					}
	
					out[c]=(char *)malloc(2);								
					sprintf(out[c++],"-");	
					
					out[c++]=NULL; 		
					out[c++]=NULL; // End the list with a 0 !!!			
					
					return 0;
				}

		case	P_FREEINFO: 		// void (char ***info)
				{
					char **info=*((char ***)data[0]);
					
					for(int32 c=0;info[c];c++) free(info[c]);
					free(info);
					
					return 0;
				}

		case	P_SETATTR:			//  void (ulong AttributeID, ulong data)
				{
					uint32 ATTR =(ulong)data[0];
					uint32 DATA =(ulong)data[1];
// softwerks
// xiivff
					switch(ATTR)
					{
						case	P_ATTR_TRACK:
								break;
						case	P_ATTR_PREFS:
								inst->prefs=(BMessage *)DATA;
								if(!inst->prefs->HasBool("DisallowEffectLoop"))inst->prefs->AddBool("DisallowEffectLoop",FALSE);
								if(!inst->prefs->HasBool("ExtendedSpeed"))inst->prefs->AddBool("ExtendedSpeed",TRUE);
								if(!inst->prefs->HasBool("DMPPanning"))inst->prefs->AddBool("DMPPanning",TRUE);
								if(!inst->prefs->HasBool("MOD669Loader"))inst->prefs->AddBool("MOD669Loader",FALSE);
								break;
						case	P_ATTR_BOOST:
								md_volume=min_c(255,DATA);
								break;
						case	P_ATTR_MODPOS:
								int t=DATA;
								if(mf)
								if(t!=mf->sngpos)
								{		
									MP_SetPosition(mf,t);							
								}
								return 0;
						case	P_ATTR_LOOP:
								mf->loop=DATA;
								break;
								
						case	P_ATTR_DUALOBJECT:
								dual_object=(Object *)DATA;
								break;
					}
					o->DoSuperMethod(c,P_SETATTR,data);
					return 0;
				}
				
		case	P_POSITIONSTRING:
				{
					char *str=(char *)data[0];
					int32 allowedsize=(int)data[1];
					int32 value=(long)data[2];
				
					sprintf(str,"%03d",value);
					
					return 0;
				}
				
		case	P_GETATTR:			//  void (ulong AttributeID, ulong data)
				{
					uint32 ATTR =(ulong)data[0];
					uint32 DATA =(ulong)data[1];
					
					switch(ATTR)
					{
						case	P_ATTR_STREAMARG:
								*((int *)DATA)=NULL;
								return 0;
						case	P_ATTR_ID:
								*((char **)DATA)="MikMod V3.00";
								return 0;
						case	P_ATTR_VIEW:
								*((MODView **)DATA)=inst->view;
								return 0;
						case	P_ATTR_MODLENGTH:
								*((int *)DATA)=mf->numpos-1;
								return 0;
						case	P_ATTR_MODPOS:
								*((int *)DATA)=mf->sngpos;
								return 0;
						case	P_ATTR_TRACK:
								*((int *)DATA)=0;
								return 0;
						case	P_ATTR_TRACKNUM:
								*((int *)DATA)=0;
								return 0;
						case	P_ATTR_RECOGNITION:
								*((int *)DATA)=60;
								return 0;
						case	P_ATTR_MIME:
								*((const char ***)DATA)=mimelist;
						default:
								return o->DoSuperMethod(c,P_GETATTR,data);
					}
				}

		default:
				return o->DoSuperMethod(c,MethodID,data);
	}
}

char *class_superclass()
{
	return "dualplayer/player/baseplayer.zclass";
};

long class_instancesize()
{
	return sizeof(struct instance_struct);
};

long class_superversion()
{
	return 2;
};

long class_version()
{
	return 2;
};

