module AppleTvConverter
Constants
- Timer
- VERSION
Public Class Methods
Get the path to the atomic_parsley binary, defaulting to ‘AtomicParsley’
@return [String] the path to the atomic_parsley binary
# File lib/apple_tv_converter.rb, line 78 def self.atomic_parsley_binary @atomic_parsley_binary.nil? ? 'AtomicParsley' : @atomic_parsley_binary end
Set the path of the atomic parsley binary. Can be useful if you need to specify a path such as /usr/local/bin/atomic_parsley
@param [String] path to the atomic parsley binary @return [String] the path you set
# File lib/apple_tv_converter.rb, line 71 def self.atomic_parsley_binary=(bin) @atomic_parsley_binary = bin end
# File lib/apple_tv_converter.rb, line 82 def self.copy(from, to) open(from) do |f| File.open(to, "wb") do |file| file.puts f.read end end end
# File lib/apple_tv_converter.rb, line 90 def self.data_path() @data_path ||= File.expand_path(File.join('~', 'Library', 'Application Support', 'apple-tv-converter')) if is_macosx? @data_path end
# File lib/apple_tv_converter.rb, line 95 def self.get_language_name(language_code) return language_code if language_code.length > 3 # ??? - English # ara - Arabic # bul - Bulgarian # chi - Chilean? -> ignore? # cze - Czech -> ces # dan - Danish # dut - Dutch -> nld # eng - English # est - Estonian # fin - Finnish # fre - French -> fra # ger - German -> deu # gre - Greek -> ell # heb - Hebrew # hrv - Croatian # hun - Hungarian # ice - Icelandic -> isl # ita - Italian # jpn - Japanese # jap - Japanese -> jpn # kor - Korean # lav - Latvian # lit - Lithuanian # may - Malay? -> ignore? # nor - Norwegian # pol - Polish # por - Portuguese # rum - Romanian -> ron # rus - Russian # slv - Slovenian # spa - Spanish # srp - Serbian # swe - Swedish # tha - Thai # tur - Turkish # ukr - Ukrainian language_code_mappings = { '' => 'eng', 'chi' => nil, 'cze' => 'ces', 'dut' => 'nld', 'fre' => 'fra', 'ger' => 'deu', 'gre' => 'ell', 'ice' => 'isl', 'rum' => 'ron', 'jap' => 'jpn', 'may' => nil } language_code = language_code_mappings.has_key?(language_code) ? language_code_mappings[language_code] : language_code return nil if language_code.nil? language = ::LanguageList::LanguageInfo.find_by_iso_639_3(language_code) return language.name unless language.nil? return nil end
Determine whether running on Mac OS X
@return [boolean] true if running on Mac OS X
# File lib/apple_tv_converter.rb, line 29 def self.is_macosx? ; RUBY_PLATFORM =~/.*?darwin.*?/i ; end
Determine whether running on Windows
@return [boolean] true if running on Windows
# File lib/apple_tv_converter.rb, line 25 def self.is_windows? ; RUBY_PLATFORM =~/.*?mingw.*?/i ; end
Get AppleTvConverter
logger.
@return [Logger]
# File lib/apple_tv_converter.rb, line 43 def self.logger return @logger if @logger logger = Logger.new(STDOUT) logger.level = Logger::INFO @logger = logger end
AppleTvConverter
logs information about its progress when it’s transcoding. Jack in your own logger through this method if you wish to.
@param [Logger] log your own logger @return [Logger] the logger you set
# File lib/apple_tv_converter.rb, line 36 def self.logger=(log) @logger = log end
Get the path to the mp4box binary, defaulting to ‘MP4Box’
@return [String] the path to the mp4box binary
# File lib/apple_tv_converter.rb, line 62 def self.mp4box_binary @mp4box_binary.nil? ? 'MP4Box' : @mp4box_binary end
Set the path of the mp4box binary. Can be useful if you need to specify a path such as /usr/local/bin/mp4box
@param [String] path to the mp4box binary @return [String] the path you set
# File lib/apple_tv_converter.rb, line 55 def self.mp4box_binary=(bin) @mp4box_binary = bin end