function strs = getconvertstructchoices(hFig)
% GETCONVERTSTRUCTCHOICES  Get the Filter Structure choices for the 
%                          Convert dialog Listbox.
%
% Inputs:
%    hFig  - Handle to the Filter Design GUI figure.
%
% Output:
%   strs - Cell array of possible dfilt or qfilt filter structure 
%          conversion strings.

%   Author(s): P. Costa 
%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 2000/06/13 21:23:13 $ 

fdatoolud = get(hFig,'UserData');

% Get the dfilt or qfilt specific listbox strings
strs = getfiltStrs(fdatoolud);


%-------------------------------------------------------------------
%                       Local Utility Function
%-------------------------------------------------------------------
function strs = getfiltStrs(fdatoolud);
% GETFILTSTRS Get the applicable filter structure conversion strings.
%
% Input:
%   fdatoolud - FDATool's UserData structure.
%
% Output:
%   strs - Cell array of possible filter structure strings for the 
%          current filter stored in FDATool's UserData.

% Common filter structures for both dfilt and qfilt
commonstrs = {'Direct form I',...
        'Direct form II',...
        'Direct form I transposed',...
        'Direct form II transposed',...
        'State-space',...
        'Lattice ARMA'};

% FIR case
if isfir(fdatoolud.filter),
    strs = {commonstrs{:},...
            'Direct form FIR',...
            'Direct form FIR transposed'};
    
    if isminphase(fdatoolud.filter),
        strs = {strs{:},'Lattice MA min. phase'};
        
    elseif ismaxphase(fdatoolud.filter),
        strs = {strs{:},'Lattice MA max. phase'};
    end
    
else % IIR case
    strs = commonstrs;
    
    % FD Tbx required for coupled-allpass conversions
    if fdatoolud.flags.fdqexists,
        strs = {commonstrs{:},...
                'Lattice coupled-allpass',...
                'Lattice coupled-allpass power-complementary'};
    end
    if isallpass(fdatoolud.filter),
        strs = {strs{:},'Lattice allpass'};        
    end
end    

% [EOF] getconvertstructchoices.m
