<?php
+
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
-// available at http://getid3.sourceforge.net //
-// or http://www.getid3.org //
-// also https://github.com/JamesHeinrich/getID3 //
-/////////////////////////////////////////////////////////////////
-// See readme.txt for more details //
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
+// see readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// module.audio.midi.php //
class getid3_midi extends getid3_handler
{
+ /**
+ * @var bool
+ */
public $scanwholefile = true;
+ /**
+ * @return bool
+ */
public function Analyze() {
$info = &$this->getid3->info;
$CurrentMicroSecondsPerBeat = 500000; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat
$CurrentBeatsPerMinute = 120; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat
$MicroSecondsPerQuarterNoteAfter = array ();
+ $MIDIevents = array();
foreach ($trackdataarray as $tracknumber => $trackdata) {
$thisfile_midi['totalticks'] = max($thisfile_midi['totalticks'], $CumulativeDeltaTime);
}
}
- $previoustickoffset = null;
+ $previoustickoffset = null;
+ $prevmicrosecondsperbeat = null;
ksort($MicroSecondsPerQuarterNoteAfter);
foreach ($MicroSecondsPerQuarterNoteAfter as $tickoffset => $microsecondsperbeat) {
return false;
}
- $info['playtime_seconds'] += (($thisfile_midi['totalticks'] - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($microsecondsperbeat / 1000000);
+ $info['playtime_seconds'] += (($thisfile_midi['totalticks'] - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000);
}
}
return true;
}
+ /**
+ * @param int $instrumentid
+ *
+ * @return string
+ */
public function GeneralMIDIinstrumentLookup($instrumentid) {
$begin = __LINE__;
return getid3_lib::EmbeddedLookup($instrumentid, $begin, __LINE__, __FILE__, 'GeneralMIDIinstrument');
}
+ /**
+ * @param int $instrumentid
+ *
+ * @return string
+ */
public function GeneralMIDIpercussionLookup($instrumentid) {
$begin = __LINE__;