Exemplo n.º 1
0
        public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
                                         int firstPage, bool firstPacketContinued, bool lastPacketCompleted, bool containsLastPacket)
        {
            ArrayList l = new ArrayList();

            int totalSize = 0;

            foreach (ByteVector b in packets)
            {
                totalSize += b.Count;
            }

            if (strategy == PaginationStrategy.Repaginate || totalSize + packets.Count > 255 * 256)
            {
                TagLibDebugger.Debug("Ogg.Page.Paginate() -- Sorry!  Repagination is not yet implemented.");
                return((OggPage[])l.ToArray(typeof(OggPage)));
            }

            // TODO: Handle creation of multiple pages here with appropriate pagination.

            OggPage p = new OggPage(packets, streamSerialNumber, firstPage, firstPacketContinued,
                                    lastPacketCompleted, containsLastPacket);

            l.Add(p);

            return((OggPage[])l.ToArray(typeof(OggPage)));
        }
Exemplo n.º 2
0
 public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
                                  int firstPage)
 {
     return(Paginate(packets, strategy, streamSerialNumber, firstPage, false));
 }
Exemplo n.º 3
0
 public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
                                  int firstPage, bool firstPacketContinued)
 {
     return(Paginate(packets, strategy, streamSerialNumber, firstPage,
                     firstPacketContinued, true));
 }
Exemplo n.º 4
0
		public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
			int firstPage)
		{
			return Paginate(packets, strategy, streamSerialNumber, firstPage, false);
		}
Exemplo n.º 5
0
		public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
			int firstPage, bool firstPacketContinued)
		{
			return Paginate(packets, strategy, streamSerialNumber, firstPage,
				firstPacketContinued, true);
		}
Exemplo n.º 6
0
		public static OggPage[] Paginate(ByteVectorCollection packets, PaginationStrategy strategy, uint streamSerialNumber,
			int firstPage, bool firstPacketContinued, bool lastPacketCompleted, bool containsLastPacket)
		{
			ArrayList l = new ArrayList();

			int totalSize = 0;
         
			foreach (ByteVector b in packets)
				totalSize += b.Count;

			if (strategy == PaginationStrategy.Repaginate || totalSize + packets.Count > 255 * 256)
			{
				TagLibDebugger.Debug ("Ogg.Page.Paginate() -- Sorry!  Repagination is not yet implemented.");
				return (OggPage[]) l.ToArray(typeof(OggPage));
			}

			// TODO: Handle creation of multiple pages here with appropriate pagination.

			OggPage p = new OggPage(packets, streamSerialNumber, firstPage, firstPacketContinued,
                            lastPacketCompleted, containsLastPacket);
			l.Add (p);

			return (OggPage[]) l.ToArray(typeof(OggPage));
		}