home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2001 April / LCD_4_01.iso / apps / movparse / movparse.gfa (.txt) next >
GFA-BASIC Atari  |  1999-06-17  |  39KB  |  1,454 lines

  1. ' MOV parser
  2. '
  3. ' Designed to parse the byte-level structure of QuickTime files.
  4. ' Stabylo / The Removers
  5. '
  6. ' This software is under the GPL licence.
  7. '
  8. ' If you do any modification to this code, please tell me :
  9. '
  10. '       benjamin.gandon@mines.u-nancy.fr
  11. '       stabylo@rtel.fr
  12. '
  13. version#=1.2
  14. revision_date$="June 15th 1999"
  15. '
  16. @init
  17. ' fichier_cmd$="e:\actuel\zip\guign.mov"
  18. '
  19. IF EXIST(fichier_cmd$)
  20.   OPEN "i",#1,fichier_cmd$
  21.   PRINT
  22.   PRINT "file : '";fichier_cmd$;"'"
  23.   PRINT
  24.   @treat_file
  25.   CLOSE #1
  26. ELSE
  27.   @select_fichier(g_extention$,g_txt$,g_chemin$,g_nom$,g_fichier$)
  28.   WHILE EXIST(g_fichier$) AND NOT quit_prg!
  29.     OPEN "i",#1,g_fichier$
  30.     PRINT
  31.     PRINT "file : '";g_fichier$;"'"
  32.     PRINT
  33.     @treat_file
  34.     CLOSE #1
  35.     IF NOT quit_prg!
  36.       @select_fichier(g_extention$,g_txt$,g_chemin$,g_nom$,g_fichier$)
  37.     ENDIF
  38.   WEND
  39. ENDIF
  40. @the_end("")
  41. '
  42. '
  43. > PROCEDURE select_fichier(extention$,txt$,VAR chemin$,nom$,fichier$)
  44.   LOCAL n&
  45.   FILESELECT #txt$,chemin$,nom$,fichier$
  46.   n&=RINSTR(fichier$,"\")
  47.   chemin$=LEFT$(fichier$,n&)+extention$
  48.   n&=LEN(fichier$)-n&
  49.   nom$=RIGHT$(fichier$,n&)
  50. RETURN
  51. > PROCEDURE init
  52.   CLS
  53.   PRINT "v"            ! active le 'Wrap-around-the-edge'... Year !
  54.   PRINT
  55.   PRINT " QuickTime parser by Stabylo / The Removers"
  56.   PRINT " version ";version#;" dated ";revision_date$
  57.   DEFMOUSE 0
  58.   @vide_clavier
  59.   '
  60.   ON ERROR GOSUB error
  61.   ON BREAK GOSUB user_break
  62.   RESERVE
  63.   RESERVE 100000
  64.   '
  65.   quit_prg!=FALSE
  66.   '
  67.   c_zero|=48
  68.   c_un|=48+1
  69.   c_deux|=48+2
  70.   c_trois|=48+3
  71.   c_quatre|=48+4
  72.   c_esc|=27
  73.   '
  74.   adr_cmd%=BASEPAGE+128
  75.   cmd_len%=BYTE{adr_cmd%}
  76.   INC adr_cmd%
  77.   BYTE{adr_cmd%+cmd_len%}=0
  78.   fichier_cmd$=CHAR{adr_cmd%}
  79.   '
  80.   g_extention$="*.MOV"
  81.   g_txt$="Load a QuickTime file"
  82.   g_chemin$=CHR$(65+GEMDOS(25))+":"+DIR$(0)+"\"+g_extention$
  83.   g_nom$=""
  84.   g_fichier$=""
  85.   '
  86.   out_extention$="*.txt"
  87.   out_txt$="Save a text file"
  88.   out_chemin$=CHR$(65+GEMDOS(25))+":"+DIR$(0)+"\"+out_extention$
  89.   out_nom$=""
  90.   out_fichier$=""
  91. RETURN
  92. > PROCEDURE user_break
  93.   the_end("User caused break of the programm")
  94. RETURN
  95. > PROCEDURE error
  96.   the_end(ERR$(ERR))
  97. RETURN
  98. > PROCEDURE the_end(msg$)
  99.   IF msg$<>""
  100.     CLS
  101.     PRINT
  102.     PRINT msg$
  103.     ~INP(2)
  104.   ENDIF
  105.   RESERVE
  106.   EDIT
  107. RETURN
  108. > PROCEDURE vide_clavier
  109.   WHILE INP?(2)
  110.     ~INP(2)
  111.   WEND
  112. RETURN
  113. '
  114. > PROCEDURE treat_file
  115.   quit_file!=FALSE
  116.   wait_key!=TRUE
  117.   indent%=2
  118.   file_len%=LOF(#1)
  119.   file_pos%=0
  120.   '
  121.   WHILE file_pos%<=file_len%-8 AND NOT quit_file!
  122.     IF file_pos%>file_len%
  123.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  124.       quit_file!=TRUE
  125.     ELSE
  126.       SEEK #1,file_pos%
  127.       atom_len%=CVL(INPUT$(4,#1))
  128.       atom_type$=INPUT$(4,#1)
  129.       IF atom_len%=0
  130.         IF CVL(atom_type$)=0
  131.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  132.           temp%=CVL(INPUT$(4,#1))
  133.           atom_len%=CVL(INPUT$(4,#1))
  134.           atom_type$=INPUT$(4,#1)
  135.         ELSE
  136.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  137.           atom_len%=8
  138.         ENDIF
  139.       ENDIF
  140.       '
  141.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  142.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  143.       IF @wait_key(FALSE)
  144.         SELECT atom_type$
  145.         CASE "mdat"
  146.           PRINT " (Movie data atom)"
  147.         CASE "pnot"
  148.           PRINT " (Preview atom)"
  149.         CASE "moov"
  150.           PRINT " (Movie resource atom)"
  151.           @treat_moov(file_pos%,atom_len%,indent%+2)
  152.         DEFAULT
  153.           PRINT
  154.         ENDSELECT
  155.       ELSE
  156.         PRINT
  157.       ENDIF
  158.       '
  159.       ADD file_pos%,atom_len%
  160.     ENDIF
  161.   WEND
  162.   IF file_pos%<file_len%
  163.     PRINT "*** Warning : padding bytes after Atoms"
  164.   ENDIF
  165.   IF NOT quit_file!
  166.     PRINT
  167.     PRINT "*** end of file"
  168.     ~INP(2)
  169.   ENDIF
  170. RETURN
  171. > PROCEDURE treat_moov(file_pos%,atom_len%,indent%)
  172.   LOCAL atom_end%,atom_type$
  173.   LOCAL size%
  174.   atom_end%=file_pos%+atom_len%
  175.   ADD file_pos%,8
  176.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  177.     IF file_pos%>file_len%
  178.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  179.       quit_file!=TRUE
  180.     ELSE
  181.       SEEK #1,file_pos%
  182.       atom_len%=CVL(INPUT$(4,#1))
  183.       atom_type$=INPUT$(4,#1)
  184.       IF atom_len%=0
  185.         IF CVL(atom_type$)=0
  186.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  187.           temp%=CVL(INPUT$(4,#1))
  188.           atom_len%=CVL(INPUT$(4,#1))
  189.           atom_type$=INPUT$(4,#1)
  190.         ELSE
  191.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  192.           atom_len%=8
  193.         ENDIF
  194.       ENDIF
  195.       '
  196.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  197.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  198.       IF @wait_key(FALSE)
  199.         SELECT atom_type$
  200.         CASE "free","skip"
  201.           PRINT " (Free space atom)"
  202.         CASE "mvhd"
  203.           PRINT " (Movie header atom)"
  204.           @treat_mvhd(file_pos%,atom_len%,indent%+2)
  205.         CASE "clip"
  206.           PRINT " (Movie clipping atom)"
  207.         CASE "udta"
  208.           PRINT " (User-defined data atom)"
  209.           @treat_udta(file_pos%,atom_len%,indent%+2)
  210.         CASE "trak"
  211.           PRINT " (Track atom)"
  212.           @treat_trak(file_pos%,atom_len%,indent%+2)
  213.         CASE "ctab"
  214.           PRINT " (Color table atom)"
  215.         DEFAULT
  216.           PRINT
  217.         ENDSELECT
  218.       ELSE
  219.         PRINT
  220.       ENDIF
  221.       '
  222.       ADD file_pos%,atom_len%
  223.     ENDIF
  224.   WEND
  225. RETURN
  226. > PROCEDURE treat_mvhd(file_pos%,atom_len%,indent%)
  227.   LOCAL atom_end%,atom_type$
  228.   LOCAL temp#,temp%,reserved$,year%,month%
  229.   atom_end%=file_pos%+atom_len%
  230.   ADD file_pos%,8
  231.   SEEK #1,file_pos%
  232.   temp%=CVL(INPUT$(4,#1))
  233.   PRINT SPC(11+indent%);"Version            : $";HEX$(SHR(temp%,24),2)
  234.   PRINT SPC(11+indent%);"Flags              : $";HEX$(temp% AND &HFFFFFF,6)
  235.   PRINT SPC(11+indent%);"Creation time      : ";@get_date$(CVL(INPUT$(4,#1)))
  236.   PRINT SPC(11+indent%);"Modification time  : ";@get_date$(CVL(INPUT$(4,#1)))
  237.   PRINT SPC(11+indent%);"Time scale         : $";HEX$(CVL(INPUT$(4,#1)),8)
  238.   PRINT SPC(11+indent%);"Duration           : $";HEX$(CVL(INPUT$(4,#1)),8)
  239.   PRINT SPC(11+indent%);"Prefered rate      : $";HEX$(CVL(INPUT$(4,#1)),8)
  240.   PRINT SPC(11+indent%);"Prefered volume    : $";HEX$(CVL(INPUT$(2,#1)),4)
  241.   LET reserved$=INPUT$(10,#1)
  242.   PRINT SPC(11+indent%);"Matrix             : ";
  243.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  244.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  245.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  246.   PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  247.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  248.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  249.   PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  250.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  251.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  252.   PRINT SPC(11+indent%);"Preview time       : $";HEX$(CVL(INPUT$(4,#1)),8)
  253.   PRINT SPC(11+indent%);"Preview duration   : $";HEX$(CVL(INPUT$(4,#1)),8)
  254.   PRINT SPC(11+indent%);"Poster time        : $";HEX$(CVL(INPUT$(4,#1)),8)
  255.   PRINT SPC(11+indent%);"Selection time     : $";HEX$(CVL(INPUT$(4,#1)),8)
  256.   PRINT SPC(11+indent%);"Selection duration : $";HEX$(CVL(INPUT$(4,#1)),8)
  257.   PRINT SPC(11+indent%);"Current time       : $";HEX$(CVL(INPUT$(4,#1)),8)
  258.   PRINT SPC(11+indent%);"Next track ID      : $";HEX$(CVL(INPUT$(4,#1)),8)
  259. RETURN
  260. > PROCEDURE treat_udta(file_pos%,atom_len%,indent%)
  261.   LOCAL atom_end%,atom_type$
  262.   LOCAL temp%
  263.   LOCAL num|
  264.   atom_end%=file_pos%+atom_len%
  265.   ADD file_pos%,8
  266.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  267.     IF file_pos%>file_len%
  268.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  269.       quit_file!=TRUE
  270.     ELSE
  271.       SEEK #1,file_pos%
  272.       atom_len%=CVL(INPUT$(4,#1))
  273.       atom_type$=INPUT$(4,#1)
  274.       IF atom_len%=0
  275.         IF CVL(atom_type$)=0
  276.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  277.           temp%=CVL(INPUT$(4,#1))
  278.           atom_len%=CVL(INPUT$(4,#1))
  279.           atom_type$=INPUT$(4,#1)
  280.         ELSE
  281.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  282.           atom_len%=8
  283.         ENDIF
  284.       ENDIF
  285.       '
  286.       PRINT "$";HEX$(file_pos%,8);SPC(indent%+2);"Size : $";HEX$(atom_len%,8)
  287.       PRINT SPC(11+indent%);"Type : ";atom_type$
  288.       IF @wait_key(TRUE)
  289.         SELECT atom_type$
  290.         CASE "⌐cpy"
  291.           PRINT SPC(11+2+indent%);"(Copyright statement)"
  292.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  293.         CASE "⌐day"
  294.           PRINT SPC(11+2+indent%);"(Date the movie content was created)"
  295.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  296.         CASE "⌐dir"
  297.           PRINT SPC(11+2+indent%);"(Name of movie's director)"
  298.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  299.         CASE "⌐ed1"
  300.           PRINT SPC(11+2+indent%);"(Edit date 1 ans description)"
  301.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  302.         CASE "⌐ed2"
  303.           PRINT SPC(11+2+indent%);"(Edit date 2 ans description)"
  304.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  305.         CASE "⌐ed3"
  306.           PRINT SPC(11+2+indent%);"(Edit date 3 ans description)"
  307.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  308.         CASE "⌐ed4"
  309.           PRINT SPC(11+2+indent%);"(Edit date 4 ans description)"
  310.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  311.         CASE "⌐ed5"
  312.           PRINT SPC(11+2+indent%);"(Edit date 5 ans description)"
  313.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  314.         CASE "⌐ed6"
  315.           PRINT SPC(11+2+indent%);"(Edit date 6 ans description)"
  316.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  317.         CASE "⌐ed7"
  318.           PRINT SPC(11+2+indent%);"(Edit date 7 ans description)"
  319.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  320.         CASE "⌐ed8"
  321.           PRINT SPC(11+2+indent%);"(Edit date 8 ans description)"
  322.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  323.         CASE "⌐ed9"
  324.           PRINT SPC(11+2+indent%);"(Edit date 9 ans description)"
  325.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  326.         CASE "⌐fmt"
  327.           PRINT SPC(11+2+indent%);"(information of movie format)"
  328.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  329.         CASE "⌐inf"
  330.           PRINT SPC(11+2+indent%);"(information about the movie)"
  331.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  332.         CASE "⌐prd"
  333.           PRINT SPC(11+2+indent%);"(Name of the movie's producer)"
  334.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  335.         CASE "⌐prf"
  336.           PRINT SPC(11+2+indent%);"(Name of performers)"
  337.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  338.         CASE "⌐req"
  339.           PRINT SPC(11+2+indent%);"(Special hardware and software requirements)"
  340.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  341.         CASE "⌐src"
  342.           PRINT SPC(11+2+indent%);"(Credit for those who provided the movie source content)"
  343.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  344.         CASE "⌐wrt"
  345.           PRINT SPC(11+2+indent%);"(Name of the movie's writer)"
  346.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  347.         CASE "WLOC"
  348.           PRINT SPC(11+2+indent%);"(Default window location for movie)"
  349.           PRINT SPC(11+2+indent%);"x : ";CVI(INPUT$(2,#1))
  350.           PRINT SPC(11+2+indent%);"y : ";CVI(INPUT$(2,#1))
  351.         CASE "name"
  352.           PRINT SPC(11+2+indent%);"(Name of object)"
  353.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  354.         CASE "LOOP"
  355.           PRINT SPC(11+2+indent%);"(Looping style information)"
  356.           temp%=CVL(INPUT$(4,#1))
  357.           PRINT SPC(11+2+indent%);"looping style : ";temp%;
  358.           SELECT temp%
  359.           CASE 0
  360.             PRINT " (no looping)"
  361.           CASE 1
  362.             PRINT " (looping set on)"
  363.           CASE 2
  364.             PRINT " (plindrome looping)"
  365.           DEFAULT
  366.             PRINT " (unreconised looping style)"
  367.           ENDSELECT
  368.         CASE "SelO"
  369.           PRINT SPC(11+2+indent%);"(Play selection only information)"
  370.           PRINT SPC(11+2+indent%);"flag : $";HEX$(ASC(INPUT$(1,#1)),2)
  371.         CASE "AllF"
  372.           PRINT SPC(11+2+indent%);"(Play all frames information)"
  373.           PRINT SPC(11+2+indent%);"flag : $";HEX$(ASC(INPUT$(1,#1)),2)
  374.         DEFAULT
  375.           PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  376.         ENDSELECT
  377.       ENDIF
  378.       '
  379.       ADD file_pos%,atom_len%
  380.     ENDIF
  381.   WEND
  382. RETURN
  383. > PROCEDURE treat_trak(file_pos%,atom_len%,indent%)
  384.   LOCAL atom_end%,atom_type$
  385.   atom_end%=file_pos%+atom_len%
  386.   ADD file_pos%,8
  387.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  388.     IF file_pos%>file_len%
  389.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  390.       quit_file!=TRUE
  391.     ELSE
  392.       SEEK #1,file_pos%
  393.       atom_len%=CVL(INPUT$(4,#1))
  394.       atom_type$=INPUT$(4,#1)
  395.       IF atom_len%=0
  396.         IF CVL(atom_type$)=0
  397.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  398.           temp%=CVL(INPUT$(4,#1))
  399.           atom_len%=CVL(INPUT$(4,#1))
  400.           atom_type$=INPUT$(4,#1)
  401.         ELSE
  402.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  403.           atom_len%=8
  404.         ENDIF
  405.       ENDIF
  406.       '
  407.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  408.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  409.       IF @wait_key(FALSE)
  410.         SELECT atom_type$
  411.         CASE "tkhd"
  412.           PRINT " (Track header atom)"
  413.           @treat_tkhd(file_pos%,atom_len%,indent%+2)
  414.         CASE "clip"
  415.           PRINT " (Track clipping atom)"
  416.         CASE "matt"
  417.           PRINT " (Track matte atom)"
  418.         CASE "edts"
  419.           PRINT " (Edit atom)"
  420.           @treat_edts(file_pos%,atom_len%,indent%+2)
  421.         CASE "load"
  422.           PRINT " (Track load settings atom)"
  423.         CASE "tref"
  424.           PRINT " (Track reference atom)"
  425.         CASE "imap"
  426.           PRINT " (Track input map atom)"
  427.         CASE "mdia"
  428.           PRINT " (Media atom)"
  429.           @treat_mdia(file_pos%,atom_len%,indent%+2)
  430.         DEFAULT
  431.           PRINT
  432.         ENDSELECT
  433.       ELSE
  434.         PRINT
  435.       ENDIF
  436.       '
  437.       ADD file_pos%,atom_len%
  438.     ENDIF
  439.   WEND
  440. RETURN
  441. > PROCEDURE treat_tkhd(file_pos%,atom_len%,indent%)
  442.   LOCAL atom_end%,atom_type$
  443.   LOCAL temp%,reserved$
  444.   atom_end%=file_pos%+atom_len%
  445.   ADD file_pos%,8
  446.   SEEK #1,file_pos%
  447.   temp%=CVL(INPUT$(4,#1))
  448.   PRINT SPC(11+indent%);"Version            : $";HEX$(SHR(temp%,24),2)
  449.   PRINT SPC(11+indent%);"Flags              : $";HEX$(temp% AND &HFFFFFF,6)
  450.   PRINT SPC(11+indent%);"Creation time      : ";@get_date$(CVL(INPUT$(4,#1)))
  451.   PRINT SPC(11+indent%);"Modification time  : ";@get_date$(CVL(INPUT$(4,#1)))
  452.   PRINT SPC(11+indent%);"Track ID           : $";HEX$(CVL(INPUT$(4,#1)),8)
  453.   LET reserved$=INPUT$(4,#1)
  454.   PRINT SPC(11+indent%);"Duration           : $";HEX$(CVL(INPUT$(4,#1)),8)
  455.   LET reserved$=INPUT$(8,#1)
  456.   PRINT SPC(11+indent%);"Layer              : $";HEX$(CVI(INPUT$(2,#1)),4)
  457.   PRINT SPC(11+indent%);"Alternate group    : $";HEX$(CVI(INPUT$(2,#1)),4)
  458.   PRINT SPC(11+indent%);"Volume             : $";HEX$(CVI(INPUT$(2,#1)),4)
  459.   LET reserved$=INPUT$(2,#1)
  460.   PRINT SPC(11+indent%);"Matrix             : ";
  461.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  462.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  463.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  464.   PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  465.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  466.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  467.   PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  468.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
  469.   PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  470.   PRINT SPC(11+indent%);"Track width        : $";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  471.   PRINT SPC(11+indent%);"Track height       : $";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  472. RETURN
  473. > PROCEDURE treat_edts(file_pos%,atom_len%,indent%)
  474.   LOCAL atom_end%,atom_type$
  475.   atom_end%=file_pos%+atom_len%
  476.   ADD file_pos%,8
  477.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  478.     IF file_pos%>file_len%
  479.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  480.       quit_file!=TRUE
  481.     ELSE
  482.       SEEK #1,file_pos%
  483.       atom_len%=CVL(INPUT$(4,#1))
  484.       atom_type$=INPUT$(4,#1)
  485.       IF atom_len%=0
  486.         IF CVL(atom_type$)=0
  487.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  488.           temp%=CVL(INPUT$(4,#1))
  489.           atom_len%=CVL(INPUT$(4,#1))
  490.           atom_type$=INPUT$(4,#1)
  491.         ELSE
  492.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  493.           atom_len%=8
  494.         ENDIF
  495.       ENDIF
  496.       '
  497.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  498.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  499.       IF @wait_key(FALSE)
  500.         SELECT atom_type$
  501.         CASE "elst"
  502.           PRINT " (Edit list Atom)"
  503.           @treat_elst(file_pos%,atom_len%,indent%+2)
  504.         DEFAULT
  505.           PRINT
  506.         ENDSELECT
  507.       ELSE
  508.         PRINT
  509.       ENDIF
  510.       '
  511.       ADD file_pos%,atom_len%
  512.     ENDIF
  513.   WEND
  514. RETURN
  515. > PROCEDURE treat_elst(file_pos%,atom_len%,indent%)
  516.   LOCAL atom_end%,atom_type$
  517.   LOCAL temp%,reserved$
  518.   atom_end%=file_pos%+atom_len%
  519.   ADD file_pos%,8
  520.   SEEK #1,file_pos%
  521.   temp%=CVL(INPUT$(4,#1))
  522.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  523.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  524.   temp%=CVL(INPUT$(4,#1))
  525.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  526.   ADD file_pos%,8
  527.   PRINT SPC(11+2+indent%);"Track duration / Media time / Media rate"
  528.   WHILE file_pos%<=atom_end%-12 AND (NOT quit_file!) AND @wait_key(TRUE)
  529.     IF file_pos%>file_len%
  530.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  531.       quit_file!=TRUE
  532.     ELSE
  533.       SEEK #1,file_pos%
  534.       PRINT SPC(11+2+indent%);
  535.       PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);"      / $";HEX$(CVL(INPUT$(4,#1)),8);"  /  $";HEX$(CVL(INPUT$(4,#1)),8)
  536.       ADD file_pos%,12
  537.     ENDIF
  538.   WEND
  539. RETURN
  540. > PROCEDURE treat_mdia(file_pos%,atom_len%,indent%)
  541.   LOCAL atom_end%,atom_type$
  542.   atom_end%=file_pos%+atom_len%
  543.   ADD file_pos%,8
  544.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  545.     IF file_pos%>file_len%
  546.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  547.       quit_file!=TRUE
  548.     ELSE
  549.       SEEK #1,file_pos%
  550.       atom_len%=CVL(INPUT$(4,#1))
  551.       atom_type$=INPUT$(4,#1)
  552.       IF atom_len%=0
  553.         IF CVL(atom_type$)=0
  554.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  555.           temp%=CVL(INPUT$(4,#1))
  556.           atom_len%=CVL(INPUT$(4,#1))
  557.           atom_type$=INPUT$(4,#1)
  558.         ELSE
  559.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  560.           atom_len%=8
  561.         ENDIF
  562.       ENDIF
  563.       '
  564.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  565.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  566.       IF @wait_key(FALSE)
  567.         SELECT atom_type$
  568.         CASE "mdhd"
  569.           PRINT " (Media header atom)"
  570.           @treat_mdhd(file_pos%,atom_len%,indent%+2)
  571.         CASE "hdlr"
  572.           PRINT " (Media handler reference atom)"
  573.           @treat_hdlr(file_pos%,atom_len%,indent%+2)
  574.         CASE "minf"
  575.           PRINT " (Media information atom)"
  576.           @treat_minf(file_pos%,atom_len%,indent%+2)
  577.         DEFAULT
  578.           PRINT
  579.         ENDSELECT
  580.       ELSE
  581.         PRINT
  582.       ENDIF
  583.       '
  584.       ADD file_pos%,atom_len%
  585.     ENDIF
  586.   WEND
  587. RETURN
  588. > PROCEDURE treat_mdhd(file_pos%,atom_len%,indent%)
  589.   LOCAL atom_end%,atom_type$
  590.   LOCAL temp2#,temp%,reserved$,year%,month%
  591.   atom_end%=file_pos%+atom_len%
  592.   ADD file_pos%,8
  593.   SEEK #1,file_pos%
  594.   temp%=CVL(INPUT$(4,#1))
  595.   PRINT SPC(11+indent%);"Version            : $";HEX$(SHR(temp%,24),2)
  596.   PRINT SPC(11+indent%);"Flags              : $";HEX$(temp% AND &HFFFFFF,6)
  597.   PRINT SPC(11+indent%);"Creation time      : ";@get_date$(CVL(INPUT$(4,#1)))
  598.   PRINT SPC(11+indent%);"Modification time  : ";@get_date$(CVL(INPUT$(4,#1)))
  599.   temp%=CVL(INPUT$(4,#1))
  600.   temp2#=temp%
  601.   PRINT SPC(11+indent%);"Time scale         : $";HEX$(temp%,8);" (=";temp%;")"
  602.   temp%=CVL(INPUT$(4,#1))
  603.   PRINT SPC(11+indent%);"Duration           : $";HEX$(temp%,8);" (=";temp%;") (=";temp%/temp2#;" sec)"
  604.   PRINT SPC(11+indent%);"Language           : $";HEX$(CVI(INPUT$(2,#1)),4)
  605.   PRINT SPC(11+indent%);"Quality            : $";HEX$(CVI(INPUT$(2,#1)),4)
  606. RETURN
  607. > PROCEDURE treat_hdlr(file_pos%,atom_len%,indent%)
  608.   LOCAL atom_end%,atom_type$
  609.   LOCAL hdlr_type$,temp$,reserved$,year%,month%
  610.   LOCAL num|
  611.   atom_end%=file_pos%+atom_len%
  612.   ADD file_pos%,8
  613.   SEEK #1,file_pos%
  614.   temp%=CVL(INPUT$(4,#1))
  615.   PRINT SPC(11+indent%);"Version                : $";HEX$(SHR(temp%,24),2)
  616.   PRINT SPC(11+indent%);"Flags                  : $";HEX$(temp% AND &HFFFFFF,6)
  617.   hdlr_type$=INPUT$(4,#1)
  618.   PRINT SPC(11+indent%);"Component type         : ";hdlr_type$
  619.   temp$=INPUT$(4,#1)
  620.   PRINT SPC(11+indent%);"Component subtype      : ";temp$;
  621.   IF hdlr_type$<>"mhlr"
  622.     PRINT
  623.   ELSE
  624.     media_type$=temp$   ! set media type for sample description atom ('stsd')
  625.     SELECT temp$
  626.     CASE "vide"
  627.       PRINT " (video media)"
  628.     CASE "soun"
  629.       PRINT " (sound media)"
  630.     CASE "tmcd"
  631.       PRINT " (time code media)"
  632.     CASE "text"
  633.       PRINT " (text media)"
  634.     CASE "musi"
  635.       PRINT " (music media)"
  636.     CASE "MPEG"
  637.       PRINT " (MPEG media)"
  638.     CASE "sprt"
  639.       PRINT " (sprite media)"
  640.     CASE "gnrc"
  641.       PRINT " (base media)"
  642.     CASE "twen"
  643.       PRINT " (tween media)"
  644.     CASE "qd3d"
  645.       PRINT " (3D media)"
  646.     DEFAULT
  647.       PRINT " (warning : unreconized media)"
  648.     ENDSELECT
  649.   ENDIF
  650.   PRINT SPC(11+indent%);"Component manufacturer : ";INPUT$(4,#1);" (reserved)"
  651.   PRINT SPC(11+indent%);"Component flags        : $";HEX$(CVL(INPUT$(4,#1)),8);" (reserved)"
  652.   PRINT SPC(11+indent%);"Component name         : '";
  653.   num|=ASC(INPUT$(1,#1))
  654.   PRINT INPUT$(num|,#1);"'"
  655. RETURN
  656. > PROCEDURE treat_minf(file_pos%,atom_len%,indent%)
  657.   LOCAL atom_end%,atom_type$
  658.   atom_end%=file_pos%+atom_len%
  659.   ADD file_pos%,8
  660.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  661.     IF file_pos%>file_len%
  662.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  663.       quit_file!=TRUE
  664.     ELSE
  665.       SEEK #1,file_pos%
  666.       atom_len%=CVL(INPUT$(4,#1))
  667.       atom_type$=INPUT$(4,#1)
  668.       IF atom_len%=0
  669.         IF CVL(atom_type$)=0
  670.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  671.           temp%=CVL(INPUT$(4,#1))
  672.           atom_len%=CVL(INPUT$(4,#1))
  673.           atom_type$=INPUT$(4,#1)
  674.         ELSE
  675.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  676.           atom_len%=8
  677.         ENDIF
  678.       ENDIF
  679.       '
  680.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  681.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  682.       IF @wait_key(FALSE)
  683.         SELECT atom_type$
  684.         CASE "vmhd"
  685.           PRINT " (Video media information header atom)"
  686.           @treat_vmhd(file_pos%,atom_len%,indent%+2)
  687.         CASE "smhd"
  688.           PRINT " (Sound media information header atom)"
  689.           @treat_smhd(file_pos%,atom_len%,indent%+2)
  690.         CASE "gmhd"
  691.           PRINT " (Base media information header atom)"
  692.           PRINT SPC(11+2+indent%);"[empty atom that signals a base media]"
  693.         CASE "gmin"
  694.           PRINT " (Base media info atom)"
  695.           @treat_gmin(file_pos%,atom_len%,indent%+2)
  696.         CASE "hdlr"
  697.           PRINT " (Data handler reference atom)"
  698.           @treat_hdlr(file_pos%,atom_len%,indent%+2)
  699.         CASE "dinf"
  700.           PRINT " (Data information atom)"
  701.           @treat_dinf(file_pos%,atom_len%,indent%+2)
  702.         CASE "stbl"
  703.           PRINT " (Sample table atom)"
  704.           @treat_stbl(file_pos%,atom_len%,indent%+2)
  705.         DEFAULT
  706.           PRINT
  707.         ENDSELECT
  708.       ELSE
  709.         PRINT
  710.       ENDIF
  711.       '
  712.       ADD file_pos%,atom_len%
  713.     ENDIF
  714.   WEND
  715. RETURN
  716. > PROCEDURE treat_vmhd(file_pos%,atom_len%,indent%)
  717.   LOCAL atom_end%,atom_type$
  718.   LOCAL temp%,reserved$,year%,month%
  719.   atom_end%=file_pos%+atom_len%
  720.   ADD file_pos%,8
  721.   SEEK #1,file_pos%
  722.   temp%=CVL(INPUT$(4,#1))
  723.   PRINT SPC(11+indent%);"Version      : $";HEX$(SHR(temp%,24),2)
  724.   PRINT SPC(11+indent%);"Flags        : $";HEX$(temp% AND &HFFFFFF,6)
  725.   PRINT SPC(11+indent%);"Graphic mode : $";HEX$(CVI(INPUT$(2,#1)),4)
  726.   PRINT SPC(11+indent%);"Opcolor      : $";
  727.   PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
  728. RETURN
  729. > PROCEDURE treat_smhd(file_pos%,atom_len%,indent%)
  730.   LOCAL atom_end%,atom_type$
  731.   LOCAL temp%,reserved$,year%,month%
  732.   atom_end%=file_pos%+atom_len%
  733.   ADD file_pos%,8
  734.   SEEK #1,file_pos%
  735.   temp%=CVL(INPUT$(4,#1))
  736.   PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
  737.   PRINT SPC(11+indent%);"Flags   : $";HEX$(temp% AND &HFFFFFF,6)
  738.   PRINT SPC(11+indent%);"Balance : $";HEX$(CVI(INPUT$(2,#1)),4)
  739. RETURN
  740. > PROCEDURE treat_gmin(file_pos%,atom_len%,indent%)
  741.   LOCAL atom_end%,atom_type$
  742.   LOCAL temp%,reserved$,year%,month%
  743.   atom_end%=file_pos%+atom_len%
  744.   ADD file_pos%,8
  745.   SEEK #1,file_pos%
  746.   temp%=CVL(INPUT$(4,#1))
  747.   PRINT SPC(11+indent%);"Version      : $";HEX$(SHR(temp%,24),2)
  748.   PRINT SPC(11+indent%);"Flags        : $";HEX$(temp% AND &HFFFFFF,6)
  749.   PRINT SPC(11+indent%);"Graphic mode : $";HEX$(CVI(INPUT$(2,#1)),4)
  750.   PRINT SPC(11+indent%);"Opcolor      : $";HEX$(CVI(INPUT$(2,#1)),4)'HEX$(CVI(INPUT$(2,#1)),4)'HEX$(CVI(INPUT$(2,#1)),4)
  751.   PRINT SPC(11+indent%);"Balance      : $";HEX$(CVI(INPUT$(2,#1)),4)
  752.   LET reserved$=INPUT$(2,#1)
  753. RETURN
  754. > PROCEDURE treat_dinf(file_pos%,atom_len%,indent%)
  755.   LOCAL atom_end%,atom_type$
  756.   atom_end%=file_pos%+atom_len%
  757.   ADD file_pos%,8
  758.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  759.     IF file_pos%>file_len%
  760.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  761.       quit_file!=TRUE
  762.     ELSE
  763.       SEEK #1,file_pos%
  764.       atom_len%=CVL(INPUT$(4,#1))
  765.       atom_type$=INPUT$(4,#1)
  766.       IF atom_len%=0
  767.         IF CVL(atom_type$)=0
  768.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  769.           temp%=CVL(INPUT$(4,#1))
  770.           atom_len%=CVL(INPUT$(4,#1))
  771.           atom_type$=INPUT$(4,#1)
  772.         ELSE
  773.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  774.           atom_len%=8
  775.         ENDIF
  776.       ENDIF
  777.       '
  778.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  779.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  780.       IF @wait_key(FALSE)
  781.         SELECT atom_type$
  782.         CASE "dref"
  783.           PRINT " (Data reference atom)"
  784.           @treat_dref(file_pos%,atom_len%,indent%+2)
  785.         DEFAULT
  786.           PRINT
  787.         ENDSELECT
  788.       ELSE
  789.         PRINT
  790.       ENDIF
  791.       '
  792.       ADD file_pos%,atom_len%
  793.     ENDIF
  794.   WEND
  795. RETURN
  796. > PROCEDURE treat_dref(file_pos%,atom_len%,indent%)
  797.   LOCAL atom_end%,atom_type$
  798.   LOCAL temp%
  799.   atom_end%=file_pos%+atom_len%
  800.   ADD file_pos%,8
  801.   SEEK #1,file_pos%
  802.   temp%=CVL(INPUT$(4,#1))
  803.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  804.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  805.   temp%=CVL(INPUT$(4,#1))
  806.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  807.   ADD file_pos%,8
  808.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  809.     IF file_pos%>file_len%
  810.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  811.       quit_file!=TRUE
  812.     ELSE
  813.       SEEK #1,file_pos%
  814.       atom_len%=CVL(INPUT$(4,#1))
  815.       atom_type$=INPUT$(4,#1)
  816.       IF atom_len%=0
  817.         IF CVL(atom_type$)=0
  818.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  819.           temp%=CVL(INPUT$(4,#1))
  820.           atom_len%=CVL(INPUT$(4,#1))
  821.           atom_type$=INPUT$(4,#1)
  822.         ELSE
  823.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  824.           atom_len%=8
  825.         ENDIF
  826.       ENDIF
  827.       '
  828.       PRINT SPC(11+2+indent%);"Size : $";HEX$(atom_len%,8)
  829.       PRINT SPC(11+2+indent%);"Type : ";atom_type$;
  830.       IF @wait_key(FALSE)
  831.         SELECT atom_type$
  832.         CASE "alis"
  833.           PRINT " (Data reference is a Macintosh alias)"
  834.         CASE "rsrc"
  835.           PRINT " (Data reference is a Macintosh alias + Type and ID of the resource)"
  836.         DEFAULT
  837.           PRINT
  838.         ENDSELECT
  839.         temp%=CVL(INPUT$(4,#1))
  840.         PRINT SPC(11+2+indent%);"Version      : $";HEX$(SHR(temp%,24),2)
  841.         PRINT SPC(11+2+4+indent%);"Flags        : $";HEX$(temp% AND &HFFFFFF,6)
  842.         PRINT SPC(11+2+4+indent%);"'";INPUT$(atom_len%-12,#1);"'"
  843.       ENDIF
  844.       '
  845.       ADD file_pos%,atom_len%
  846.     ENDIF
  847.   WEND
  848. RETURN
  849. > PROCEDURE treat_stbl(file_pos%,atom_len%,indent%)
  850.   LOCAL atom_end%,atom_type$
  851.   atom_end%=file_pos%+atom_len%
  852.   ADD file_pos%,8
  853.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  854.     IF file_pos%>file_len%
  855.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  856.       quit_file!=TRUE
  857.     ELSE
  858.       SEEK #1,file_pos%
  859.       atom_len%=CVL(INPUT$(4,#1))
  860.       atom_type$=INPUT$(4,#1)
  861.       IF atom_len%=0
  862.         IF CVL(atom_type$)=0
  863.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  864.           temp%=CVL(INPUT$(4,#1))
  865.           atom_len%=CVL(INPUT$(4,#1))
  866.           atom_type$=INPUT$(4,#1)
  867.         ELSE
  868.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  869.           atom_len%=8
  870.         ENDIF
  871.       ENDIF
  872.       '
  873.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  874.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  875.       IF @wait_key(FALSE)
  876.         SELECT atom_type$
  877.         CASE "stts"
  878.           PRINT " (Time-to-sample atom)"
  879.           @treat_stts(file_pos%,atom_len%,indent%+2)
  880.         CASE "stss"
  881.           PRINT " (Sync sample atom)"
  882.           @treat_stss(file_pos%,atom_len%,indent%+2)
  883.         CASE "stsd"
  884.           PRINT " (Sample description atom)"
  885.           @treat_stsd(file_pos%,atom_len%,indent%+2)
  886.         CASE "stsz"
  887.           PRINT " (Sample size atom)"
  888.           @treat_stsz(file_pos%,atom_len%,indent%+2)
  889.         CASE "stsh"
  890.           PRINT " (Shadow sync atom) *** WARNING : obsolete atom !!!"
  891.         CASE "stco"
  892.           PRINT " (Chunk offset atom)"
  893.           @treat_stco(file_pos%,atom_len%,indent%+2)
  894.         CASE "stsc"
  895.           PRINT " (Sample-to-chunk atom)"
  896.           @treat_stsc(file_pos%,atom_len%,indent%+2)
  897.         DEFAULT
  898.           PRINT
  899.         ENDSELECT
  900.       ELSE
  901.         PRINT
  902.       ENDIF
  903.       '
  904.       ADD file_pos%,atom_len%
  905.     ENDIF
  906.   WEND
  907. RETURN
  908. > PROCEDURE treat_stsd(file_pos%,atom_len%,indent%)
  909.   LOCAL atom_end%,atom_type$
  910.   LOCAL temp%,reserved$
  911.   LOCAL size%,data_format$,first_extension!
  912.   atom_end%=file_pos%+atom_len%
  913.   ADD file_pos%,8
  914.   SEEK #1,file_pos%
  915.   temp%=CVL(INPUT$(4,#1))
  916.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  917.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  918.   temp%=CVL(INPUT$(4,#1))
  919.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  920.   ADD file_pos%,8
  921.   first_extension!=TRUE
  922.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  923.     IF file_pos%>file_len%
  924.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  925.       quit_file!=TRUE
  926.     ELSE
  927.       SEEK #1,file_pos%
  928.       size%=CVL(INPUT$(4,#1))
  929.       LET data_format$=INPUT$(4,#1)
  930.       '
  931.       PRINT SPC(11+2+indent%);"Size        : $";HEX$(size%,8)
  932.       PRINT SPC(11+2+indent%);"Data format : ";data_format$
  933.       IF first_extension!
  934.         LET reserved$=INPUT$(6,#1)
  935.         PRINT SPC(11+2+indent%);"Index       : $";HEX$(CVI(INPUT$(2,#1)),4)
  936.         SELECT media_type$
  937.         CASE "vide"
  938.           PRINT SPC(11+indent%);"(Video media)"
  939.           @display_video_sample_description(file_pos%,atom_len%,indent%+2)
  940.         CASE "soun"
  941.           PRINT SPC(11+indent%);"(Sound media)"
  942.           @display_sound_sample_description(file_pos%,atom_len%,indent%+2)
  943.         CASE "tmcd"
  944.           PRINT SPC(11+indent%);"(Time code media)"
  945.           @display_time_code_sample_description(file_pos%,atom_len%,indent%+2)
  946.         CASE "text"
  947.           PRINT SPC(11+indent%);"(Text media)"
  948.           @display_text_sample_description(file_pos%,atom_len%,indent%+2)
  949.         CASE "musi"
  950.           PRINT SPC(11+indent%);"(Music media)"
  951.           @display_music_sample_description(file_pos%,atom_len%,indent%+2)
  952.         CASE "MPEG"
  953.           PRINT SPC(11+indent%);"(MPEG media)"
  954.           ' nothing added in the atom
  955.         CASE "sprt"
  956.           PRINT SPC(11+indent%);"(Sprite media)"
  957.           ' nothing added in the atom
  958.         CASE "gnrc"
  959.           PRINT SPC(11+indent%);"(Base media)"
  960.           ' nothing added in the atom
  961.         CASE "twen"
  962.           PRINT SPC(11+indent%);"(Tween media)"
  963.           ' nothing added in the atom
  964.         CASE "qd3d"
  965.           PRINT SPC(11+indent%);"(3D media)"
  966.           ' nothing added in the atom
  967.         DEFAULT
  968.           PRINT SPC(11+indent%);"'";INPUT$(size%-16,#1);"'"
  969.         ENDSELECT
  970.       ELSE
  971.         SELECT media_type$
  972.         CASE "vide"
  973.           SELECT data_format$
  974.           CASE "gama"
  975.             PRINT SPC(11+2+indent%);"(Gamma correction)"
  976.             PRINT SPC(11+2+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
  977.           CASE "fiel"
  978.             PRINT SPC(11+2+indent%);"(Number of video fields in data stream)"
  979.             PRINT SPC(11+2+indent%);"Field count     : ";HEX$(ASC(INPUT$(1,#1)),2)
  980.             temp%=ASC(INPUT$(1,#1))
  981.             PRINT SPC(11+2+indent%);"Field dominance : ";HEX$(temp%,2);
  982.             SELECT temp%
  983.             CASE 1
  984.               PRINT " (Top field is first, temporally)"
  985.             CASE 2
  986.               PRINT " (Bottom field is first, temporally)"
  987.             DEFAULT
  988.               PRINT " (Field dominance unknown)"
  989.             ENDSELECT
  990.           CASE "mjqt"
  991.             PRINT SPC(11+2+indent%);"(Default quantization table)"
  992.           CASE "mjht"
  993.             PRINT SPC(11+2+indent%);"(Default Huffman table)"
  994.           ENDSELECT
  995.         CASE "text"
  996.           SELECT data_format$
  997.           CASE "styl"
  998.             PRINT SPC(11+2+indent%);"(Style information)"
  999.           CASE "ftab"
  1000.             PRINT SPC(11+2+indent%);"(Table of font names)"
  1001.           CASE "hlit"
  1002.             PRINT SPC(11+2+indent%);"(Highlight information)"
  1003.           CASE "hclr"
  1004.             PRINT SPC(11+2+indent%);"(Highlight color)"
  1005.           CASE "drpo"
  1006.             PRINT SPC(11+2+indent%);"(Drop shadow offset)"
  1007.           CASE "drpt"
  1008.             PRINT SPC(11+2+indent%);"(Drop shadow transparency)"
  1009.           CASE "imag"
  1010.             PRINT SPC(11+2+indent%);"(Image font data)"
  1011.           CASE "metr"
  1012.             PRINT SPC(11+2+indent%);"(Image font highlighting)"
  1013.           ENDSELECT
  1014.         ENDSELECT
  1015.       ENDIF
  1016.       first_extension!=FALSE
  1017.       ADD file_pos%,atom_len%
  1018.     ENDIF
  1019.   WEND
  1020. RETURN
  1021. > PROCEDURE treat_stts(file_pos%,atom_len%,indent%)
  1022.   LOCAL atom_end%,atom_type$
  1023.   LOCAL temp%,reserved$
  1024.   atom_end%=file_pos%+atom_len%
  1025.   ADD file_pos%,8
  1026.   SEEK #1,file_pos%
  1027.   temp%=CVL(INPUT$(4,#1))
  1028.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  1029.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  1030.   temp%=CVL(INPUT$(4,#1))
  1031.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  1032.   ADD file_pos%,8
  1033.   WHILE file_pos%<=atom_end%-8 AND (NOT quit_file!) AND @wait_key(TRUE)
  1034.     IF file_pos%>file_len%
  1035.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1036.       quit_file!=TRUE
  1037.     ELSE
  1038.       SEEK #1,file_pos%
  1039.       PRINT SPC(11+2+indent%);"Sample count / duration : ";
  1040.       PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8)
  1041.       ADD file_pos%,8
  1042.     ENDIF
  1043.   WEND
  1044. RETURN
  1045. > PROCEDURE treat_stss(file_pos%,atom_len%,indent%)
  1046.   LOCAL atom_end%,atom_type$
  1047.   LOCAL temp%,reserved$
  1048.   atom_end%=file_pos%+atom_len%
  1049.   ADD file_pos%,8
  1050.   SEEK #1,file_pos%
  1051.   temp%=CVL(INPUT$(4,#1))
  1052.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  1053.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  1054.   temp%=CVL(INPUT$(4,#1))
  1055.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  1056.   ADD file_pos%,8
  1057.   WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
  1058.     IF file_pos%>file_len%
  1059.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1060.       quit_file!=TRUE
  1061.     ELSE
  1062.       SEEK #1,file_pos%
  1063.       PRINT SPC(11+2+indent%);"Sync sample number : $";HEX$(CVL(INPUT$(4,#1)),8)
  1064.       ADD file_pos%,4
  1065.     ENDIF
  1066.   WEND
  1067. RETURN
  1068. > PROCEDURE treat_stsc(file_pos%,atom_len%,indent%)
  1069.   LOCAL atom_end%,atom_type$
  1070.   LOCAL temp%,reserved$
  1071.   atom_end%=file_pos%+atom_len%
  1072.   ADD file_pos%,8
  1073.   SEEK #1,file_pos%
  1074.   temp%=CVL(INPUT$(4,#1))
  1075.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  1076.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  1077.   temp%=CVL(INPUT$(4,#1))
  1078.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  1079.   ADD file_pos%,8
  1080.   PRINT SPC(11+2+indent%);"1st chunk / Spls per chunk / Spl description ID"
  1081.   WHILE file_pos%<=atom_end%-12 AND (NOT quit_file!) AND @wait_key(TRUE)
  1082.     IF file_pos%>file_len%
  1083.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1084.       quit_file!=TRUE
  1085.     ELSE
  1086.       SEEK #1,file_pos%
  1087.       PRINT SPC(11+2+indent%);
  1088.       PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);" /   $";HEX$(CVL(INPUT$(4,#1)),8);"    /  $";HEX$(CVL(INPUT$(4,#1)),8)
  1089.       ADD file_pos%,12
  1090.     ENDIF
  1091.   WEND
  1092. RETURN
  1093. > PROCEDURE treat_stsz(file_pos%,atom_len%,indent%)
  1094.   LOCAL atom_end%,atom_type$
  1095.   LOCAL temp%,reserved$
  1096.   atom_end%=file_pos%+atom_len%
  1097.   ADD file_pos%,8
  1098.   SEEK #1,file_pos%
  1099.   temp%=CVL(INPUT$(4,#1))
  1100.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  1101.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  1102.   temp%=CVL(INPUT$(4,#1))
  1103.   PRINT SPC(11+indent%);"Sample size       : $";HEX$(temp%,8)
  1104.   temp%=CVL(INPUT$(4,#1))
  1105.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  1106.   ADD file_pos%,12
  1107.   WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
  1108.     IF file_pos%>file_len%
  1109.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1110.       quit_file!=TRUE
  1111.     ELSE
  1112.       SEEK #1,file_pos%
  1113.       PRINT SPC(11+2+indent%);"Sample size : $";HEX$(CVL(INPUT$(4,#1)),8)
  1114.       ADD file_pos%,4
  1115.     ENDIF
  1116.   WEND
  1117. RETURN
  1118. > PROCEDURE treat_stco(file_pos%,atom_len%,indent%)
  1119.   LOCAL atom_end%,atom_type$
  1120.   LOCAL temp%,reserved$
  1121.   atom_end%=file_pos%+atom_len%
  1122.   ADD file_pos%,8
  1123.   SEEK #1,file_pos%
  1124.   temp%=CVL(INPUT$(4,#1))
  1125.   PRINT SPC(11+indent%);"Version           : $";HEX$(SHR(temp%,24),2)
  1126.   PRINT SPC(11+indent%);"Flags             : $";HEX$(temp% AND &HFFFFFF,6)
  1127.   temp%=CVL(INPUT$(4,#1))
  1128.   PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
  1129.   ADD file_pos%,8
  1130.   WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
  1131.     IF file_pos%>file_len%
  1132.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1133.       quit_file!=TRUE
  1134.     ELSE
  1135.       SEEK #1,file_pos%
  1136.       PRINT SPC(11+2+indent%);"Chunk offset : $";HEX$(CVL(INPUT$(4,#1)),8)
  1137.       ADD file_pos%,4
  1138.     ENDIF
  1139.   WEND
  1140. RETURN
  1141. '
  1142. > PROCEDURE display_video_sample_description(file_pos%,atom_len%,indent%)
  1143.   LOCAL temp%,temp$
  1144.   PRINT SPC(11+indent%);"Version               : $";HEX$(CVI(INPUT$(2,#1)),4)
  1145.   PRINT SPC(11+indent%);"Revision level        : $";HEX$(CVI(INPUT$(2,#1)),4)
  1146.   temp%=CVL(INPUT$(4,#1))
  1147.   PRINT SPC(11+indent%);"Vendor                : $";HEX$(temp%,8);" ('";MKL$(temp%);
  1148.   IF temp%=CVL("appl")
  1149.     PRINT "'='Apple Computer, Inc')"
  1150.   ELSE
  1151.     PRINT "')"
  1152.   ENDIF
  1153.   temp%=CVL(INPUT$(4,#1))
  1154.   PRINT SPC(11+indent%);"Temporal quality      : $";HEX$(temp%,8);" (";ROUND((temp%+1)/10.24);"%)"
  1155.   temp%=CVL(INPUT$(4,#1))
  1156.   PRINT SPC(11+indent%);"Spacial quality       : $";HEX$(temp%,8);" (";ROUND((temp%+1)/10.24);"%)"
  1157.   PRINT SPC(11+indent%);"Width                 : ";CVI(INPUT$(2,#1))
  1158.   PRINT SPC(11+indent%);"Height                : ";CVI(INPUT$(2,#1))
  1159.   PRINT SPC(11+indent%);"Horizontal resolution : $";
  1160.   temp%=CVL(INPUT$(4,#1))
  1161.   PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" ppi)"
  1162.   PRINT SPC(11+indent%);"Vertical resolution   : $";
  1163.   temp%=CVL(INPUT$(4,#1))
  1164.   PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" ppi)"
  1165.   PRINT SPC(11+indent%);"Data size             : $";HEX$(CVL(INPUT$(4,#1)),8)
  1166.   PRINT SPC(11+indent%);"Frame count           : $";HEX$(CVI(INPUT$(2,#1)),4)
  1167.   temp%=ASC(INPUT$(1,#1))               ! lenght of the pascal string
  1168.   temp$=INPUT$(31,#1)
  1169.   IF temp%<32                           ! that string is limited to 31 bytes
  1170.     temp$=MID$(temp$,1,temp%)
  1171.   ELSE
  1172.     temp$=RIGHT$(temp$,31)
  1173.   ENDIF
  1174.   PRINT SPC(11+indent%);"Compressor name       : '";temp$;"'"
  1175.   ' FOR i%=1 TO 32 STEP 4
  1176.   ' PRINT HEX$(CVL(MID$(temp$,i%,4)),8)'
  1177.   ' NEXT i%
  1178.   ' PRINT
  1179.   PRINT SPC(11+indent%);"Depth                 : $";HEX$(CVI(INPUT$(2,#1)),4)
  1180.   temp%=CVI(INPUT$(2,#1))
  1181.   PRINT SPC(11+indent%);"Color table ID        : $";HEX$(temp%,4)
  1182.   IF temp%=0
  1183.     PRINT SPC(11+indent%);"[ID=0 -> color table follows here]"
  1184.   ENDIF
  1185. RETURN
  1186. > PROCEDURE display_sound_sample_description(file_pos%,atom_len%,indent%)
  1187.   LOCAL temp%,temp$
  1188.   PRINT SPC(11+indent%);"Version            : $";HEX$(CVI(INPUT$(2,#1)),4)
  1189.   PRINT SPC(11+indent%);"Revision level     : $";HEX$(CVI(INPUT$(2,#1)),4)
  1190.   temp%=CVL(INPUT$(4,#1))
  1191.   PRINT SPC(11+indent%);"Vendor             : $";HEX$(temp%,8);" ('";MKL$(temp%);
  1192.   IF temp%=CVL("appl")
  1193.     PRINT "' = 'Apple Computer, Inc')"
  1194.   ELSE
  1195.     PRINT "')"
  1196.   ENDIF
  1197.   PRINT SPC(11+indent%);"Number of channels : $";HEX$(CVI(INPUT$(2,#1)),4)
  1198.   PRINT SPC(11+indent%);"Sample size        : $";HEX$(CVI(INPUT$(2,#1)),4)
  1199.   PRINT SPC(11+indent%);"Compression ID     : $";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
  1200.   PRINT SPC(11+indent%);"Packet size        : $";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
  1201.   PRINT SPC(11+indent%);"Sample rate        : $";
  1202.   temp%=CVL(INPUT$(4,#1))
  1203.   PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" Hz)"
  1204. RETURN
  1205. > PROCEDURE display_time_code_sample_description(file_pos%,atom_len%,indent%)
  1206.   LOCAL atom_end%,atom_type$,atom_len%
  1207.   LOCAL reserved$
  1208.   LET reserved$=INPUT$(4,#1)
  1209.   temp%=CVL(INPUT$(4,#1))
  1210.   PRINT SPC(11+indent%);"Flags            : $";HEX$(temp%,8);
  1211.   IF (temp% AND &HF)=0
  1212.     PRINT
  1213.   ENDIF
  1214.   IF (temp% AND &H1)<>0
  1215.     PRINT " +Drop_frame"
  1216.   ENDIF
  1217.   IF (temp% AND &H2)<>0
  1218.     PRINT " +24_hour_max"       ! then warp after 24 hours
  1219.   ENDIF
  1220.   IF (temp% AND &H4)<>0
  1221.     PRINT " +Negative_times_OK"
  1222.   ENDIF
  1223.   IF (temp# AND &H8)<>0
  1224.     PRINT " +Counter"           ! then time code values are tape counter values
  1225.   ENDIF
  1226.   PRINT SPC(11+indent%);"Time Scale       : $";HEX$(CVL(INPUT$(4,#1)),8)
  1227.   PRINT SPC(11+indent%);"Frame duration   : $";HEX$(CVL(INPUT$(4,#1)),8)
  1228.   PRINT SPC(11+indent%);"Number of frames : $";HEX$(ASC(INPUT$(1,#1)),2)
  1229.   LET reserved$=INPUT$(3,#1)
  1230.   ADD file_pos%,20
  1231.   PRINT SPC(11+indent%);"Source reference :"
  1232.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  1233.     IF file_pos%>file_len%
  1234.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1235.       quit_file!=TRUE
  1236.     ELSE
  1237.       SEEK #1,file_pos%
  1238.       atom_len%=CVL(INPUT$(4,#1))
  1239.       atom_type$=INPUT$(4,#1)
  1240.       IF atom_len%=0
  1241.         IF CVL(atom_type$)=0
  1242.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  1243.           temp%=CVL(INPUT$(4,#1))
  1244.           atom_len%=CVL(INPUT$(4,#1))
  1245.           atom_type$=INPUT$(4,#1)
  1246.         ELSE
  1247.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  1248.           atom_len%=8
  1249.         ENDIF
  1250.       ENDIF
  1251.       '
  1252.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  1253.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  1254.       IF @wait_key(FALSE)
  1255.         SELECT atom_type$
  1256.         CASE "name"
  1257.           PRINT " (Name of the source tape)"
  1258.           PRINT SPC(9+4+indent%);"'";INPUT$(atom_len%-8,#1);"'"
  1259.         DEFAULT
  1260.           PRINT
  1261.         ENDSELECT
  1262.       ELSE
  1263.         PRINT
  1264.       ENDIF
  1265.       '
  1266.       ADD file_pos%,atom_len%
  1267.     ENDIF
  1268.   WEND
  1269. RETURN
  1270. > PROCEDURE display_text_sample_description(file_pos%,atom_len%,indent%)
  1271.   LOCAL atom_end%,atom_type$,atom_len%
  1272.   LOCAL reserved$,temp%,temp$
  1273.   temp%=CVL(INPUT$(4,#1))
  1274.   PRINT SPC(11+indent%);"Display flags      : $";HEX$(temp%,8);
  1275.   IF (temp% AND &H73EA)=0               ! mask of understood flags
  1276.     PRINT
  1277.   ENDIF
  1278.   IF (temp% AND &H2)<>0
  1279.     PRINT " +Don't_auto_scale"
  1280.   ENDIF
  1281.   IF (temp% AND &H8)<>0
  1282.     PRINT " +Use_movie_background_color" ! then ignores the background color field
  1283.   ENDIF                                  ! in the text sample description
  1284.   IF (temp% AND &H20)<>0
  1285.     PRINT " +Scroll_in"
  1286.   ENDIF
  1287.   IF (temp% AND &H40)<>0
  1288.     PRINT " +Scroll_out"
  1289.   ENDIF
  1290.   IF (temp# AND &H80)<>0
  1291.     PRINT " +Horizontal_scroll"
  1292.   ENDIF
  1293.   IF (temp# AND &H100)<>0
  1294.     PRINT " +Reverse_scroll"
  1295.   ENDIF
  1296.   IF (temp# AND &H200)<>0
  1297.     PRINT " +Continuous_scroll"
  1298.   ENDIF
  1299.   IF (temp# AND &H1000)<>0
  1300.     PRINT " +Drop_shadow"
  1301.   ENDIF
  1302.   IF (temp# AND &H2000)<>0
  1303.     PRINT " +Anti-alias"
  1304.   ENDIF
  1305.   IF (temp# AND &H4000)<>0
  1306.     PRINT " +Key_text"          ! then don't display background color so that
  1307.   ENDIF                         ! the text overlays the background tracks
  1308.   temp%=CVL(INPUT$(4,#1))
  1309.   PRINT SPC(11+indent%);"Text justification : $";HEX$(temp%,8);
  1310.   IF temp%>0
  1311.     PRINT " (Centered)"
  1312.   ELSE IF temp%<0
  1313.     PRINT " (Right-justified)"
  1314.   ELSE
  1315.     PRINT " (Left-justified)"
  1316.   ENDIF
  1317.   PRINT SPC(11+indent%);"Background color   : $";
  1318.   PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
  1319.   PRINT SPC(11+indent%);"Default text box   :"
  1320.   PRINT SPC(11+4+indent%);"Top    : ";HEX$(CVI(INPUT$(2,#1)),4)
  1321.   PRINT SPC(11+4+indent%);"Left   : ";HEX$(CVI(INPUT$(2,#1)),4)
  1322.   PRINT SPC(11+4+indent%);"Bottom : ";HEX$(CVI(INPUT$(2,#1)),4)
  1323.   PRINT SPC(11+4+indent%);"Right  : ";HEX$(CVI(INPUT$(2,#1)),4)
  1324.   LET reserved$=INPUT$(8,#1)
  1325.   PRINT SPC(11+indent%);"Font number        : ";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
  1326.   temp%=CVI(INPUT$(2,#1))
  1327.   PRINT SPC(11+indent%);"Font face          : ";HEX$(temp%,4);
  1328.   IF (temp% AND &H7F)=0
  1329.     PRINT
  1330.   ENDIF
  1331.   IF (temp% AND &H1)<>0
  1332.     PRINT " +Bold"
  1333.   ENDIF
  1334.   IF (temp% AND &H2)<>0
  1335.     PRINT " +Italic"
  1336.   ENDIF
  1337.   IF (temp% AND &H4)<>0
  1338.     PRINT " +Underline"
  1339.   ENDIF
  1340.   IF (temp% AND &H8)<>0
  1341.     PRINT " +Outline"
  1342.   ENDIF
  1343.   IF (temp% AND &H10)<>0
  1344.     PRINT " +Shadow"
  1345.   ENDIF
  1346.   IF (temp% AND &H20)<>0
  1347.     PRINT " +Condense"
  1348.   ENDIF
  1349.   IF (temp% AND &H40)<>0
  1350.     PRINT " +Extend"
  1351.   ENDIF
  1352.   LET reserved$=INPUT$(3,#1)
  1353.   PRINT SPC(11+indent%);"Foreground color   : $";
  1354.   PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
  1355.   temp%=ASC(INPUT$(1,#1))
  1356.   temp$=INPUT$(temp%,#1)
  1357.   PRINT SPC(11+indent%);"Text name          : ";temp$
  1358. RETURN
  1359. > PROCEDURE display_music_sample_description(file_pos%,atom_len%,indent%)
  1360.   PRINT SPC(11+indent%);"Flags : $";HEX$(CVL(INPUT$(4,#1)),8)   ! no flag defined
  1361. RETURN
  1362. '
  1363. ' Voici un prototype pour ajouter la gestion de nouveaux atoms
  1364. > PROCEDURE treat_empty(file_pos%,atom_len%,indent%)
  1365.   LOCAL atom_end%,atom_type$
  1366.   atom_end%=file_pos%+atom_len%
  1367.   ADD file_pos%,8
  1368.   WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
  1369.     IF file_pos%>file_len%
  1370.       PRINT "*** Warning : Early end of file (before end of Atoms)"
  1371.       quit_file!=TRUE
  1372.     ELSE
  1373.       SEEK #1,file_pos%
  1374.       atom_len%=CVL(INPUT$(4,#1))
  1375.       atom_type$=INPUT$(4,#1)
  1376.       IF atom_len%=0
  1377.         IF CVL(atom_type$)=0
  1378.           PRINT "*** Warning : atom with length zero : must be a QT atom"
  1379.           temp%=CVL(INPUT$(4,#1))
  1380.           atom_len%=CVL(INPUT$(4,#1))
  1381.           atom_type$=INPUT$(4,#1)
  1382.         ELSE
  1383.           PRINT "*** Warning : atom with length zero : fixing length to 8"
  1384.           atom_len%=8
  1385.         ENDIF
  1386.       ENDIF
  1387.       '
  1388.       PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
  1389.       PRINT SPC(9+indent%);"Type : ";atom_type$;
  1390.       IF @wait_key(FALSE)
  1391.         SELECT atom_type$
  1392.         CASE "none"
  1393.           PRINT ""
  1394.           @treat_empty(file_pos%,atom_len%,indent%+2)
  1395.         DEFAULT
  1396.           PRINT
  1397.         ENDSELECT
  1398.       ELSE
  1399.         PRINT
  1400.       ENDIF
  1401.       '
  1402.       ADD file_pos%,atom_len%
  1403.     ENDIF
  1404.   WEND
  1405. RETURN
  1406. > FUNCTION wait_key(leaf_atom!)
  1407.   LOCAL key|
  1408.   IF quit_file!
  1409.     RETURN FALSE
  1410.   ELSE
  1411.     IF (NOT wait_key!) AND (NOT INP?(2))
  1412.       RETURN TRUE
  1413.     ELSE
  1414.       key|=0
  1415.       REPEAT
  1416.       UNTIL INP?(2)
  1417.       WHILE INP?(2)
  1418.         key|=INP(2)
  1419.       WEND
  1420.       SELECT UPPER$(CHR$(key|))
  1421.       CASE "V"
  1422.         wait_key!=TRUE
  1423.         RETURN FALSE
  1424.         ' RETURN NOT leaf_atom!         ! not working correctly ...
  1425.       CASE 27
  1426.         quit_file!=TRUE
  1427.         quit_prg!=TRUE
  1428.         RETURN FALSE
  1429.       CASE "Q"
  1430.         quit_file!=TRUE
  1431.         RETURN FALSE
  1432.       CASE " "
  1433.         wait_key!=NOT wait_key!
  1434.         RETURN TRUE
  1435.       DEFAULT
  1436.         wait_key!=TRUE
  1437.         RETURN TRUE
  1438.       ENDSELECT
  1439.     ENDIF
  1440.   ENDIF
  1441. ENDFUNC
  1442. > FUNCTION get_date$(long%)
  1443.   LOCAL temp#,year%,month%
  1444.   temp#=long%
  1445.   IF temp#<0
  1446.     ADD temp#,2^32
  1447.   ENDIF
  1448.   year%=TRUNC(temp#/(60*60*24*365.25))
  1449.   SUB temp#,year%*(60*60*24*365.25)
  1450.   ADD year%,1904
  1451.   month%=TRUNC(temp#/(60*60*24*(365.25/12)))
  1452.   RETURN "~ "+STR$(month%)+"/"+STR$(year%)+"  ($"+HEX$(long%,8)+")"
  1453. ENDFUNC
  1454.