home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / UTILITIE / VOCSHO.ZIP / VOC_SHOW.PKG < prev   
Text File  |  1991-01-07  |  2KB  |  65 lines

  1. with command_line;
  2. with util;
  3. with text_io;
  4. with voc_data;
  5. with voc_io;
  6. with voc_pc;
  7.  
  8. procedure voc_show is
  9.  
  10.   package pk_io is new text_io.enumeration_io(voc_data.pack_types);
  11.   package d_io is new text_io.fixed_io(duration);
  12.   f:voc_io.handles;
  13.   type handle_block_results is (finished,more_to_come);
  14.  
  15.   function handle_block return handle_block_results is
  16.     b:voc_data.blocks;
  17.   begin
  18.     voc_io.read(f,b);
  19.     text_io.new_line;
  20.     case b.block_type is
  21.       when voc_data.terminator =>
  22.         return finished;
  23.       when voc_data.voice_data =>
  24.         text_io.put("sound "
  25.                   & integer'image(b.block_length)
  26.                   & "@"
  27.                   & integer'image(integer(b.sample_rate))
  28.                   & " "
  29.                    );
  30.         pk_io.put(b.packing);
  31.         voc_pc.play(b);
  32.       when voc_data.silence =>
  33.         text_io.put("silence ");
  34.         d_io.put(b.silence_interval);
  35.         voc_pc.play(b);
  36.       when voc_data.marker =>
  37.         text_io.put("marker=" & integer'image(integer(b.mark)));
  38.       when voc_data.text =>
  39.         text_io.put(b.text_string);
  40.       when voc_data.start_repeat =>
  41.         text_io.put("start repeat " & integer'image(integer(b.count)));
  42.       when voc_data.end_repeat =>
  43.         text_io.put("end repeat");
  44.       when voc_data.voice_continuation =>
  45.         text_io.put("voice_continuation"); -- should never happen!
  46.     end case;
  47.     return more_to_come;
  48.   end handle_block;
  49.  
  50. begin
  51.   if command_line.parameter_count /= 1 then
  52.     text_io.Put("usage:voc_show filename");
  53.     util.halt(1);
  54.   end if;
  55.   voc_io.open(command_line.parameter(1),f);
  56.   loop
  57.     exit when handle_block = finished;
  58.   end loop;
  59.   voc_io.close(f);
  60. exception
  61.   when voc_io.name_error =>
  62.     text_io.put("Sorry, can't find file " & command_line.parameter(1));
  63.     util.halt(1);
  64. end voc_show;
  65.