private void AddPath(STFReader stf, TrackPath path)
 {
     try
     {
         TrackPaths.Add(path.DynamicSectionIndex, path);
     }
     catch (Exception e)
     {
         System.Console.WriteLine("Warning: in route tsection.dat " + e.Message);
     }
 }
        }                                                         //route's tsection.dat

        public void AddRouteTSectionDatFile(string fileName)
        {
            using (STFReader stf = new STFReader(fileName, false))
            {
                if (stf.SimisSignature != "SIMISA@@@@@@@@@@JINX0T0t______")
                {
                    Trace.TraceWarning("Skipped invalid TSECTION.DAT in route folder");
                    return;
                }
                stf.ParseFile(new STFReader.TokenProcessor[] {
                    new STFReader.TokenProcessor("tracksections", () => { TrackSections.AddRouteTrackSections(stf); }),
                    new STFReader.TokenProcessor("sectionidx", () => { TrackSectionIndex = new TrackPaths(stf); }),
                    // todo read in SectionIdx part of RouteTSectionDat
                });
            }
        }
Beispiel #3
0
        internal override void ReadData(AwesomeReader ar)
        {
            TrackPaths.Clear();

            InstrumentType          = ar.ReadUInt64();
            Difficulty              = ar.ReadUInt64();
            ar.BaseStream.Position += 8; // Should be zero'd

            // Reads tuning info
            Tuning = InstrumentTuning.ReadData(ar);

            // Reads track paths
            int count = ar.ReadInt32();

            ar.BaseStream.Position += 4; // Offset - Should be 4

            for (int i = 0; i < count; i++)
            {
                TrackPaths.Add(ar.ReadUInt64());
            }
        }
Beispiel #4
0
        async public Task <Button> GetButton()
        {
            var button = new Button();

            button.Width      = 140;
            button.Height     = 140;
            button.Background = new SolidColorBrush(Windows.UI.Colors.Transparent);
            button.Margin     = new Thickness(0);

            var s = new StackPanel();

            button.Content = s;
            var bitmapImage = new BitmapImage();

            if (TrackPaths.Count() > 0)
            {
                var thumbnail = await(await StorageFile.GetFileFromPathAsync(TrackPaths[0])).GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.SingleItem);
                bitmapImage.SetSource(thumbnail);
            }
            var image = new Image();

            image.Width  = 90;
            image.Height = 90;
            image.Source = bitmapImage;
            s.Children.Add(image);
            var tBlock = new TextBlock();

            tBlock.Text       = $"{this.Title}\n{this.Artist}";
            tBlock.FontSize   = 12;
            tBlock.FontFamily = new Windows.UI.Xaml.Media.FontFamily("YU Gothic UI");

            s.Children.Add(tBlock);
            button.Tag = AlbumID;

            return(button);
        }
Beispiel #5
0
 public override string ToString() =>
 $"{M3UIdentity}\n\n{string.Join("\n\n", TrackPaths.Select(x => $"{M3UINFOHeader}:42, {x.Key}\n{x.Value}"))}";