Example #1
0
        private void PopulateListWithMappings()
        {
            mappingsListView.BeginUpdate();
            mappingsListView.Items.Clear();

            mappingsListView.LargeImageList = new ImageList();

            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c    = kvp.Value;
                string         name = kvp.Key;

                ListViewItem item = new ListViewItem();
                item.Text     = name;
                item.Name     = name;
                item.ImageKey = name;
                item.Tag      = c;
                if (Library.DefaultMapping != null && Library.DefaultMappingName.Equals(name))
                {
                    item.Font = new Font(item.Font, FontStyle.Bold);
                }

                mappingsListView.Items.Add(item);
            }

            if (!Library.Any())
            {
                SetWidths();
            }

            mappingsListView.EndUpdate();

            UpdateListViewCtrl();
        }
Example #2
0
        public override IModuleDataModel Clone()
        {
            LipSyncMapData newInstance = new LipSyncMapData();

            newInstance.MapItems = new List <LipSyncMapItem>();

            foreach (LipSyncMapItem item in MapItems)
            {
                newInstance.MapItems.Add(item.Clone());
            }
            newInstance.StringCount          = StringCount;
            newInstance.LibraryReferenceName = LibraryReferenceName;
            newInstance.IsDefaultMapping     = false;
            newInstance.StartNode            = StartNode;
            newInstance.StringsAreRows       = StringsAreRows;
            newInstance.GroupsAllowed        = GroupsAllowed;
            newInstance.RecursionAllowed     = RecursionAllowed;
            newInstance.IsMatrix             = IsMatrix;
            newInstance.Notes         = Notes;
            newInstance.UsingDefaults = UsingDefaults;

            //Deprecated Variables
            newInstance.MatrixPixelsPerString = MatrixPixelsPerString;
            newInstance.MatrixStringCount     = MatrixStringCount;
            newInstance.ZoomLevel             = ZoomLevel;

            return(newInstance);
        }
Example #3
0
        private void PopulateListWithMappings()
        {
            listViewMappings.BeginUpdate();
            listViewMappings.Items.Clear();

            listViewMappings.LargeImageList = new ImageList();

            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c    = kvp.Value;
                string         name = kvp.Key;

                listViewMappings.LargeImageList.ImageSize = new Size(64, 64);
                listViewMappings.LargeImageList.Images.Add(name, _iconBitmap);

                ListViewItem item = new ListViewItem();
                item.Text     = name;
                item.Name     = name;
                item.ImageKey = name;
                item.Tag      = c;
                if (_library.DefaultMappingName.Equals(name))
                {
                    item.Font = new Font(item.Font, FontStyle.Bold);
                }

                listViewMappings.Items.Add(item);
            }
            listViewMappings.EndUpdate();

            buttonNewMap.Enabled    = true;
            buttonEditMap.Enabled   = false;
            buttonDeleteMap.Enabled = false;
            buttonCloneMap.Enabled  = false;
        }
Example #4
0
        private void UpdateListViewCtrl()
        {
            mappingsListView.Columns.Clear();
            mappingsListView.Columns.Add("Name");
            //mappingsListView.Columns.Add("Type");
            mappingsListView.Columns.Add("Notes");

            mappingsListView.Items.Clear();
            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c = kvp.Value;

                ListViewItem lvi = new ListViewItem();
                lvi.Tag  = kvp.Value;
                lvi.Text = kvp.Key;
                lvi.Name = kvp.Key;

                ListViewItem.ListViewSubItem subItemNotes = new ListViewItem.ListViewSubItem(lvi, "Notes");
                subItemNotes.Name = @"Notes";
                subItemNotes.Text = kvp.Value.Notes;

                //lvi.SubItems.Add(subItemType);
                lvi.SubItems.Add(subItemNotes);
                mappingsListView.Items.Add(lvi);
            }


            SetWidths();
        }
Example #5
0
        private void buttonNewMap_Click(object sender, EventArgs e)
        {
            LipSyncMapData newMap  = new LipSyncMapData();
            string         mapName = Library.AddMapping(true, null, newMap, true);

            Changed = Library.EditLibraryMapping(mapName);
            this.PopulateListWithMappings();
        }
Example #6
0
 public LipSyncMapEditor(LipSyncMapData mapData)
 {
     InitializeComponent();
     _doMatrixUpdate = false;
     LoadResourceBitmaps();
     this.MapData    = mapData;
     _doMatrixUpdate = true;
 }
