+
+ ["hilighted", "unhilighted"].each do |state|
+ c.program("playlist_item.#{state}", :set_state) do |p|
+ p.signal = "playlist_item.#{state}"
+ p.source = "*"
+ p.state = state == "unselected" ? "default" : state
+ p.mode = state == "selected" ? :accelerate : :decelerate
+ p.time = 0.5
+ p.targets << ProgramTarget.new(c.part("title"))
+ p.targets << ProgramTarget.new(c.part("duration"))
+ end
+ end
+
+ ["selected", "unselected"].each do |state|
+ c.program("playlist_item.#{state}", :set_state) do |p|
+ p.signal = "playlist_item.#{state}"
+ p.source = "*"
+ p.state = state
+ p.targets << ProgramTarget.new(c.part("background"))
+ end
+ end
+
+ c.program("playlist_item.click", :emit_signal) do |p|
+ p.signal = "mouse,clicked,1"
+ p.source = "*"
+ p.emission_signal = "playlist_item.selected"
+ end
+
+ c.program("playlist_item.doubleclick", :emit_signal) do |p|
+ p.signal = "mouse,down,1,double"
+ p.source = "*"
+ p.emission_signal = "playlist_item.play"
+ end