ffmpeg-filter_graph 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c05fb4a2ed62cd57c57bcd8d9bfbba450075712d
4
- data.tar.gz: c9fdd4f24fcb014992c605e7a966c751965a92f0
3
+ metadata.gz: fa0bbf4ed676022a7b35a4aff42b66cf2a5d2988
4
+ data.tar.gz: ef731984c3cebdbc6bb001459b10e9d97b846b37
5
5
  SHA512:
6
- metadata.gz: 61591d28787f1495c3626879772fad0e6e1a5afbc1107cf58c5de427b76f83c44d74e3e26c4f155008f5784f3d416ccc196e47c2048fde57a267c435ffbe7c78
7
- data.tar.gz: 87ccab1f5766a0103fdf4e468a12988dba2345eaacbecdfc3ad4b8403bc9ddbe00e866111a7a3e75a80c0e29ee15a594c55b947d0effdbfb487028d4f57cdb1a
6
+ metadata.gz: 03232cd2095f7c22014b427f5427c10bfbf7ffdbc8d6d78f1cb4cfcdbb26c7daad8f39ea9c65672b4dc5e6f8ee16594ce4786dd52b0109d9ec28e786370538ea
7
+ data.tar.gz: 5e44641498b622704e50f00a44cd138306b2c5282ebe9456b52bbcffe1dd3bfb1ffe532342860ef37957dfa3248bd5ae87474ab7e65236c5817487430cb393fb
data/CHANGELOG.md CHANGED
@@ -5,3 +5,4 @@
5
5
  ### Added
6
6
  - Extracted from `rifftrax` gem.
7
7
  - `FFmpeg::FilterGraph::Helper` can be merged into client classes for easy use.
8
+ - Filters can created with `editable` flag, to allow Timeline Editing options.
@@ -1,24 +1,27 @@
1
1
  module FFmpeg::FilterGraph
2
2
  class Filter
3
- # @param name [String] Sets the filter-name output by this filter
4
- def self.name(name = nil)
5
- if name.nil?
6
- @name || fail('filter name not set')
7
- else
8
- @name = name
3
+ class << self
4
+ # @param name [String] Sets the filter-name output by this filter
5
+ def name(name = nil)
6
+ if name.nil?
7
+ @name || fail('filter name not set')
8
+ else
9
+ @name = name
10
+ end
9
11
  end
10
- end
11
12
 
12
- # @param opts [Array<String>] a list of valid options for this filter
13
- def self.options(*opts)
14
- @opts ||= []
13
+ # @param opts [Array<String>] a list of valid options for this filter
14
+ def option(*opts)
15
+ @opts ||= []
15
16
 
16
- if opts.any?
17
- @opts.concat(opts)
18
- attr_accessor *opts
19
- end
17
+ if opts.any?
18
+ @opts.concat(opts)
19
+ attr_accessor *opts
20
+ end
20
21
 
21
- @opts
22
+ @opts
23
+ end
24
+ alias_method :options, :option
22
25
  end
23
26
 
24
27
  def to_s
@@ -32,7 +35,7 @@ module FFmpeg::FilterGraph
32
35
  # @return [String] A string concatenating the set options.
33
36
  # @note May be overridden by atypical filters
34
37
  def options_string
35
- join_options(options)
38
+ join_options(*options.keys)
36
39
  end
37
40
 
38
41
  # Set all options to nil
@@ -30,6 +30,7 @@ module FFmpeg::FilterGraph
30
30
  self.class_name = class_name.to_s
31
31
  self.required = required || []
32
32
  self.optional = optional || []
33
+ self.editable = editable
33
34
  self.options_string = options_string
34
35
  end
35
36
 
@@ -41,10 +42,8 @@ module FFmpeg::FilterGraph
41
42
  # We need to make these local vars, to work in the Class.new block
42
43
  cn = class_name.to_s
43
44
 
44
- mod.const_set(cn, create_class(cn, required, optional, options_string))
45
-
46
- if editable
47
- end
45
+ klass = create_class(cn, required, optional, editable, options_string)
46
+ mod.const_set(cn, klass)
48
47
 
49
48
  if helper_module
50
49
  helper_name = underscore(cn)
@@ -58,13 +57,15 @@ module FFmpeg::FilterGraph
58
57
 
59
58
  private
60
59
 
61
- def create_class(cn, req, opt, opt_str)
60
+ def create_class(cn, req, opt, editable, opt_str)
62
61
  Class.new(Filter) do
63
62
  const_set('REQUIRED', req.freeze)
64
63
  const_set('OPTIONAL', opt.freeze)
65
64
 
66
65
  name(cn.downcase.to_sym)
67
- options(*(const_get('REQUIRED') + const_get('OPTIONAL')))
66
+
67
+ option(*(const_get('REQUIRED') + const_get('OPTIONAL')))
68
+ option(:enable) if editable
68
69
 
69
70
  def initialize(args = {})
70
71
  self.class.const_get('REQUIRED').each do |o|
@@ -1,5 +1,5 @@
1
1
  module FFmpeg::FilterGraph
2
- class FilterGraph
2
+ class Graph
3
3
  attr_accessor :chains, :outputs
4
4
 
5
5
  def initialize(chains: [], outputs: [])
@@ -1,5 +1,5 @@
1
1
  module Ffmpeg
2
2
  module FilterGraph
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffmpeg-filter_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Sangster