Example #7
0
 public LipSyncMapEditor(LipSyncMapData mapData)
 {
     InitializeComponent();
     _doMatrixUpdate = false;
     LoadResourceBitmaps();
     this.MapData = mapData;
     _doMatrixUpdate = true;
 }
Example #8
0
        private void UpdateListViewCtrl()
        {
            mappingsListView.Columns.Clear();
            mappingsListView.Columns.Add("Name");
            mappingsListView.Columns.Add("Type");
            mappingsListView.Columns.Add("Notes");

            mappingsListView.Items.Clear();
            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c = kvp.Value;

                ListViewItem lvi = new ListViewItem();
                lvi.Tag  = kvp.Value;
                lvi.Text = kvp.Key;
                lvi.Name = kvp.Key;

                ListViewItem.ListViewSubItem subItemType = new ListViewItem.ListViewSubItem(lvi, "Type");
                subItemType.Name = "Type";

                if (kvp.Value.IsMatrix)
                {
                    subItemType.Text = "Picture";
                }
                else
                {
                    subItemType.Text = "String";
                }

                ListViewItem.ListViewSubItem subItemNotes = new ListViewItem.ListViewSubItem(lvi, "Notes");
                subItemNotes.Name = "Notes";
                subItemNotes.Text = kvp.Value.Notes;

                lvi.SubItems.Add(subItemType);
                lvi.SubItems.Add(subItemNotes);
                mappingsListView.Items.Add(lvi);
            }

            int totalSize = mappingsListView.Columns.Count + 1;

            foreach (ColumnHeader column in mappingsListView.Columns)
            {
                column.Width = -1;
                if (!column.Text.Equals("Notes"))
                {
                    totalSize += column.Width;
                }
                else
                {
                    int proposedViewSize = column.Width + totalSize;
                    if (proposedViewSize <= mappingsListView.Width)
                    {
                        column.Width = mappingsListView.Width - totalSize;
                    }
                }
            }
        }
Example #9
0
 public LipSyncMapData(LipSyncMapData mapSetup)
 {
     IsCurrentLibraryMapping = mapSetup.IsCurrentLibraryMapping;
     LibraryReferenceName    = (string)mapSetup.LibraryReferenceName.Clone();
     IsDefaultMapping        = mapSetup.IsDefaultMapping;
     IsMatrix      = mapSetup.IsMatrix;
     Notes         = mapSetup.Notes;
     UsingDefaults = mapSetup.UsingDefaults;
 }
Example #10
0
 public LipSyncMapMatrixEditor(LipSyncMapData mapData)
 {
     InitializeComponent();
     LoadResourceBitmaps();
     dataTables = new Dictionary<PhonemeType, DataTable>();
     this.MapData = (LipSyncMapData)mapData.Clone();
     stringsAreRows = mapData.StringsAreRows;
     startMapIndex = -1;
     zoomSteps = mapData.ZoomLevel;
 }
Example #11
0
 private void buttonCloneMap_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem lvItem in listViewMappings.SelectedItems)
     {
         LipSyncMapData tempItem = new LipSyncMapData(_library.GetMapping(lvItem.Name));
         string         mapName  = _library.AddMapping(true, lvItem.Name, tempItem, tempItem.IsMatrix);
         this.PopulateListWithMappings();
         Changed = true;
     }
 }
Example #12
0
 public LipSyncMapMatrixEditor(LipSyncMapData mapData)
 {
     InitializeComponent();
     LoadResourceBitmaps();
     dataTables     = new Dictionary <PhonemeType, DataTable>();
     this.MapData   = (LipSyncMapData)mapData.Clone();
     stringsAreRows = mapData.StringsAreRows;
     startMapIndex  = -1;
     zoomSteps      = mapData.ZoomLevel;
 }
Example #13
0
        private void PopulateListWithMappings()
        {
            listViewMappings.BeginUpdate();
            listViewMappings.Items.Clear();

            listViewMappings.LargeImageList = new ImageList();

            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c    = kvp.Value;
                string         name = kvp.Key;

                listViewMappings.LargeImageList.ImageSize = new Size(64, 64);
                listViewMappings.LargeImageList.Images.Add(name, _iconBitmap);

                ListViewItem item = new ListViewItem();
                item.Text     = name;
                item.Name     = name;
                item.ImageKey = name;
                item.Tag      = c;
                if (_library.DefaultMappingName.Equals(name))
                {
                    item.Font = new Font(item.Font, FontStyle.Bold);
                }

                listViewMappings.Items.Add(item);
            }
            listViewMappings.EndUpdate();

            //listViewMappings.LargeImageList = new ImageList { ColorDepth = ColorDepth.Depth32Bit, ImageSize = new Size(68, 68) };

            //foreach (KeyValuePair<string, LipSyncMapData> kvp in Library)
            //{
            //	LipSyncMapData c = kvp.Value;
            //	string name = kvp.Key;

            //	var image = c.cGenerateGenericCurveImage(new Size(68, 68));
            //	Graphics gfx = Graphics.FromImage(image);
            //	gfx.VixenModules.App.Curves.DrawRectangle(new Pen(Color.FromArgb(136, 136, 136), 2), 0, 0, 68, 68);

            //	listViewMappings.LargeImageList.Images.Add(name, image);

            //	ListViewItem item = new ListViewItem { Text = name, Name = name, ImageKey = name, Tag = c };
            //	item.ForeColor = DarkThemeColorTable.ForeColor;
            //	listViewMappings.Items.Add(item);
            //}

            //listViewMappings.EndUpdate();

            buttonNewMap.Enabled    = true;
            buttonEditMap.Enabled   = false;
            buttonDeleteMap.Enabled = false;
            buttonCloneMap.Enabled  = false;
        }
Example #14
0
        private void newContextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            LipSyncMapData newMap  = new LipSyncMapData();
            string         mapName = Library.AddMapping(
                true,
                null,
                newMap,
                Convert.ToBoolean(e.ClickedItem.Tag));

            Changed = Library.EditLibraryMapping(mapName);
            this.PopulateListWithMappings();
        }
Example #15
0
        public override IModuleDataModel Clone()
        {
            LipSyncMapData newInstance = new LipSyncMapData();

            newInstance.LibraryReferenceName = LibraryReferenceName;
            newInstance.IsDefaultMapping     = false;
            newInstance.IsMatrix             = IsMatrix;
            newInstance.Notes         = Notes;
            newInstance.UsingDefaults = UsingDefaults;

            return(newInstance);
        }
Example #16
0
 public LipSyncMapEditor(LipSyncMapData mapData)
 {
     InitializeComponent();
     ForeColor = ThemeColorTable.ForeColor;
     BackColor = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
     dataGridView1.DefaultCellStyle.ForeColor = Color.Black;
     Icon            = Resources.Icon_Vixen3;
     _doMatrixUpdate = false;
     LoadResourceBitmaps();
     this.MapData    = mapData;
     _doMatrixUpdate = true;
 }
Example #17
0
        public LipSyncMapEditor(LipSyncMapData mapData)
        {
			InitializeComponent();
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
			dataGridView1.DefaultCellStyle.ForeColor = Color.Black;
			Icon = Resources.Icon_Vixen3;
            _doMatrixUpdate = false;
            LoadResourceBitmaps();
            this.MapData = mapData;
            _doMatrixUpdate = true;
        }
Example #18
0
 public LipSyncMapData(LipSyncMapData data)
 {
     MapItems = new List<LipSyncMapItem>(data.MapItems);
     IsCurrentLibraryMapping = data.IsCurrentLibraryMapping;
     LibraryReferenceName = (string)data.LibraryReferenceName.Clone();
     IsDefaultMapping = data.IsDefaultMapping;
     StringCount = data.StringCount;
     MatrixStringCount = data.MatrixStringCount;
     MatrixPixelsPerString = data.MatrixPixelsPerString;
     IsMatrix = data.IsMatrix;
     StartNode = data.StartNode;
     ZoomLevel = data.ZoomLevel;
     StringsAreRows = data.StringsAreRows;
 }
Example #19
0
 public LipSyncMapData(LipSyncMapData data)
 {
     MapItems = new List <LipSyncMapItem>(data.MapItems);
     IsCurrentLibraryMapping = data.IsCurrentLibraryMapping;
     LibraryReferenceName    = (string)data.LibraryReferenceName.Clone();
     IsDefaultMapping        = data.IsDefaultMapping;
     StringCount             = data.StringCount;
     MatrixStringCount       = data.MatrixStringCount;
     MatrixPixelsPerString   = data.MatrixPixelsPerString;
     IsMatrix       = data.IsMatrix;
     StartNode      = data.StartNode;
     ZoomLevel      = data.ZoomLevel;
     StringsAreRows = data.StringsAreRows;
 }
