home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 April
/
PCWorld_2008-04_cd.bin
/
multimedia
/
mediacoder
/
MediaCoder-0.6.0.3905.exe
/
extensions
/
Zune.7z
/
main.js
< prev
next >
Wrap
Text File
|
2007-05-27
|
2KB
|
72 lines
/*************************************************************************
* MediaCoder extension - Microsoft Zune Transcoder
* Distributed under GPL license
* Copyright (c) 2007 Jeffrey McKowan (AKA BlinkN) <venom05@gmail.com>
* All rights reserved.
*************************************************************************/
var busy = false;
function ApplyParams()
{
if (busy) return;
busy = true;
var doc = NewXML("MediaCoderPrefs");
if (!doc) {
alert("Error creating config XML");
return;
}
var res = document.getElementById("res").value.split("x");
var format = document.getElementById("format").value;
switch (format) {
case "XviD":
AddPrefNode(doc, "overall.container.format", "MP4");
AddPrefNode(doc, "videoenc.xvid.gmc", "false");
AddPrefNode(doc, "overall.audio.encoder", "Nero Encoder");
AddPrefNode(doc, "audioenc.nero.quality", document.getElementById("aq").value);
break;
case "Windows Media":
AddPrefNode(doc, "overall.container.format", "Default");
AddPrefNode(doc, "overall.audio.encoder", "Windows Media Audio");
var fmt;
switch (document.getElementById("aq").value) {
case "50":
fmt = "192 kbps, 44 kHz, stereo (A/V) CBR";
break;
case "40":
fmt = "128 kbps, 44 kHz, stereo (A/V) CBR";
break;
case "20":
fmt = "64 kbps, 44 kHz, stereo (A/V) CBR";
break;
case "10":
fmt = "48 kbps, 44 kHz, stereo (A/V) CBR";
break;
default:
fmt = "96 kbps, 44 kHz, stereo (A/V) CBR";
break;
}
SetPrefValue("videoenc.wm.audioFormat", fmt);
break;
}
AddPrefNode(doc, "overall.video.format", format);
AddPrefNode(doc, "overall.video.bitrate", document.getElementById("vb").value);
AddPrefNode(doc, "videofilter.frame.enabled", "true");
AddPrefNode(doc, "videofilter.frame.fps", document.getElementById("fps").value);
AddPrefNode(doc, "videofilter.frame.fpsScale", "1");
AddPrefNode(doc, "videofilter.scale.enabled", "true");
AddPrefNode(doc, "videofilter.scale.width", res[0]);
AddPrefNode(doc, "videofilter.scale.height", res[1]);
// post settings to MediaCoder
PostPrefXML(doc);
busy = false;
}
function Unload()
{
// stop playback
SendCommand("stop_play");
}