static void Main(string[] args) { //Start. Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Argument mode. if (args.Length > 0) { //Switch type. switch (Path.GetExtension(args[0])) { //Sound archive. case ".sdat": Application.Run(new MainWindow(args[0])); break; //Sound sequence. case ".sseq": Application.Run(new SequenceEditor(args[0])); break; //Sound archive. case ".ssar": Application.Run(new SequenceArchiveEditor(args[0])); break; //Sound bank. case ".sbnk": Application.Run(new BankEditor(args[0])); break; //Sound wave archive. case ".swar": Application.Run(new WaveArchiveEditor(args[0])); break; //Stream. case ".strm": RiffWave r = new RiffWave(); NitroFileLoader.Stream s = new NitroFileLoader.Stream(); s.Read(args[0]); r.FromOtherStreamFile(s); r.Write(MainWindow.NitroPath + "/" + "tmpStream" + 0 + ".wav"); Application.Run(new StreamPlayer(null, MainWindow.NitroPath + "/" + "tmpStream" + 0 + ".wav", Path.GetFileNameWithoutExtension(args[0]))); break; } } else { //Start the editor. Application.Run(new MainWindow()); } }
/// <summary> /// Replace the wave. /// </summary> public override void NodeReplace() { //Get the file. OpenFileDialog o = new OpenFileDialog(); o.Filter = "Supported Audio Files|*.wav;*.swav;*.strm"; o.RestoreDirectory = true; o.ShowDialog(); //If valid. if (o.FileName != "") { //Swav file. Wave w = new Wave(); switch (Path.GetExtension(o.FileName)) { case ".wav": RiffWave r = new RiffWave(o.FileName); w.FromOtherStreamFile(r); break; case ".swav": w.Read(o.FileName); break; case ".strm": NitroFileLoader.Stream s = new NitroFileLoader.Stream(); s.Read(o.FileName); w.FromOtherStreamFile(s); break; default: MessageBox.Show("Unsupported file format!"); return; } //Add the wave. WA.Waves[tree.SelectedNode.Index] = w; UpdateNodes(); DoInfoStuff(); } }