--- /dev/null
+# $Id: README 1 2005-04-19 09:41:42Z tilman $
+#
+# Multipass for Euphoria
+#
+# This is a port of Multipass for WinAmp 5 by R. Peter Clark:
+# http://www.deviantart.com/deviation/9420043/
+#
+# All images by R. Peter Clark (rpeterclark at hotmail com),
+# Edje/Embryo code by Tilman Sauerbeck (tilman at code-monkey de).
+#
+# The font used in this theme, acknowledge2.ttf, was created by
+# Brian Kent (kentp at norwich net) and edited by Tilman Sauerbeck.
+# See acknowledge.txt for further information.
--- /dev/null
+# $Id: Rakefile 1 2005-04-19 09:41:42Z tilman $
+
+require "rake/clean"
+
+SRC = "multipass.rb"
+EDJ = SRC.sub(/\.[^.]+$/, ".edj")
+
+CLOBBER.include(EDJ)
+
+desc "Default task builds #{EDJ}"
+task :default => [EDJ]
+
+desc "Test #{EDJ} in Edje."
+task :test => [EDJ] do |t|
+ sh "edje #{EDJ}"
+end
+
+deps = FileList["**/*.rb", "**/*.sma", "README", "acknowledge.txt"]
+
+desc "Build #{EDJ}"
+file EDJ => deps do |t|
+ sh "redact #{SRC} -o #{EDJ}"
+end
--- /dev/null
+# __________________________________\r
+# Acknowledge Created by Brian Kent\r
+# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\r
+# \r
+# Thanks for Downloading Acknowledge.\r
+# \r
+# \r
+# -Acknowledge TT [.ttf]\r
+# -Acknowledge [7pt] [.fon]\r
+# \r
+# 'Acknowle.fon' is a Windows Bitmap Font (.fon). This font is best\r
+# used at 7pt. To use it at larger point sizes (for images), try using\r
+# a graphics program like Photoshop, Paint Shop Pro, or the Paint\r
+# program that comes with Windows. Type out your text at the recommended\r
+# point size [7pt], then resize the image. Set the color mode to 256\r
+# or 2 colors so the edges don't get blured when resizing, then after you\r
+# have the text to the size that you want, then change back to a higher\r
+# color mode and edit the image.\r
+# \r
+# For programs that don't show Bitmap Fonts in the Font Selector, you\r
+# may be able to get the font to work by typing in:\r
+# acknowledge -brk-\r
+# \r
+# \r
+# If you have any questions or comments, you can e-mail me at\r
+# kentpw@norwich.net\r
+# \r
+# You can visit my Homepage <ÆNIGMA GAMES & FONTS> at\r
+# http://www.aenigmafonts.com/\r
+# \r
+# ____________\r
+# !!! NOTE !!!\r
+# ¯¯¯¯¯¯¯¯¯¯¯¯\r
+# This font has been updated! I've edited the (BRK) in the font name\r
+# to just BRK. It seems that Adobe Illustrator and web pages with CSS\r
+# don't like fonts with ( and ) in their name.\r
+# \r
+# ________________\r
+# INSTALLING FONTS\r
+# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\r
+# There's a couple of ways to install Fonts. The 'easy' way to\r
+# install fonts is to just Unzip/place the font file into your\r
+# Windows\Fonts directory (I always use this method). If you're unable\r
+# to do it the 'easy' way, then try to do it this way (for Windows\r
+# 95/98/NT):\r
+# \r
+# 1] Unzip the Font(s) to a folder (or somewhere, just remember where\r
+# you unzipped it) on your Computer.\r
+# \r
+# 2] Next, click on the START button, then select SETTINGS then\r
+# CONTROL PANEL.\r
+# \r
+# 3] When the Control Panel Window pops up, Double Click on FONTS.\r
+# \r
+# 4] When the FONTS window pops up, select File then Install New Font...\r
+# \r
+# 5] A Add Fonts window will pop up, just go to the folder that you\r
+# unzipped the Font(s) to, select the Font(s) and then click on OK.\r
+# Now the Font(s) are installed.\r
+# \r
+# Now you can use the Font(s) in programs the utilize Fonts. Make\r
+# sure that you install the font(s) first, then open up your apps\r
+# (so the app will recognize the font). Sometimes you'll have to\r
+# wait until you computer 'auto-refreshes' for programs to recognize\r
+# fonts (Windows is sometimes slow to do that). You can refresh your\r
+# computer quicker by going into Windows Explorer -or- My Computer and\r
+# press F5 (or in the menubar select VIEW then REFRESH).\r
+# \r
+# \r
+# __________\r
+# DISCLAIMER\r
+# ¯¯¯¯¯¯¯¯¯¯\r
+# -The font(s) in this zip file were created by me (Brian Kent). All\r
+# of my Fonts are Freeware, you can use them any way you want to\r
+# (Personal use, Commercial use, or whatever).\r
+# \r
+# -If you have a Font related site and would like to offer my fonts on\r
+# your site, go right ahead. All I ask is that you keep this text file\r
+# intact with the Font.\r
+# \r
+# -You may not Sell or Distribute my Fonts for profit or alter them in\r
+# any way without asking me first. [e-mail - kentpw@norwich.net]\r
--- /dev/null
+# $Id: multipass.rb 1 2005-04-19 09:41:42Z tilman $
+
+require "src/slider.rb"
+require "src/button.rb"
+
+include Redact
+
+load "README"
+load "acknowledge.txt"
+
+EDJE.collection("euphoria") do |c|
+ c.set_size(252, 333)
+
+ c.data["shaped"] = "true"
+ c.data["has_volume_slider"] = "true"
+ c.data["has_eq_slider"] = "true"
+
+ c.script =<<SMALL
+public toggle_state_repeat;
+public toggle_state_shuffle;
+public toggle_state_crossfade;
+public toggle_state_drawer;
+public toggle_state_eq;
+public toggle_state_eq_auto;
+public drawer_timer;
+
+#{File.read("src/player-display-track.sma")}
+
+public drawer_timer_cb (val)
+{
+ /* don't hide the side drawers if the bottom drawer is visible */
+ if (!get_int (toggle_state_drawer))
+ run_program (PROGRAM:"player.normal.group.drawer.hide");
+}
+
+#{File.read("src/message_handler.sma")}
+SMALL
+
+ c.part("root", :rect) do |p|
+ p.mouse_events = false;
+
+ p.description do |d|
+ g = c.min
+ d.set_size(g[0], g[1])
+
+ d.color = "#00000000"
+ end
+ end
+
+ load "src/init.rb"
+ load "src/player-drawer-bottom.rb"
+ load "src/player-drawer-bottom-eq.rb"
+ load "src/player-drawer-volume.rb"
+ load "src/player-drawer-left.rb"
+
+ load "src/player-main-background.rb"
+ load "src/player-main-buttons.rb"
+
+ load "src/player-display.rb"
+ load "src/player-display-background.rb"
+ load "src/player-display-buttons.rb"
+ load "src/player-display-track.rb"
+ load "src/player-display-seeker.rb"
+ load "src/intro.rb"
+ load "src/player-overlay.rb"
+
+ c.part("playlist", :swallow)
+end
+
+EDJE.collection("playlist_item") do |c|
+ c.part("length", :text)
+ c.part("title", :text)
+end
--- /dev/null
+# $Id: button.rb 1 2005-04-19 09:41:42Z tilman $
+
+class Button
+ attr_reader :part
+
+ def initialize(collection, name, rel, image, x, y)
+ @collection = collection
+ @name = name
+ @rel = rel
+ @image = image
+ @x = x
+ @y = y
+
+ @part = setup_part
+ setup_programs
+ end
+
+ private
+ def setup_part
+ ret = nil
+
+ @collection.part(@name, :image) do |p|
+ ret = p
+
+ ["normal", "hover", "down"].each do |state|
+ s = state == "normal" ? "default" : state
+
+ p.description(s) do |d|
+ d.rel[0].to = d.rel[1].to = @rel
+ d.rel[0].set_offset(@x, @y)
+
+ d.auto_rel = true
+ d.image = "images/#{@image}-#{state}.png"
+ end
+ end
+ end
+
+ ret
+ end
+
+ def setup_programs
+ {"in" => "hover", "out" => "default"}.each do |sig, state|
+ @collection.program("#{@name}.#{sig}",
+ :set_state) do |p|
+ p.signal = "mouse,#{sig}"
+ p.source = @name
+ p.state = state
+ p.time = 0.2
+ p.targets << ProgramTarget.new(@part)
+ end
+ end
+
+ {"up" => "hover", "down" => "down"}.each do |sig, state|
+ @collection.program("#{@name}.#{sig}",
+ :set_state) do |p|
+ p.signal = "mouse,#{sig},1"
+ p.source = @name
+ p.state = state
+ p.targets << ProgramTarget.new(@part)
+ end
+ end
+ end
+end
+
+class SignalButton < Button
+ def initialize(collection, name, rel, image, x, y, signal)
+ super(collection, name, rel, image, x, y)
+
+ collection.program("#{name}.clicked",
+ :emit_signal) do |p|
+ p.signal = "mouse,clicked,1"
+ p.source = name
+ p.emission_signal = signal
+ p.emission_source = name
+ end
+ end
+end
+
+class ButtonLed
+ def initialize(c, name, rel, image, x, y)
+ @c = c
+ @name = name
+ @rel = rel
+ @image = image
+ @x = x
+ @y = y
+
+ @part = setup_part
+ setup_programs
+ end
+
+ private
+ def setup_part
+ ret = nil
+
+ @c.part(@name, :image) do |p|
+ ret = p
+ p.mouse_events = false
+
+ p.description("default") do |d|
+ d.visible = false
+ d.color = "#ffffff00"
+
+ d.rel[0].to = d.rel[1].to = @rel
+ d.rel[0].set_offset(@x, @y)
+
+ d.auto_rel = true
+ d.image = "images/#{@image}.png"
+ end
+
+ p.description("hover") do |d|
+ d.color = "#ffffffff"
+
+ d.rel[0].to = d.rel[1].to = @rel
+ d.rel[0].set_offset(@x, @y)
+
+ d.auto_rel = true
+ d.image = "images/#{@image}.png"
+ end
+ end
+
+ ret
+ end
+
+ def setup_programs
+ {"in" => "hover", "out" => "default"}.each do |sig, state|
+ @c.program("#{@name}.#{sig}", :set_state) do |p|
+ p.signal = "mouse,#{sig}"
+ p.source = @name[0..-5] # cut '.led' suffix
+ p.state = state
+ p.mode = sig == "in" ? :accelerate : :decelerate
+ p.time = 0.3
+ p.targets << ProgramTarget.new(@part)
+ end
+ end
+ end
+end
+
+class ToggleButton
+ attr_reader :part
+
+ def initialize(collection, name, rel, image, x, y, variable, signal)
+ @col = collection
+ @name = name
+ @rel = rel
+ @image = image
+ @x = x
+ @y = y
+ @signal = signal
+ @variable = variable
+
+ @part = setup_part
+ setup_programs
+ end
+
+ private
+ def setup_part
+ ret = nil
+
+ @col.part(@name, :image) do |p|
+ ret = p
+
+ ["inactive", "active"].each do |state|
+ s = state == "inactive" ? "default" : state
+
+ p.description(s) do |d|
+ d.rel[0].to = d.rel[1].to = @rel
+ d.rel[0].set_offset(@x, @y)
+
+ d.auto_rel = true
+ d.image = "images/#{@image}-#{state}.png"
+ end
+ end
+ end
+
+ ret
+ end
+
+ def setup_programs
+ programs = []
+ toggle_prg = nil
+ emit_toggle_prg = nil
+
+ @col.program("#{@name}.toggle", :exec_script) do |p|
+ toggle_prg = p
+
+ p.script =<<SMALL
+new i = !get_int (#{@variable});
+set_int (#{@variable}, i);
+
+set_state (PART:"#{@name}", i ? "active" : "default", 0.0);
+SMALL
+ end
+
+ @col.program("#{@name}.emit_toggle", :emit_signal) do |p|
+ emit_toggle_prg = p
+
+ p.emission_signal = @signal
+ p.emission_source = @name
+ end
+
+ @col.program("#{@name}.on_toggle", :base) do |p|
+ p.signal = @signal
+ p.source = "Euphoria"
+ p.after << ProgramAfter.new(toggle_prg)
+ end
+
+ @col.program("#{@name}.clicked", :base) do |p|
+ p.signal = "mouse,clicked,1"
+ p.source = @name
+ p.after << ProgramAfter.new(toggle_prg)
+ p.after << ProgramAfter.new(emit_toggle_prg)
+ end
+ end
+end
--- /dev/null
+# $Id: init.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+
+c.program("player.init", :exec_script) do |p|
+ p.signal = "load"
+ p.source = ""
+
+ p.script =<<SMALL
+new buf[256], len;
+
+custom_state (PART:"player.songname", "default");
+
+len = snprintf (buf, 256, "%s", "Metallica - For Whom The Bell Tolls");
+set_songname (buf, len);
+
+set_drag(PART:"seeker", 1.0, 0.1)
+SMALL
+end
--- /dev/null
+# $Id: intro.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+
+c.part("player.normal.animation.intro", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = c.part("player.normal.group.display")
+ d.rel[0].set_offset(31, 30)
+ d.rel[1].set_rel(0.0, 0.0)
+
+ d.auto_rel = true
+ d.image = "images/anim-intro_00.png"
+
+ 1.upto(74) do |i|
+ d.tweens << "images/anim-intro_%02i.png" % i
+ end
+ end
+end
+
+c.program("player.intro.play", :set_state) do |p|
+ p.signal = "show"
+ p.time = 8.0
+ p.targets << ProgramTarget.new(c.part("player.normal.animation.intro"))
+end
--- /dev/null
+/* $Id: message_handler.sma 1 2005-04-19 09:41:42Z tilman $ */
+
+#define MSG_ID_SET_SONGNAME 0
+
+public message (Msg_Type:type, id, ...)
+{
+ switch (id) {
+ case MSG_ID_SET_SONGNAME: {
+ new buf[256], len;
+
+ if (type != MSG_STRING)
+ return;
+
+ len = snprintf (buf, 256, "%s", getarg (2));
+ set_songname (buf, len);
+ }
+ }
+}
--- /dev/null
+# $Id: player-display-background.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("player.normal.group.display")
+
+c.part("player.normal.background.display", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+
+ d.image = "images/background-display.png"
+ end
+end
+
+c.part("player.normal.background.display.overlay", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+
+ d.image = "images/background-display-overlay.png"
+ end
+end
+
+c.part("player.normal.background.display.details", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(5, 3)
+
+ d.auto_rel = true
+ d.image = "images/background-display-details.png"
+ end
+end
--- /dev/null
+# $Id: player-display-buttons.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("player.normal.group.display")
+
+h = {"repeat" => [90, 10, "REPEAT_MDOE"],
+ "shuffle" => [109, 9, "SHUFFLE"],
+ "crossfade" => [133, 9, "CROSSFADE"]}
+h.each do |name, (x, y, sig)|
+ ToggleButton.new(c, "player.button.#{name}", root,
+ "button-#{name}", x, y,
+ "toggle_state_#{name}", "TOGGLE_#{sig}")
+end
--- /dev/null
+# $Id: player-display-seeker.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+parent = c.part("player.normal.group.display")
+name = "player.normal.animation.seek"
+progress = nil
+
+c.part("#{name}.progress", :image) do |p|
+ progress = p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parent
+ d.rel[0].set_offset(15, 80)
+
+ d.auto_rel = true
+ d.image = "images/anim-seek-progress.png"
+ end
+end
+
+c.part("#{name}.clip", :rect) do |p|
+ progress.clip = p
+
+ p.description.rel[0].to = progress
+end
+
+c.part("#{name}.trough", :rect) do |p|
+ p.description do |d|
+ d.set_min(10, 13)
+ d.set_max(1000, 13)
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = progress
+ d.rel[0].set_offset(-3, 0)
+ d.rel[1].set_offset(-3, 0)
+ end
+end
+
+c.part("seeker", :rect) do |p|
+ c.part("#{name}.clip").description.rel[1].to = p
+
+ p.dragable.enabled[0] = true
+ p.dragable.step[0] = 5
+ p.dragable.confine = c.part("#{name}.trough")
+
+ p.description do |d|
+ d.set_size(5, 13)
+ d.color = "#00000000"
+
+ d.rel[0].to = progress
+ end
+end
+
+=begin
+c.part("player.normal.animation.seek.grabber") do |p|
+ p.repeat_events = true
+
+ p.description do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = progress
+ end
+end
+=end
--- /dev/null
+# $Id: player-display-track.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+parent = c.part("player.normal.group.display")
+
+TEXT_COLOR = "#95e3fd"
+OUTLINE_COLOR = "#01366bc1"
+
+c.part("player.time", :text) do |p|
+ p.effect = :outline
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parent
+ d.rel[0].set_offset(15, 9)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(75, 24)
+
+ d.color = TEXT_COLOR
+ d.outline_color = OUTLINE_COLOR
+
+ d.text = "00:06:35"
+ d.font = "fonts/acknowledge2.ttf"
+ d.font_size = 15
+ d.set_text_align(1.0, 0.5)
+ end
+end
+
+c.part("player.songname", :text) do |p|
+ p.effect = :outline
+
+ p.description do |d|
+ d.color = TEXT_COLOR
+ d.outline_color = OUTLINE_COLOR
+
+ d.set_align(0.0)
+
+ d.text = "Metallica - Battery"
+ d.font = "fonts/acknowledge2.ttf"
+ d.font_size = 14
+ d.set_text_min(true, true)
+ d.set_text_align(0.0)
+ end
+end
+
+c.part("player.songname.clip", :rect) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parent
+ d.rel[0].set_offset(13, 66)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(154, 78)
+ end
+
+ c.part("player.songname").clip = p
+ c.part("player.songname").description do |d|
+ d.rel[0].to = d.rel[1].to = p
+ end
+end
--- /dev/null
+/* $Id: player-display-track.sma 1 2005-04-19 09:41:42Z tilman $ */
+
+#define SONGNAME_SCROLL_SPEED 0.2857
+
+public songname_len;
+public songname_animator;
+public songname_timer;
+
+public on_songname_animator_restart(val)
+{
+ new id;
+
+ id = anim (get_int (songname_len) * SONGNAME_SCROLL_SPEED,
+ "on_songname_animator", round (abs (1 - val)));
+ set_int (songname_animator, id);
+}
+
+public on_songname_animator(val, Float:pos)
+{
+ new p = PART:"player.songname";
+
+ set_state_val (p, STATE_ALIGNMENT, abs (val - pos), 0.5);
+ set_state (p, "custom", 0.0);
+
+ if (pos == 1.0) {
+ new id = timer (1.0, "on_songname_animator_restart", val);
+ set_int (songname_timer, id);
+ }
+}
+
+public set_songname (sname[], len)
+{
+ new p = PART:"player.songname", id;
+
+ if ((id = get_int (songname_timer)))
+ cancel_timer (id);
+
+ if ((id = get_int (songname_animator)))
+ cancel_anim (id);
+
+ set_text (p, sname);
+ set_state (p, "default", 0.0);
+
+ /* with the font and size we're using, 18 characters
+ * are fitting into the display (no scrolling required)
+ */
+ len -= 18;
+
+ if (len > 0) {
+ set_int (songname_len, len);
+
+ id = timer (1.0, "on_songname_animator_restart", 1);
+ set_int (songname_timer, id);
+ }
+}
--- /dev/null
+# $Id: player-display.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+
+c.part("player.normal.group.display", :rect) do |p|
+ p.mouse_events = false
+
+ p.description do |d|
+ d.color = "#000000"
+
+ d.rel[0].to = d.rel[1].to = c.part("root")
+ d.rel[0].set_offset(52, 25)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(219, 122)
+ end
+end
--- /dev/null
+# $Id: player-drawer-bottom-eq.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+parts = []
+
+c.part("player.normal.group.drawer.bottom.eq", :rect) do |p|
+ parts << p
+ p.mouse_events = false
+
+ p.description.color = "#00000000"
+end
+
+c.part("player.background.eq", :image) do |p|
+ parts << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parts.first
+ d.rel[0].set_offset(4, 41)
+
+ d.auto_rel = true
+ d.image = "images/background-eq.png"
+ end
+
+ h = {"preamp" => 11, "band01" => 28, "band02" => 42,
+ "band03" => 57, "band04" => 72, "band05" => 87,
+ "band06" => 102, "band07" => 117, "band08" => 133,
+ "band09" => 147, "band10" => 162}
+ h.each do |name, x|
+ VerticalSlider.new(c, "player.slider.eq.#{name}", parts.first,
+ x, 63, 50)
+ end
+end
+
+c.part("player.normal.group.drawer.bottom.eq.clip", :rect) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to =
+ c.part("player.normal.group.drawer.bottom")
+ d.rel[1].set_offset(0, -25)
+ end
+
+ parts.each { |part| part.clip = p }
+ parts.first.description { |d| d.rel[0].to = d.rel[1].to = p }
+end
--- /dev/null
+# $Id: player-drawer-bottom.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("root")
+bottom = []
+
+c.part("player.normal.group.drawer.bottom", :rect) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.visible = false
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(45, 0)
+
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(226, 177)
+ end
+
+ p.description("visible") do |d|
+ d.visible = true
+ d.color = "#00000000"
+ end
+end
+
+c.part("player.background.drawer.bottom.shadow", :image) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = bottom.first
+ d.image = "images/background-drawer-bottom-shadow.png"
+ end
+end
+
+c.part("player.background.drawer.bottom.top", :image) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = bottom.first
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-bottom-top.png"
+ end
+end
+
+c.part("player.background.drawer.bottom.bottom", :image) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = bottom.first
+ d.rel[0].set_offset(0, 37)
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-bottom-bottom.png"
+ end
+end
+
+c.part("player.background.drawer.bottom.arm", :image) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = bottom.first
+ d.rel[0].set_offset(64, 0)
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-bottom-arm.png"
+ end
+end
+
+c.part("player.background.drawer.bottom.title", :image) do |p|
+ bottom << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = bottom.first
+ d.rel[0].set_offset(9, 26)
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-bottom-title.png"
+ end
+end
+
+h = {"eq" => 9,
+ "options" => 39,
+ "colorthemes" => 94}
+h.each do |name, (x, im)|
+ bottom << Button.new(c, "player.button." << name, bottom.first,
+ "button-#{im || name}", x, 151).part
+end
+
+c.part("player.background.drawer.bottom.clip", :rect) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(45, 155)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(226, 332)
+ end
+
+ bottom.each { |i| i.clip = p }
+
+ c.part("player.normal.group.drawer.bottom").description("visible") do |d|
+ d.rel[0].to = d.rel[1].to = p
+ end
+end
+
+{"show" => "visible", "hide" => "default"}.each do |prog, state|
+ c.program("player.normal.group.drawer.bottom.#{prog}",
+ :set_state) do |p|
+ p.state = state
+ p.time = 0.5
+ p.targets <<
+ ProgramTarget.new(c.part("player.normal.group.drawer.bottom"))
+ end
+end
--- /dev/null
+# $Id: player-drawer-left.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+
+parts = []
+
+c.part("player.normal.group.drawer.left", :rect) do |p|
+ parts << p
+
+ p.description do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = c.part("player.normal.group.drawer.volume")
+ d.rel[0].set_offset(44, 8)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(104, 165)
+ end
+
+ p.description("visible").color = "#00000000"
+end
+
+c.part("player.background.drawer.left.shadow", :image) do |p|
+ parts << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parts.first
+
+ d.image = "images/background-drawer-left-shadow.png"
+ end
+end
+
+c.part("player.background.drawer.left", :image) do |p|
+ parts << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parts.first
+
+ d.image = "images/background-drawer-left.png"
+ end
+end
+
+c.part("player.background.drawer.left.arm", :image) do |p|
+ parts << p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = parts.first
+ d.rel[0].set_offset(34, 49)
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-left-arm.png"
+ end
+end
+
+h = {"pl" => 6,
+ "ml" => 25,
+ "eject" => 44,
+ "video" => [68, "misc"],
+ "skinoptions" => [94, "misc"],
+ "drawer" => [121, nil,
+ "player.normal.group.drawer.bottom.toggle_vis"]}
+h.each do |name, (y, im, sig)|
+ if sig.nil?
+ parts << Button.new(c, "player.button." + name, parts.first,
+ "button-#{im || name}", 9, y).part
+ else
+ parts << SignalButton.new(c, "player.button." + name,
+ parts.first, "button-#{im || name}",
+ 9, y, sig).part
+ end
+end
+
+c.program("player.normal.group.drawer.bottom.toggle_vis",
+ :exec_script) do |p|
+ p.signal = "mouse,clicked,1"
+ p.source = parts.last.name
+
+ p.script =<<SMALL
+new i = !get_int (toggle_state_drawer);
+set_int (toggle_state_drawer, i);
+
+if (i)
+ run_program (PROGRAM:"player.normal.group.drawer.bottom.show");
+else
+ run_program (PROGRAM:"player.normal.group.drawer.bottom.hide");
+SMALL
+end
+
+c.part("player.background.drawer.left.clip", :rect) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = c.part("root")
+ d.rel[0].set_offset(5, 8)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(65, 165)
+ end
+
+ parts.each { |part| part.clip = p }
+
+ parts.first.description("visible") do |d|
+ d.rel[0].to = d.rel[1].to = p
+ end
+end
--- /dev/null
+# $Id: player-drawer-volume.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("root")
+
+c.part("player.normal.group.drawer.volume", :rect) do |p|
+ p.description do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(170, 8)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(226, 159)
+ end
+
+ p.description("visible") do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(195, 8)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(251, 159)
+ end
+
+ root = p
+end
+
+c.part("player.background.drawer.volume.shadow", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-volume-shadow.png"
+ end
+end
+
+c.part("player.background.drawer.volume", :image) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+
+ d.auto_rel = true
+ d.image = "images/background-drawer-volume.png"
+ end
+
+ VerticalSlider.new(c, "player.slider.volume", p, 38, 21)
+end
--- /dev/null
+# $Id: player-main-background.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("root")
+
+c.part("player.normal.background.shadow", :image) do |p|
+ p.repeat_events = true
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+ d.image = "images/background-shadow.png"
+ end
+end
+
+c.part("player.normal.background.main", :image) do |p|
+ p.repeat_events = true
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+
+ d.image = "images/background-alpha.png"
+ end
+end
+
+c.part("player.normal.background.titlebar", :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(45, 0)
+
+ d.auto_rel = true
+ d.image = "images/background-titlebar.png"
+ end
+end
+
+c.part("player.normal.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(70, 6)
+
+ d.auto_rel = true
+ d.image = "images/background-titlebar-title.png"
+ end
+end
+
+c.part("player.normal.background.bottom", :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(46, 46)
+
+ d.auto_rel = true
+ d.image = "images/background-bottom.png"
+ end
+end
--- /dev/null
+# $Id: player-main-buttons.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+root = c.part("root")
+
+buttons = []
+
+def image_from_name(name)
+ md = name.match(/^player\.(.*)$/)
+ md.nil? ? name : md.captures.first.gsub(".", "-")
+end
+
+h = {"player.button.play" => ["playback.play", [121, 133]],
+ "player.button.pause" => ["playback.pause", [90, 133]],
+ "player.button.stop" => ["playback.stop", [155, 133]],
+ "player.button.next" => ["playback.next", [184, 135]],
+ "player.button.prev" => ["playback.prev", [60, 134]]}
+h.each do |name, (sig, (x, y))|
+ buttons << SignalButton.new(c, name, root, image_from_name(name),
+ x, y, sig).part
+end
+
+# FOOBARBAZ
+{"player.button.play.led" => [132, 142],
+ "player.button.pause.led" => [98, 142],
+ "player.button.stop.led" => [163, 142],
+ "player.button.next.led" => [194, 143],
+ "player.button.prev.led" => [68, 143]}.each do |name, (x, y)|
+ ButtonLed.new(c, name, root, image_from_name(name), x, y)
+end
+
+h = {"player.button.close" => ["close", [206, 5]],
+ "player.button.switch" => [nil, [186, 5]],
+ "player.button.minimize" => [nil, [166, 5]],
+ "player.button.system" => [nil, [50, 5]]}
+h.each do |name, (sig, (x, y))|
+ args = [c, name, root, image_from_name(name), x, y]
+ args << sig unless sig.nil?
+
+ buttons << (sig.nil? ? Button : SignalButton).new(*args).part
+end
+
+c.part("player.background.buttons.clip", :rect) do |p|
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = root
+ d.rel[0].set_offset(45, 0)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(240, 175)
+ end
+
+ buttons.each { |button| button.clip = p }
+end
--- /dev/null
+# $Id: player-overlay.rb 1 2005-04-19 09:41:42Z tilman $
+
+c = EDJE.collection("euphoria")
+
+c.part("player.overlay", :rect) do |p|
+ p.repeat_events = true
+
+ p.description do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = c.part("root")
+ d.rel[1].set_rel(1.0, 0.0)
+ d.rel[1].set_offset(0, 170)
+ end
+end
+
+{"show" => "visible", "hide" => "default"}.each do |name, state|
+ c.program("player.normal.group.drawer.#{name}", :set_state) do |p|
+ p.state = state
+ p.mode = :accelerate
+ p.time = 0.4
+ p.targets <<
+ ProgramTarget.new(c.part("player.normal.group.drawer.volume"))
+ p.targets <<
+ ProgramTarget.new(c.part("player.normal.group.drawer.left"))
+ end
+end
+
+c.program("player.overlay.mouse.out", :exec_script) do |p|
+ p.signal ="mouse,out"
+ p.source = "player.overlay"
+
+ p.script =<<SMALL
+cancel_timer (get_int (drawer_timer));
+set_int (drawer_timer, timer (1.0, "drawer_timer_cb", 0));
+SMALL
+end
+
+c.program("player.overlay.mouse.in", :exec_script) do |p|
+ p.signal = "mouse,in"
+ p.source = "player.overlay"
+
+ p.script =<<SMALL
+new i = get_int (drawer_timer);
+
+if (i != -1) {
+ cancel_timer (i);
+ set_int (drawer_timer, -1);
+}
+
+if (!get_int (toggle_state_drawer))
+ run_program (PROGRAM:"player.normal.group.drawer.show");
+SMALL
+end
--- /dev/null
+# $Id: slider.rb 1 2005-04-19 09:41:42Z tilman $
+
+class VerticalSlider
+ def initialize(c, name, rel, x, y, height = 95)
+ background = nil
+ clip = nil
+ main = nil
+
+ c.part("#{name}.background", :image) do |p|
+ background = p
+
+ p.description do |d|
+ d.rel[0].to = d.rel[1].to = rel
+ d.rel[0].set_offset(x, y)
+ d.rel[1].set_rel(0.0, 0.0)
+ d.rel[1].set_offset(x + 6, y + height)
+
+ d.image = "images/background-fillbar-vertical.png"
+ end
+ end
+
+ c.part("#{name}.clip", :rect) do |p|
+ background.clip = p
+ clip = p
+
+ p.description.rel[1].to = background
+ end
+
+ c.part("#{name}.trough", :rect) do |p|
+ p.description do |d|
+ d.color = "#00000000"
+
+ d.rel[0].to = d.rel[1].to = background
+ d.rel[0].set_offset(3, -3)
+ d.rel[1].set_offset(3, 3)
+ end
+ end
+
+ c.part(name, :image) do |p|
+ main = p
+ clip.description.rel[0].to = p
+
+ p.dragable.enabled[1] = true
+ p.dragable.step[1] = 1
+ p.dragable.count[1] = 1
+ p.dragable.confine = c.part("#{name}.trough")
+
+ ["normal", "hover", "down"].each do |state|
+ s = state == "normal" ? "default" : state
+ p.description(s) do |d|
+ d.set_size(15, 12)
+ d.image = "images/slider-grip-#{state}.png"
+ end
+ end
+ end
+
+ c.part("#{name}.led", :image) do |p|
+ p.repeat_events = true
+
+ p.description do |d|
+ d.visible = false
+ d.color = "#ffffff00"
+
+ d.rel[0].to = d.rel[1].to = main
+
+ d.auto_rel = true
+ d.image = "images/slider-grip-led.png"
+ end
+
+ p.description("visible") do |d|
+ d.visible = true
+ d.color = "#ffffffff"
+
+ d.rel[0].to = d.rel[1].to = main
+
+ d.auto_rel = true
+ d.image = "images/slider-grip-led.png"
+ end
+ end
+
+ c.program("#{name}.led.show", :set_state) do |p|
+ p.signal ="mouse,down,1"
+ p.source = main.name
+ p.state = "visible"
+ p.mode = :accelerate
+ p.time = 0.5
+ p.targets << ProgramTarget.new(c.part("#{name}.led"))
+ end
+
+ c.program("#{name}.led.hide", :set_state) do |p|
+ p.signal = "mouse,up,1"
+ p.source = main.name
+ p.state = "default"
+ p.mode = :decelerate
+ p.time = 0.3
+ p.targets << ProgramTarget.new(c.part("#{name}.led"))
+ end
+ end
+end