Ejemplo n.º 1
0
        private void assignNodes()
        {
            BuildRowNameList();

            LipSyncNodeSelect nodeSelectDlg = new LipSyncNodeSelect();

            nodeSelectDlg.MaxNodes          = _newMapping.MatrixStringCount * _newMapping.MatrixPixelsPerString;
            nodeSelectDlg.MatrixOptionsOnly = true;
            nodeSelectDlg.StringsAreRows    = _newMapping.StringsAreRows;
            nodeSelectDlg.NodeNames         = _rowNames;

            DialogResult dr = nodeSelectDlg.ShowDialog();

            if ((dr == DialogResult.OK) && (nodeSelectDlg.Changed == true))
            {
                List <LipSyncMapItem> newMappings = new List <LipSyncMapItem>();
                LipSyncMapItem        tempMapItem = null;

                _newMapping.StringsAreRows = nodeSelectDlg.StringsAreRows;
                stringsAreRows             = _newMapping.StringsAreRows;

                _rowNames.Clear();
                _rowNames.AddRange(nodeSelectDlg.NodeNames);

                foreach (string nodeName in nodeSelectDlg.NodeNames)
                {
                    tempMapItem = _newMapping.MapItems.Find(
                        delegate(LipSyncMapItem item)
                    {
                        return(item.Name.Equals(nodeName));
                    });

                    if (tempMapItem != null)
                    {
                        newMappings.Add(tempMapItem);
                    }
                    else
                    {
                        newMappings.Add(new LipSyncMapItem(nodeName, -1));
                    }
                }

                _newMapping.MapItems.Clear();

                int stringCount = 0;
                foreach (LipSyncMapItem mapItem in newMappings)
                {
                    mapItem.StringNum = stringCount++;
                    _newMapping.MapItems.Add(mapItem);
                }

                _newMapping.StartNode =
                    (_newMapping.MapItems.Count != 0) ? _newMapping.MapItems[0].Name : "";

                reconfigureDataTable();
            }
        }
Ejemplo n.º 2
0
        private void buttonAssign_Click(object sender, EventArgs e)
        {
            LipSyncNodeSelect nodeSelectDlg = new LipSyncNodeSelect();

            //nodeSelectDlg.MaxNodes = _mapping.MapItems.Count;
            nodeSelectDlg.MaxNodes          = Int32.MaxValue;
            nodeSelectDlg.MatrixOptionsOnly = false;
            nodeSelectDlg.SelectedNodeNames = _rowNames;
            nodeSelectDlg.AllowGroups       = _mapping.GroupsAllowed;
            nodeSelectDlg.AllowRecursiveAdd = _mapping.RecursionAllowed;

            DialogResult dr = nodeSelectDlg.ShowDialog();

            if ((dr == DialogResult.OK) && (nodeSelectDlg.Changed == true))
            {
                List <LipSyncMapItem> newMappings = new List <LipSyncMapItem>();
                LipSyncMapItem        tempMapItem = null;

                _mapping.LibraryReferenceName = nameTextBox.Text;
                _mapping.GroupsAllowed        = nodeSelectDlg.AllowGroups;
                _mapping.RecursionAllowed     = nodeSelectDlg.AllowRecursiveAdd;

                _rowNames.Clear();
                _rowNames.AddRange(nodeSelectDlg.SelectedNodeNames);

                foreach (string nodeName in nodeSelectDlg.SelectedNodeNames)
                {
                    tempMapItem = _mapping.MapItems.Find(
                        delegate(LipSyncMapItem item)
                    {
                        return(item.Name.Equals(nodeName));
                    });

                    if (tempMapItem != null)
                    {
                        newMappings.Add(tempMapItem);
                    }
                    else
                    {
                        newMappings.Add(new LipSyncMapItem(nodeName, -1));
                    }
                }

                _mapping.MapItems.Clear();

                int stringCount = 0;
                foreach (LipSyncMapItem mapItem in newMappings)
                {
                    mapItem.StringNum = stringCount++;
                    _mapping.MapItems.Add(mapItem);
                }

                reconfigureDataTable();
            }
            Refresh();
        }
