ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
getid3_mod Class Reference

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g // More...

+ Inheritance diagram for getid3_mod:
+ Collaboration diagram for getid3_mod:

Public Member Functions

 getid3_mod (&$fd, &$ThisFileInfo, $option)
 
 getMODheaderFilepointer (&$fd, &$ThisFileInfo)
 
 getXMheaderFilepointer (&$fd, &$ThisFileInfo)
 
 getS3MheaderFilepointer (&$fd, &$ThisFileInfo)
 
 getITheaderFilepointer (&$fd, &$ThisFileInfo)
 
 Analyze ()
 
 getMODheaderFilepointer ()
 
 getXMheaderFilepointer ()
 
 getS3MheaderFilepointer ()
 
 getITheaderFilepointer ()
 
- Public Member Functions inherited from getid3_handler
 __construct (getID3 $getid3, $call_module=null)
 
 Analyze ()
 
 AnalyzeString ($string)
 
 setStringMode ($string)
 
 saveAttachment ($name, $offset, $length, $image_mime=null)
 

Additional Inherited Members

- Protected Member Functions inherited from getid3_handler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
 notice ($text)
 
- Protected Attributes inherited from getid3_handler
 $getid3
 
 $data_string_flag = false
 
 $data_string = ''
 
 $data_string_position = 0
 
 $data_string_length = 0
 

Detailed Description

getID3() by James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g //

Definition at line 17 of file module.audio.mod.php.

Member Function Documentation

◆ Analyze()

getid3_mod::Analyze ( )

Reimplemented from getid3_handler.

Definition at line 21 of file module.audio.mod.php.

21 {
22 $info = &$this->getid3->info;
23 $this->fseek($info['avdataoffset']);
24 $fileheader = $this->fread(1088);
25 if (preg_match('#^IMPM#', $fileheader)) {
26 return $this->getITheaderFilepointer();
27 } elseif (preg_match('#^Extended Module#', $fileheader)) {
28 return $this->getXMheaderFilepointer();
29 } elseif (preg_match('#^.{44}SCRM#', $fileheader)) {
30 return $this->getS3MheaderFilepointer();
31 } elseif (preg_match('#^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)#', $fileheader)) {
32 return $this->getMODheaderFilepointer();
33 }
34 $info['error'][] = 'This is not a known type of MOD file';
35 return false;
36 }
fseek($bytes, $whence=SEEK_SET)
Definition: getid3.php:1697
fread($bytes)
Definition: getid3.php:1685
$info
Definition: example_052.php:80

References $info, getid3_handler\fread(), getid3_handler\fseek(), getITheaderFilepointer(), getMODheaderFilepointer(), getS3MheaderFilepointer(), and getXMheaderFilepointer().

+ Here is the call graph for this function:

◆ getid3_mod()

getid3_mod::getid3_mod ( $fd,
$ThisFileInfo,
  $option 
)

Definition at line 21 of file module.audio.mod.php.

21 {
22
23 if ($option === 'mod') {
24 $this->getMODheaderFilepointer($fd, $ThisFileInfo);
25 }
26 elseif ($option === 'xm') {
27 $this->getXMheaderFilepointer($fd, $ThisFileInfo);
28 }
29 elseif ($option === 'it') {
30 $this->getITheaderFilepointer($fd, $ThisFileInfo);
31 }
32 elseif ($option === 's3m') {
33 $this->getS3MheaderFilepointer($fd, $ThisFileInfo);
34 }
35 }

References getITheaderFilepointer(), getMODheaderFilepointer(), getS3MheaderFilepointer(), and getXMheaderFilepointer().

+ Here is the call graph for this function:

◆ getITheaderFilepointer() [1/2]

getid3_mod::getITheaderFilepointer ( $fd,
$ThisFileInfo 
)

Definition at line 83 of file module.audio.mod.php.

83 {
84
85 fseek($fd, $ThisFileInfo['avdataoffset']);
86 $FormatID = fread($fd, 4);
87 if (!ereg('^IMPM$', $FormatID)) {
88 $ThisFileInfo['error'][] = 'This is not an ImpulseTracker MOD file';
89 return false;
90 }
91
92 $ThisFileInfo['fileformat'] = 'it';
93
94 $ThisFileInfo['error'][] = 'ImpulseTracker parsing not enabled in this version of getID3()';
95 return false;
96 }

References getid3_handler\fread(), and getid3_handler\fseek().

+ Here is the call graph for this function:

◆ getITheaderFilepointer() [2/2]

getid3_mod::getITheaderFilepointer ( )

Definition at line 84 of file module.audio.mod.php.

84 {
85 $info = &$this->getid3->info;
86 $this->fseek($info['avdataoffset']);
87 $FormatID = $this->fread(4);
88 if (!preg_match('#^IMPM$#', $FormatID)) {
89 $info['error'][] = 'This is not an ImpulseTracker MOD file';
90 return false;
91 }
92
93 $info['fileformat'] = 'it';
94
95 $info['error'][] = 'ImpulseTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']';
96 return false;
97 }

