private void updateLabels() { labels = new List <OST>(); for (int x = 0; x < xCategories.Count(); x++) { OST ost = new OST() { text = xCategories.Skip(x).First().label, pos = getPosForSquare(x, 0) - new Vector3(0, squareSize.Y / 2, 0), anchor = OST.Anchor.Right, rotationDegrees = 45f, height = 0.05f }; labels.Add(ost); } for (int y = 0; y < yCategories.Count(); y++) { OST ost = new OST() { text = yCategories.Skip(y).First().label, pos = getPosForSquare(0, y) - new Vector3(squareSize.X / 2, 0, 0), anchor = OST.Anchor.Right, height = Math.Min(Math.Max(size.Y / yCategories.Count(), 0.01f), 0.1f) }; labels.Add(ost); } }
private void updateBars(IEnumerable <Bar> data) { List <Bar> bars = data.ToList(); List <Rectangle> rectangles = new List <Rectangle>(); List <OST> labels = new List <OST>(); float maxHeight = bars.Max(b => b.height); axes.maxYValue = maxHeight; float barSpacing = size.X / bars.Count; float barWidth = barSpacing - 0.01f; for (int barIndex = 0; barIndex < bars.Count; barIndex++) { Bar bar = bars[barIndex]; float barX = (-bars.Count / 2.0f * barSpacing) + (barIndex * barSpacing) + (barSpacing * 0.5f); float scaledHeight = bar.height / maxHeight * size.Y; Rectangle rectangle = new Rectangle() { pos = new Vector3(barX, -size.Y / 2 + scaledHeight / 2, 0), size = new Vector3(barWidth, scaledHeight, 0.1f) }; rectangles.Add(rectangle); OST label = new OST() { text = bar.label, rotationDegrees = -45, anchor = OST.Anchor.Left, pos = new Vector3(barX, -size.Y / 2 - 0.02f, 0), height = 0.05f }; labels.Add(label); OST displayValue = new OST() { text = bar.displayValue ?? String.Empty, pos = new Vector3(barX, rectangle.pos.Y + scaledHeight / 2 + 0.02f, 0), height = 0.05f }; labels.Add(displayValue); } drawables = new List <IDrawable> { axes }.Concat(rectangles).Concat(labels); }
private static void LoadOST() { if (Directory.Exists(OSTPath)) { foreach (var filename in Directory.GetFiles(OSTPath, "*", SearchOption.AllDirectories)) { if (OST.ContainsKey(filename) || failedPaths.Contains(filename) || !ValidAudioFile(filename)) { continue; } OST.Add(filename, null); } } }
public static void Play_OST_Track(OST ost) { Song play_this; Audio_Music.TryGetValue(ost, out play_this); MediaPlayer.Play(play_this); return; }
private void SetOST() { if (Is64BitOperatingSystem()) CurOST = OST.x64; else CurOST = OST.x32; }
//Set CurOST public Boolean SetCurOST(String ost) { /* Pre: none. * Post: Sets current OST & current OST string * If invalid option is passed, return false & set to NULL */ if (ost == "x64") { CurOST = OST.x64; CurOSTStr = "x64"; } else if (ost == "x32") { CurOST = OST.x32; CurOSTStr = "x32"; } else if (ost == "NULL") { CurOST = OST.NULL; CurOSTStr = "NULL"; } else { CurOST = OST.NULL; CurOSTStr = "NULL"; return false; } return true; }
//Set CurOST public Boolean SetCurOST(OST ost) { /* Pre: none. * Post: Sets current OST & current OST string * If invalid option is passed, return false & set to NULL */ switch (ost) { case OST.x64: CurOST = OST.x64; CurOSTStr = "x64"; break; case OST.x32: CurOST = OST.x32; CurOSTStr = "x32"; break; case OST.NULL: CurOST = OST.NULL; CurOSTStr = "NULL"; break; default: CurOST = OST.NULL; CurOSTStr = "NULL"; return false; } return true; }