indexing description: "[ Implements the preset part for the musci channel. Use this class to store/load the music channel settings. Note: This is the class where the music channel settings are stored. ]" date: "$Date$" revision: "$Revision$" class MIXER_PRESET_MUSIC_CHANNEL inherit EM_AUDIO_CONSTANTS export {NONE} all end create make feature {NONE} -- Initialization make (a_music_channel: MIXER_MUSIC_CHANNEL) is -- Initialize preset music channel. require a_music_channel_not_void: a_music_channel /= Void do playlist_index := a_music_channel.listbox.selected_index active := a_music_channel.active.active mute := a_music_channel.mute.active repeat := a_music_channel.repeat.active fade := a_music_channel.fade.active create fade_value.make_from_string (a_music_channel.fade_value.text) internal_volume := a_music_channel.volume.current_value end feature -- Implementation load (a_music_channel: MIXER_MUSIC_CHANNEL) is -- Load settings from `a_music_channel'. require a_music_channel_not_void: a_music_channel /= Void do if playlist_index /= a_music_channel.listbox.selected_index then a_music_channel.listbox.set_selected_index (playlist_index) end if active /= a_music_channel.active.active then a_music_channel.active_button_clicked end if mute /= a_music_channel.mute.active then a_music_channel.mute_button_clicked end if repeat /= a_music_channel.repeat.active then a_music_channel.repeat_button_clicked end if fade /= a_music_channel.fade.active then a_music_channel.fade_button_clicked end if not fade_value.is_equal (a_music_channel.fade_value.text) then a_music_channel.fade_value.set_text (fade_value) end if volume /= a_music_channel.volume.current_volume then a_music_channel.volume.set_current_value (internal_volume) end end feature -- Access playlist_index: INTEGER -- Current index of playlist active: BOOLEAN -- Is music_channel active? mute: BOOLEAN -- Is mute active? repeat: BOOLEAN -- Is repeat active? fade: BOOLEAN -- Is fade active? fade_value: STRING -- Current fade value volume: INTEGER is -- Current volume value do Result := Em_max_volume - internal_volume end feature -- Internal variables internal_volume: INTEGER end