OSDN Git Service

Scripts: Updates manicure to handle peak framerate.
[handbrake-jp/handbrake-jp-git.git] / scripts / manicure.rb
index 7adc98e..f808b27 100755 (executable)
@@ -84,8 +84,7 @@ class Presets
    homeLocation = `echo $HOME`.chomp
    
    # Use that to build a path to the presets .plist
-   #inputFile = homeLocation+'/Library/Application Support/HandBrake/UserPresets.plist'
-   inputFile = homeLocation+'/UserPresets.plist'
+   inputFile = homeLocation+'/Library/Application Support/HandBrake/UserPresets.plist'
    
     # Parse the presets into hashes
     @hashMasterList = Plist::parse_xml( inputFile )
@@ -312,6 +311,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks
@@ -555,6 +558,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks
@@ -791,7 +798,12 @@ class Display
         commandString << "job->vrate_base = " << "1080000\n    "
       # Gotta add the rest of the framerates for completion's sake.
       end
-      commandString << "job->cfr = 1;\n    "
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << "job->cfr = 2;\n    "
+      else
+        commandString << "job->cfr = 1;\n    "
+      end
     end
     
     #Audio tracks
@@ -1067,6 +1079,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks