function varargout = get_ui(self, varargin)
    for a = 1:length(varargin)
        control = varargin{a};
        known_controls = { ...
            'series', ...
            'ensemble', ...
            'crop_min', ...
            'crop_max', ...
            'exclude', ...
            'min_states', ...
            'max_states', ...
            'restarts', ...
            'run_all', ...
            'run_precision'};
        if ~any(strcmp(control, known_controls))
            error('ebfret.ui.MainWindow:UnkownControl', ...
                  'Unknown control "%s"', control);
        end
        switch control
            case 'series'
                varargout{a} = ...
                    struct('value', self.handles.seriesControl.value, ...
                           'min', self.handles.seriesControl.min, ...
                           'max', self.handles.seriesControl.max);
            case 'ensemble'
                varargout{a} = ...
                    struct('value', self.handles.ensembleControl.value, ...
                           'min', self.handles.ensembleControl.min, ...
                           'max', self.handles.ensembleControl.max);
            case 'crop_min'
                varargout{a} = round(str2num(get(self.handles.cropMinEdit, 'string')));
            case 'crop_max'
                varargout{a} = round(str2num(get(self.handles.cropMaxEdit, 'string')));
            case 'exclude'
                varargout{a} = get(self.handles.excludeCheck, 'value');
            case 'min_states'
                varargout{a} = round(str2num(get(self.handles.minStatesEdit, 'string')));
            case 'max_states'
                varargout{a} = round(str2num(get(self.handles.maxStatesEdit, 'string')));
            case 'restarts'
                varargout{a} = round(str2num(get(self.handles.analysisRestartsEdit, 'string')));
            % case 'all_restarts'
            %     varargout{a} = round(str2num(get(self.handles.allRestartsEdit, 'string')));
            % case 'gmm_restarts'
            %     varargout{a} = round(get(self.handles.GmmRestartsCheck, 'value'));
            case 'run_all'
                varargout{a} = 2 - round(get(self.handles.analysisPopup, 'value'));
            case 'run_precision'
                varargout{a} = str2num(get(self.handles.analysisPrecisionEdit, 'string'));
        end
    end