private void btnSave_Click(object sender, EventArgs e) { string initDir = ""; if (lastNewFile.Length > 5) { Path.GetDirectoryName(lastNewFile); } if (!Directory.Exists(initDir)) { initDir = utils.DefaultSequencesPath; } string initFile = Path.GetFileNameWithoutExtension(lastFile1); initFile += " merged with "; initFile += Path.GetFileNameWithoutExtension(lastFile2); dlgSaveFile.Filter = "Musical Sequence Files *.lms|*.lms|Animated Sequence Files *.las|*.las"; dlgSaveFile.FileName = initFile; dlgSaveFile.InitialDirectory = initDir; dlgSaveFile.CheckPathExists = true; dlgSaveFile.OverwritePrompt = true; dlgSaveFile.Title = "Save Merged Sequences As..."; DialogResult result = dlgSaveFile.ShowDialog(); if (result == DialogResult.OK) { ImBusy(true); lastNewFile = dlgSaveFile.FileName; Properties.Settings.Default.LastNewFile = lastNewFile; Properties.Settings.Default.Save(); seqNew.WriteSequenceFile_DisplayOrder(lastNewFile); ImBusy(false); } }
private void SaveSequence(string newFilename) { ImBusy(true); // normal default when not testing seq.WriteSequenceFile_DisplayOrder(newFilename, false, false); System.Media.SystemSounds.Beep.Play(); //dirtySeq = false; //fileSeqSave = newFilename; //Add to MRU ImBusy(false); }
private void PrevFoobarIt(string theFile) { seq = new Sequence4(theFile); for (int idx = 0; idx < seq.Channels.Count; idx++) { Channel ch = seq.Channels[idx]; lblNum.Text = (idx + 1).ToString() + " of " + seq.Channels.Count.ToString(); lblName.Text = ch.Name; lblNum.Refresh(); lblName.Refresh(); int isr = ch.Name.IndexOf("Keywdel"); if (isr > 0) { isr = ch.Name.IndexOf("(R)"); if (isr > 0) { int oldChanNo = ch.output.circuit; int newChanNo = oldChanNo + 1; ch.output.circuit = newChanNo; string name2 = ch.Name.Replace(oldChanNo.ToString().Trim(), newChanNo.ToString().Trim()); ch.ChangeName(name2); } isr = ch.Name.IndexOf("(G)"); if (isr > 0) { int oldChanNo = ch.output.circuit; int newChanNo = oldChanNo - 1; ch.output.circuit = newChanNo; string name2 = ch.Name.Replace(oldChanNo.ToString().Trim(), newChanNo.ToString().Trim()); ch.ChangeName(name2); } } } string fdir = Path.GetDirectoryName(theFile) + "\\"; string fnam = Path.GetFileNameWithoutExtension(theFile); string fext = Path.GetExtension(theFile); string fnew = fdir + fnam + " v17i GRB" + fext; seq.WriteSequenceFile_DisplayOrder(fnew); //seq.WriteSequenceFile(fnew); string snd = Path.GetDirectoryName(Application.ExecutablePath) + "\\laser.wav"; SoundPlayer simpleSound = new SoundPlayer(@snd); simpleSound.Play(); }
} // End FixGroup private void btnSaveAs_Click(object sender, EventArgs e) { dlgSave.InitialDirectory = Path.GetDirectoryName(fileName); dlgSave.Filter = utils.FILT_SAVE_EITHER; dlgSave.DefaultExt = Path.GetExtension(fileName); dlgSave.FileName = Path.GetFileNameWithoutExtension(fileName) + " Fixed"; dlgSave.Title = "Save Fixed File As..."; dlgSave.OverwritePrompt = true; dlgSave.CheckPathExists = true; dlgSave.ValidateNames = true; DialogResult dr = dlgSave.ShowDialog(); if (dr == DialogResult.OK) { string newFile = dlgSave.FileName; seq.WriteSequenceFile_DisplayOrder(newFile, true, false); } } // End SaveAs
private void button1_Click(object sender, EventArgs e) { seqOne.WriteSequenceFile("D:\\Light-O-Rama\\2017 Betty\\rewritten_norm.las"); seqOne.WriteSequenceFile_DisplayOrder("D:\\Light-O-Rama\\2017 Betty\\rewritten_disp.las"); }