indexing description: "[ Implements a panning slider. Use this class to create a panning slider. Note: To create one you can set the coordinates. Everything else is defined in this class. Take a look at the mixer example, the "panning" slider is an implementation of it. ]" date: "$Date$" revision: "$Revision$" class MIXER_SLIDER_PANNING inherit EM_SLIDER EM_AUDIO_CONSTANTS export {NONE} all end MIXER_CONSTANTS export {NONE} all end create make_positioned feature {NONE} -- Initialization make_positioned (an_x: like x; a_y: like y) is -- Initialize volume slider. require position_valid: an_x >= 0 and a_y >= 0 do make_horizontal set_position (an_x, a_y) set_dimension (76, 36) set_range (-255, 255) set_border (create {EM_NO_BORDER}) set_delegate (create {MIXER_SLIDER_DELEGATE}) set_transparent set_current_value (0) ensure position_set: x = an_x and y = a_y dimension_set: inner_height = 36 and inner_width = 76 range_set: left_value = -255 and right_value = 255 current_value_set: current_value = 0 end feature -- Implementation update_lights is -- Update the lights of the slider. local v: DOUBLE do v := ((current_value / right_value) * 5).rounded if v = 0 then set_background (create {EM_BITMAP_BACKGROUND}.make_from_file (image_directory + "/nopanning.png")) elseif v < 0 then set_background (create {EM_BITMAP_BACKGROUND}.make_from_file (image_directory + "/left_" + v.abs.out + ".png")) else set_background (create {EM_BITMAP_BACKGROUND}.make_from_file (image_directory + "/right_" + v.out + ".png")) end end end