References $info, getid3_handler\fread(), and getid3_handler\fseek().

Referenced by Analyze(), and getid3_mod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMODheaderFilepointer() [1/2]

getid3_mod::getMODheaderFilepointer ( $fd,
$ThisFileInfo 
)

Definition at line 38 of file module.audio.mod.php.

38 {
39
40 fseek($fd, $ThisFileInfo['avdataoffset'] + 1080);
41 $FormatID = fread($fd, 4);
42 if (!ereg('^(M.K.|[5-9]CHN|[1-3][0-9]CH)$', $FormatID)) {
43 $ThisFileInfo['error'][] = 'This is not a known type of MOD file';
44 return false;
45 }
46
47 $ThisFileInfo['fileformat'] = 'mod';
48
49 $ThisFileInfo['error'][] = 'MOD parsing not enabled in this version of getID3()';
50 return false;
51 }

References getid3_handler\fread(), and getid3_handler\fseek().

+ Here is the call graph for this function:

◆ getMODheaderFilepointer() [2/2]

getid3_mod::getMODheaderFilepointer ( )

Definition at line 39 of file module.audio.mod.php.

39 {
40 $info = &$this->getid3->info;
41 $this->fseek($info['avdataoffset'] + 1080);
42 $FormatID = $this->fread(4);
43 if (!preg_match('#^(M.K.|[5-9]CHN|[1-3][0-9]CH)$#', $FormatID)) {
44 $info['error'][] = 'This is not a known type of MOD file';
45 return false;
46 }
47
48 $info['fileformat'] = 'mod';
49
50 $info['error'][] = 'MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']';
51 return false;
52 }

References $info, getid3_handler\fread(), and getid3_handler\fseek().

Referenced by Analyze(), and getid3_mod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getS3MheaderFilepointer() [1/2]

getid3_mod::getS3MheaderFilepointer ( $fd,
$ThisFileInfo 
)

Definition at line 68 of file module.audio.mod.php.

68 {
69
70 fseek($fd, $ThisFileInfo['avdataoffset'] + 44);
71 $FormatID = fread($fd, 4);
72 if (!ereg('^SCRM$', $FormatID)) {
73 $ThisFileInfo['error'][] = 'This is not a ScreamTracker MOD file';
74 return false;
75 }
76
77 $ThisFileInfo['fileformat'] = 's3m';
78
79 $ThisFileInfo['error'][] = 'ScreamTracker parsing not enabled in this version of getID3()';
80 return false;
81 }

References getid3_handler\fread(), and getid3_handler\fseek().

+ Here is the call graph for this function:

◆ getS3MheaderFilepointer() [2/2]

getid3_mod::getS3MheaderFilepointer ( )

Definition at line 69 of file module.audio.mod.php.

69 {
70 $info = &$this->getid3->info;
71 $this->fseek($info['avdataoffset'] + 44);
72 $FormatID = $this->fread(4);
73 if (!preg_match('#^SCRM$#', $FormatID)) {
74 $info['error'][] = 'This is not a ScreamTracker MOD file';
75 return false;
76 }
77
78 $info['fileformat'] = 's3m';
79
80 $info['error'][] = 'ScreamTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']';
81 return false;
82 }

References $info, getid3_handler\fread(), and getid3_handler\fseek().

Referenced by Analyze(), and getid3_mod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXMheaderFilepointer() [1/2]

getid3_mod::getXMheaderFilepointer ( $fd,
$ThisFileInfo 
)

Definition at line 53 of file module.audio.mod.php.

53 {
54
55 fseek($fd, $ThisFileInfo['avdataoffset']);
56 $FormatID = fread($fd, 15);
57 if (!ereg('^Extended Module$', $FormatID)) {
58 $ThisFileInfo['error'][] = 'This is not a known type of XM-MOD file';
59 return false;
60 }
61
62 $ThisFileInfo['fileformat'] = 'xm';
63
64 $ThisFileInfo['error'][] = 'XM-MOD parsing not enabled in this version of getID3()';
65 return false;
66 }

References getid3_handler\fread(), and getid3_handler\fseek().

+ Here is the call graph for this function:

◆ getXMheaderFilepointer() [2/2]

getid3_mod::getXMheaderFilepointer ( )

Definition at line 54 of file module.audio.mod.php.

54 {
55 $info = &$this->getid3->info;
56 $this->fseek($info['avdataoffset']);
57 $FormatID = $this->fread(15);
58 if (!preg_match('#^Extended Module$#', $FormatID)) {
59 $info['error'][] = 'This is not a known type of XM-MOD file';
60 return false;
61 }
62
63 $info['fileformat'] = 'xm';
64
65 $info['error'][] = 'XM-MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']';
66 return false;
67 }

References $info, getid3_handler\fread(), and getid3_handler\fseek().

Referenced by Analyze(), and getid3_mod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: