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(); }
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); }
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; }
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(); }
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(); }
public LipSyncMapEditor(LipSyncMapData mapData) { InitializeComponent(); _doMatrixUpdate = false; LoadResourceBitmaps(); this.MapData = mapData; _doMatrixUpdate = true; }
public LipSyncMapEditor(LipSyncMapData mapData) { InitializeComponent(); _doMatrixUpdate = false; LoadResourceBitmaps(); this.MapData = mapData; _doMatrixUpdate = true; }
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; } } } }
public LipSyncMapData(LipSyncMapData mapSetup) { IsCurrentLibraryMapping = mapSetup.IsCurrentLibraryMapping; LibraryReferenceName = (string)mapSetup.LibraryReferenceName.Clone(); IsDefaultMapping = mapSetup.IsDefaultMapping; IsMatrix = mapSetup.IsMatrix; Notes = mapSetup.Notes; UsingDefaults = mapSetup.UsingDefaults; }
public LipSyncMapMatrixEditor(LipSyncMapData mapData) { InitializeComponent(); LoadResourceBitmaps(); dataTables = new Dictionary<PhonemeType, DataTable>(); this.MapData = (LipSyncMapData)mapData.Clone(); stringsAreRows = mapData.StringsAreRows; startMapIndex = -1; zoomSteps = mapData.ZoomLevel; }
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; } }
public LipSyncMapMatrixEditor(LipSyncMapData mapData) { InitializeComponent(); LoadResourceBitmaps(); dataTables = new Dictionary <PhonemeType, DataTable>(); this.MapData = (LipSyncMapData)mapData.Clone(); stringsAreRows = mapData.StringsAreRows; startMapIndex = -1; zoomSteps = mapData.ZoomLevel; }
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; }
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(); }
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); }
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; }
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; }
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; }
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; }
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; }
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); }
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; } } } }
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; }
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; }
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(); }
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(); } }
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; }
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); }
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); }
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; }
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; } }
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(); }