From: Tilman Sauerbeck Date: Sun, 24 Apr 2005 09:36:27 +0000 (+0000) Subject: Added basic playlist support. X-Git-Url: http://git.code-monkey.de/?p=multipass-eu.git;a=commitdiff_plain;h=2c309021d4596beda1b22a0e145e536278b0384c Added basic playlist support. --- diff --git a/images/background-main-bottomleft.png b/images/background-main-bottomleft.png new file mode 100644 index 0000000..0bd2cf1 Binary files /dev/null and b/images/background-main-bottomleft.png differ diff --git a/images/background-main-bottommiddle.png b/images/background-main-bottommiddle.png new file mode 100644 index 0000000..e7f80a0 Binary files /dev/null and b/images/background-main-bottommiddle.png differ diff --git a/images/background-main-bottomright.png b/images/background-main-bottomright.png new file mode 100644 index 0000000..a0783e3 Binary files /dev/null and b/images/background-main-bottomright.png differ diff --git a/images/background-main-footer-left.png b/images/background-main-footer-left.png new file mode 100644 index 0000000..568ea99 Binary files /dev/null and b/images/background-main-footer-left.png differ diff --git a/images/background-main-footer-middle.png b/images/background-main-footer-middle.png new file mode 100644 index 0000000..bf3c0bc Binary files /dev/null and b/images/background-main-footer-middle.png differ diff --git a/images/background-main-footer-right.png b/images/background-main-footer-right.png new file mode 100644 index 0000000..aa26662 Binary files /dev/null and b/images/background-main-footer-right.png differ diff --git a/images/background-main-middle.png b/images/background-main-middle.png new file mode 100644 index 0000000..f8612c5 Binary files /dev/null and b/images/background-main-middle.png differ diff --git a/images/background-main-middleleft-2.png b/images/background-main-middleleft-2.png new file mode 100644 index 0000000..be3e416 Binary files /dev/null and b/images/background-main-middleleft-2.png differ diff --git a/images/background-main-middleleft.png b/images/background-main-middleleft.png new file mode 100644 index 0000000..a23dbac Binary files /dev/null and b/images/background-main-middleleft.png differ diff --git a/images/background-main-middleright-2.png b/images/background-main-middleright-2.png new file mode 100644 index 0000000..321cd5e Binary files /dev/null and b/images/background-main-middleright-2.png differ diff --git a/images/background-main-middleright.png b/images/background-main-middleright.png new file mode 100644 index 0000000..dbd1f3f Binary files /dev/null and b/images/background-main-middleright.png differ diff --git a/images/background-main-topleft.png b/images/background-main-topleft.png new file mode 100644 index 0000000..ef21c1f Binary files /dev/null and b/images/background-main-topleft.png differ diff --git a/images/background-main-topmiddle.png b/images/background-main-topmiddle.png new file mode 100644 index 0000000..89bdb02 Binary files /dev/null and b/images/background-main-topmiddle.png differ diff --git a/images/background-main-topright.png b/images/background-main-topright.png new file mode 100644 index 0000000..5edf5b7 Binary files /dev/null and b/images/background-main-topright.png differ diff --git a/images/background-title-inset.png b/images/background-title-inset.png new file mode 100644 index 0000000..59779d3 Binary files /dev/null and b/images/background-title-inset.png differ diff --git a/images/background-title-pl.png b/images/background-title-pl.png new file mode 100644 index 0000000..a96e2c1 Binary files /dev/null and b/images/background-title-pl.png differ diff --git a/images/background-titlebar-left.png b/images/background-titlebar-left.png new file mode 100644 index 0000000..43b3df4 Binary files /dev/null and b/images/background-titlebar-left.png differ diff --git a/images/background-titlebar-middle.png b/images/background-titlebar-middle.png new file mode 100644 index 0000000..8dcfb45 Binary files /dev/null and b/images/background-titlebar-middle.png differ diff --git a/images/background-titlebar-right.png b/images/background-titlebar-right.png new file mode 100644 index 0000000..9469d6e Binary files /dev/null and b/images/background-titlebar-right.png differ diff --git a/multipass.rb b/multipass.rb index 246ebf7..ea542de 100644 --- a/multipass.rb +++ b/multipass.rb @@ -1,4 +1,4 @@ -# $Id: multipass.rb 2 2005-04-23 13:23:58Z tilman $ +# $Id: multipass.rb 6 2005-04-24 09:36:27Z tilman $ require "src/slider.rb" require "src/button.rb" @@ -63,11 +63,49 @@ SMALL load "src/player-display-seeker.rb" load "src/intro.rb" load "src/player-overlay.rb" +end + +EDJE.collection("playlist") do |c| + c.set_min(450, 150) + + c.data["shaped"] = "true" + + c.part("root", :rect) do |p| + p.mouse_events = false + p.description.color = "#00000000" + end - c.part("playlist", :swallow) + load "src/playlist-background.rb" end EDJE.collection("playlist_item") do |c| - c.part("length", :text) - c.part("title", :text) + c.set_size(150, 10) + + c.part("title", :text) do |p| + p.effect = :outline + + p.description do |d| + d.color = TEXT_COLOR + d.outline_color = OUTLINE_COLOR + + d.font = "fonts/acknowledge2.ttf" + d.font_size = 12 + d.text = "Dark Tranquillity - Through Smudged Lenses" + d.set_text_align(0.0) + end + end + + c.part("length", :text) do |p| + p.effect = :outline + + p.description do |d| + d.color = TEXT_COLOR + d.outline_color = OUTLINE_COLOR + + d.font = "fonts/acknowledge2.ttf" + d.font_size = 12 + d.text = "04:11" + d.set_text_align(1.0) + end + end end diff --git a/src/playlist-background.rb b/src/playlist-background.rb new file mode 100644 index 0000000..9749e45 --- /dev/null +++ b/src/playlist-background.rb @@ -0,0 +1,209 @@ +# $Id: playlist-background.rb 6 2005-04-24 09:36:27Z tilman $ + +c = EDJE.collection("playlist") +root = c.part("root") + +c.part("playlist.background.titlebar.left", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + d.auto_rel = true + + d.image = "images/background-titlebar-left.png" + end +end + +c.part("playlist.background.titlebar.right", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + + d.rel[0].set_rel(1.0, 0.0) + d.rel[1].set_rel(1.0, 0.0) + + d.rel[0].set_offset(-12, 0) + d.rel[1].set_offset(-1, 17) + + d.image = "images/background-titlebar-right.png" + end +end + +c.part("playlist.background.titlebar.middle", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].set_to(c.part("playlist.background.titlebar.left")) + d.rel[1].set_to(c.part("playlist.background.titlebar.right")) + + d.rel[0].set_rel(1.0, 0.0) + d.rel[1].set_rel(0.0, 1.0) + + d.image = "images/background-titlebar-middle.png" + end +end + +c.part("playlist.background.titlebar.text", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + d.rel[0].set_offset(25, 6) + + d.auto_rel = true + d.image = "images/background-title-pl.png" + end +end + +c.part("playlist.background.titlebar.inset", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + d.rel[0].set_offset(79, 6) + + d.auto_rel = true + d.image = "images/background-title-inset.png" + end +end + +["left", "right"].each do |id| + c.part("playlist.background.top.#{id}", :image) do |p| + p.repeat_events = true + + p.description do |d| + ref_part = c.part("playlist.background.titlebar.#{id}") + d.rel[0].set_to(ref_part) + d.rel[1].set_to(ref_part) + + d.rel[0].set_rel(0.0, 1.0) + d.rel[1].set_offset(-1, 11) + + d.image = "images/background-main-top#{id}.png" + end + end +end + +c.part("playlist.background.top", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].set_to(c.part("playlist.background.top.left")) + d.rel[1].set_to(c.part("playlist.background.top.right")) + + d.rel[0].set_rel(1.0, 0.0) + d.rel[1].set_rel(0.0, 1.0) + + d.image = "images/background-main-topmiddle.png" + end +end + +["left", "right"].each do |id| + c.part("playlist.background.#{id}", :image) do |p| + p.repeat_events = true + + p.description do |d| + ref_part = c.part("playlist.background.top.#{id}") + d.rel[0].to = ref_part + d.rel[1].set_to(ref_part, nil) + + d.rel[0].set_rel(0.0, 1.0) + d.rel[1].set_offset(-1, -25) + + d.image = "images/background-main-middle#{id}.png" + end + end +end + +c.part("playlist.background.footer.left", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + + d.rel[0].set_rel(0.0, 1.0) + d.rel[1].set_rel(0.0, 1.0) + + d.rel[0].set_offset(0, -26) + d.rel[1].set_offset(11, -1) + + d.image = "images/background-main-footer-left.png" + end +end + +c.part("playlist.background.footer.right", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].to = d.rel[1].to = root + + d.rel[0].set_rel(1.0, 1.0) + d.rel[0].set_offset(-12, -26) + + d.image = "images/background-main-footer-right.png" + end +end + +c.part("playlist.background.footer.middle", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].set_to(c.part("playlist.background.footer.left")) + d.rel[1].set_to(c.part("playlist.background.footer.right")) + + d.rel[0].set_rel(1.0, 0.0) + d.rel[1].set_rel(0.0, 1.0) + + d.image = "images/background-main-footer-middle.png" + end +end + +["left", "right"].each do |id| + 2.times do |i| + name = i.zero? ? "bottom.#{id}" : "#{id}2" + ref_part = i.zero? ? "footer" : "bottom" + ref_part = c.part("playlist.background.#{ref_part}.#{id}") + + c.part("playlist.background." + name, :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].set_to(ref_part) + d.rel[1].set_to(ref_part) + + d.rel[1].set_rel(1.0, 0.0) + d.rel[0].set_offset(0, i.zero? ? -14 : -38) + + img = (i.zero? ? "bottom#{id}" : "middle#{id}-2") + d.image = "images/background-main-#{img}.png" + end + end + end +end + +c.part("playlist.background.bottom", :image) do |p| + p.repeat_events = true + + p.description do |d| + d.rel[0].set_to(c.part("playlist.background.bottom.left")) + d.rel[1].set_to(c.part("playlist.background.bottom.right")) + + d.rel[0].set_rel(1.0, 0.0) + d.rel[1].set_rel(0.0, 1.0) + + d.image = "images/background-main-bottommiddle.png" + end +end + +c.part("playlist.container", :image) do |p| + p.description do |d| + d.rel[0].set_to(c.part("playlist.background.top.left")) + d.rel[1].set_to(c.part("playlist.background.bottom.right")) + + d.rel[0].set_rel(1.0, 1.0) + d.rel[1].set_rel(0.0, 0.0) + + d.image = "images/background-main-middle.png" + end +end