//container coder
// container format
const CF_ENUM_STR =[
"Default", 
  "Raw Stream", 
  "AVI", 
  "MP4", 
  "Matroska", 
  "MPEG1", 
  "MPEG2", 
  "MPEG TS", 
  "M2TS", 
  "FLV",
  "F4V",
  "ASF", 
  "3GP", 
  "3GP2", 
  "MOV", 
  "OGG", 
  "MJPEG", 
  "RealMedia", 
  "DV", 
  "NUT", 
  "PMP"
];

const MUXER_ENUM_STR =[
"MP4Box", 
"MKVMerge", 
"TSMuxer", 
"MEncoder", 
"FFmpeg", 
"PMPMuxer", 
"MP4Creator"
];
const MUXER_INDEX_2_MUX_STR = ["mp4box","matroska","tsmuxer","mencoder","ffmpeg","pmp","mp4creator"];
const CF_STR_2_MUXER_STR = {"Default":"FFmpeg","MP4":"MP4Box","FLV":"FFmpeg","F4V":"MP4Box","3GP":"MP4Box","3GP2":"MP4Box",
                            "MPEG TS":"TSMuxer","Matroska":"MKVMerge","NONE":"FFmpeg","PMP":"PMPMuxer"};
// Audio Formats
const AF_ENUM_STR =[
"Default",  //0
"MP3",
"Vorbis",
"LC-AAC",
"HE-AAC",   //4
"HE-AAC V2", 
"WMA 7", 
"WMA 8", 
"WMA 9", 
"MP2",      //9
"AC3",
"MusePack",
"Speex",
"AMR",
"FLAC",       // 14
"APE",      //
"WavPack",
"ALAC", 
"PCM",
"ADPCM"         //19
];
// Audio Encoder
const AE_ENUM_STR =[
"LAME MP3",   //0
"Vorbis", 
"Nero Encoder",
"FAAC", 
"CT AAC+",   //4
"3GPP AAC+",
"WM Encoder",
"Helix MP3", 
"Fraunhofer MP3",
"MusePack",   // 9
"Speex",  
"AMR",
"FFmpeg",
"MEncoder",
"WavPack",   //14
"FLAC",
"APE",
"MP3HD",
"TTA",
"ALS",          //19
"OptimFROG",
"lossyWAV",
"Waveform",
"Stream Dumper",
"Generic CLI"   //24
];

const AE_INDEX_2_AENC_STR = ["lame","vorbis","nero","faac","aacplus", "aac3gp","wm","helix","fraunhofer","musepack", "speex","amr","ffmpeg","mencoder","wavpack",
                "flac","ape","mp3hd","tta","als", "ofr", "lossywav", "pcm", "ffmpeg", "cli"];
const AF_STR_2_AE_STR = {"MP3":"LAME MP3", "LC-AAC":"FAAC", "HE-AAC":"Nero Encoder",
"HE-AAC V2":"Nero Encoder", "WMA 9":"WM Encoder","NONE":"FFmpeg"}; 
// Video Formats
const VF_ENUM_STR =[
"XviD", 
"H.264", 
"MPEG1",
"MPEG2",
"MPEG4",
"Flash Video", 
"Theora", 
"VC-1", 
"WMV 7", 
"WMV 8", 
"WMV 9", 
"Dirac Video", 
"RealVideo", 
"H.263", 
"H.263+", 
"H.261", 
"MS-MPEG4-V2", 
"DV Video", 
"Motion JPEG", 
"Lossless JPEG", 
"Huffyuv", 
"Snow", 
"AMV", 
"Matrox MPEG2-I",
"Matrox MPEG2-I HD",
"Matrox DVCAM",
"Matrox DVPRO",
"Matrox DVPRO50",
"Canopus DV",
"Raw Video"
];

// Video Encoder
const VE_ENUM_STR =[
"x264", 
"CUDA Encoder", 
"XviD", 
"Theora Encoder", 
"VFW Encoder", 
"WM Encoder", 
"VC-1 Encoder", 
"MEncoder", 
"FFmpeg", 
"JM Encoder", 
"Dirac", 
"AMV Encoder", 
"Stream Dumper", 
"Frame Dumper", 
"x264 Remote"
];
//Video Enc
const VE_INDEX_2_VENC_STR = ["x264","cuda264","xvid","theora","vfw", "wm","vc1","mencoder","ffmpeg","jm", "dirac","amv","dumper","dumper","wm"]; 
const VF_STR_2_VE_STR = {"XviD":"XviD","H.264":"x264","VC-1":"VC-1 Encoder", "WMV 9":"VC-1 Encoder","NONE":"FFmpeg", "Matrox MPEG2-I":"VFW Encoder",
"Matrox MPEG2-I HD":"VFW Encoder", "Matrox DVCAM":"VFW Encoder", "Matrox DVPRO":"VFW Encoder", "Matrox DVPRO50":"VFW Encoder", "Canopus DV":"VFW Encoder"};

//Worker State
const WS_DISCONNECTED = -1;
const WS_CONNECTED = 0;
const WS_STARTED = 1;
const WS_EXITING = 2;
const WS_ERROR = 3;

// Task Priority
const TASK_LOWEST = 0;
const TASK_LOW = 1;
const TASK_NORMAL = 2;
const TASK_HIGH = 3;
const TASK_HIGHEST = 4;

//TASK LIST HEADER
const TL_HEAD_INDEX = 0;
const TL_HEAD_TITLE = 1;
const TL_HEAD_STATE = 2;
const TL_HEAD_PROGRESS = 3;
const TL_HEAD_SPEED = 4;
const TL_HEAD_TIME = 5;
const TL_HEAD_PRIORITY = 6;
const TL_HEAD_NODEID = 7;
const TL_HEAD_SIZE = 8;
const TL_HEAD_RESOLUTION = 9;

//task state
const TASK_NOTSET = -1;
const TASK_READY = 0;
const TASK_ENCODING = 1;
const TASK_ENCODING_PREPARE = 2;
const TASK_MUXING = 3;
const TASK_PAUSED = 4;
const TASK_DONE = 5;
const TASK_REUSABLE = 6;
const TASK_CANCELLED = 7;
const TASK_ERROR = 8;

//
const CONTENT_VIDEO = 1;
const CONTENT_AUDIO = 2;
const CONTENT_IMAGE = 3;
const CONTENT_OTHER = 4;

var LOCAL_PREF_DIR = "localprefs";
var REMOTE_PREF_DIR = "prefs";