Double-channel technique with VB6 is obtained 8/23/2001 9: 8: 59 · · ·. Vbeden is now developing computer multimedia technology, making the disc can play in the computer without the decompression card, and due to VCD2. 0 The popularity of standards, the DVD has completed the transition to digital files, and it is easy to copy any VCD to your hard drive, without having to be a hard-to-tech optical drive. This also provides us with a piece of disc at interception. However, the general use of the compressed AVI file is not only bulky, but the picture is stagnant and the speed is very slow. On the basis of summarizing the experience of writing file segmentation software, the author has made a way out of a different path, ie, using a dual-channel technology directly intercepting the disc file file, fundamentally overcomes the above-mentioned drawbacks. (1) Programming; generally, the actual video file of VCD is placed in the "MPEGAV" subdirectory in the CD root directory, and the file name is Music001.dat or sequentially, and the user can save any The wonderful disc slice, according to the author, about one minute can be played every 10 megabytes, so that the user can use the software to intercept the VCD in any period of time, but use "Super Skally" 5.02 or higher. Play. Since the audio file is very large, the length of the audio and video file in the ordinary VCD2.0 format is more than 600 megabytes, so the method of defining the binary array in single channel is not only bad, but it is difficult to implement long-term segmentation. The author adopted double Channel technology, that is, by defining a smaller fixed binary array, a channel is used to read, and another channel is used to write. This involves complex binary positioning techniques. (2) Programming instance; (first step) Start VB6 Chinese version to establish a standard EXE project, name "Form1", click "Project" menu item, select "Components", "control" control in Partial dialog "Select" Microsoft Windows Common Controls 6.0 "in the column, confirm that there is a black timeline in front of its check box, click" OK ", add a reference to the control. Add 6 tabs, 4 text Box (arranged upwards in turn), 3 buttons, one progress bar is named BA1, a public dialog control named COG1, drag the control to the appropriate position, the interface design is roughly shown in Figure 1. Among them, "audio file name:" tag corresponds to text1, "audio and video file length:" TAXT2, "Intercept start position:" Tag corresponding text3, "Intercept length:" The tag corresponds to text4, "After interception, the file saves path:" The label corresponds to Text5. Setting the Border of Label6, "Browse (* .dat) button corresponds to Command1," Save As (* .dat) button corresponds to Command2, "Start Intercept" button corresponds to CommAND3. Double-click the form to add the following code:
Private Sub Command1_Click () Note: Browse Select File Cog1.FileName = "" Note: Clear Expiration File Name Cog1.Filter = "VCD DVD Document (* .dat) | * .dat" Note: Only DVD file Cog1.Showopen Note : Performing an Open Operation if Cog1.FileName <> "" Tonarios: If you give up, you ignore the operation text1.text = Cog1.FileName Note: Get an intercept file name label6.caption = cint (filelen (text1.text) / 2 ^ 20 Note: Transform file length into a megabyte end if End sub private submmand2_click () Note: Save as if text1.text = "" THEN Note: If you do not select the audio file, you will refuse to operate, show the prompt information msgbox " First select a piece of intercepted file! ", Vbokonly Vbexclamation Exit Sub Note: Interrupt Operation End if Cog1.FileName =" "" Cog1.Showsave if Cog1.FileName <> "" TEXT4.TEXT = Cog1.FileName Comment: Save Path Name End if End Sub Private Sub Command3_Click () Note: Start Interception Operation Dim Err_DESCR AS String if Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" OR TEXT4.TEXT = "" THEN Note: Re-verification Parameter correctness msgbox "Please enter the correct information, don't miss it!", Vbokonly vbexclamation exit sub comment: If the parameter is incomplete ignore the operation End if if not jiequ (Text1.Text, Text2.Text, Text3. TEXT, TEXT4.TEXT) THEN Note: Execute interception failed MSGBOX "Red Arrow Tips:" & Err_DesCr, Vbokonly Vbexclamati ON Note: Return Error Message Else Note: Execute the Success MsgBox "DRR message: File interception operation has been successfully completed!", Vbokonly Vbexclamation end if end sub private subform_load () me.caption = app.title me.Left = (Screen.Width - Me.Width) / 2 me.top = (Screen.Height - Me.Height) / 2 Note: Form-in Subprivate Sub Form_Unload (Cancel AS Integer) End Note: End Project End Sub Step 2) Add a module, enter the following code: Option expedition: Variable Check TypeEsection Bytes () AS BYTE Note:
Define key array End Type Type SectionedFile Files () As FileSection NOTE: defining auxiliary array End Type Public Function jieQU (Yname As String, Kshi As Long, CHang As Long, Bname As String) As Boolean Note: capture operation defined function Form1.MousePointer = 11 Note: Set the mouse pointer to the funnel type jiequ = true Note: Function Success Sign DIM MLP AS INTEGER, I AS INTEGER, ZHI As Long, Fnum as ion : Define memory fixed arrays, length 2 megabytes kshi = kshi * 2 ^ 20 Note: Conversion file pointer unit is byte chang = chang * 2 ^ 20 Note: Conversion file length unit is byte if Chang