home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ST-Computer Leser-CD 2001 April
/
LCD_4_01.iso
/
apps
/
movparse
/
movparse.gfa
(
.txt
)
next >
Wrap
GFA-BASIC Atari
|
1999-06-17
|
39KB
|
1,454 lines
' MOV parser
'
' Designed to parse the byte-level structure of QuickTime files.
' Stabylo / The Removers
'
' This software is under the GPL licence.
'
' If you do any modification to this code, please tell me :
'
' benjamin.gandon@mines.u-nancy.fr
' stabylo@rtel.fr
'
version#=1.2
revision_date$="June 15th 1999"
'
@init
' fichier_cmd$="e:\actuel\zip\guign.mov"
'
IF EXIST(fichier_cmd$)
OPEN "i",#1,fichier_cmd$
PRINT
PRINT "file : '";fichier_cmd$;"'"
PRINT
@treat_file
CLOSE #1
ELSE
@select_fichier(g_extention$,g_txt$,g_chemin$,g_nom$,g_fichier$)
WHILE EXIST(g_fichier$) AND NOT quit_prg!
OPEN "i",#1,g_fichier$
PRINT
PRINT "file : '";g_fichier$;"'"
PRINT
@treat_file
CLOSE #1
IF NOT quit_prg!
@select_fichier(g_extention$,g_txt$,g_chemin$,g_nom$,g_fichier$)
ENDIF
WEND
ENDIF
@the_end("")
'
'
> PROCEDURE select_fichier(extention$,txt$,VAR chemin$,nom$,fichier$)
LOCAL n&
FILESELECT #txt$,chemin$,nom$,fichier$
n&=RINSTR(fichier$,"\")
chemin$=LEFT$(fichier$,n&)+extention$
n&=LEN(fichier$)-n&
nom$=RIGHT$(fichier$,n&)
RETURN
> PROCEDURE init
CLS
PRINT "v" ! active le 'Wrap-around-the-edge'... Year !
PRINT
PRINT " QuickTime parser by Stabylo / The Removers"
PRINT " version ";version#;" dated ";revision_date$
DEFMOUSE 0
@vide_clavier
'
ON ERROR GOSUB error
ON BREAK GOSUB user_break
RESERVE
RESERVE 100000
'
quit_prg!=FALSE
'
c_zero|=48
c_un|=48+1
c_deux|=48+2
c_trois|=48+3
c_quatre|=48+4
c_esc|=27
'
adr_cmd%=BASEPAGE+128
cmd_len%=BYTE{adr_cmd%}
INC adr_cmd%
BYTE{adr_cmd%+cmd_len%}=0
fichier_cmd$=CHAR{adr_cmd%}
'
g_extention$="*.MOV"
g_txt$="Load a QuickTime file"
g_chemin$=CHR$(65+GEMDOS(25))+":"+DIR$(0)+"\"+g_extention$
g_nom$=""
g_fichier$=""
'
out_extention$="*.txt"
out_txt$="Save a text file"
out_chemin$=CHR$(65+GEMDOS(25))+":"+DIR$(0)+"\"+out_extention$
out_nom$=""
out_fichier$=""
RETURN
> PROCEDURE user_break
the_end("User caused break of the programm")
RETURN
> PROCEDURE error
the_end(ERR$(ERR))
RETURN
> PROCEDURE the_end(msg$)
IF msg$<>""
CLS
PRINT
PRINT msg$
~INP(2)
ENDIF
RESERVE
EDIT
RETURN
> PROCEDURE vide_clavier
WHILE INP?(2)
~INP(2)
WEND
RETURN
'
> PROCEDURE treat_file
quit_file!=FALSE
wait_key!=TRUE
indent%=2
file_len%=LOF(#1)
file_pos%=0
'
WHILE file_pos%<=file_len%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "mdat"
PRINT " (Movie data atom)"
CASE "pnot"
PRINT " (Preview atom)"
CASE "moov"
PRINT " (Movie resource atom)"
@treat_moov(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
IF file_pos%<file_len%
PRINT "*** Warning : padding bytes after Atoms"
ENDIF
IF NOT quit_file!
PRINT
PRINT "*** end of file"
~INP(2)
ENDIF
RETURN
> PROCEDURE treat_moov(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL size%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "free","skip"
PRINT " (Free space atom)"
CASE "mvhd"
PRINT " (Movie header atom)"
@treat_mvhd(file_pos%,atom_len%,indent%+2)
CASE "clip"
PRINT " (Movie clipping atom)"
CASE "udta"
PRINT " (User-defined data atom)"
@treat_udta(file_pos%,atom_len%,indent%+2)
CASE "trak"
PRINT " (Track atom)"
@treat_trak(file_pos%,atom_len%,indent%+2)
CASE "ctab"
PRINT " (Color table atom)"
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_mvhd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp#,temp%,reserved$,year%,month%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Creation time : ";@get_date$(CVL(INPUT$(4,#1)))
PRINT SPC(11+indent%);"Modification time : ";@get_date$(CVL(INPUT$(4,#1)))
PRINT SPC(11+indent%);"Time scale : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Duration : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Prefered rate : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Prefered volume : $";HEX$(CVL(INPUT$(2,#1)),4)
LET reserved$=INPUT$(10,#1)
PRINT SPC(11+indent%);"Matrix : ";
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Preview time : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Preview duration : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Poster time : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Selection time : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Selection duration : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Current time : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Next track ID : $";HEX$(CVL(INPUT$(4,#1)),8)
RETURN
> PROCEDURE treat_udta(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%
LOCAL num|
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%+2);"Size : $";HEX$(atom_len%,8)
PRINT SPC(11+indent%);"Type : ";atom_type$
IF @wait_key(TRUE)
SELECT atom_type$
CASE "⌐cpy"
PRINT SPC(11+2+indent%);"(Copyright statement)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐day"
PRINT SPC(11+2+indent%);"(Date the movie content was created)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐dir"
PRINT SPC(11+2+indent%);"(Name of movie's director)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed1"
PRINT SPC(11+2+indent%);"(Edit date 1 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed2"
PRINT SPC(11+2+indent%);"(Edit date 2 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed3"
PRINT SPC(11+2+indent%);"(Edit date 3 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed4"
PRINT SPC(11+2+indent%);"(Edit date 4 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed5"
PRINT SPC(11+2+indent%);"(Edit date 5 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed6"
PRINT SPC(11+2+indent%);"(Edit date 6 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed7"
PRINT SPC(11+2+indent%);"(Edit date 7 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed8"
PRINT SPC(11+2+indent%);"(Edit date 8 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐ed9"
PRINT SPC(11+2+indent%);"(Edit date 9 ans description)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐fmt"
PRINT SPC(11+2+indent%);"(information of movie format)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐inf"
PRINT SPC(11+2+indent%);"(information about the movie)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐prd"
PRINT SPC(11+2+indent%);"(Name of the movie's producer)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐prf"
PRINT SPC(11+2+indent%);"(Name of performers)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐req"
PRINT SPC(11+2+indent%);"(Special hardware and software requirements)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐src"
PRINT SPC(11+2+indent%);"(Credit for those who provided the movie source content)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "⌐wrt"
PRINT SPC(11+2+indent%);"(Name of the movie's writer)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "WLOC"
PRINT SPC(11+2+indent%);"(Default window location for movie)"
PRINT SPC(11+2+indent%);"x : ";CVI(INPUT$(2,#1))
PRINT SPC(11+2+indent%);"y : ";CVI(INPUT$(2,#1))
CASE "name"
PRINT SPC(11+2+indent%);"(Name of object)"
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
CASE "LOOP"
PRINT SPC(11+2+indent%);"(Looping style information)"
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+2+indent%);"looping style : ";temp%;
SELECT temp%
CASE 0
PRINT " (no looping)"
CASE 1
PRINT " (looping set on)"
CASE 2
PRINT " (plindrome looping)"
DEFAULT
PRINT " (unreconised looping style)"
ENDSELECT
CASE "SelO"
PRINT SPC(11+2+indent%);"(Play selection only information)"
PRINT SPC(11+2+indent%);"flag : $";HEX$(ASC(INPUT$(1,#1)),2)
CASE "AllF"
PRINT SPC(11+2+indent%);"(Play all frames information)"
PRINT SPC(11+2+indent%);"flag : $";HEX$(ASC(INPUT$(1,#1)),2)
DEFAULT
PRINT SPC(11+indent%);"'";INPUT$(atom_len%-8,#1);"'"
ENDSELECT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_trak(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "tkhd"
PRINT " (Track header atom)"
@treat_tkhd(file_pos%,atom_len%,indent%+2)
CASE "clip"
PRINT " (Track clipping atom)"
CASE "matt"
PRINT " (Track matte atom)"
CASE "edts"
PRINT " (Edit atom)"
@treat_edts(file_pos%,atom_len%,indent%+2)
CASE "load"
PRINT " (Track load settings atom)"
CASE "tref"
PRINT " (Track reference atom)"
CASE "imap"
PRINT " (Track input map atom)"
CASE "mdia"
PRINT " (Media atom)"
@treat_mdia(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_tkhd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Creation time : ";@get_date$(CVL(INPUT$(4,#1)))
PRINT SPC(11+indent%);"Modification time : ";@get_date$(CVL(INPUT$(4,#1)))
PRINT SPC(11+indent%);"Track ID : $";HEX$(CVL(INPUT$(4,#1)),8)
LET reserved$=INPUT$(4,#1)
PRINT SPC(11+indent%);"Duration : $";HEX$(CVL(INPUT$(4,#1)),8)
LET reserved$=INPUT$(8,#1)
PRINT SPC(11+indent%);"Layer : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Alternate group : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Volume : $";HEX$(CVI(INPUT$(2,#1)),4)
LET reserved$=INPUT$(2,#1)
PRINT SPC(11+indent%);"Matrix : ";
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+21+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)''
PRINT "$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Track width : $";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Track height : $";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
RETURN
> PROCEDURE treat_edts(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "elst"
PRINT " (Edit list Atom)"
@treat_elst(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_elst(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
PRINT SPC(11+2+indent%);"Track duration / Media time / Media rate"
WHILE file_pos%<=atom_end%-12 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);
PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,12
ENDIF
WEND
RETURN
> PROCEDURE treat_mdia(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "mdhd"
PRINT " (Media header atom)"
@treat_mdhd(file_pos%,atom_len%,indent%+2)
CASE "hdlr"
PRINT " (Media handler reference atom)"
@treat_hdlr(file_pos%,atom_len%,indent%+2)
CASE "minf"
PRINT " (Media information atom)"
@treat_minf(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_mdhd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp2#,temp%,reserved$,year%,month%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Creation time : ";@get_date$(CVL(INPUT$(4,#1)))
PRINT SPC(11+indent%);"Modification time : ";@get_date$(CVL(INPUT$(4,#1)))
temp%=CVL(INPUT$(4,#1))
temp2#=temp%
PRINT SPC(11+indent%);"Time scale : $";HEX$(temp%,8);" (=";temp%;")"
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Duration : $";HEX$(temp%,8);" (=";temp%;") (=";temp%/temp2#;" sec)"
PRINT SPC(11+indent%);"Language : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Quality : $";HEX$(CVI(INPUT$(2,#1)),4)
RETURN
> PROCEDURE treat_hdlr(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL hdlr_type$,temp$,reserved$,year%,month%
LOCAL num|
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
hdlr_type$=INPUT$(4,#1)
PRINT SPC(11+indent%);"Component type : ";hdlr_type$
temp$=INPUT$(4,#1)
PRINT SPC(11+indent%);"Component subtype : ";temp$;
IF hdlr_type$<>"mhlr"
PRINT
ELSE
media_type$=temp$ ! set media type for sample description atom ('stsd')
SELECT temp$
CASE "vide"
PRINT " (video media)"
CASE "soun"
PRINT " (sound media)"
CASE "tmcd"
PRINT " (time code media)"
CASE "text"
PRINT " (text media)"
CASE "musi"
PRINT " (music media)"
CASE "MPEG"
PRINT " (MPEG media)"
CASE "sprt"
PRINT " (sprite media)"
CASE "gnrc"
PRINT " (base media)"
CASE "twen"
PRINT " (tween media)"
CASE "qd3d"
PRINT " (3D media)"
DEFAULT
PRINT " (warning : unreconized media)"
ENDSELECT
ENDIF
PRINT SPC(11+indent%);"Component manufacturer : ";INPUT$(4,#1);" (reserved)"
PRINT SPC(11+indent%);"Component flags : $";HEX$(CVL(INPUT$(4,#1)),8);" (reserved)"
PRINT SPC(11+indent%);"Component name : '";
num|=ASC(INPUT$(1,#1))
PRINT INPUT$(num|,#1);"'"
RETURN
> PROCEDURE treat_minf(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "vmhd"
PRINT " (Video media information header atom)"
@treat_vmhd(file_pos%,atom_len%,indent%+2)
CASE "smhd"
PRINT " (Sound media information header atom)"
@treat_smhd(file_pos%,atom_len%,indent%+2)
CASE "gmhd"
PRINT " (Base media information header atom)"
PRINT SPC(11+2+indent%);"[empty atom that signals a base media]"
CASE "gmin"
PRINT " (Base media info atom)"
@treat_gmin(file_pos%,atom_len%,indent%+2)
CASE "hdlr"
PRINT " (Data handler reference atom)"
@treat_hdlr(file_pos%,atom_len%,indent%+2)
CASE "dinf"
PRINT " (Data information atom)"
@treat_dinf(file_pos%,atom_len%,indent%+2)
CASE "stbl"
PRINT " (Sample table atom)"
@treat_stbl(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_vmhd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$,year%,month%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Graphic mode : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Opcolor : $";
PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
RETURN
> PROCEDURE treat_smhd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$,year%,month%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Balance : $";HEX$(CVI(INPUT$(2,#1)),4)
RETURN
> PROCEDURE treat_gmin(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$,year%,month%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+indent%);"Graphic mode : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Opcolor : $";HEX$(CVI(INPUT$(2,#1)),4)'HEX$(CVI(INPUT$(2,#1)),4)'HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Balance : $";HEX$(CVI(INPUT$(2,#1)),4)
LET reserved$=INPUT$(2,#1)
RETURN
> PROCEDURE treat_dinf(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "dref"
PRINT " (Data reference atom)"
@treat_dref(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_dref(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT SPC(11+2+indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(11+2+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "alis"
PRINT " (Data reference is a Macintosh alias)"
CASE "rsrc"
PRINT " (Data reference is a Macintosh alias + Type and ID of the resource)"
DEFAULT
PRINT
ENDSELECT
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+2+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+2+4+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
PRINT SPC(11+2+4+indent%);"'";INPUT$(atom_len%-12,#1);"'"
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_stbl(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "stts"
PRINT " (Time-to-sample atom)"
@treat_stts(file_pos%,atom_len%,indent%+2)
CASE "stss"
PRINT " (Sync sample atom)"
@treat_stss(file_pos%,atom_len%,indent%+2)
CASE "stsd"
PRINT " (Sample description atom)"
@treat_stsd(file_pos%,atom_len%,indent%+2)
CASE "stsz"
PRINT " (Sample size atom)"
@treat_stsz(file_pos%,atom_len%,indent%+2)
CASE "stsh"
PRINT " (Shadow sync atom) *** WARNING : obsolete atom !!!"
CASE "stco"
PRINT " (Chunk offset atom)"
@treat_stco(file_pos%,atom_len%,indent%+2)
CASE "stsc"
PRINT " (Sample-to-chunk atom)"
@treat_stsc(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_stsd(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
LOCAL size%,data_format$,first_extension!
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
first_extension!=TRUE
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
size%=CVL(INPUT$(4,#1))
LET data_format$=INPUT$(4,#1)
'
PRINT SPC(11+2+indent%);"Size : $";HEX$(size%,8)
PRINT SPC(11+2+indent%);"Data format : ";data_format$
IF first_extension!
LET reserved$=INPUT$(6,#1)
PRINT SPC(11+2+indent%);"Index : $";HEX$(CVI(INPUT$(2,#1)),4)
SELECT media_type$
CASE "vide"
PRINT SPC(11+indent%);"(Video media)"
@display_video_sample_description(file_pos%,atom_len%,indent%+2)
CASE "soun"
PRINT SPC(11+indent%);"(Sound media)"
@display_sound_sample_description(file_pos%,atom_len%,indent%+2)
CASE "tmcd"
PRINT SPC(11+indent%);"(Time code media)"
@display_time_code_sample_description(file_pos%,atom_len%,indent%+2)
CASE "text"
PRINT SPC(11+indent%);"(Text media)"
@display_text_sample_description(file_pos%,atom_len%,indent%+2)
CASE "musi"
PRINT SPC(11+indent%);"(Music media)"
@display_music_sample_description(file_pos%,atom_len%,indent%+2)
CASE "MPEG"
PRINT SPC(11+indent%);"(MPEG media)"
' nothing added in the atom
CASE "sprt"
PRINT SPC(11+indent%);"(Sprite media)"
' nothing added in the atom
CASE "gnrc"
PRINT SPC(11+indent%);"(Base media)"
' nothing added in the atom
CASE "twen"
PRINT SPC(11+indent%);"(Tween media)"
' nothing added in the atom
CASE "qd3d"
PRINT SPC(11+indent%);"(3D media)"
' nothing added in the atom
DEFAULT
PRINT SPC(11+indent%);"'";INPUT$(size%-16,#1);"'"
ENDSELECT
ELSE
SELECT media_type$
CASE "vide"
SELECT data_format$
CASE "gama"
PRINT SPC(11+2+indent%);"(Gamma correction)"
PRINT SPC(11+2+indent%);"$";HEX$(CVI(INPUT$(2,#1)),4);".";HEX$(CVI(INPUT$(2,#1)),4)
CASE "fiel"
PRINT SPC(11+2+indent%);"(Number of video fields in data stream)"
PRINT SPC(11+2+indent%);"Field count : ";HEX$(ASC(INPUT$(1,#1)),2)
temp%=ASC(INPUT$(1,#1))
PRINT SPC(11+2+indent%);"Field dominance : ";HEX$(temp%,2);
SELECT temp%
CASE 1
PRINT " (Top field is first, temporally)"
CASE 2
PRINT " (Bottom field is first, temporally)"
DEFAULT
PRINT " (Field dominance unknown)"
ENDSELECT
CASE "mjqt"
PRINT SPC(11+2+indent%);"(Default quantization table)"
CASE "mjht"
PRINT SPC(11+2+indent%);"(Default Huffman table)"
ENDSELECT
CASE "text"
SELECT data_format$
CASE "styl"
PRINT SPC(11+2+indent%);"(Style information)"
CASE "ftab"
PRINT SPC(11+2+indent%);"(Table of font names)"
CASE "hlit"
PRINT SPC(11+2+indent%);"(Highlight information)"
CASE "hclr"
PRINT SPC(11+2+indent%);"(Highlight color)"
CASE "drpo"
PRINT SPC(11+2+indent%);"(Drop shadow offset)"
CASE "drpt"
PRINT SPC(11+2+indent%);"(Drop shadow transparency)"
CASE "imag"
PRINT SPC(11+2+indent%);"(Image font data)"
CASE "metr"
PRINT SPC(11+2+indent%);"(Image font highlighting)"
ENDSELECT
ENDSELECT
ENDIF
first_extension!=FALSE
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE treat_stts(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);"Sample count / duration : ";
PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,8
ENDIF
WEND
RETURN
> PROCEDURE treat_stss(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);"Sync sample number : $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,4
ENDIF
WEND
RETURN
> PROCEDURE treat_stsc(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
PRINT SPC(11+2+indent%);"1st chunk / Spls per chunk / Spl description ID"
WHILE file_pos%<=atom_end%-12 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);
PRINT "$";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8);" / $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,12
ENDIF
WEND
RETURN
> PROCEDURE treat_stsz(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Sample size : $";HEX$(temp%,8)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,12
WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);"Sample size : $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,4
ENDIF
WEND
RETURN
> PROCEDURE treat_stco(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
LOCAL temp%,reserved$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
SEEK #1,file_pos%
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Version : $";HEX$(SHR(temp%,24),2)
PRINT SPC(11+indent%);"Flags : $";HEX$(temp% AND &HFFFFFF,6)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Number of entries : $";HEX$(temp%,8)
ADD file_pos%,8
WHILE file_pos%<=atom_end%-4 AND (NOT quit_file!) AND @wait_key(TRUE)
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
PRINT SPC(11+2+indent%);"Chunk offset : $";HEX$(CVL(INPUT$(4,#1)),8)
ADD file_pos%,4
ENDIF
WEND
RETURN
'
> PROCEDURE display_video_sample_description(file_pos%,atom_len%,indent%)
LOCAL temp%,temp$
PRINT SPC(11+indent%);"Version : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Revision level : $";HEX$(CVI(INPUT$(2,#1)),4)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Vendor : $";HEX$(temp%,8);" ('";MKL$(temp%);
IF temp%=CVL("appl")
PRINT "'='Apple Computer, Inc')"
ELSE
PRINT "')"
ENDIF
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Temporal quality : $";HEX$(temp%,8);" (";ROUND((temp%+1)/10.24);"%)"
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Spacial quality : $";HEX$(temp%,8);" (";ROUND((temp%+1)/10.24);"%)"
PRINT SPC(11+indent%);"Width : ";CVI(INPUT$(2,#1))
PRINT SPC(11+indent%);"Height : ";CVI(INPUT$(2,#1))
PRINT SPC(11+indent%);"Horizontal resolution : $";
temp%=CVL(INPUT$(4,#1))
PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" ppi)"
PRINT SPC(11+indent%);"Vertical resolution : $";
temp%=CVL(INPUT$(4,#1))
PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" ppi)"
PRINT SPC(11+indent%);"Data size : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Frame count : $";HEX$(CVI(INPUT$(2,#1)),4)
temp%=ASC(INPUT$(1,#1)) ! lenght of the pascal string
temp$=INPUT$(31,#1)
IF temp%<32 ! that string is limited to 31 bytes
temp$=MID$(temp$,1,temp%)
ELSE
temp$=RIGHT$(temp$,31)
ENDIF
PRINT SPC(11+indent%);"Compressor name : '";temp$;"'"
' FOR i%=1 TO 32 STEP 4
' PRINT HEX$(CVL(MID$(temp$,i%,4)),8)'
' NEXT i%
' PRINT
PRINT SPC(11+indent%);"Depth : $";HEX$(CVI(INPUT$(2,#1)),4)
temp%=CVI(INPUT$(2,#1))
PRINT SPC(11+indent%);"Color table ID : $";HEX$(temp%,4)
IF temp%=0
PRINT SPC(11+indent%);"[ID=0 -> color table follows here]"
ENDIF
RETURN
> PROCEDURE display_sound_sample_description(file_pos%,atom_len%,indent%)
LOCAL temp%,temp$
PRINT SPC(11+indent%);"Version : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Revision level : $";HEX$(CVI(INPUT$(2,#1)),4)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Vendor : $";HEX$(temp%,8);" ('";MKL$(temp%);
IF temp%=CVL("appl")
PRINT "' = 'Apple Computer, Inc')"
ELSE
PRINT "')"
ENDIF
PRINT SPC(11+indent%);"Number of channels : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Sample size : $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Compression ID : $";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
PRINT SPC(11+indent%);"Packet size : $";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
PRINT SPC(11+indent%);"Sample rate : $";
temp%=CVL(INPUT$(4,#1))
PRINT HEX$(SHR(temp%,16),4);".";HEX$(AND(temp%,&HFFFF),4);" (";temp%/2^16;" Hz)"
RETURN
> PROCEDURE display_time_code_sample_description(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$,atom_len%
LOCAL reserved$
LET reserved$=INPUT$(4,#1)
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Flags : $";HEX$(temp%,8);
IF (temp% AND &HF)=0
PRINT
ENDIF
IF (temp% AND &H1)<>0
PRINT " +Drop_frame"
ENDIF
IF (temp% AND &H2)<>0
PRINT " +24_hour_max" ! then warp after 24 hours
ENDIF
IF (temp% AND &H4)<>0
PRINT " +Negative_times_OK"
ENDIF
IF (temp# AND &H8)<>0
PRINT " +Counter" ! then time code values are tape counter values
ENDIF
PRINT SPC(11+indent%);"Time Scale : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Frame duration : $";HEX$(CVL(INPUT$(4,#1)),8)
PRINT SPC(11+indent%);"Number of frames : $";HEX$(ASC(INPUT$(1,#1)),2)
LET reserved$=INPUT$(3,#1)
ADD file_pos%,20
PRINT SPC(11+indent%);"Source reference :"
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "name"
PRINT " (Name of the source tape)"
PRINT SPC(9+4+indent%);"'";INPUT$(atom_len%-8,#1);"'"
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> PROCEDURE display_text_sample_description(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$,atom_len%
LOCAL reserved$,temp%,temp$
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Display flags : $";HEX$(temp%,8);
IF (temp% AND &H73EA)=0 ! mask of understood flags
PRINT
ENDIF
IF (temp% AND &H2)<>0
PRINT " +Don't_auto_scale"
ENDIF
IF (temp% AND &H8)<>0
PRINT " +Use_movie_background_color" ! then ignores the background color field
ENDIF ! in the text sample description
IF (temp% AND &H20)<>0
PRINT " +Scroll_in"
ENDIF
IF (temp% AND &H40)<>0
PRINT " +Scroll_out"
ENDIF
IF (temp# AND &H80)<>0
PRINT " +Horizontal_scroll"
ENDIF
IF (temp# AND &H100)<>0
PRINT " +Reverse_scroll"
ENDIF
IF (temp# AND &H200)<>0
PRINT " +Continuous_scroll"
ENDIF
IF (temp# AND &H1000)<>0
PRINT " +Drop_shadow"
ENDIF
IF (temp# AND &H2000)<>0
PRINT " +Anti-alias"
ENDIF
IF (temp# AND &H4000)<>0
PRINT " +Key_text" ! then don't display background color so that
ENDIF ! the text overlays the background tracks
temp%=CVL(INPUT$(4,#1))
PRINT SPC(11+indent%);"Text justification : $";HEX$(temp%,8);
IF temp%>0
PRINT " (Centered)"
ELSE IF temp%<0
PRINT " (Right-justified)"
ELSE
PRINT " (Left-justified)"
ENDIF
PRINT SPC(11+indent%);"Background color : $";
PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+indent%);"Default text box :"
PRINT SPC(11+4+indent%);"Top : ";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+4+indent%);"Left : ";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+4+indent%);"Bottom : ";HEX$(CVI(INPUT$(2,#1)),4)
PRINT SPC(11+4+indent%);"Right : ";HEX$(CVI(INPUT$(2,#1)),4)
LET reserved$=INPUT$(8,#1)
PRINT SPC(11+indent%);"Font number : ";HEX$(CVI(INPUT$(2,#1)),4);" (must be set to 0)"
temp%=CVI(INPUT$(2,#1))
PRINT SPC(11+indent%);"Font face : ";HEX$(temp%,4);
IF (temp% AND &H7F)=0
PRINT
ENDIF
IF (temp% AND &H1)<>0
PRINT " +Bold"
ENDIF
IF (temp% AND &H2)<>0
PRINT " +Italic"
ENDIF
IF (temp% AND &H4)<>0
PRINT " +Underline"
ENDIF
IF (temp% AND &H8)<>0
PRINT " +Outline"
ENDIF
IF (temp% AND &H10)<>0
PRINT " +Shadow"
ENDIF
IF (temp% AND &H20)<>0
PRINT " +Condense"
ENDIF
IF (temp% AND &H40)<>0
PRINT " +Extend"
ENDIF
LET reserved$=INPUT$(3,#1)
PRINT SPC(11+indent%);"Foreground color : $";
PRINT HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4);" $";HEX$(CVI(INPUT$(2,#1)),4)
temp%=ASC(INPUT$(1,#1))
temp$=INPUT$(temp%,#1)
PRINT SPC(11+indent%);"Text name : ";temp$
RETURN
> PROCEDURE display_music_sample_description(file_pos%,atom_len%,indent%)
PRINT SPC(11+indent%);"Flags : $";HEX$(CVL(INPUT$(4,#1)),8) ! no flag defined
RETURN
'
' Voici un prototype pour ajouter la gestion de nouveaux atoms
> PROCEDURE treat_empty(file_pos%,atom_len%,indent%)
LOCAL atom_end%,atom_type$
atom_end%=file_pos%+atom_len%
ADD file_pos%,8
WHILE file_pos%<=atom_end%-8 AND NOT quit_file!
IF file_pos%>file_len%
PRINT "*** Warning : Early end of file (before end of Atoms)"
quit_file!=TRUE
ELSE
SEEK #1,file_pos%
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
IF atom_len%=0
IF CVL(atom_type$)=0
PRINT "*** Warning : atom with length zero : must be a QT atom"
temp%=CVL(INPUT$(4,#1))
atom_len%=CVL(INPUT$(4,#1))
atom_type$=INPUT$(4,#1)
ELSE
PRINT "*** Warning : atom with length zero : fixing length to 8"
atom_len%=8
ENDIF
ENDIF
'
PRINT "$";HEX$(file_pos%,8);SPC(indent%);"Size : $";HEX$(atom_len%,8)
PRINT SPC(9+indent%);"Type : ";atom_type$;
IF @wait_key(FALSE)
SELECT atom_type$
CASE "none"
PRINT ""
@treat_empty(file_pos%,atom_len%,indent%+2)
DEFAULT
PRINT
ENDSELECT
ELSE
PRINT
ENDIF
'
ADD file_pos%,atom_len%
ENDIF
WEND
RETURN
> FUNCTION wait_key(leaf_atom!)
LOCAL key|
IF quit_file!
RETURN FALSE
ELSE
IF (NOT wait_key!) AND (NOT INP?(2))
RETURN TRUE
ELSE
key|=0
REPEAT
UNTIL INP?(2)
WHILE INP?(2)
key|=INP(2)
WEND
SELECT UPPER$(CHR$(key|))
CASE "V"
wait_key!=TRUE
RETURN FALSE
' RETURN NOT leaf_atom! ! not working correctly ...
CASE 27
quit_file!=TRUE
quit_prg!=TRUE
RETURN FALSE
CASE "Q"
quit_file!=TRUE
RETURN FALSE
CASE " "
wait_key!=NOT wait_key!
RETURN TRUE
DEFAULT
wait_key!=TRUE
RETURN TRUE
ENDSELECT
ENDIF
ENDIF
ENDFUNC
> FUNCTION get_date$(long%)
LOCAL temp#,year%,month%
temp#=long%
IF temp#<0
ADD temp#,2^32
ENDIF
year%=TRUNC(temp#/(60*60*24*365.25))
SUB temp#,year%*(60*60*24*365.25)
ADD year%,1904
month%=TRUNC(temp#/(60*60*24*(365.25/12)))
RETURN "~ "+STR$(month%)+"/"+STR$(year%)+" ($"+HEX$(long%,8)+")"
ENDFUNC