public Class248(zzQbSongObject class323_1, string string_4, string string_5) { this.class323_0 = class323_1; this.string_1 = this.class323_0.fileName; this.string_3 = string_4; this.string_2 = string_5; string[] array = this.class323_0.string_1; for (int i = 0; i < array.Length; i++) { string text = array[i]; if (text.Equals(this.class323_0.fileName + "_rhythm")) { this.bool_0 = true; } else if (text.Contains(this.class323_0.fileName + "_coop_")) { this.bool_1 = true; } } }
private void GuitarAudioBtn_Click(object sender, EventArgs e) { string fileName = KeyGenerator.OpenOrSaveFile("Select the Guitar Audio track file.", "Any Supported Audio Formats|*.dat.xen;*.mp3;*.wav;*.ogg;*.flac|GH3 Audio Header file|*.dat.xen|MPEG Layer-3 Audio file|*.mp3|Waveform Audio file|*.wav|Ogg Vorbis Audio file|*.ogg|FLAC Audio File|*.flac", true).ToLower(); if (this.SingleAudioBtn.Checked) { if (!(fileName.Equals(""))) { this.GuitarAudioTxt.Text = fileName; this.GuitarAudioTxt.SelectionStart = this.GuitarAudioTxt.TextLength; if (fileName.EndsWith(".dat.xen")) { if (!File.Exists(fileName.Replace(".dat.xen", ".fsb.xen"))) { MessageBox.Show("Data file (FSB.XEN) is missing.", "Error!"); this.class323_0 = null; this.GuitarAudioTxt.Text = ""; } else { this.class323_0 = new zzQbSongObject(fileName); if ((int)new FileInfo(fileName.Replace(".dat.xen", ".fsb.xen")).Length != this.class323_0.int_0) { MessageBox.Show("FSB file size does not match!", "Error!"); this.class323_0 = null; this.GuitarAudioTxt.Text = ""; } else { this.PreviewSlider.Enabled = false; } } } else { this.PreviewSlider.Enabled = true; this.method_11(); } this.method_3(); return; } } else if (!(fileName.Equals(""))) { this.GuitarAudioTxt.Text = fileName; this.GuitarAudioTxt.SelectionStart = this.GuitarAudioTxt.TextLength; this.PreviewSlider.Enabled = true; this.method_11(); this.method_3(); } }
public SongData(string string_0, QBCParser class362_1, zzQbSongObject class323_1, string[] string_1) { this.InitializeComponent(); this.SongNameTxt.Text = string_0; this.bool_2 = true; this.qbcParser = class362_1; this.method_6(); this.method_4("No Track"); this.method_5("No Track"); this.method_8(0); foreach (string current in this.qbcParser.noteList.Keys) { this.method_4(current); } if (this.qbcParser.class228_2.Count != 0) { this.method_5("faceoffp1"); } if (this.qbcParser.class228_3.Count != 0) { this.method_5("faceoffp2"); } if (this.qbcParser.bpmList.Count != 0) { this.method_5("bossbattlep1"); } if (this.qbcParser.class228_5.Count != 0) { this.method_5("bossbattlep2"); } this.method_7(); if (class323_1 != null) { this.class323_0 = class323_1; return; } if (string_1.Length == 1) { this.SingleAudioBtn.Checked = true; this.GuitarAudioTxt.Text = string_1[0]; } else { string text = null; string text2 = null; string text3 = null; string text4 = null; string text5 = null; string text6 = null; for (int i = 0; i < string_1.Length; i++) { string text7 = string_1[i]; string text8 = KeyGenerator.GetFileName(text7).ToLower(); if (string_1.Length > 4 && text8.Contains("coop")) { if (text5 == null && (text8.Contains("rhythm") || text8.Contains("bass"))) { text5 = text7; } else if (text4 == null && text8.Contains("guitar")) { text4 = text7; } else if (text6 == null) { text6 = text7; } } else if (text2 == null && (text8.Contains("rhythm") || text8.Contains("bass"))) { text2 = text7; } else if (text == null && text8.Contains("guitar")) { text = text7; } else if (text3 == null) { text3 = text7; } } if (text == null) { throw new Exception("File names did not follow format!"); } if (text3 != null) { if (text2 != null) { if (text4 != null && text5 != null && text6 != null) { this.CoopAudioBtn.Checked = true; this.GuitarCoopTxt.Text = text4; this.RhythmCoopTxt.Text = text5; this.BandCoopTxt.Text = text6; } else { this.MultiAudioBtn.Checked = true; } this.RhythmAudioTxt.Text = text2; } else { this.DualAudioBtn.Checked = true; } this.BandAudioTxt.Text = text3; } else { this.SingleAudioBtn.Checked = true; } this.GuitarAudioTxt.Text = text; } this.PreviewSlider.method_18(Convert.ToInt32(AudioManager.getAudioStream(this.GuitarAudioTxt.Text).vmethod_1().timeSpan_0.TotalSeconds)); this.PreviewSlider.method_14(this.PreviewSlider.method_17() / 2); if (this.GuitarAudioTxt.Text == "" || (!this.SingleAudioBtn.Checked && (this.BandAudioTxt.Text == "" || !this.DualAudioBtn.Checked) && (this.RhythmAudioTxt.Text == "" || !this.MultiAudioBtn.Checked) && (this.GuitarCoopTxt.Text == "" || this.RhythmCoopTxt.Text == "" || this.BandCoopTxt.Text == "" || !this.CoopAudioBtn.Checked))) { throw new Exception("File names did not follow format!"); } }
private void MassImporter_MenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); folderBrowserDialog.ShowNewFolderButton = false; folderBrowserDialog.Description = "Please select a folder that contains the folder structure for mass song importing."; folderBrowserDialog.RootFolder = Environment.SpecialFolder.DesktopDirectory; if (folderBrowserDialog.ShowDialog() != DialogResult.OK) { return; } string[] directories = Directory.GetDirectories(folderBrowserDialog.SelectedPath, "*", SearchOption.TopDirectoryOnly); List<string> list = new List<string>(directories); string[] array = directories; for (int i = 0; i < array.Length; i++) { string file = array[i]; try { List<string> list2 = KeyGenerator.checkFile(file, "*.mid;*.chart;*.qbc;*.dbc", true); List<string> list3 = KeyGenerator.checkFile(file, "*.wav;*.mp3;*.ogg", true); string[] files = Directory.GetFiles(file, "*.dat", SearchOption.TopDirectoryOnly); if (list2.Count != 0 && (list3.Count != 0 || files.Length != 0)) { GH3Song gH3Song = this.bool_0 ? new GHASong() : new GH3Song(); gH3Song.name = KeyGenerator.GetFileName(file).ToLower().Replace(" ", "").Replace('.', '_'); if (gH3Song.name.Length > 30) { gH3Song.name = gH3Song.name.Remove(30); } if (QbSongClass1.smethod_4(gH3Song.name) || this.gh3Songlist_0.method_3(gH3Song.name)) { int num = 2; while (QbSongClass1.smethod_4(gH3Song.name + num) || this.gh3Songlist_0.method_3(gH3Song.name + num)) { num++; } GH3Song expr_176 = gH3Song; expr_176.name += num; } QBCParser qbcParser = null; foreach (string current in list2) { try { if (current.EndsWith(".qbc")) { qbcParser = new QBCParser(current); } else if (current.EndsWith(".mid")) { qbcParser = Midi2Chart.getMidiSong(current, this.forceRB3MidConversionToolStripMenuItem.Checked); } else { qbcParser = new ChartParser(current).method_3(); } break; } catch { } } if (qbcParser != null) { zzQbSongObject class2 = null; if (files.Length != 0) { string[] array2 = files; for (int j = 0; j < array2.Length; j++) { string text2 = array2[j]; try { if (File.Exists(text2.Replace(".dat.xen", ".fsb.xen"))) { class2 = new zzQbSongObject(text2); if ((int)new FileInfo(text2.Replace(".dat.xen", ".fsb.xen")).Length == class2.int_0) { break; } } } catch { } } } if (class2 != null || list3.Count != 0) { SongData songData = new SongData(gH3Song.name, qbcParser, class2, list3.ToArray()); Class250 class3 = songData.method_1(this.class319_0, this.dataFolder); Class248 class4 = songData.method_0(this.dataFolder); gH3Song.vmethod_0(class3.class362_0.gh3Song_0); if (File.Exists(file + "\\song.ini")) { string[] array3 = File.ReadAllLines(file + "\\song.ini"); for (int k = 0; k < array3.Length; k++) { string text3 = array3[k]; if (text3.StartsWith("name")) { gH3Song.title = text3.Remove(0, text3.IndexOf('=') + 1).Trim(); } else if (text3.StartsWith("artist")) { gH3Song.artist = text3.Remove(0, text3.IndexOf('=') + 1).Trim(); } } } gH3Song.no_rhythm_track = !class4.bool_0; gH3Song.use_coop_notetracks = class4.bool_1; gH3Song.version = 3; gH3Song.leaderboard = true; gH3Song.editable = true; this.method_4(class3); this.method_4(class4); this.gh3Songlist_0.Add(gH3Song.name, gH3Song); list.Remove(file); } } } } catch { } } this.method_4(new Class247(this.class319_0, this.gh3Songlist_0)); this.method_0(); if (list.Count != 0) { string text4 = "The follwing songs (by folder name) failed:"; foreach (string current2 in list) { text4 = text4 + "\n" + KeyGenerator.GetFileName(current2); } MessageBox.Show(text4, "Error!"); } }