Beispiel #1
0
        bool AppendFile(GR.Memory.ByteBuffer Buffer, FileEntry File)
        {
            _LastError = "";

            Buffer.Reserve((int)Buffer.Length + 3 * 27136 + 4 * 188 * 20 + 2 * (int)File.Data.Length * 20);
            // leading silence, 27136 bytes 0x30 (approx. 10 seconds)
            Buffer.AppendRepeated(0x30, 27136);
            //Buffer.AppendU32NetworkOrder( 0x000180DC );

            // Sync for header
            AppendSync(Buffer);
            AppendHeader(Buffer, File);

            // interblock gap
            Buffer.AppendRepeated(0x30, 0x4f);

            // Sync for header repeated
            AppendSyncRepeated(Buffer);
            AppendHeader(Buffer, File);

            // trailer
            Buffer.AppendRepeated(0x30, 0x4e);


            // leading silence, 27136 bytes 0x30 (approx. 10 seconds)
            Buffer.AppendRepeated(0x30, 27136);
            //Buffer.AppendU32NetworkOrder( 0x000180DC );

            // Sync
            AppendSync(Buffer);
            AppendData(Buffer, File.Data);

            // interblock gap
            Buffer.AppendRepeated(0x30, 0x4f);


            // Sync for header repeated
            AppendSyncRepeated(Buffer);
            AppendData(Buffer, File.Data);

            // trailer
            Buffer.AppendRepeated(0x30, 0x4e);


            /*
             * // data trailer
             *
             * // leading silence, 27136 bytes 0x30 (approx. 10 seconds)
             * Buffer.AppendRepeated( 0x30, 27136 );
             *
             * // Sync for header
             * AppendSync( Buffer );
             * AppendHeader( Buffer, File );
             *
             * // interblock gap
             * Buffer.AppendRepeated( 0x30, 0x4f );
             *
             * // Sync for header repeated
             * AppendSyncRepeated( Buffer );
             * AppendHeader( Buffer, File );
             *
             * // trailer
             * Buffer.AppendRepeated( 0x30, 0x4e );
             */
            return(true);
        }