Ejemplo n.º 1
0
        private int loadSequence(string seqFile)
        {
            int err = 0;

            txtFilename.Text = Path.GetFileName(seqFile);
            err = seq.ReadSequenceFile(seqFile);
            MessageBox.Show(this, seq.summary(), "Summary", MessageBoxButtons.OK, MessageBoxIcon.Information);
            fileName = seqFile;

            if (err == 0)
            {
                btnSaveAs.Enabled = true;
                if (chkAutoSave.Checked)
                {
                    int    f           = 2;
                    string autoSeqPath = utils.DefaultSequencesPath;
                    string autoSeqName = Path.GetFileNameWithoutExtension(fileName);
                    string ext         = Path.GetExtension(fileName);
                    string tryFile     = autoSeqPath + autoSeqName + " Rewrite" + ext;
                    //while (System.IO.File.Exists(tryFile))
                    //{
                    //	tryFile = autoSeqPath + autoSeqName + " (" + f.ToString() + ")" + ext;
                    //	f++;
                    //}
                    err = SaveSequence(tryFile);
                }
            }
            return(err);
        }
Ejemplo n.º 2
0
		private void btnMake_Click(object sender, EventArgs e)
		{
			ImBusy(true);
			
			seq = new Sequence4();
			if (File.Exists(lastFile))
			{
				seq.ReadSequenceFile(lastFile);
			}

			if (chkDoFence.Checked)
			{
				BuildFence();
			}

			if (chkDoAirship.Checked)
			{
				BuildShip();
			}

			if (chkDoTree.Checked)
			{
				BuildTreeNew();
			}

			FileInfo oFilenfo = new FileInfo(lastFile);
			string newFile = oFilenfo.Directory + "\\" + JustName(lastFile) + " + NEW" + oFilenfo.Extension;

			seq.WriteSequenceFile(newFile);
			//seq.WriteFileInDisplayOrder(newFile);

			ImBusy(false);
			SystemSounds.Exclamation.Play();

		}
Ejemplo n.º 3
0
        private void SaveInExistingSequence()
        {
            string filt    = "Musical Sequences *.lms|*lms";
            string idir    = utils.DefaultSequencesPath;
            string ifl     = txtSeqName.Text.Trim();
            string theFile = "";

            if (utils.ValidFilename(ifl, true, false))
            {
                idir = Path.GetDirectoryName(ifl);
                if (utils.ValidFilename(ifl, true, true))
                {
                    if (Path.GetExtension(ifl.ToLower()) == "lms")
                    {
                        theFile = Path.GetFileName(ifl);
                    }
                }
            }
            else
            {
                // Keep default sequence path
            }


            dlgOpenFile.Filter           = filt;
            dlgOpenFile.FilterIndex      = 2;           //! Temporary?  Set back to 1 and/or change filter string?
            dlgOpenFile.InitialDirectory = idir;
            //dlgOpenFile.FileName = Properties.Settings.Default.fileSeqLast;

            DialogResult dr = dlgOpenFile.ShowDialog(this);

            if (dr == DialogResult.OK)
            {
                fileCurrent     = dlgOpenFile.FileName;
                txtSeqName.Text = Path.GetFileName(fileCurrent);
                string ex = Path.GetExtension(fileCurrent).ToLower();
                // If they picked an existing musical sequence
                if (ex == ".lms")
                {
                    seq.ReadSequenceFile(fileCurrent);
                    //fileAudioOriginal = seq.info.music.File;
                    //txtFileAudio.Text = Path.GetFileNameWithoutExtension(fileAudioOriginal);
                    grpAudio.Text       = " Original Audio File ";
                    btnBrowseAudio.Text = "Analyze";
                    //fileSeqCur = fileCurrent;
                    //fileChanCfg = "";
                    // Add to Sequences MRU

                    centiseconds = SequenceFunctions.ms2cs(audioData.Duration);

                    //! ImportVampsToSequence();
                    SaveSequence(fileCurrent);
                }
                //grpGrids.Enabled = true;
                //grpTracks.Enabled = true;
                //grpAudio.Enabled = true;
                //btnBrowseAudio.Focus();
            }
        }
