当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Io_Writer::writeUInt16BE方法代码示例

本文整理汇总了PHP中Zend_Io_Writer::writeUInt16BE方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Io_Writer::writeUInt16BE方法的具体用法?PHP Zend_Io_Writer::writeUInt16BE怎么用?PHP Zend_Io_Writer::writeUInt16BE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Io_Writer的用法示例。


在下文中一共展示了Zend_Io_Writer::writeUInt16BE方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeMessageDefinition

 /**
  * Writes a definition record to file, when necessary (not already written).
  * @param mixed[] $msg_def The definition of the message.
  * @return \Fit\Writer
  */
 protected function writeMessageDefinition($msg_def)
 {
     $local_msg_type = $this->getLocalMsgType($msg_def['global_msg_number'], true);
     if ($local_msg_type !== false) {
         $this->writeRecordHeaderByte($local_msg_type, true);
         //write definition record fields
         $this->writer->writeUInt8(0);
         //reserved
         //architecture
         $this->writer->writeUInt8($msg_def['architecture']);
         //Architecture Type 0: Definition and Data Messages are Little Endian 1: Definition and Data Message are Big Endian
         $big_endian = $msg_def['architecture'] === 1;
         //global_msg_number
         if ($big_endian) {
             $this->writer->writeUInt16BE($msg_def['global_msg_number']);
             //0:65535 – Unique to each message *Endianness of this 2 Byte value is defined in the Architecture byte
         } else {
             $this->writer->writeUInt16LE($msg_def['global_msg_number']);
             //0:65535 – Unique to each message *Endianness of this 2 Byte value is defined in the Architecture byte
         }
         //no_of_fields
         $this->writer->writeUInt8(count($msg_def['fields']));
         //Number of fields in the Data Message
         foreach ($msg_def['fields'] as $field_def) {
             $this->writer->writeUInt8($field_def[\Fit\Field::DEF_NUMBER]);
             $this->writer->writeUInt8($field_def[\Fit\Field::SIZE]);
             $this->writer->writeUInt8(self::bartoint(array_merge(array_slice(self::inttobar($field_def[\Fit\Field::TYPE_NUMBER]), 0, 5), array(false, false, self::$base_types[$field_def[\Fit\Field::TYPE_NUMBER]]['endian_ability']))));
         }
     }
     return $this;
 }
开发者ID:alexmcroberts,项目名称:fit-php,代码行数:36,代码来源:Writer.php

示例2: _writeData

 /**
  * Writes the frame raw data without the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $writer->writeInt8($this->_interpolation)->writeString8($this->_device, 1);
     foreach ($this->_adjustments as $frequency => $adjustment) {
         $writer->writeUInt16BE($frequency * 2)->writeInt16BE($adjustment * 512);
     }
 }
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:13,代码来源:Equ2.php

示例3: _writeData

 /**
  * Writes the frame raw data without the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $writer->writeUInt16BE($this->_reverbLeft)->writeUInt16BE($this->_reverbRight)->writeUInt8($this->_reverbBouncesLeft)->writeUInt8($this->_reverbBouncesRight)->writeUInt8($this->_reverbFeedbackLtoL)->writeUInt8($this->_reverbFeedbackLtoR)->writeUInt8($this->_reverbFeedbackRtoR)->writeUInt8($this->_reverbFeedbackRtoL)->writeUInt8($this->_premixLtoR)->writeUInt8($this->_premixRtoL);
 }
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:10,代码来源:Rvrb.php

示例4: _writeData

 /**
  * Writes the frame raw data without the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $writer->writeInt8($flags = 0);
     if ($this->_adjustments[self::right] > 0) {
         $flags = $flags | 0x1;
     }
     if ($this->_adjustments[self::left] > 0) {
         $flags = $flags | 0x2;
     }
     $writer->writeInt8(16)->writeUInt16BE(abs($this->_adjustments[self::right]))->writeUInt16BE(abs($this->_adjustments[self::left]))->writeUInt16BE(abs($this->_adjustments[self::peakRight]))->writeUInt16BE(abs($this->_adjustments[self::peakLeft]));
     if (isset($this->_adjustments[self::rightBack]) && isset($this->_adjustments[self::leftBack]) && isset($this->_adjustments[self::peakRightBack]) && isset($this->_adjustments[self::peakLeftBack])) {
         if ($this->_adjustments[self::rightBack] > 0) {
             $flags = $flags | 0x4;
         }
         if ($this->_adjustments[self::leftBack] > 0) {
             $flags = $flags | 0x8;
         }
         $writer->writeUInt16BE(abs($this->_adjustments[self::rightBack]))->writeUInt16BE(abs($this->_adjustments[self::leftBack]))->writeUInt16BE(abs($this->_adjustments[self::peakRightBack]))->writeUInt16BE(abs($this->_adjustments[self::peakLeftBack]));
     }
     if (isset($this->_adjustments[self::center]) && isset($this->_adjustments[self::peakCenter])) {
         if ($this->_adjustments[self::center] > 0) {
             $flags = $flags | 0x10;
         }
         $writer->writeUInt16BE(abs($this->_adjustments[self::center]))->writeUInt16BE(abs($this->_adjustments[self::peakCenter]));
     }
     if (isset($this->_adjustments[self::bass]) && isset($this->_adjustments[self::peakBass])) {
         if ($this->_adjustments[self::bass] > 0) {
             $flags = $flags | 0x20;
         }
         $writer->writeUInt16BE(abs($this->_adjustments[self::bass]))->writeUInt16BE(abs($this->_adjustments[self::peakBass]));
     }
     $writer->setOffset(0);
     $writer->writeInt8($flags);
 }
开发者ID:hjoelr,项目名称:com_mediasyndicator,代码行数:40,代码来源:Rvad.php

示例5: _writeData

 /**
  * Writes the frame raw data without the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $writer->writeInt8(16);
     foreach ($this->_adjustments as $frequency => $adjustment) {
         $writer->writeUInt16BE($adjustment > 0 ? $frequency | 0x8000 : $frequency & ~0x8000)->writeUInt16BE(abs($adjustment));
     }
 }
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:13,代码来源:Equa.php


注:本文中的Zend_Io_Writer::writeUInt16BE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。