Пример #1
0
        public async static System.Threading.Tasks.Task <CDTrackStream> Create(string deviceID, int startSector, int endSector)
        {
            CDTrackStream cdts = null;

            try
            {
                cdts = new CDTrackStream(deviceID, startSector, endSector);
                if (cdts != null)
                {
                    bool result = await cdts.SetCDDeviceAsync();

                    if (result == true)
                    {
                        result = await cdts.WriteWAVHeader();
                    }
                    if (result != true)
                    {
                        cdts = null;
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Exception while creating CDTrackStream: " + ex.Message);
            }
            return(cdts);
        }
Пример #2
0
        public IRandomAccessStream CloneStream()
        {
            // return this.internalStream.CloneStream();

            var t = CDTrackStream.Create(DeviceID, StartSector, EndSector);

            t.Wait();
            CDTrackStream cdts = t.Result;

            if (cdts != null)
            {
                if (this.Size == cdts.Size)
                {
                    return(cdts);
                }
            }
            return(null);
        }