;+
; NAME:
;	SMEI_SEQ_INFO
;
;
; PURPOSE:
;	Return various information about a SMEI_SEQUENCE
;
;
; CATEGORY:
;	CLI
;
;
; CALLING SEQUENCE:
;	smei_seq_info, source, info, <selector keys>
;
;
; INPUTS:
;	source	objref	The sequence to be queried
;
;
; KEYWORD PARAMETERS:
;	/count		If set, then return the number of images in the
;			sequence.
;	/name		If set, then return the user-defined name of the
;			sequence.
;	/n_planes	If set, then return the number of planes in the
;			image.
;	/size		If set, then return the size of the biggest
;			image in the sequence.
;	/summary	If set, then return a summary of the sequence.
;
; OUTPUTS:
;	info	various	A named variable to hold the requested
;			information.
;
;
; RESTRICTIONS:
;	The selector keywords are mutually exclusive
;
;
; MODIFICATION HISTORY:
;	Original: 20/1/04; SJT
;-

pro smei_seq_info, source, info, count = count, name = name, n_planes $
                   = n_planes, size = size, summary = summary, help = $
                   help

if keyword_set(help) then begin
    self_help
    return
endif

if not arg_present(info) then begin
    smei_msg, /warn, ['SMEI_SEQ_INFO must have 2 arguments,', $
                      'the second must be writable']
    return
endif

if not obj_valid(source) then begin
    smei_msg, /warn, ['The specified source must be', $
                      'a valid object reference']

    return
endif

if not obj_isa(source, 'SMEI_SEQUENCE') then begin
    smei_msg, /warn, ['The source argument of SMEI_SEQ_INFO must ', $
                      'be a SMEI_SEQUENCE']
    return
endif

nkey = keyword_set(count) + keyword_set(name) + $
       keyword_set(n_planes) + keyword_set(size)+ keyword_set(summary)

if nkey ne 1 then begin
    smei_msg, /warn, ['You must give EXACTLY one of the selector', $
                      'keywords: /count, /name, /n_planes, /size', $
                      'or /summary']
    return
endif

if keyword_set(count) then info = source -> get_count() $
else if keyword_set(name) then info = source -> get_name() $
     else if keyword_set(n_planes) then info = source ->  $
       get_n_planes() $ 
          else if keyword_set(size) then info = source ->  $
            get_biggest_image() $
               else if keyword_set(summary) then info = source ->  $
                 get_summary()

end
