From 9881fb7cea6e92d211ac57259083af7e43c9c4f7 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 8 Jun 2010 18:04:14 +0100 Subject: [PATCH] Added UI for additional rip options --- HandBrakeCluster/Job.class.php | 17 ++-- styles/normal.css | 7 ++ templates/rips/setup-rip.tpl | 139 ++++++++++++++++++++++++++------- 3 files changed, 125 insertions(+), 38 deletions(-) diff --git a/HandBrakeCluster/Job.class.php b/HandBrakeCluster/Job.class.php index 8417d17..ba3c410 100644 --- a/HandBrakeCluster/Job.class.php +++ b/HandBrakeCluster/Job.class.php @@ -116,12 +116,11 @@ class HandBrakeCluster_Job { return $jobs; } - public static function fromPostRequest($source_id, $config) { - $source_filename = base64_decode(str_replace('-', '/', HandBrakeCluster_Main::issetelse($source_id, HandBrakeCluster_Exception_InvalidParameters))); - $source = HandBrakeCluster_Rips_Source::load($source_filename); + public static function fromPostRequest($source_id, $global_options, $titles) { + $source = HandBrakeCluster_Rips_Source::loadEncoded(HandBrakeCluster_Main::issetelse($source_id, HandBrakeCluster_Exception_InvalidParameters)); $jobs = array(); - foreach ($config as $title => $details) { + foreach ($titles as $title => $details) { if (HandBrakeCluster_Main::issetelse($details['queue'])) { $job = new HandBrakeCluster_Job( $source, @@ -130,11 +129,11 @@ class HandBrakeCluster_Job { $source->filename(), HandBrakeCluster_Main::issetelse($details['output_filename'], HandBrakeCluster_Exception_InvalidParameters), $title, - 'mkv', // @todo Make this configurable - 'x264', // @todo Make this configurable - 0, // @todo Make this configurable - 0, // @todo Make this configurable - 0.61, // @todo Make this configurable + $global_options['format'], + $global_options['video-codec'], + $global_options['video-width'], + $global_options['video-height'], + $global_options['quantizer'], HandBrakeCluster_Main::issetelse($details['deinterlace'], 2), implode(',', HandBrakeCluster_Main::issetelse($details['audio'], array())), implode(',', array_pad(array(), count($details['audio']), 'ac3')), // @todo Make this configurable diff --git a/styles/normal.css b/styles/normal.css index 671394e..921efa9 100644 --- a/styles/normal.css +++ b/styles/normal.css @@ -104,3 +104,10 @@ label { width: 16px; } +table#setup-rips input,select { + +} + +#quantizer-slider { + width: 20em; +} diff --git a/templates/rips/setup-rip.tpl b/templates/rips/setup-rip.tpl index d918aef..823ee5d 100644 --- a/templates/rips/setup-rip.tpl +++ b/templates/rips/setup-rip.tpl @@ -10,56 +10,127 @@ {else}
- Configure titles to rip + Configure global rip options - +
+ + +
-
- {foreach from=$titles item=title} -

Title {$title->id()} (Duration: {$title->duration()}, Chapters: {$title->chapterCount()})

-
-
- Configure title rip options - - - - -
- +
+ + +
+ +
+ + +
+ +
+ + + (Use 0 to leave size unchanged from source.) +
+
+ + + (Use 0 to leave size unchanged from source.) +
+ +
+ + + (Defaults to 0.61, x264's quantizer value for 20) +
+
+ +
+ +
+
+ +
+ {foreach from=$titles item=title} +

Title {$title->id()} (Duration: {$title->duration()}, Chapters: {$title->chapterCount()})

+
+
+ Configure title rip options + +
+ + +
+ +
- + + + + + + + + + + + +
Selected audio tracks
TrackEncoderName
+
+ +
- -
- + + + + + + + + + + + +
Selected subtitle tracks
TrackLanguageFormat
+
+ +
- -
- +
+ +
+ - -
-
- {/foreach} -
+
+ +
+ + {/foreach} + +
+ Queue rips
@@ -69,6 +140,16 @@ $(function() { $("#available-titles").accordion(); $("input:submit").button(); + $("#quantizer-slider").slider({ + value:0.61, + min: 0, + max: 1.0, + step: 0.01, + slide: function(event, ui) { + $("#output-quantizer").val(ui.value); + } + }); + $("#output-quantizer").val($("#quantizer-slider").slider("value")); }); {/literal}