Example #20
0
 public LipSyncMapData(LipSyncMapData mapSetup)
 {
     MapItems = new List <LipSyncMapItem>(mapSetup.MapItems);
     IsCurrentLibraryMapping = mapSetup.IsCurrentLibraryMapping;
     LibraryReferenceName    = (string)mapSetup.LibraryReferenceName.Clone();
     IsDefaultMapping        = mapSetup.IsDefaultMapping;
     StringCount             = mapSetup.StringCount;
     StartNode        = mapSetup.StartNode;
     StringsAreRows   = mapSetup.StringsAreRows;
     GroupsAllowed    = mapSetup.GroupsAllowed;
     RecursionAllowed = mapSetup.RecursionAllowed;
     IsMatrix         = mapSetup.IsMatrix;
     Notes            = mapSetup.Notes;
     UsingDefaults    = mapSetup.UsingDefaults;
 }
Example #21
0
        private DataTable BuildDialogFromMap(LipSyncMapData data)
        {
            nameTextBox.Text  = data.LibraryReferenceName;
            notesTextBox.Text = data.Notes;

            DataTable dt = new DataTable(nameTextBox.Text);

            dt.Columns.Add(" ", typeof(string));

            foreach (string key in _phonemeBitmaps.Keys)
            {
                dt.Columns.Add(key, typeof(System.Boolean));
            }

            dt.Columns.Add(COLOR_COLUMN_NAME, typeof(Color));

            bool result = false;

            foreach (LipSyncMapItem lsbItem in data.MapItems)
            {
                DataRow dr = dt.Rows.Add();
                dr[0] = lsbItem.Name;
                ElementNode tempNode = VixenSystem.Nodes.GetElementNode(lsbItem.ElementGuid);
                if (tempNode != null)
                {
                    dr[0] = (tempNode.Element == null) ? tempNode.Name : tempNode.Element.Name;
                }

                foreach (string key in _phonemeBitmaps.Keys)
                {
                    if (lsbItem.PhonemeList.TryGetValue(key, out result) == true)
                    {
                        dr[key] = result;
                    }
                    else
                    {
                        dr[key] = false;
                    }
                }
                dr[COLOR_COLUMN_NAME] = lsbItem.ElementColor;
            }

            dt.Columns[" "].ReadOnly = true;
            dt.Columns[COLOR_COLUMN_NAME].ReadOnly = true;

            return(dt);
        }
Example #22
0
        private void UpdateListViewCtrl()
        {
            mappingsListView.Columns.Clear();
            mappingsListView.Columns.Add("Name");
            //mappingsListView.Columns.Add("Type");
            mappingsListView.Columns.Add("Notes");

            mappingsListView.Items.Clear();
            foreach (KeyValuePair <string, LipSyncMapData> kvp in Library)
            {
                LipSyncMapData c = kvp.Value;

                ListViewItem lvi = new ListViewItem();
                lvi.Tag  = kvp.Value;
                lvi.Text = kvp.Key;
                lvi.Name = kvp.Key;

                ListViewItem.ListViewSubItem subItemNotes = new ListViewItem.ListViewSubItem(lvi, "Notes");
                subItemNotes.Name = @"Notes";
                subItemNotes.Text = kvp.Value.Notes;

                //lvi.SubItems.Add(subItemType);
                lvi.SubItems.Add(subItemNotes);
                mappingsListView.Items.Add(lvi);
            }

            if (!Library.Any())
            {
                SetWidths();
            }
            else
            {
                int totalSize = mappingsListView.Columns.Count + 1;
                foreach (ColumnHeader column in mappingsListView.Columns)
                {
                    if (column.Index != mappingsListView.Columns.Count - 1)
                    {
                        column.Width = -1;
                    }
                    else
                    {
                        column.Width = -2;
                    }
                }
            }
        }
Example #23
0
        public LipSyncMapMatrixEditor(LipSyncMapData mapData)
        {
			Location = ActiveForm != null ? new Point(ActiveForm.Location.X - 150, ActiveForm.Location.Y - 100) : new Point(200, 100);
			InitializeComponent();
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
			lipSyncMapColorCtrl1.BackColor = BackColor = ThemeColorTable.BackgroundColor;
			lipSyncMapColorCtrl1.panelColor.BackColor = Color.White;
	        zoomTrackbar.BackColor = ThemeColorTable.BackgroundColor;
			Icon = Resources.Icon_Vixen3;
            LoadResourceBitmaps();
            dataTables = new Dictionary<PhonemeType, DataTable>();
            this.MapData = (LipSyncMapData)mapData.Clone();
            stringsAreRows = mapData.StringsAreRows;
            startMapIndex = -1;
            zoomSteps = mapData.ZoomLevel;
        }
