update_row is
local
duration: INTEGER
img: GTK_SPICE_IMAGE_BOX
txt: GTK_SPICE_TEXT_BOX
content_vid: MEDIA_CONTENT [MEDIA_VIDEO]
content_aud: MEDIA_CONTENT [MEDIA_AUDIO]
content_img: MEDIA_CONTENT [MEDIA_IMAGE]
content_txt: TEXT_CONTENT
it: ITERATOR [GTK_WIDGET]
path_name: PATH_NAME
thumbnail_update: THUMBNAIL_UPDATE
do
path_name := new_path
if editor.video_background /= Void then
path_name.make_from_string (editor.video_background.url)
if row.background = Void or else not path_name.to_url.is_equal (row.background.media.url) then
create content_vid.from_media (create {MEDIA_VIDEO}.from_file (path_name))
content_vid.set_looped (video_loop_check_button.is_active)
duration := editor.video_background.duration
content_vid.set_markers ((video_in_marker.value * duration).force_to_integer_32,
(video_out_marker.value * duration).force_to_integer_32)
row.set_background (content_vid)
end
elseif editor.image_background /= Void then
if row.background = Void or else not editor.image_background.to_url.is_equal (row.background.media.url) then
create content_img.from_media (create {MEDIA_IMAGE}.from_file (editor.image_background))
row.set_background (content_img)
end
else
row.set_background (Void)
end
if editor.audio_background /= Void then
path_name.make_from_string (editor.audio_background.url)
if row.audio = Void or else not path_name.to_url.is_equal (row.audio.media.url) then
create content_aud.from_media (create {MEDIA_AUDIO}.from_file (path_name))
content_aud.set_looped (audio_loop_check_button.is_active)
duration := editor.audio_background.duration
content_aud.set_markers ((audio_in_marker.value * duration).force_to_integer_32,
(audio_out_marker.value * duration).force_to_integer_32)
row.set_audio (content_aud)
end
else
row.set_audio (Void)
end
if row.is_slide then
from until row.count = 0 loop
row.remove (row.lower)
end
from it := editor.boxes.get_new_iterator until it.is_off loop
if it.item /= Void then
img ?= it.item
txt ?= it.item
if img /= Void then
path_name.make_from_string (img.filename)
content_img := create {MEDIA_CONTENT[MEDIA_IMAGE]}.from_media (
create {MEDIA_IMAGE}.from_file (path_name))
content_img.set_scale (img.relative_scale_x, img.relative_scale_y)
content_img.set_position (img.relative_x, img.relative_y)
row.add_last (content_img)
elseif txt /= Void then
content_txt := create {TEXT_CONTENT}.with_markup (txt.markup)
content_txt.set_scale (txt.relative_scale_x, txt.relative_scale_y)
content_txt.set_position (txt.relative_x, txt.relative_y)
row.add_last (content_txt)
else
end
end
it.next
end
end
editor.clear_boxes
if row.is_slide then
create thumbnail_update.make (Void, row.as_slide, False)
elseif row.is_segment then
create thumbnail_update.make (row.as_segment, Void, True)
end
end