English 中文(简体)
是否可能选择IMAPI接口的笔记书写方式?
原标题:Is it possible to choose cd-writing mode in IMAPI interface?
  • 时间:2011-02-02 12:18:51
  •  标签:
  • c#
  • imapi

我正在利用IMAPIv2在我的C#项目中焚烧CD/DVD。 我认识到,XA-format(Mode2)。 我认为,XA格式主要用于ISO。 网上有关Iv2号国际行动计划的许多实例使用以下方法显示完全的断层空间和自由空间:

discFormatData.Recorder = discRecorder;
IMAPI_MEDIA_PHYSICAL_TYPE mediaType = discFormatData.CurrentPhysicalMediaType;
this.MediaType = GetMediaTypeString(mediaType);
fileSystemImage = new MsftFileSystemImage();
fileSystemImage.ChooseImageDefaultsForMediaType(mediaType);
MediaStateString = GetMediaStatus(discFormatData.CurrentMediaStatus);
if (discFormatData.MediaHeuristicallyBlank) MediaStateString = "Blank";

Int64 freeMediaBlocks = discFormatData.FreeSectorsOnMedia;
this.TotalDiscCapacity = 2048 * freeMediaBlocks;
Int64 userMediaBlocks = discFormatData.TotalSectorsOnMedia - discFormatData.FreeSectorsOnMedia;
this.TotalUsedDiscSpace = 2048 * userMediaBlocks;

不幸的是,如果我把2048年 *与上文描述的“Media”区总数相加,将无法得到正确的“完全消除能力”。 当我烧掉800个甲基溴生产能力与Iv2分离时,上述代码将显示,我的消毒能力大约在650个甲基溴。 当我检查与其他软件燃烧器的裂痕时,即看到该模式是XA。 是否可能在燃烧之前确定这一方式? 此外,如果在模式1中写了会议,我如何解决确定自由空间的问题? 是否有可能学习哪一种方式?

感谢。

问题回答

为了获得全部磁盘能力,你需要将各部门的数目乘以每个部门的用户数据领域(光盘/XA(电子构造)模式2的长度为2336个,而不是2048个)。


光盘的一个部门拥有2048年的用户数据,而其他用途则有304个tes。 每一数据部门都由16位逐位负责人组成:

  • 12-byte sync field (00 ff ff ff ff ff ff ff ff ff ff 00)
  • 3 byte address (minute, second, fraction (1/75th) of a second)
  • 1 byte mode

该模式决定了该行业其余2336名特工认为什么:

  • Mode 0: null data; serves no practical purpose for CD recording
  • Mode 1: the typical CD-ROM layout 2048 bytes of user data 4 bytes of EDC (Error Detection Code, a 32-bit CRC) 8 bytes of reserved space, set to zeros 172 bytes of "P" parity 104 bytes of "Q" parity
  • Mode 2: 2336 bytes of user data, usually used for CD-ROM/XA

为了检索一个轨道上为这些部门提供的数据类型,您可使用以下方法:get_SectorType from 接口。

可能的部门类型由 enumeration:

typedef enum  { 
 IMAPI_CD_SECTOR_AUDIO          = 0x00,
 IMAPI_CD_SECTOR_MODE_ZERO      = 0x01,
 IMAPI_CD_SECTOR_MODE1          = 0x02,
 IMAPI_CD_SECTOR_MODE2FORM0     = 0x03,
 IMAPI_CD_SECTOR_MODE2FORM1     = 0x04,
 IMAPI_CD_SECTOR_MODE2FORM2     = 0x05,
 IMAPI_CD_SECTOR_MODE1RAW       = 0x06,
 IMAPI_CD_SECTOR_MODE2FORM0RAW  = 0x07,
 IMAPI_CD_SECTOR_MODE2FORM1RAW  = 0x08,
 IMAPI_CD_SECTOR_MODE2FORM2RAW  = 0x09
} IMAPI_CD_SECTOR_TYPE;
  • IMAPI_CD_SECTOR_AUDIO With this sector type, Audio data has 2352 bytes per sector/frame. This can be broken down into 588 contiguous samples, each sample being four bytes. The layout of a single sample matches the 16-bit stereo 44.1KHz WAV file data. This type of sector has no additional error correcting codes.
  • IMAPI_CD_SECTOR_MODE_ZERO With this sector type, user data has 2336 bytes per sector/frame. This seldom-used sector type contains all zero data, and is almost never seen in media today.
  • IMAPI_CD_SECTOR_MODE1 With this sector type, user data has 2048 bytes per sector/frame. Mode1 data is the most common data form for pressed CD-ROM media. This data type also provides the greatest level of ECC/EDC among the standard sector types.
  • IMAPI_CD_SECTOR_MODE2FORM0 With this sector type, user data has 2336 bytes per sector/frame. All Mode 2 sector types are also known as "CD-ROM XA" modes, which allows mixing of audio and data tracks on a single disc. This sector type is also known as Mode 2 "Formless", is considered deprecated, and is very seldom used.
  • IMAPI_CD_SECTOR_MODE2FORM1 With this sector type, user data has 2048 bytes per sector/frame. All Mode 2 sector types are also known as "CD-ROM XA" modes, which allows mixing of audio and data tracks on a single disc.
  • IMAPI_CD_SECTOR_MODE2FORM2 With this sector type, user data has 2336 bytes per sector/frame, of which the final four bytes are an optional CRC code (zero if not used). All Mode 2 sector types are also known as "CD-ROM XA" modes, which allows mixing of audio and data tracks on a single disc. This sector type is most often used when writing VideoCD discs.
  • IMAPI_CD_SECTOR_MODE1RAW With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode1Cooked data sectors, with sector header, ECC/EDC, and scrambling already added to the data stream.
  • IMAPI_CD_SECTOR_MODE2FORM0RAW With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form0 data sectors, with sector header, ECC/EDC, and scrambling already added to the data stream.
  • IMAPI_CD_SECTOR_MODE2FORM1RAW With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form1 data sectors, with sector header, ECC/EDC, and scrambling already added to the data stream.
  • IMAPI_CD_SECTOR_MODE2FORM2RAW With this sector type, user data has 2352 bytes per sector/frame. This is pre-processed Mode2Form2 data sectors, with sector header, ECC/EDC, and scrambling already added to the data stream.

Remarks: Some sector types are not compatible with other sector types within a single image. The following are typical examples of this condition: If the first track is audio, then all tracks must be audio. If the first track is Mode1, then all tracks must be Mode1. Only the three Mode2 (XA) sectors (Mode 2 Form 0, Mode 2 Form 1, and Mode 2 Form 2) may be mixed within a single disc image, and even then, only with other Mode 2 (XA) sector types.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签