//public FlpForm(Monad.FLParser.Project selectedFlp) public FlpForm(string instanceName, Monad.FLParser.Project selectedFlp) : base(instanceName) { this.DefaultFloatingSize = new System.Drawing.Size(273, 462); this.InitializeComponent(); this.label2.Text = "BPM: " + selectedFlp.Tempo; for (var i = 0; i < selectedFlp.Tracks.Length; i++) { var track = selectedFlp.Tracks[i]; var trackName = track.Name; if (selectedFlp.Tracks[i].Items.Count > 0) { indeciesWithItems.Add(i); } else { continue; } if (trackName == null) { trackName = String.Format("Track {0}", (i + 1)); if (track.Items.Count > 0) { if (track.Items[0] is ChannelPlaylistItem) { trackName = (track.Items[0] as ChannelPlaylistItem).Channel.Name; } else if (track.Items[0] is PatternPlaylistItem) { Pattern pattern = (track.Items[0] as PatternPlaylistItem).Pattern; if (pattern.Notes.Keys.Count > 0) { trackName = pattern.Notes.Keys.First().Name; } else { trackName = pattern.Name; } } } } var listViewItem = new ListViewItem(new string[] { trackName, track.Items.Count.ToString() }); tracks.Items.Add(listViewItem); } }
private void ImportFlpCMD_Invoked(object sender, EventArgs e) { try { string selectedFile = "C:\\Users\\Lorenz\\Desktop\\demo.flp"; vegas.FileUtilities.SelectFileDlg(vegas.MainWindow.Handle, "Load Project File", "FL Studio Project (*.flp)", null, out selectedFile, 0); this.selectedFlp = Monad.FLParser.Project.Load(selectedFile, true); FlpForm dockView = new FlpForm("FLPForm", selectedFlp); dockView.OnImport += importCallback; this.vegas.LoadDockView(dockView); } catch (Exception err) { LogWriter.LogWrite(err.ToString()); throw err; } }