Example #24
0
        private DataTable BuildDialogFromMap(LipSyncMapData data)
        {
            nameTextBox.Text = data.LibraryReferenceName;

            DataTable dt = new DataTable(nameTextBox.Text);
            dt.Columns.Add(" ", typeof(string));

            foreach (string key in _phonemeBitmaps.Keys)
            {
                dt.Columns.Add(key, typeof(System.Boolean));
            }

            dt.Columns.Add(COLOR_COLUMN_NAME, typeof(Color));
            
            bool result = false;
            foreach (LipSyncMapItem lsbItem in data.MapItems)
            {
                DataRow dr = dt.Rows.Add();
                dr[0] = lsbItem.Name;
                ElementNode tempNode = VixenSystem.Nodes.GetElementNode(lsbItem.ElementGuid);
                if (tempNode != null)
                {
                    dr[0] = (tempNode.Element == null) ? tempNode.Name : tempNode.Element.Name;
                }

                foreach (string key in _phonemeBitmaps.Keys)
                {
                    if (lsbItem.PhonemeList.TryGetValue(key, out result) == true)
                    {
                        dr[key] = result;
                    }
                    else
                    {
                        dr[key] = false;
                    }
                }
                dr[COLOR_COLUMN_NAME] = lsbItem.ElementColor;
            }

            dt.Columns[" "].ReadOnly = true;
            dt.Columns[COLOR_COLUMN_NAME].ReadOnly = true;

            return dt;
        }
Example #25
0
        public LipSyncMapMatrixEditor(LipSyncMapData mapData)
        {
            Location = ActiveForm != null ? new Point(ActiveForm.Location.X - 150, ActiveForm.Location.Y - 100) : new Point(200, 100);
            InitializeComponent();
            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            Icon         = Resources.Icon_Vixen3;
            this.MapData = (LipSyncMapData)mapData.Clone();
            renderedPicture.MinimumSize = new Size(MIN_PICTUREBOX_WIDTH, MIN_PICTUREBOX_HEIGHT);
            renderedPicture.MaximumSize = new Size(MAX_PICTUREBOX_WIDTH, MAX_PICTUREBOX_HEIGHT);
            renderedPicture.SizeMode    = PictureBoxSizeMode.CenterImage;
            FormBorderStyle             = FormBorderStyle.FixedDialog;
            SizeGripStyle = SizeGripStyle.Hide;

            _moduleDirPath  = Paths.ModuleDataFilesPath + "\\LipSync";
            _pictureBitmaps = new Dictionary <string, Bitmap>();
            LoadIconsAndBitmaps();
        }
Example #26
0
        private void buttonNewMap_Click(object sender, EventArgs e)
        {
            LipSyncNewMapType newMapTypeselector = new LipSyncNewMapType();
            DialogResult      dr = newMapTypeselector.ShowDialog();

            if (dr == DialogResult.OK)
            {
                LipSyncMapData newMap = new LipSyncMapData();
                newMap.MatrixStringCount     = newMapTypeselector.StringCount;
                newMap.MatrixPixelsPerString = newMapTypeselector.PixelsPerString;
                string mapName = _library.AddMapping(
                    true,
                    null,
                    newMap,
                    newMapTypeselector.matrixMappingRadio.Checked);

                Changed = Library.EditLibraryMapping(mapName);
                this.PopulateListWithMappings();
            }
        }
Example #27
0
        public override IModuleDataModel Clone()
        {
            LipSyncMapData newInstance = new LipSyncMapData();
            newInstance.MapItems = new List<LipSyncMapItem>();

            foreach (LipSyncMapItem item in MapItems)
            {
                newInstance.MapItems.Add(item.Clone());
            }
            newInstance.StringCount = StringCount;
            newInstance.LibraryReferenceName = LibraryReferenceName;
            newInstance.IsDefaultMapping = false;
            newInstance.IsMatrix = IsMatrix;
            newInstance.MatrixPixelsPerString = MatrixPixelsPerString;
            newInstance.MatrixStringCount = MatrixStringCount;
            newInstance.StartNode = StartNode;
            newInstance.ZoomLevel = ZoomLevel;
            newInstance.StringsAreRows = StringsAreRows;

            return newInstance;
        }
