void UpdateTapeViewBlock() { TZXFile tzxblockfile = new TZXFile(); tzxblockfile.Blocks.Clear(); tzxblockfile.Blocks.Add(CassetteController.TZXFile.Blocks[CassetteController.TZXBlockIndex]); blockView.TZXFile = tzxblockfile; }
public void Clear() { this.Image = new Bitmap(this.Width, this.Height); CursorPosition = 0; tZXFile = new TZXFile(); tooltip.SetToolTip(this, ""); Invalidate(); }
public TapeView(TZXFile tzxFile) { this.tZXFile = tzxFile; this.Image = new Bitmap(this.Width, this.Height); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); this.UpdateStyles(); TZXFileLength = tzxFile.TZXLength; }
private void CassetteDeck_EndFileLoad(string filename, TZXFile tzxFile) { listView1.BeginUpdate(); listView1.Items.AddRange(listViewItems.ToArray()); for (int i = 0; i < listView1.Items.Count; i++) { listView1.Items[i].UseItemStyleForSubItems = false; listView1.Items[i].SubItems[1].BackColor = SystemColors.ControlDark; } listView1.EndUpdate(); CassetteController.TZXBlockIndex = 0; Text = Path.GetFileName(filename); tapeView.TZXFile = CassetteController.TZXFile; UpdateTapeViewBlock(); SetButtons(true); }
public static void LoadFile(string filename) { LoadComplete = false; Filename = filename; ToggleDeck(CassetteDeckStates.Show); OnBeginLoadFile(filename); TZXFile = new TZXFile(); TZXFile.FoundBlock += TZXFile_FoundBlock; try { TZXFile.LoadFile(filename); } catch (Exception ex) { MessageBox.Show(ex.Message); } OnEndFileLoad(filename, TZXFile); Reset(); }
private void CassetteDeck_Progress(TZXFile tzxFile, int blocklength, int tapeCounter, int blockCounter, float overallProgress, float blockProgress, string block, ITZXDataBlock tZXDataBlock) { class11.SelectionStart = class11.SelectionEnd = 0; class11.SetSelectionForeColor(true, Color.Lime); class11.SetSelectionBackColor(true, SystemColors.WindowFrame); if (tzxFile != null) { ProgressText = "Block:" + blockCounter.ToString("0000000") + "/" + (blocklength - 1).ToString() + " Total: " + tapeCounter.ToString("0000000") + "/" + tzxFile.TZXLength.ToString(); } counter1.Value = tapeCounter + 1; if (panel1.Visible) { toolStripStatusLabel1.Text = blockCounter == 0 ? "Paused" : "Playing"; blockView.CursorPen = null; tapeView.CursorPen = null; blockView.Next(blockProgress); tapeView.CursorPen = blockView.CursorPen; tapeView.Next(overallProgress); } if (tZXDataBlock != null) { if (class11.Visible && tZXDataBlock is ITZXDataBlock) { int b = tZXDataBlock.Progress; string s = tZXDataBlock.Details; int charindex = s.IndexOf("TZXTAP Block:") + 16; // "TZXTAP Block: /r/n".Length charindex += 5; // " {\r\n".Length int row = b / 16; int col = (b % 16); charindex = charindex + (row * 57); charindex += 11; charindex += (col * 3) - 3; class11.GotoPosition(charindex); class11.SelectionStart = charindex; class11.SelectionEnd = charindex + 2; class11.SetSelectionBackColor(true, Color.Lime); class11.SetSelectionForeColor(true, SystemColors.WindowFrame); } } }
public static void OnEndFileLoad(string filename, TZXFile tzxFile) { EndFileLoad?.Invoke(filename, tzxFile); }
public static void OnProgress(TZXFile tzxfile, int blocklength, int tapeCounter, int blockCounter, float overallProgress, float blockProgress, string block, ITZXDataBlock tZXDataBlock) { Progress?.Invoke(tzxfile, blocklength, tapeCounter, blockCounter, overallProgress, blockProgress, block, tZXDataBlock); }