Ejemplo n.º 4
0
        }         // End SaveFormPostion

        private void btnBrowseFirst_Click(object sender, EventArgs e)
        {
            string initDir = "q:\\dfkjalshjdfklja";

            if (lastFile1.Length > 6)
            {
                initDir = Path.GetDirectoryName(lastFile1);
            }
            if (!Directory.Exists(initDir))
            {
                initDir = utils.DefaultChannelConfigsPath;
            }
            if (!Directory.Exists(initDir))
            {
                initDir = utils.DefaultSequencesPath;
            }
            if (!Directory.Exists(initDir))
            {
                initDir = utils.DefaultDocumentsPath;
            }
            if (!Directory.Exists(initDir))
            {
                initDir = utils.DefaultSequencesPath;
            }
            string initFile = "";

            if (File.Exists(lastFile1))
            {
                initFile = Path.GetFileName(lastFile1);
            }

            dlgOpenFile.Filter = "Sequence Files *.las, *.lms|*.las;*.lms|Musical Sequence Files *.lms|*.lms|Animated Sequence Files *.las|*.las";
            //dlgOpenFile.DefaultExt = "*.lms";

            dlgOpenFile.InitialDirectory = initDir;
            dlgOpenFile.FileName         = initFile;
            dlgOpenFile.CheckFileExists  = true;
            dlgOpenFile.CheckPathExists  = true;
            dlgOpenFile.Multiselect      = false;
            dlgOpenFile.Title            = "Select First Sequence...";
            //pnlAll.Enabled = false;
            DialogResult result = dlgOpenFile.ShowDialog();

            if (result == DialogResult.OK)
            {
                lastFile1 = dlgOpenFile.FileName;

                FileInfo fi = new FileInfo(lastFile1);
                Properties.Settings.Default.LastFile1 = lastFile1;
                Properties.Settings.Default.Save();

                txtFirstFile.Text = utils.ShortenLongPath(lastFile1, 80);
                seqOne.ReadSequenceFile(lastFile1);
                utils.TreeFillChannels(treNewChannels, seqOne, ref siNodes, false, true);
                seqNew = seqOne;
            }     // end if (result = DialogResult.OK)
            //pnlAll.Enabled = true;
        }         // end browse for First File
Ejemplo n.º 5
0
		private void loadSequence(string seqFile)
		{
			seq.ReadSequenceFile(seqFile);
			fileSequence = seqFile;
			seq.Members.ReIndex();

			string rpt = tempPath + Path.GetFileNameWithoutExtension(seqFile) + " Report.htm";
			//CreateReport(seqFile, rpt);
		}
Ejemplo n.º 6
0
        }         // end optColor3_CheckedChanged

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            string basePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Light-O-Rama\\Sequences\\";
            string workFile = "";

            dlgFileOpen.Filter           = "Sequence Files *.las, *.lms|*.las;*.lms|Musical Sequences *.lms|*.lms|Animated Sequences *.las|*.las";
            dlgFileOpen.DefaultExt       = "*.lms";
            dlgFileOpen.InitialDirectory = basePath;
            dlgFileOpen.CheckFileExists  = true;
            dlgFileOpen.CheckPathExists  = true;
            dlgFileOpen.Multiselect      = false;
            DialogResult result = dlgFileOpen.ShowDialog();

            if (result == DialogResult.OK)
            {
                workFile = dlgFileOpen.FileName;
                if (workFile.Substring(1, 2) != ":\\")
                {
                    workFile = basePath + "\\" + lastFile;
                }

                int errs = seq.ReadSequenceFile(workFile);
                if (errs == 0)
                {
                    lastFile = workFile;
                    Properties.Settings.Default.lastFile = lastFile;
                    Properties.Settings.Default.Save();

                    if (lastFile.Length > basePath.Length)
                    {
                        if (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0)
                        {
                            txtInputFilename.Text = lastFile.Substring(basePath.Length);
                        }
                        else
                        {
                            txtInputFilename.Text = lastFile;
                        }                 // End else (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0)
                    }                     // end if (lastFile.Length > basePath.Length)

                    string t = "All of " + utils.FormatTime(seq.Centiseconds) + " Selected";
                    lblSelectionTime.Text    = t;
                    lblSelectionTime.Visible = true;
                    t = "All of " + seq.RGBchannels.Count.ToString() + " RGB Channels Selected";
                    lblSelectionCount.Text    = t;
                    lblSelectionCount.Visible = true;
                }
            }             // end if (result = DialogResult.OK)
        }