Example #28
0
        public override IModuleDataModel Clone()
        {
            LipSyncMapData newInstance = new LipSyncMapData();

            newInstance.MapItems = new List <LipSyncMapItem>();

            foreach (LipSyncMapItem item in MapItems)
            {
                newInstance.MapItems.Add(item.Clone());
            }
            newInstance.StringCount           = StringCount;
            newInstance.LibraryReferenceName  = LibraryReferenceName;
            newInstance.IsDefaultMapping      = false;
            newInstance.IsMatrix              = IsMatrix;
            newInstance.MatrixPixelsPerString = MatrixPixelsPerString;
            newInstance.MatrixStringCount     = MatrixStringCount;
            newInstance.StartNode             = StartNode;
            newInstance.ZoomLevel             = ZoomLevel;
            newInstance.StringsAreRows        = StringsAreRows;

            return(newInstance);
        }
Example #29
0
        private DataTable BuildDialogFromMap(LipSyncMapData data)
        {
            nameTextBox.Text = data.LibraryReferenceName;

            stringCount        = _newMapping.MatrixStringCount;
            pixelCount         = _newMapping.MatrixPixelsPerString;
            zoomTrackbar.Value = _newMapping.ZoomLevel;

            DataTable dt   = BuildBlankTable();
            int       cols = CalcNumDataGridCols;
            int       rows = CalcNumDataGridRows;

            LipSyncMapItem mapItem = null;

            DataRow dr;

            for (int row = 0; row < rows; row++)
            {
                dr = dt.Rows[row];
                for (int col = 0; col < cols; col++)
                {
                    mapItem = FindRenderMapItem(row, col);


                    if (mapItem != null)
                    {
                        dr[col] =
                            (mapItem.ElementColors.ContainsKey(phonemeArray[currentPhonemeIndex]) == false) ?
                            Color.Black : mapItem.ElementColors[phonemeArray[currentPhonemeIndex]];
                    }
                    else
                    {
                        dr[col] = Color.Gray;
                    }
                }
            }

            return(dt);
        }
Example #30
0
        private DataTable BuildDialogFromMap(LipSyncMapData data)
        {
            nameTextBox.Text = data.LibraryReferenceName;

            stringCount = _newMapping.MatrixStringCount;
            pixelCount = _newMapping.MatrixPixelsPerString;
            zoomTrackbar.Value = _newMapping.ZoomLevel;

            DataTable dt = BuildBlankTable();
            int cols = CalcNumDataGridCols;
            int rows = CalcNumDataGridRows;

            LipSyncMapItem mapItem = null;

            DataRow dr;
            for (int row = 0; row < rows; row++)
            {
                dr = dt.Rows[row];
                for (int col = 0; col < cols; col++)
                {
                    mapItem = FindRenderMapItem(row,col);
                    

                    if (mapItem != null)
                    {
                        dr[col] =
                            (mapItem.ElementColors.ContainsKey(phonemeArray[currentPhonemeIndex]) == false) ?
                                Color.Black : mapItem.ElementColors[phonemeArray[currentPhonemeIndex]];
                    }
                    else
                    {
                        dr[col] = Color.Gray;
                    }
                }
            }

            return dt;
        }
Example #31
0
        private void buttonCloneMap_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem lvItem in listViewMappings.SelectedItems)
            {
                LipSyncMapData tempItem = new LipSyncMapData(_library.GetMapping(lvItem.Name));
                string mapName = _library.AddMapping(true, lvItem.Name, tempItem, tempItem.IsMatrix);
                this.PopulateListWithMappings();
                Changed = true;
            }

        }
Example #32
0
        private void buttonNewMap_Click(object sender, EventArgs e)
        {
            LipSyncNewMapType newMapTypeselector = new LipSyncNewMapType();
            DialogResult dr = newMapTypeselector.ShowDialog();
            if (dr == DialogResult.OK)
            {
                LipSyncMapData newMap = new LipSyncMapData();
                newMap.MatrixStringCount = newMapTypeselector.StringCount;
                newMap.MatrixPixelsPerString = newMapTypeselector.PixelsPerString;
                string mapName = _library.AddMapping(
                    true, 
                    null, 
                    newMap,
                    newMapTypeselector.matrixMappingRadio.Checked);
                
                Changed = Library.EditLibraryMapping(mapName);
                this.PopulateListWithMappings();
            }

			Refresh();
        }