Skip to content

Commit

Permalink
fix movie sketches
Browse files Browse the repository at this point in the history
  • Loading branch information
monkstone committed Oct 3, 2016
1 parent 0653894 commit 05ecfd5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
6 changes: 2 additions & 4 deletions processing_app/library/video/movie/pixelate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# using rectangles as pixels by reading the values stored
# in the current video frame pixels array.
#

load_library :video
include_package 'processing.video'

Expand All @@ -17,7 +16,7 @@
def setup
sketch_title 'Pixelate'
no_stroke
@mov = Movie.new(self, 'transit.mov')
@mov = Movie.new(self, data_path('transit.mov'))
@num_pixels_wide = width / BLOCK_SIZE
@num_pixels_high = height / BLOCK_SIZE
@movie_color = []
Expand Down Expand Up @@ -46,6 +45,5 @@ def draw
end

def settings
size 640, 360, FX2D
size 640, 360, P2D
end

7 changes: 2 additions & 5 deletions processing_app/library/video/movie/reverse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# underlying gstreamer plugins used by gsvideo. For example, the
# theora codec does support backward playback, but not so the H264
# codec, at least in its current version.
#
#
load_library :video, :video_event
include_package 'processing.video'

Expand All @@ -19,7 +17,7 @@ def setup
background(0)
@speed_set = false
@once = true
@mov = Movie.new(self, 'transit.mkv')
@mov = Movie.new(self, data_path('transit.mkv'))
mov.play
end

Expand All @@ -46,6 +44,5 @@ def movieEvent(m)
end

def settings
size 640, 360, FX2D
size 640, 360
end

6 changes: 3 additions & 3 deletions processing_app/library/video/movie/scratch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def setup
sketch_title 'Scratch'
background(0)
@mov = Movie.new(self, 'transit.mov')
@mov = Movie.new(self, data_path('transit.mov'))
# Pausing the video at the first frame.
mov.play
mov.jump 0
Expand All @@ -24,7 +24,7 @@ def draw
begin
mov.read
# A new time position is calculated using the current mouse location:
t = mov.duration * map1d(mouse_x, (0..width), (0..1.0))
t = mov.duration * norm(mouse_x, 0, width)
mov.play
mov.jump(t)
mov.pause
Expand All @@ -33,5 +33,5 @@ def draw
end

def settings
size 640, 360, FX2D
size 640, 360
end
5 changes: 2 additions & 3 deletions processing_app/library/video/movie/speed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# drag mouse ip screen to decrease speed
# Uses the Movie.speed method to change
# the playback speed.

load_libraries :video, :video_event
include_package 'processing.video'

Expand All @@ -12,7 +11,7 @@
def setup
sketch_title 'Speed'
background(0)
@mov = Movie.new(self, 'transit.mov')
@mov = Movie.new(self, data_path('transit.mov'))
mov.loop
end

Expand All @@ -31,5 +30,5 @@ def movieEvent(m)
end

def settings
size 640, 360, FX2D
size 640, 360
end

0 comments on commit 05ecfd5

Please sign in to comment.