Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix Scissor::Tape#stretch

  • Loading branch information...
commit f6d7a679fcc8e427ceb5225c7d6d7748a2ba964c 1 parent a5df2c5
@youpy authored
View
6 lib/scissor/fragment.rb
@@ -43,7 +43,8 @@ def create(remaining_start, remaining_length)
start + remaining_start * pitch.to_f / 100,
(duration - remaining_start) * pitch.to_f / 100,
false,
- pitch)
+ pitch,
+ stretched?)
remaining_length -= duration - remaining_start
remaining_start = 0
@@ -53,7 +54,8 @@ def create(remaining_start, remaining_length)
start + remaining_start * pitch.to_f / 100,
remaining_length * pitch.to_f / 100,
false,
- pitch)
+ pitch,
+ stretched?)
remaining_start = 0
remaining_length = 0
View
3  lib/scissor/tape.rb
@@ -170,7 +170,8 @@ def reverse
fragment.start,
fragment.original_duration,
!fragment.reversed?,
- fragment.pitch))
+ fragment.pitch,
+ fragment.stretched?))
end
new_instance
View
11 spec/scissor_spec.rb
@@ -187,6 +187,17 @@
scissor.duration.should eql(0.1)
scissor.pitch((0.1 / 120) * 100, true).duration.should be_close(120.0, 0.1)
scissor.stretch((120 / 0.1) * 100).duration.should be_close(120.0, 0.1)
+
+ stretched = scissor.stretch((120 / 0.1) * 100).slice(0, 10)
+ stretched.fragments.first.should be_stretched
+
+ stretched1 = scissor.stretch((120 / 0.1) * 100)
+ stretched2 = scissor.stretch((120 / 0.1) * 100)
+ stretched = (stretched1 + stretched2).slice(100, 50)
+ stretched.fragments.first.should be_stretched
+
+ scissor = (@mp3.slice(0, 10) + @mp3.slice(0, 5)).stretch(200).reverse
+ scissor.fragments.first.should be_stretched
end
it "should join instances of scissor" do
Please sign in to comment.
Something went wrong with that request. Please try again.