Ejemplo n.º 3
0
        private void buttonAssign_Click(object sender, EventArgs e)
        {
            LipSyncNodeSelect nodeSelectDlg = new LipSyncNodeSelect();
            //nodeSelectDlg.MaxNodes = _mapping.MapItems.Count;
            nodeSelectDlg.MaxNodes = Int32.MaxValue;
            nodeSelectDlg.MatrixOptionsOnly = false;
            nodeSelectDlg.NodeNames = _rowNames;

            DialogResult dr = nodeSelectDlg.ShowDialog();
            if ((dr == DialogResult.OK) && (nodeSelectDlg.Changed == true))
            {
                List<LipSyncMapItem> newMappings = new List<LipSyncMapItem>();
                LipSyncMapItem tempMapItem = null;

                _mapping.LibraryReferenceName = nameTextBox.Text;
                _rowNames.Clear();
                _rowNames.AddRange(nodeSelectDlg.NodeNames);

                foreach (string nodeName in nodeSelectDlg.NodeNames)
                {
                    tempMapItem = _mapping.MapItems.Find(
                        delegate(LipSyncMapItem item)
                        {
                            return item.Name.Equals(nodeName);
                        });

                    if (tempMapItem != null)
                    {
                        newMappings.Add(tempMapItem);
                    }
                    else
                    {
                        newMappings.Add(new LipSyncMapItem(nodeName,-1));
                    }
                }

                _mapping.MapItems.Clear();
                
                int stringCount = 0;
                foreach (LipSyncMapItem mapItem in newMappings)
                {
                    mapItem.StringNum = stringCount++;
                    _mapping.MapItems.Add(mapItem);
                }

                reconfigureDataTable();
            }
			Refresh();
        }
Ejemplo n.º 4
0
        private void assignNodes()
        {
            BuildRowNameList();

            LipSyncNodeSelect nodeSelectDlg = new LipSyncNodeSelect();
            nodeSelectDlg.MaxNodes = _newMapping.MatrixStringCount * _newMapping.MatrixPixelsPerString;
            nodeSelectDlg.MatrixOptionsOnly = true;
            nodeSelectDlg.StringsAreRows = _newMapping.StringsAreRows;
            nodeSelectDlg.NodeNames = _rowNames;

            DialogResult dr = nodeSelectDlg.ShowDialog();
            if ((dr == DialogResult.OK) && (nodeSelectDlg.Changed == true))
            {
                List<LipSyncMapItem> newMappings = new List<LipSyncMapItem>();
                LipSyncMapItem tempMapItem = null;

                _newMapping.StringsAreRows = nodeSelectDlg.StringsAreRows;
                stringsAreRows = _newMapping.StringsAreRows;

                _rowNames.Clear();
                _rowNames.AddRange(nodeSelectDlg.NodeNames);

                foreach (string nodeName in nodeSelectDlg.NodeNames)
                {
                    tempMapItem = _newMapping.MapItems.Find(
                        delegate(LipSyncMapItem item)
                        {
                            return item.Name.Equals(nodeName);
                        });

                    if (tempMapItem != null)
                    {
                        newMappings.Add(tempMapItem);
                    }
                    else
                    {
                        newMappings.Add(new LipSyncMapItem(nodeName, -1));
                    }
                }

                _newMapping.MapItems.Clear();

                int stringCount = 0;
                foreach (LipSyncMapItem mapItem in newMappings)
                {
                    mapItem.StringNum = stringCount++;
                    _newMapping.MapItems.Add(mapItem);
                }

                _newMapping.StartNode =
                    (_newMapping.MapItems.Count != 0) ? _newMapping.MapItems[0].Name : "";

                reconfigureDataTable();
            }
        }