Sha256: d0af391b58e397c632535dd0714fb2f9eb0ae5e587d20435a5e5eafcd0fa7436

Contents?: true

Size: 777 Bytes

Versions: 5

Compression:

Stored size: 777 Bytes

Contents

require 'fileutils'
require File.dirname(__FILE__) + '/hdhomerun'
require File.dirname(__FILE__) + '/pvr_logger'

module SimplePvr
  class Recorder
    def initialize(tuner, recording)
      @tuner, @recording = tuner, recording
    end
  
    def start!
      @directory = PvrInitializer.recording_manager.create_directory_for_recording(@recording)
      PvrInitializer.hdhomerun.start_recording(@tuner, @recording.channel.frequency, @recording.channel.channel_id, @directory)
    
      PvrLogger.info "Started recording #{@recording.show_name} in #{@directory}"
    end
  
    def stop!
      PvrInitializer.hdhomerun.stop_recording(@tuner)
      Ffmpeg.create_thumbnail_for(@directory)
    
      PvrLogger.info "Stopped recording #{@recording.show_name}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_pvr-1.0.0 lib/simple_pvr/recorder.rb
simple_pvr-0.0.4 lib/simple_pvr/recorder.rb
simple_pvr-0.0.3 lib/simple_pvr/recorder.rb
simple_pvr-0.0.2 lib/simple_pvr/recorder.rb
simple_pvr-0.0.1 lib/simple_pvr/recorder.rb