Ejemplo n.º 7
0
		private void btnMake_Click(object sender, EventArgs e)
		{
			EnableAll(false);
			pixelNum = 1;
			groupCount = 0;
			groupNumber = 1;

			seq = new Sequence4();
			if (File.Exists(lastFile))
			{
				seq.ReadSequenceFile(lastFile);
			}





			// Strip 1
			if (chkMake1.Checked)
			{
				stripName = txtStripName1.Text;
				universeNum = Convert.ToInt16(numUniverse1.Value);
				stripCount = Int16.Parse(txtKeywdelCt1.Text);
				stripNum = 1;
				pixelNum = 1;
				reversed = optReverse1.Checked;
				if (reversed)
				{
					stripStart = Int16.Parse(txtKeywdelCt1.Text);
					stripEnd = Int16.Parse(txtStartCh1.Text);
					chIncr = -1;
				}
				else
				{
					stripStart = Int16.Parse(txtStartCh1.Text);
					stripEnd = Int16.Parse(txtKeywdelCt1.Text);
					chIncr = 1;
				}
				if (optRGB1.Checked) chOrder = 1;
				if (optGRB1.Checked) chOrder = 2;
				groupSize = Int16.Parse(cboGroupSize1.Text);

				pixNumFirst = 1;
				pixNumLast = groupSize;
				stripNumFirst = stripStart;
				stripNumLast = stripStart + (groupSize * chIncr);
				dmxChFirst = Math.Min(stripNumFirst, stripNumLast) * 3 + 1;
				dmxChLast = Math.Max(stripNumFirst, stripNumLast) * 3;

				AddStrip();
			}
			
			// Strip 2
			if (chkMake2.Checked)
			{
				stripName = txtStripName2.Text;
				universeNum = Convert.ToInt16(numUniverse2.Value);
				stripCount = Int16.Parse(txtKeywdelCt2.Text);
				stripNum = 2;
				reversed = optReverse2.Checked;
				if (reversed)
				{
					stripStart = Int16.Parse(txtKeywdelCt2.Text);
					stripEnd = Int16.Parse(txtStartCh2.Text);
					chIncr = -1;
				}
				else
				{
					stripStart = Int16.Parse(txtStartCh2.Text);
					stripEnd = Int16.Parse(txtKeywdelCt2.Text);
					chIncr = 1;
				}
				if (optRGB2.Checked) chOrder = 1;
				if (optGRB2.Checked) chOrder = 2;
				groupSize = Int16.Parse(cboGroupSize2.Text);

				pixNumFirst = Int16.Parse(txtKeywdelCt1.Text) + 1;
				int gc = ((pixelNum / Int16.Parse(cboGroupSize1.Text)) + 1) * groupSize;
				pixNumLast = 180; // gc; // Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text);
				stripNumFirst = 1;
				stripNumLast = 10;
				dmxChFirst = Int16.Parse(txtStartCh2.Text);
				dmxChLast = 30; // groupSize * 3;

				AddStrip();
			}

			// Strip 3
			if (chkMake3.Checked)
			{
				stripName = txtStripName3.Text;
				universeNum = Convert.ToInt16(numUniverse3.Value);
				stripCount = Int16.Parse(txtKeywdelCt3.Text);
				stripNum = 3;
				reversed = optReverse3.Checked;
				if (reversed)
				{
					stripStart = Int16.Parse(txtKeywdelCt3.Text);
					stripEnd = Int16.Parse(txtStartCh3.Text);
					chIncr = -1;
				}
				else
				{
					stripStart = Int16.Parse(txtStartCh3.Text);
					stripEnd = Int16.Parse(txtKeywdelCt3.Text);
					chIncr = 1;
				}
				if (optRGB3.Checked) chOrder = 1;
				if (optGRB3.Checked) chOrder = 2;
				groupSize = Int16.Parse(cboGroupSize3.Text);

				pixNumFirst = Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + 1;
				pixNumLast = 360; // Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + Int16.Parse(txtKeywdelCt3.Text);
				stripNumFirst = 170; // Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + stripStart;
				stripNumLast = 151; // stripNumFirst + (groupSize * chIncr);
				dmxChFirst = 451; // Int16.Parse(txtStartCh3.Text);
				dmxChLast = 510; //  (Int16.Parse(txtKeywdelCt3.Text) * 3) - 1;

				AddStrip();
			}

			// Strip 4
			if (chkMake4.Checked)
			{
				stripName = txtStripName4.Text;
				universeNum = Convert.ToInt16(numUniverse4.Value);
				stripCount = Int16.Parse(txtKeywdelCt4.Text);
				stripNum = 4;
				reversed = optReverse4.Checked;
				if (reversed)
				{
					stripStart = Int16.Parse(txtKeywdelCt4.Text);
					stripEnd = Int16.Parse(txtStartCh4.Text);
					chIncr = -1;
				}
				else
				{
					stripStart = Int16.Parse(txtStartCh4.Text);
					stripEnd = Int16.Parse(txtKeywdelCt4.Text);
					chIncr = 1;
				}
				if (optRGB4.Checked) chOrder = 1;
				if (optGRB4.Checked) chOrder = 2;
				groupSize = Int16.Parse(cboGroupSize4.Text);

				pixNumFirst = Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + Int16.Parse(txtKeywdelCt3.Text) + 1;
				pixNumLast = 520; // Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + Int16.Parse(txtKeywdelCt3.Text) + Int16.Parse(txtKeywdelCt4.Text);
				stripNumFirst = 1; // Int16.Parse(txtKeywdelCt1.Text) + Int16.Parse(txtKeywdelCt2.Text) + Int16.Parse(txtKeywdelCt3.Text) + stripStart;
				stripNumLast = 10; // stripNumFirst + (groupSize * chIncr);
				dmxChFirst = 1; // Int16.Parse(txtStartCh4.Text);
				dmxChLast = 30; // (Int16.Parse(txtKeywdelCt4.Text) * 3) - 1;

				AddStrip();
			}

			FileInfo oFilenfo = new FileInfo(lastFile);
			//string newFile = oFilenfo.Directory + "\\" + JustName(lastFile) + " + Strips" + oFilenfo.Extension;
			string newFile = oFilenfo.Directory + "\\" + Path.GetFileNameWithoutExtension(lastFile) + " + Strips" + oFilenfo.Extension;

			seq.WriteSequenceFile(newFile);
			//seq.WriteFileInDisplayOrder(newFile);

			EnableAll(true);
			SystemSounds.Exclamation.Play();

		} // end btnMake_Click()