public static void FillChannels(TreeViewAdv tree, Sequence4 seq, List <TreeNodeAdv>[] siNodes, bool selectedOnly, bool includeRGBchildren, int memberTypes) { //TODO: 'Selected' not implemented yet tree.Nodes.Clear(); nodeIndex = 1; int listSize = seq.Members.HighestSavedIndex + seq.Tracks.Count + seq.TimingGrids.Count + 1; //Array.Resize(ref siNodes, listSize); // const string ERRproc = " in FillChannels("; // const string ERRtrk = "), in Track #"; // const string ERRitem = ", Items #"; // const string ERRline = ", Line #"; for (int n = 0; n < siNodes.Length; n++) { //siNodes[n] = null; //siNodes[n] = new List<TreeNodeAdv>(); //siNodes.Add(new List<TreeNodeAdv>()); siNodes[n] = new List <TreeNodeAdv>(); } for (int t = 0; t < seq.Tracks.Count; t++) { TreeNodeAdv trackNode = AddTrack(seq, tree.Nodes, t, siNodes, selectedOnly, includeRGBchildren, memberTypes); } }
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(); }
private static TreeNodeAdv AddChannel(Sequence4 seq, TreeNodeAdvCollection baseNodes, int channelSI, bool selectedOnly) { Channel theChannel = (Channel)seq.Members.bySavedIndex[channelSI]; string nodeText = theChannel.Name; TreeNodeAdv channelNode = new TreeNodeAdv(nodeText); baseNodes.Add(channelNode); //IMember nodeTag = theChannel; nodeIndex++; channelNode.Tag = theChannel; //channelNode.ImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.SelectedImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.ImageKey = ICONchannel; //channelNode.SelectedImageKey = ICONchannel; ImageList icons = baseNodes[0].TreeView.LeftImageList; int iconIndex = ColorIcon(icons, theChannel.color); int[] icodxColor = new int[] { iconIndex }; channelNode.LeftImageIndices = icodxColor; channelNode.Checked = theChannel.Selected; return(channelNode); }
public static TreeNode AddChannel(Sequence4 seq, TreeNode parentNode, int channelIndex, bool selected) { string nodeText = seq.channels[channelIndex].name; TreeNode channelNode = parentNode.Nodes.Add(nodeText); ChanInfo nodeTag = new ChanInfo(); nodeTag.tableType = tableType.channel; nodeTag.objIndex = channelIndex; nodeTag.savedIndex = seq.channels[channelIndex].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; channelNode.Tag = nodeTag; //channelNode.ImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.SelectedImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.ImageKey = ICONchannel; //channelNode.SelectedImageKey = ICONchannel; ImageList icons = parentNode.TreeView.ImageList; int iconIndex = ColorIcon(icons, seq.channels[channelIndex].color); channelNode.ImageIndex = iconIndex; channelNode.SelectedImageIndex = iconIndex; return(channelNode); }
} // 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
} // End Browse-Open void FixFile(string theFile) { seq = new Sequence4(theFile); rgbChans1 = null; rgbChans2 = null; Array.Resize(ref rgbChans1, 301); Array.Resize(ref rgbChans2, 301); int ix = 0; // Select Everything for (int i = 0; i < seq.Tracks.Count; i++) { seq.Tracks[i].Selected = true; } for (int i = 0; i < seq.TimingGrids.Count; i++) { seq.TimingGrids[i].Selected = true; } for (int i = 0; i < seq.Channels.Count; i++) { seq.Channels[i].Selected = true; } for (int i = 0; i < seq.RGBchannels.Count; i++) { RGBchannel rgb = seq.RGBchannels[i]; rgb.Selected = true; if (rgb.Name.Substring(0, 11).CompareTo("Tree Pixel ") == 0) { int pxNo = int.Parse(rgb.Name.Substring(11, 3)); if (rgbChans1[pxNo] == null) { rgbChans1[pxNo] = rgb; } else { rgbChans2[pxNo] = rgb; rgb.Selected = false; rgb.redChannel.Selected = false; rgb.grnChannel.Selected = false; rgb.bluChannel.Selected = false; } } } for (int i = 0; i < seq.ChannelGroups.Count; i++) { ChannelGroup cg = seq.ChannelGroups[i]; cg.Selected = true; if (cg.Name.Length > 20) { if (cg.Name.Substring(0, 18).CompareTo("Tree Pixels Column") == 0) { FixGroup(cg); } } } } // End FixFile
private Sequence4 CreateNewSequence(string theFilename) { seq = new Sequence4(); seq.info.author = utils.DefaultAuthor; SaveSongInfo(); // Save what we have so far... //seq.WriteSequenceFile_DisplayOrder(theFilename); return(seq); }
private static TreeNodeAdv AddRGBchannel(Sequence4 seq, TreeNodeAdvCollection baseNodes, int RGBsi, List <TreeNodeAdv>[] siNodes, bool selectedOnly, bool includeRGBchildren) { TreeNodeAdv rgbNode = null; if (siNodes[RGBsi] != null) { RGBchannel theRGB = (RGBchannel)seq.Members.bySavedIndex[RGBsi]; string nodeText = theRGB.Name; rgbNode = new TreeNodeAdv(nodeText); baseNodes.Add(rgbNode); //IMember nodeTag = theRGB; nodeIndex++; rgbNode.Tag = theRGB; rgbNode.LeftImageIndices = icodxRGBchannel; rgbNode.Checked = theRGB.Selected; if (includeRGBchildren) { // * * R E D S U B C H A N N E L * * TreeNodeAdv colorNode = null; int ci = theRGB.redChannel.SavedIndex; nodeText = theRGB.redChannel.Name; colorNode = new TreeNodeAdv(nodeText); nodeIndex++; colorNode.Tag = theRGB.redChannel; colorNode.LeftImageIndices = icodxRedChannel; colorNode.Checked = theRGB.redChannel.Selected; siNodes[ci].Add(colorNode); rgbNode.Nodes.Add(colorNode); // * * G R E E N S U B C H A N N E L * * ci = theRGB.grnChannel.SavedIndex; nodeText = theRGB.grnChannel.Name; colorNode = new TreeNodeAdv(nodeText); nodeIndex++; colorNode.Tag = theRGB.grnChannel; colorNode.LeftImageIndices = icodxGrnChannel; colorNode.Checked = theRGB.grnChannel.Selected; siNodes[ci].Add(colorNode); rgbNode.Nodes.Add(colorNode); // * * B L U E S U B C H A N N E L * * ci = theRGB.bluChannel.SavedIndex; nodeText = theRGB.bluChannel.Name; colorNode = new TreeNodeAdv(nodeText); nodeIndex++; colorNode.Tag = theRGB.bluChannel; colorNode.LeftImageIndices = icodxBluChannel; colorNode.Checked = theRGB.bluChannel.Selected; siNodes[ci].Add(colorNode); rgbNode.Nodes.Add(colorNode); } // end includeRGBchildren } return(rgbNode); }
public static void TreeFillChannels(TreeViewAdv tree, Sequence4 seq, ref List <TreeNodeAdv>[] nodesBySI, bool selectedOnly, bool includeRGBchildren) { int listSize = seq.Members.HighestSavedIndex + seq.Tracks.Count + seq.TimingGrids.Count + 1; //Array.Resize(ref nodesBySI, listSize); if (nodesBySI == null) { Array.Resize(ref nodesBySI, listSize); } int t = SeqEnums.MEMBER_Channel | SeqEnums.MEMBER_RGBchannel | SeqEnums.MEMBER_ChannelGroup | SeqEnums.MEMBER_Track; TreeFillChannels(tree, seq, ref nodesBySI, selectedOnly, includeRGBchildren, t); }
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 LoadFormPostion private DialogResult MakeSelections() { ImBusy(true); DialogResult ret = DialogResult.None; frmChannels chanForm = new frmChannels((Sequence4)seq.Clone()); ret = chanForm.ShowDialog(this); if (ret == DialogResult.OK) { seq = chanForm.seq; } ImBusy(false); return(ret); }
public frmMapList(Sequence4 sourceSequence, Sequence4 masterSequence, List <IMember>[] srcToMastMap, IMember[] mastToSrcMap, ImageList icons) { InitializeComponent(); seqSource = sourceSequence; seqMaster = masterSequence; mapMastToSrc = mastToSrcMap; mapSrcToMast = srcToMastMap; imlTreeIcons = icons; lstMap.SmallImageList = icons; //seqSource.Members.ReIndex(); //seqMaster.Members.ReIndex(); //BuildList(); }
private void SaveAsNewSequence() { string filter = "Musical Sequence *.lms|*.lms"; string idr = utils.DefaultSequencesPath; string ifile = Path.GetFileNameWithoutExtension(fileCurrent); if (ifile.Length < 2) { //ifile = seq.info.music.Title + " by " + seq.info.music.Artist; ifile = audioData.Title + " by " + audioData.Artist; } ifile = utils.FixInvalidFilenameCharacters(ifile); ifile += ".lms"; dlgSaveFile.Filter = filter; dlgSaveFile.InitialDirectory = idr; dlgSaveFile.FileName = ifile; dlgSaveFile.FilterIndex = 1; dlgSaveFile.OverwritePrompt = true; dlgSaveFile.Title = "Save Sequence As..."; dlgSaveFile.ValidateNames = true; DialogResult result = dlgSaveFile.ShowDialog(this); if (result == DialogResult.OK) { ImBusy(true); fileSeqName = dlgSaveFile.FileName; txtSeqName.Text = Path.GetFileNameWithoutExtension(fileSeqName); seq = CreateNewSequence(fileSeqName); seq.info.author = utils.DefaultAuthor; seq.info.music.Album = audioData.Album; seq.info.music.Artist = audioData.Artist; seq.info.music.Title = audioData.Title; seq.info.music.File = fileAudioLast; //ImportVampsToSequence(); ExportSelectedVamps(); SaveSequence(fileSeqName); //ImBusy(false); if (chkAutolaunch.Checked) { System.Diagnostics.Process.Start(fileSeqName); } } //btnBrowseSequence.Focus(); }
private void InitForm() { lastFile = Properties.Settings.Default.lastFile; string ChannelList = Properties.Settings.Default.lastFile; //channels = ChannelList.Split(','); string basePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Light-O-Rama\\Sequences\\"; if (lastFile.Length > basePath.Length) { if (File.Exists(lastFile)) { seq = new Sequence4(lastFile); CreateGroups(); } else { lastFile = ""; } if (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0) { txtFile.Text = lastFile.Substring(basePath.Length); } else { txtFile.Text = lastFile; } // End else (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0) } // end if (lastFile.Length > basePath.Length) /* if (channels.Length > 0) { for (int loop = 0; loop < channels.Length; loop++) { if (channels[loop].Length > 0) { channelsListBox.Items.Add(channels[loop]); } // end if (channels[loop].Length > 0) } // end for (int loop = 0; loop <= channels.Length; loop++) } // end if (channels.Length > 0) */ RestoreFormPosition(); SetTheControlsForTheHeartOfTheSun(); } // end private void InitForm()
} // end Beats public int xTimingsToLORtimings(xTimings timings, Sequence4 sequence) { // Ignore the timings passed in, and use the ones already cached for Bars and Beats // (Other transforms will use the one passed in) seqFunct.Sequence = sequence; int errs = 0; if (xOnsets != null) { if (xOnsets.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Note Onsets", true); seqFunct.ImportTimingGrid(barGrid, xOnsets); } } return(errs); }
private void BrowseButton_Click(object sender, EventArgs e) { string basePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Light-O-Rama\\Sequences\\"; if (File.Exists(lastFile)) { FileInfo fi = new FileInfo(lastFile); openFileDialog.InitialDirectory = fi.DirectoryName; openFileDialog.FileName = fi.Name; } else { openFileDialog.InitialDirectory = utils.DefaultSequencesPath; openFileDialog.FileName = ""; } openFileDialog.Filter = "Sequences (*.lms,las)|*.lms;*.las|Just Musical Sequences (*.lms)|*.lms|Just Animated Sequences (*.las)|*.las"; openFileDialog.DefaultExt = "*.lms;*.las"; //openFileDialog.InitialDirectory = basePath; openFileDialog.CheckFileExists = true; openFileDialog.CheckPathExists = true; openFileDialog.Multiselect = false; DialogResult result = openFileDialog.ShowDialog(); if (result == DialogResult.OK) { lastFile = openFileDialog.FileName; if (lastFile.Length > basePath.Length) { if (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0) { txtFile.Text = lastFile.Substring(basePath.Length); } else { Reset(); seq = new Sequence4(lastFile); txtFile.Text = lastFile; CreateGroups(); } // End else (lastFile.Substring(0, basePath.Length).CompareTo(basePath) == 0) } // end if (lastFile.Length > basePath.Length) } // end if (result = DialogResult.OK) } // end private void BrowseButton_Click(object sender, EventArgs e)
public static void TreeFillChannels(TreeViewAdv tree, Sequence4 seq, ref List <TreeNodeAdv>[] nodesBySI, bool selectedOnly, bool includeRGBchildren, int memberTypes) { //TODO: 'Selected' not implemented yet tree.Nodes.Clear(); nodeIndex = 1; int listSize = seq.Members.HighestSavedIndex + seq.Tracks.Count + seq.TimingGrids.Count + 1; //Array.Resize(ref nodesBySI, listSize); if (nodesBySI == null) { Array.Resize(ref nodesBySI, listSize); } if (listSize >= nodesBySI.Length) { Array.Resize(ref nodesBySI, listSize); } //const string ERRproc = " in TreeFillChannels("; //const string ERRtrk = "), in Track #"; //const string ERRitem = ", Items #"; //const string ERRline = ", Line #"; for (int n = 0; n < nodesBySI.Length; n++) { //nodesBySI[n] = null; //nodesBySI[n] = new List<TreeNodeAdv>(); //nodesBySI.Add(new List<TreeNodeAdv>()); nodesBySI[n] = new List <TreeNodeAdv>(); } for (int t = 0; t < seq.Tracks.Count; t++) { Track trk = seq.Tracks[t]; TreeNodeAdv trackNode = TreeAddTrack(seq, tree.Nodes, trk, ref nodesBySI, selectedOnly, includeRGBchildren, memberTypes); } int xx = 42; }
public int xTimingsToLORChannels(xTimings timings, Sequence4 sequence, int firstBeat, bool ramps) { int errs = 0; Track vampTrack = seqFunct.GetTrack("Vamp-O-Rama"); ChannelGroup beatGroup = seqFunct.GetGroup("Bars and Beats", vampTrack); if (xOnsets != null) { if (xOnsets.effects.Count > 0) { if (ramps) { Channel barCh = seqFunct.GetChannel("Bars", beatGroup.Members); seqFunct.ImportBeatChannel(barCh, xOnsets, 1, firstBeat, ramps); } } } return(errs); }
private static TreeNodeAdv TreeAddChannel(Sequence4 seq, TreeNodeAdvCollection baseNodes, Channel channel, bool selectedOnly) { //Channel channel = (Channel)seq.Members.bySavedIndex[channelSI]; int channelSI = channel.SavedIndex; string nodeText = channel.Name; TreeNodeAdv channelNode = new TreeNodeAdv(nodeText); baseNodes.Add(channelNode); List <TreeNodeAdv> nodeList; //IMember nodeTag = channel; nodeIndex++; channelNode.Tag = channel; if (channel.Tag == null) { nodeList = new List <TreeNodeAdv>(); channel.Tag = nodeList; } else { nodeList = (List <TreeNodeAdv>)channel.Tag; } nodeList.Add(channelNode); //channelNode.ImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.SelectedImageIndex = imlTreeIcons.Images.IndexOfKey("Channel"); //channelNode.ImageKey = ICONchannel; //channelNode.SelectedImageKey = ICONchannel; ImageList icons = baseNodes[0].TreeView.LeftImageList; int iconIndex = ColorIcon(icons, channel.color); int[] colorIcon = new int[] { iconIndex }; channelNode.LeftImageIndices = colorIcon; //channelNode.SelectedImageIndex = iconIndex; channelNode.Checked = channel.Selected; return(channelNode); }
private void CreateGroups() { ChannelGroup grp = null; string nm = ""; Array.Resize(ref rowGroups, 14); Array.Resize(ref colGroups, 8); seq = new Sequence4(lastFile); treeTrack = seq.CreateTrack("Tree Pixels [U7.001-U8-388"); masterRowGroup = seq.CreateChannelGroup("Tree Pixels by Row"); masterColGroup = seq.CreateChannelGroup("Tree Pixels by Column"); treeTrack.AddItem(masterRowGroup); treeTrack.AddItem(masterColGroup); for (int r = 0; r < 14; r++) { nm = "Tree Pixels Row " + (r + 1).ToString(); grp = seq.CreateChannelGroup(nm); rowGroups[r] = grp; masterRowGroup.AddItem(grp); } for (int c = 0; c < 8; c++) { nm = "Tree Pixels Column " + (c + 1).ToString(); nm += " {" + DirName(c + 1) + "}"; string f = FaceName(c + 1); if (f.Length > 0) { nm += "{" + f + "}"; } grp = seq.CreateChannelGroup(nm); colGroups[c] = grp; masterColGroup.AddItem(grp); } }
public int xTimingsToLORChannels(xTimings timings, Sequence4 sequence) { return(xTimingsToLORChannels(timings, sequence, 1, false)); }
public static TreeNode AddRGBchannel(Sequence4 seq, TreeNode parentNode, int RGBIndex, List <List <TreeNode> > siNodes, bool selected, bool includeSubChannels) { List <TreeNode> qlist; string nodeText = seq.rgbChannels[RGBIndex].name; TreeNode channelNode = parentNode.Nodes.Add(nodeText); ChanInfo nodeTag = new ChanInfo(); nodeTag.tableType = tableType.rgbChannel; nodeTag.objIndex = RGBIndex; nodeTag.savedIndex = seq.rgbChannels[RGBIndex].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; channelNode.Tag = nodeTag; channelNode.ImageKey = ICONrgbChannel; channelNode.SelectedImageKey = ICONrgbChannel; if (includeSubChannels) { // * * R E D S U B C H A N N E L * * int ci = seq.rgbChannels[RGBIndex].redChannelObjIndex; nodeText = seq.channels[ci].name; TreeNode colorNode = channelNode.Nodes.Add(nodeText); nodeTag = new ChanInfo(); nodeTag.tableType = tableType.channel; nodeTag.objIndex = ci; nodeTag.savedIndex = seq.channels[ci].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; colorNode.Tag = nodeTag; colorNode.ImageKey = ICONredChannel; colorNode.SelectedImageKey = ICONredChannel; qlist = siNodes[seq.channels[ci].savedIndex]; qlist.Add(colorNode); // * * G R E E N S U B C H A N N E L * * ci = seq.rgbChannels[RGBIndex].grnChannelObjIndex; nodeText = seq.channels[ci].name; colorNode = channelNode.Nodes.Add(nodeText); nodeTag = new ChanInfo(); nodeTag.tableType = tableType.channel; nodeTag.objIndex = ci; nodeTag.savedIndex = seq.channels[ci].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; colorNode.Tag = nodeTag; colorNode.ImageKey = ICONgrnChannel; colorNode.SelectedImageKey = ICONgrnChannel; qlist = siNodes[seq.channels[ci].savedIndex]; qlist.Add(colorNode); // * * B L U E S U B C H A N N E L * * ci = seq.rgbChannels[RGBIndex].bluChannelObjIndex; nodeText = seq.channels[ci].name; colorNode = channelNode.Nodes.Add(nodeText); nodeTag = new ChanInfo(); nodeTag.tableType = tableType.channel; nodeTag.objIndex = ci; nodeTag.savedIndex = seq.channels[ci].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; colorNode.Tag = nodeTag; colorNode.ImageKey = ICONbluChannel; colorNode.SelectedImageKey = ICONbluChannel; qlist = siNodes[seq.channels[ci].savedIndex]; qlist.Add(colorNode); } // end includeSubChannels return(channelNode); }
public frmChannels(Sequence4 theSequence) { InitializeComponent(); seq = theSequence; utils.TreeFillChannels(treeChannels, seq, nodeList, false, false); }
public int xTimingsToLORChannels(xTimings timings, Sequence4 sequence, int firstBeat, bool ramps) { int errs = 0; Track vampTrack = seqFunct.GetTrack("Vamp-O-Rama", true); ChannelGroup beatGroup = seqFunct.GetGroup("Bars and Beats", vampTrack); if (xBars != null) { if (xBars.effects.Count > 0) { //if (ramps) //{ Channel barCh = seqFunct.GetChannel("Bars", beatGroup.Members); //seqFunct.ImportBeatChannel(barCh, xBars, 1, firstBeat, ramps); //seqFunct.ImportBeatChannel(barCh, xBars, 1, firstBeat, true); seqFunct.ImportBeatChannel(barCh, xBars, 1, firstBeat, ramps); //////} //} } } //if (chkBeatsFull.Checked) if (true) { if (xBeatsFull != null) { if (xBeatsFull.effects.Count > 0) { Channel beatCh = seqFunct.GetChannel("Beats-Full", beatGroup.Members); seqFunct.ImportBeatChannel(beatCh, xBeatsFull, BeatsPerBar, firstBeat, ramps); } } } //if (chkBeatsHalf.Checked) if (true) { if (xBeatsHalf != null) { if (xBeatsHalf.effects.Count > 0) { Channel beatCh = seqFunct.GetChannel("Beats-Half", beatGroup.Members); seqFunct.ImportBeatChannel(beatCh, xBeatsHalf, BeatsPerBar * 2, firstBeat, ramps); } } } //if (chkBeatsThird.Checked) if (true) { if (xBeatsThird != null) { if (xBeatsThird.effects.Count > 0) { Channel beatCh = seqFunct.GetChannel("Beats-Third", beatGroup.Members); seqFunct.ImportBeatChannel(beatCh, xBeatsThird, BeatsPerBar * 3, firstBeat, ramps); } } } //if (chkBeatsQuarter.Checked) if (true) { if (xBeatsQuarter != null) { if (xBeatsQuarter.effects.Count > 0) { Channel beatCh = seqFunct.GetChannel("Beats-Quarter", beatGroup.Members); seqFunct.ImportBeatChannel(beatCh, xBeatsQuarter, BeatsPerBar * 4, firstBeat, ramps); } } } return(errs); }
} // end Beats public int xTimingsToLORtimings(xTimings timings, Sequence4 sequence) { // Ignore the timings passed in, and use the ones already cached for Bars and Beats // (Other transforms will use the one passed in) seqFunct.Sequence = sequence; int errs = 0; if (xBars != null) { if (xBars.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Bars", true); seqFunct.ImportTimingGrid(barGrid, xBars); } } //if (chkBeatsFull.Checked) if (true) { if (xBeatsFull != null) { if (xBeatsFull.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Beats-Full", true); seqFunct.ImportTimingGrid(barGrid, xBeatsFull); } } } //if (chkBeatsHalf.Checked) if (true) { if (xBeatsHalf != null) { if (xBeatsHalf.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Beats-Half", true); seqFunct.ImportTimingGrid(barGrid, xBeatsHalf); } } } //if (chkBeatsThird.Checked) if (true) { if (xBeatsThird != null) { if (xBeatsThird.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Beats-Third", true); seqFunct.ImportTimingGrid(barGrid, xBeatsThird); } } } //if (chkBeatsQuarter.Checked) if (true) { if (xBeatsQuarter != null) { if (xBeatsQuarter.effects.Count > 0) { TimingGrid barGrid = seqFunct.GetGrid("Beats-Quarter", true); seqFunct.ImportTimingGrid(barGrid, xBeatsQuarter); } } } if (xFrames != null) { if (xFrames.effects.Count > 0) { TimingGrid barFrame = seqFunct.GetGrid(xFrames.timingName, true); seqFunct.ImportTimingGrid(barFrame, xFrames); } } return(errs); }
public static void FillChannels(TreeViewAdv tree, Sequence4 seq, List <Syncfusion.Windows.Forms.Tools.TreeNodeAdv>[] siNodes, bool selectedOnly, bool includeRGBchildren) { int t = SeqEnums.MEMBER_Channel | SeqEnums.MEMBER_RGBchannel | SeqEnums.MEMBER_ChannelGroup | SeqEnums.MEMBER_Track; FillChannels(tree, seq, siNodes, selectedOnly, includeRGBchildren, t); }
private static TreeNodeAdv AddTrack(Sequence4 seq, TreeNodeAdvCollection baseNodes, int trackNumber, List <TreeNodeAdv>[] siNodes, bool selectedOnly, bool includeRGBchildren, int memberTypes) { string nodeText = ""; bool inclChan = false; if ((memberTypes & SeqEnums.MEMBER_Channel) > 0) { inclChan = true; } bool inclRGB = false; if ((memberTypes & SeqEnums.MEMBER_RGBchannel) > 0) { inclRGB = true; } // TEMPORARY, FOR DEBUGGING // int tcount = 0; int gcount = 0; int rcount = 0; int ccount = 0; int dcount = 0; //try //{ Track theTrack = seq.Tracks[trackNumber]; nodeText = theTrack.Name; TreeNodeAdv trackNode = new TreeNodeAdv(nodeText); baseNodes.Add(trackNode); List <TreeNodeAdv> qlist; //int inclCount = theTrack.Members.DescendantCount(selectedOnly, inclChan, inclRGB, includeRGBchildren); //if (inclCount > 0) //{ // Tracks don't normally have savedIndexes // But we will assign one for tracking and matching purposes //theTrack.SavedIndex = seq.Members.HighestSavedIndex + t + 1; //if ((memberTypes & SeqEnums.MEMBER_Track) > 0) //{ baseNodes = trackNode.Nodes; nodeIndex++; trackNode.Tag = theTrack; trackNode.LeftImageIndices = icodxTrack; trackNode.Checked = theTrack.Selected; //} for (int ti = 0; ti < theTrack.Members.Count; ti++) { //try //{ IMember member = theTrack.Members.Items[ti]; int si = member.SavedIndex; if (member != null) { if (member.MemberType == MemberType.ChannelGroup) { ChannelGroup memGrp = (ChannelGroup)member; int inclCount = memGrp.Members.DescendantCount(selectedOnly, inclChan, inclRGB, includeRGBchildren); if (inclCount > 0) { TreeNodeAdv groupNode = AddGroup(seq, baseNodes, member.SavedIndex, siNodes, selectedOnly, includeRGBchildren, memberTypes); //AddNode(siNodes[si], groupNode); qlist = siNodes[si]; if (qlist == null) { qlist = new List <TreeNodeAdv>(); } qlist.Add(groupNode); gcount++; //siNodes[si].Add(groupNode); } } if (member.MemberType == MemberType.CosmicDevice) { CosmicDevice memDev = (CosmicDevice)member; int inclCount = memDev.Members.DescendantCount(selectedOnly, inclChan, inclRGB, includeRGBchildren); if (inclCount > 0) { TreeNodeAdv cosmicNode = AddGroup(seq, baseNodes, member.SavedIndex, siNodes, selectedOnly, includeRGBchildren, memberTypes); //AddNode(siNodes[si], groupNode); qlist = siNodes[si]; if (qlist == null) { qlist = new List <TreeNodeAdv>(); } qlist.Add(cosmicNode); dcount++; //siNodes[si].Add(groupNode); } } if (member.MemberType == MemberType.RGBchannel) { TreeNodeAdv rgbNode = AddRGBchannel(seq, baseNodes, member.SavedIndex, siNodes, selectedOnly, includeRGBchildren); //AddNode(siNodes[si], rgbNode); //siNodes[si].Add(rgbNode); qlist = siNodes[si]; if (qlist == null) { qlist = new List <TreeNodeAdv>(); } qlist.Add(rgbNode); rcount++; } if (member.MemberType == MemberType.Channel) { TreeNodeAdv channelNode = AddChannel(seq, baseNodes, member.SavedIndex, selectedOnly); //AddNode(siNodes[si], channelNode); //siNodes[si].Add(channelNode); qlist = siNodes[si]; if (qlist == null) { qlist = new List <TreeNodeAdv>(); } qlist.Add(channelNode); ccount++; } } // end not null //} // end try #region catch1 /* * catch (System.NullReferenceException ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } * catch (System.InvalidCastException ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } * catch (Exception ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } */ #endregion } // end loop thru track items #region catch2 /* * } // end try * catch (System.NullReferenceException ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } * catch (System.InvalidCastException ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } * catch (Exception ex) * { * StackTrace st = new StackTrace(ex, true); * StackFrame sf = st.GetFrame(st.FrameCount - 1); * string emsg = ex.ToString(); * emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); * emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG * System.Diagnostics.Debugger.Break(); #endif * utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); * } */ #endregion // int x = 1; // Check ccount, rcount, gcount return(trackNode); } // end fillOldChannels
public static void FillChannels(TreeView tree, Sequence4 seq, List <List <TreeNode> > siNodes, bool selected, bool includeRGB) { //TODO: 'selected' not implemented yet tree.Nodes.Clear(); //ChanInfo tagInfo = new ChanInfo(); string nodeText = ""; ChanInfo nodeTag = new ChanInfo(); nodeIndex = 1; int listSize = seq.highestSavedIndex + seq.tracks.Count + 1; //Array.Resize(ref siNodes, listSize); // TEMPORARY, FOR DEBUGGING int tcount = 0; int gcount = 0; int rcount = 0; int ccount = 0; const string ERRproc = " in FillChannels("; const string ERRtrk = "), in Track #"; const string ERRitem = ", Item #"; const string ERRline = ", Line #"; for (int n = 0; n < listSize; n++) { //siNodes[n] = null; //siNodes[n] = new List<TreeNode>(); siNodes.Add(new List <TreeNode>()); } for (int t = 0; t < seq.tracks.Count; t++) { try { int tNo = t + 1; //nodeText = "Track " + tNo.ToString() + ":" + seq.tracks[t].name; nodeTag = new ChanInfo(); nodeText = seq.tracks[t].name; TreeNode trackNode = tree.Nodes.Add(nodeText); nodeTag.tableType = tableType.track; nodeTag.objIndex = t; nodeTag.nodeIndex = nodeIndex; nodeTag.savedIndex = seq.highestSavedIndex + t; nodeIndex++; trackNode.Tag = nodeTag; List <TreeNode> qlist; trackNode.ImageKey = ICONtrack; trackNode.SelectedImageKey = ICONtrack; qlist = siNodes[nodeTag.savedIndex]; qlist.Add(trackNode); for (int ti = 0; ti < seq.tracks[t].itemSavedIndexes.Count; ti++) { try { int si = seq.tracks[t].itemSavedIndexes[ti]; if (seq.savedIndexes[si] != null) { if (seq.savedIndexes[si].objType == tableType.channelGroup) { TreeNode groupNode = AddGroup(seq, trackNode, seq.savedIndexes[si].objIndex, siNodes, selected, includeRGB); //AddNode(siNodes[si], groupNode); qlist = siNodes[si]; qlist.Add(groupNode); gcount++; //siNodes[si].Add(groupNode); } if (seq.savedIndexes[si].objType == tableType.rgbChannel) { TreeNode rgbNode = AddRGBchannel(seq, trackNode, seq.savedIndexes[si].objIndex, siNodes, selected, includeRGB); //AddNode(siNodes[si], rgbNode); //siNodes[si].Add(rgbNode); qlist = siNodes[si]; qlist.Add(rgbNode); rcount++; } if (seq.savedIndexes[si].objType == tableType.channel) { TreeNode channelNode = AddChannel(seq, trackNode, seq.savedIndexes[si].objIndex, selected); //AddNode(siNodes[si], channelNode); //siNodes[si].Add(channelNode); qlist = siNodes[si]; qlist.Add(channelNode); ccount++; } } // end not null } // end try catch (System.NullReferenceException ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } catch (System.InvalidCastException ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } catch (Exception ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString() + ERRitem + ti.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } } // end loop thru track items } // end try catch (System.NullReferenceException ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } catch (System.InvalidCastException ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } catch (Exception ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRtrk + t.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG System.Diagnostics.Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } } // end loop thru tracks int x = 1; // Check ccount, rcount, gcount } // end fillOldChannels
public void SetParentSeq(Sequence4 newParentSeq) { // Do Nothing }
} // end fillOldChannels public static TreeNode AddGroup(Sequence4 seq, TreeNode parentNode, int groupIndex, List <List <TreeNode> > siNodes, bool selected, bool includeRGB) { string nodeText = seq.channelGroups[groupIndex].name; TreeNode groupNode = parentNode.Nodes.Add(nodeText); ChanInfo nodeTag = new ChanInfo(); nodeTag.tableType = tableType.channelGroup; nodeTag.objIndex = groupIndex; nodeTag.savedIndex = seq.channelGroups[groupIndex].savedIndex; nodeTag.nodeIndex = nodeIndex; nodeIndex++; groupNode.Tag = nodeTag; groupNode.ImageKey = ICONchannelGroup; groupNode.SelectedImageKey = ICONchannelGroup; groupNode.ImageKey = ICONchannelGroup; groupNode.SelectedImageKey = ICONchannelGroup; List <TreeNode> qlist; const string ERRproc = " in FillChannels-AddGroup("; const string ERRgrp = "), in Group #"; const string ERRitem = ", Item #"; const string ERRline = ", Line #"; for (int gi = 0; gi < seq.channelGroups[groupIndex].itemSavedIndexes.Count; gi++) { try { int si = seq.channelGroups[groupIndex].itemSavedIndexes[gi]; if (seq.savedIndexes[si].objType == tableType.channelGroup) { TreeNode subGroupNode = AddGroup(seq, groupNode, seq.savedIndexes[si].objIndex, siNodes, selected, includeRGB); qlist = siNodes[si]; qlist.Add(subGroupNode); } if (seq.savedIndexes[si].objType == tableType.channel) { TreeNode channelNode = AddChannel(seq, groupNode, seq.savedIndexes[si].objIndex, selected); qlist = siNodes[si]; qlist.Add(channelNode); } if (seq.savedIndexes[si].objType == tableType.rgbChannel) { TreeNode rgbChannelNode = AddRGBchannel(seq, groupNode, seq.savedIndexes[si].objIndex, siNodes, selected, includeRGB); qlist = siNodes[si]; qlist.Add(rgbChannelNode); } } // end try catch (Exception ex) { StackTrace st = new StackTrace(ex, true); StackFrame sf = st.GetFrame(st.FrameCount - 1); string emsg = ex.ToString(); emsg += ERRproc + seq.filename + ERRgrp + groupIndex.ToString() + ERRitem + gi.ToString(); emsg += ERRline + sf.GetFileLineNumber(); #if DEBUG Debugger.Break(); #endif utils.WriteLogEntry(emsg, utils.LOG_Error, Application.ProductName); } // end catch } // End loop thru items return(groupNode); } // end AddGroup