indexing description: "[ Implements the preset part for the channel. Use this class to store/load the channels settings. Note: This is the class where the channel settings are stored. ]" date: "$Date$" revision: "$Revision$" class MIXER_PRESET_CHANNEL inherit EM_AUDIO_CONSTANTS export {NONE} all end create make feature {NONE} -- Initialization make (a_channel: MIXER_CHANNEL) is -- Initialize preset music channel. require a_channel_not_void: a_channel /= Void do active := a_channel.active.active group := a_channel.group_active file_index := a_channel.combobox.selected_index mute := a_channel.mute.active reverse := a_channel.reverse.active fade := a_channel.fade.active create fade_value.make_from_string (a_channel.fade_value.text) echo := a_channel.echo.active phasing := a_channel.phasing.active panning := a_channel.panning.current_value internal_volume := a_channel.volume.current_value end feature -- Implementation load (a_channel: MIXER_CHANNEL) is -- Load settings of `a_channel' require a_channel_not_void: a_channel /= Void do if active /= a_channel.active.active then a_channel.active_button_clicked end if group /= a_channel.group_active then a_channel.group_button_clicked (a_channel.group_active) end if file_index /= a_channel.combobox.selected_index then a_channel.combobox.set_selected_index (file_index) end if mute /= a_channel.mute.active then a_channel.mute_button_clicked end if reverse /= a_channel.reverse.active then a_channel.reverse_button_clicked end if fade /= a_channel.fade.active then a_channel.fade_button_clicked end if not fade_value.is_equal (a_channel.fade_value.text) then a_channel.fade_value.set_text (fade_value) end if echo /= a_channel.echo.active then a_channel.echo_button_clicked end if phasing /= a_channel.phasing.active then a_channel.phasing_button_clicked end if panning /= a_channel.panning.current_value then a_channel.panning.set_current_value (panning) end if volume /= a_channel.volume.current_volume then a_channel.volume.set_current_value (internal_volume) end end feature -- Access active: BOOLEAN -- Is active? group: INTEGER -- Group id of the channel file_index: INTEGER -- Index of file mute: BOOLEAN -- Is channel mute? reverse: BOOLEAN -- Is reverse active? fade: BOOLEAN -- Is fade active? fade_value: STRING -- Current fade value. echo: BOOLEAN -- Is echo active? phasing: BOOLEAN -- Is phasing active? panning: INTEGER -- Current panning value volume: INTEGER is -- Current volume value do Result := Em_max_volume - internal_volume end feature -- Internal variables internal_volume: INTEGER end