ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
GetId3\Module\Audio\Mod Class Reference

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

+ Inheritance diagram for GetId3\Module\Audio\Mod:
+ Collaboration diagram for GetId3\Module\Audio\Mod:

Public Member Functions

 analyze ()
 
 getMODheaderFilepointer ()
 
 getXMheaderFilepointer ()
 
 getS3MheaderFilepointer ()
 
 getITheaderFilepointer ()
 
- Public Member Functions inherited from GetId3\Handler\BaseHandler
 __construct (GetId3Core $getid3, $call_module=null)
 
 analyze ()
 Analyze from file pointer. More...
 
 AnalyzeString (&$string)
 Analyze from string instead. More...
 
 saveAttachment (&$ThisFileInfoIndex, $filename, $offset, $length)
 

Additional Inherited Members

- Protected Member Functions inherited from GetId3\Handler\BaseHandler
 ftell ()
 
 fread ($bytes)
 
 fseek ($bytes, $whence=SEEK_SET)
 
 feof ()
 
 isDependencyFor ($module)
 
 error ($text)
 
 warning ($text)
 
- Protected Attributes inherited from GetId3\Handler\BaseHandler
 $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 //.

module for analyzing MOD Audio files

Author
James Heinrich info@.nosp@m.geti.nosp@m.d3.or.nosp@m.g http://www.getid3.org

Definition at line 28 of file Mod.php.

Member Function Documentation

◆ analyze()

GetId3\Module\Audio\Mod::analyze ( )
Returns
boolean

Definition at line 35 of file Mod.php.

References $info, GetId3\Handler\BaseHandler\fread(), GetId3\Handler\BaseHandler\fseek(), GetId3\Module\Audio\Mod\getITheaderFilepointer(), GetId3\Module\Audio\Mod\getMODheaderFilepointer(), GetId3\Module\Audio\Mod\getS3MheaderFilepointer(), and GetId3\Module\Audio\Mod\getXMheaderFilepointer().

36  {
37  $info = &$this->getid3->info;
38  fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
39  $fileheader = fread($this->getid3->fp, 1088);
40  if (preg_match('#^IMPM#', $fileheader)) {
41  return $this->getITheaderFilepointer();
42  } elseif (preg_match('#^Extended Module#', $fileheader)) {
43  return $this->getXMheaderFilepointer();
44  } elseif (preg_match('#^.{44}SCRM#', $fileheader)) {
45  return $this->getS3MheaderFilepointer();
46  } elseif (preg_match('#^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)#', $fileheader)) {
47  return $this->getMODheaderFilepointer();
48  }
49  $info['error'][] = 'This is not a known type of MOD file';
50 
51  return false;
52  }
fseek($bytes, $whence=SEEK_SET)
$info
Definition: example_052.php:80
+ Here is the call graph for this function:

◆ getITheaderFilepointer()

GetId3\Module\Audio\Mod::getITheaderFilepointer ( )
Returns
boolean

Definition at line 124 of file Mod.php.

References $info, GetId3\Handler\BaseHandler\fread(), and GetId3\Handler\BaseHandler\fseek().

Referenced by GetId3\Module\Audio\Mod\analyze().

125  {
126  $info = &$this->getid3->info;
127  fseek($this->getid3->fp, $info['avdataoffset']);
128  $FormatID = fread($this->getid3->fp, 4);
129  if (!preg_match('#^IMPM$#', $FormatID)) {
130  $info['error'][] = 'This is not an ImpulseTracker MOD file';
131 
132  return false;
133  }
134 
135  $info['fileformat'] = 'it';
136 
137  $info['error'][] = 'ImpulseTracker parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().']';
138 
139  return false;
140  }
fseek($bytes, $whence=SEEK_SET)
$info
Definition: example_052.php:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMODheaderFilepointer()

GetId3\Module\Audio\Mod::getMODheaderFilepointer ( )
Returns
boolean

Definition at line 58 of file Mod.php.

References $info, GetId3\Handler\BaseHandler\fread(), and GetId3\Handler\BaseHandler\fseek().

Referenced by GetId3\Module\Audio\Mod\analyze().

59  {
60  $info = &$this->getid3->info;
61  fseek($this->getid3->fp, $info['avdataoffset'] + 1080);
62  $FormatID = fread($this->getid3->fp, 4);
63  if (!preg_match('#^(M.K.|[5-9]CHN|[1-3][0-9]CH)$#', $FormatID)) {
64  $info['error'][] = 'This is not a known type of MOD file';
65 
66  return false;
67  }
68 
69  $info['fileformat'] = 'mod';
70 
71  $info['error'][] = 'MOD parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().']';
72 
73  return false;
74  }
fseek($bytes, $whence=SEEK_SET)
$info
Definition: example_052.php:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getS3MheaderFilepointer()

GetId3\Module\Audio\Mod::getS3MheaderFilepointer ( )
Returns
boolean

Definition at line 102 of file Mod.php.

References $info, GetId3\Handler\BaseHandler\fread(), and GetId3\Handler\BaseHandler\fseek().

Referenced by GetId3\Module\Audio\Mod\analyze().

103  {
104  $info = &$this->getid3->info;
105  fseek($this->getid3->fp, $info['avdataoffset'] + 44);
106  $FormatID = fread($this->getid3->fp, 4);
107  if (!preg_match('#^SCRM$#', $FormatID)) {
108  $info['error'][] = 'This is not a ScreamTracker MOD file';
109 
110  return false;
111  }
112 
113  $info['fileformat'] = 's3m';
114 
115  $info['error'][] = 'ScreamTracker parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().']';
116 
117  return false;
118  }
fseek($bytes, $whence=SEEK_SET)
$info
Definition: example_052.php:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXMheaderFilepointer()

GetId3\Module\Audio\Mod::getXMheaderFilepointer ( )
Returns
boolean

Definition at line 80 of file Mod.php.

References $info, GetId3\Handler\BaseHandler\fread(), and GetId3\Handler\BaseHandler\fseek().

Referenced by GetId3\Module\Audio\Mod\analyze().

81  {
82  $info = &$this->getid3->info;
83  fseek($this->getid3->fp, $info['avdataoffset']);
84  $FormatID = fread($this->getid3->fp, 15);
85  if (!preg_match('#^Extended Module$#', $FormatID)) {
86  $info['error'][] = 'This is not a known type of XM-MOD file';
87 
88  return false;
89  }
90 
91  $info['fileformat'] = 'xm';
92 
93  $info['error'][] = 'XM-MOD parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().']';
94 
95  return false;
96  }
fseek($bytes, $whence=SEEK_SET)
$info
Definition: example_052.php:80
+ 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 file: