# HG changeset patch # User ARIAS Santiago # Date 1258641346 -3600 # Node ID 110067a19ec82880207a451b6145af303ea4e685 # Parent bbac5d25dbb205ef829bf09c0374bf8ee463e5d8# Parent 50e6fe2c2ea200a1af0b2e511b69466f303494a5 Merge diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance.Control.Menu/UserControlMenu.xaml.cs --- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs Thu Nov 19 15:35:46 2009 +0100 @@ -21,13 +21,23 @@ { public partial class UserControlMenu { + private String _menuXmlFile = "menu.xml"; + public UserControlMenu() { this.InitializeComponent(); + } - // Insert code required on object creation below this point. - initChildSize(); - } + public String MenuXmlFile + { + get { return _menuXmlFile; } + set + { + _menuXmlFile = value; + initChildSize(); + } + + } //Premet de deplacer les sous menus vers la droite pour avoir un effect tree view private void initChildSize() @@ -37,17 +47,18 @@ DirectoryInfo info = assemblyPath.Directory; try { - reader = new StreamReader(info.FullName.ToString() + "\\Resources\\menu.xml"); + reader = new StreamReader(info.FullName.ToString() + "\\Resources\\" + _menuXmlFile); XmlSerializer serializer = new XmlSerializer(typeof(Menu)); Menu temp = (Menu)serializer.Deserialize(reader); - foreach (Item elt in temp.Items) - try + foreach (Item elt in temp.Items) { - //SscrollViewer.Co - LayoutRoot.Children.Add(CreateMenuItem(elt)); + try + { + LayoutRoot.Children.Add(CreateMenuItem(elt)); + } + catch (Exception) { } } - catch (Exception) { } - reader.Close(); + reader.Close(); } catch (Exception e) { diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance.Control.Screen/UserControlScreen.xaml.cs --- a/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance.Control.Screen/UserControlScreen.xaml.cs Thu Nov 19 15:35:46 2009 +0100 @@ -22,7 +22,7 @@ public int id = 0; public event EventHandler UC_Screen_NewCutting; private MainViewModel _mainViewModel; - private String AnnotationOrSearchMode; + public String AnnotationOrSearchMode; public Cutting Cutting; private String videoName; @@ -175,11 +175,8 @@ loadedProject.Cuttings.Add(new Cutting(cuttingNode.Attribute("id").Value,cuttingNode.Element("title").Value,la)); } // We define the loaded project as the current session's project. - if (AnnotationOrSearchMode == "Annotation") - { - _mainViewModel.Project = new ProjectViewModel(loadedProject); - OpenProject(); - } + _mainViewModel.Project = new ProjectViewModel(loadedProject); + OpenProject(); } } catch (Exception) @@ -216,11 +213,20 @@ { try { - // We display the list of cuttings available for the current project - UserControlListCutting listCuttings = new UserControlListCutting(_mainViewModel.Project.CuttingsDict); - listCuttings.Name = "listCuttings"; - LayoutRoot.Children.Add(listCuttings); - listCuttings.EH_Item_ContactDown += new EventHandler(listCuttings_EH_Item_ContactDown); + if (AnnotationOrSearchMode == "Annotation") + { + // We display the list of cuttings available for the current project + UserControlListCutting listCuttings = new UserControlListCutting(_mainViewModel.Project.CuttingsDict); + listCuttings.Name = "listCuttings"; + LayoutRoot.Children.Add(listCuttings); + listCuttings.EH_Item_ContactDown += new EventHandler(listCuttings_EH_Item_ContactDown); + } + else + { + Cutting = null; + if (UC_Screen_NewCutting != null) + UC_Screen_NewCutting(this, new EventArgs()); + } } catch (Exception) { diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Thu Nov 19 15:35:46 2009 +0100 @@ -155,7 +155,8 @@ //cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), 100 - (3 * AnnotWidth), 20, "Saut 4")); //cut.AnnotList.Add(new Annotation("s_" + System.Guid.NewGuid(), 120 - (4 * AnnotWidth), 50, "Saut 5")); - tv.DataContext = new CuttingViewModel(cut, AnnotWidth); + if(cut!=null) + tv.DataContext = new CuttingViewModel(cut, AnnotWidth); } diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml --- a/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml Thu Nov 19 15:35:46 2009 +0100 @@ -24,7 +24,7 @@ - + \ No newline at end of file diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs --- a/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance.Control.UserPanel/UserControlUserPanel.xaml.cs Thu Nov 19 15:35:46 2009 +0100 @@ -51,13 +51,16 @@ // Insert code required on object creation below this point. } - public UserControlUserPanel(int idPar, Color col, Cutting cutPar, string path) + public UserControlUserPanel(int idPar, Color col, Cutting cutPar, String path, String AnnotationOrSearchMode) { this.InitializeComponent(); id = idPar; cut = cutPar; + // We make the syncsrc load the good video and cutting this.UserControlSyncSource.Load(path, col, cut); - UserControlSyncSource.OnSuccessAnnotation+=new EventHandler(UserControlSyncSource_OnSuccessAnnotation); + UserControlSyncSource.OnSuccessAnnotation += new EventHandler(UserControlSyncSource_OnSuccessAnnotation); + // We make the menu load the good xml + UCMenu.MenuXmlFile = (AnnotationOrSearchMode == "Search") ? "menu_search.xml" : "menu.xml"; //SAR -Initialize Tag Values InitializeDefinitions(); } diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance/FingersDance.csproj --- a/src/FingersDance/FingersDance.csproj Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance/FingersDance.csproj Thu Nov 19 15:35:46 2009 +0100 @@ -122,6 +122,9 @@ Always + + Always + PreserveNewest diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance/MainSurfaceWindow.xaml.cs --- a/src/FingersDance/MainSurfaceWindow.xaml.cs Thu Nov 19 15:32:13 2009 +0100 +++ b/src/FingersDance/MainSurfaceWindow.xaml.cs Thu Nov 19 15:35:46 2009 +0100 @@ -407,31 +407,34 @@ Grid root = (Grid)(((UserControlScreen)sender).Parent); // We remove the UserControlScreen's instance root.Children.Remove(((UserControlScreen)sender)); - - if (((UserControlScreen)sender).Cutting != null) + + if ((((UserControlScreen)sender).Cutting != null && ((UserControlScreen)sender).AnnotationOrSearchMode == "Annotation") || (((UserControlScreen)sender).AnnotationOrSearchMode == "Search")) { //2-Creation du User Panel Cutting newCutting = ((UserControlScreen)sender).Cutting; // We test if each Panel does not already own the sent cuttingVM - if (Panel1 != null) - if (Panel1.Cutting.Title==newCutting.Title) - return; - if (Panel2 != null) - if (Panel2.Cutting.Title == newCutting.Title) - return; - if (Panel3 != null) - if (Panel3.Cutting.Title == newCutting.Title) - return; - if (Panel4 != null) - if (Panel4.Cutting.Title == newCutting.Title) - return; + if (((UserControlScreen)sender).Cutting != null && ((UserControlScreen)sender).AnnotationOrSearchMode == "Annotation") + { + if (Panel1 != null) + if (Panel1.Cutting.Title==newCutting.Title) + return; + if (Panel2 != null) + if (Panel2.Cutting.Title == newCutting.Title) + return; + if (Panel3 != null) + if (Panel3.Cutting.Title == newCutting.Title) + return; + if (Panel4 != null) + if (Panel4.Cutting.Title == newCutting.Title) + return; - // We add the new cutting to the _mainviewmodel's datas IF THE CUTTING IS NEW (if not it means that it is from a loaded project) - if (!_mainviewmodel.Project.CuttingsDict.ContainsKey(newCutting.Title)) - { - _mainviewmodel.Project.Cuttings.Add(newCutting); - _mainviewmodel.Project.CuttingsDict.Add(newCutting.Title, newCutting); + // We add the new cutting to the _mainviewmodel's datas IF THE CUTTING IS NEW (if not it means that it is from a loaded project) + if (!_mainviewmodel.Project.CuttingsDict.ContainsKey(newCutting.Title)) + { + _mainviewmodel.Project.Cuttings.Add(newCutting); + _mainviewmodel.Project.CuttingsDict.Add(newCutting.Title, newCutting); + } } // And now we build the new UserPanel @@ -441,7 +444,7 @@ { case 1: UserControlPivot.ApplyColor(1, color); - Panel1 = new UserControlUserPanel(1, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath); + Panel1 = new UserControlUserPanel(1, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode); Panel1.Name = "UserPanel1"; Panel1.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation); Panel1.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation); @@ -451,7 +454,7 @@ break; case 2: UserControlPivot.ApplyColor(2, color); - Panel2 = new UserControlUserPanel(2, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath); + Panel2 = new UserControlUserPanel(2, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode); Panel2.Name = "UserPanel2"; Panel2.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation); Panel2.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation); @@ -461,7 +464,7 @@ break; case 3: UserControlPivot.ApplyColor(3, color); - Panel3 = new UserControlUserPanel(3, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath); + Panel3 = new UserControlUserPanel(3, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode); Panel3.Name = "UserPanel3"; Panel3.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation); Panel3.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation); @@ -471,7 +474,7 @@ break; case 4: UserControlPivot.ApplyColor(4, color); - Panel4 = new UserControlUserPanel(4, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath); + Panel4 = new UserControlUserPanel(4, (new ColorFactory()).Colors[color], newCutting, _mainviewmodel.Project.VideoPath, ((UserControlScreen)sender).AnnotationOrSearchMode); Panel4.Name = "UserPanel4"; Panel4.OnSuccessAnnotation += new EventHandler(Panel_OnSuccessAnnotation); Panel4.OnTagVisualisation += new EventHandler(Panel_OnTagVisualisation); @@ -521,7 +524,7 @@ } - //On success annotation Display annotations in the different Panels + //On success annotation we save the update datas private void Panel_OnSuccessAnnotation(object sender, EventArgs e) { // We save datas diff -r bbac5d25dbb2 -r 110067a19ec8 src/FingersDance/Resources/menu_search.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance/Resources/menu_search.xml Thu Nov 19 15:35:46 2009 +0100 @@ -0,0 +1,375 @@ + + + + + + Recherche + + + Chorégraphique + + + 1 DANSEUR + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + 2 DANSEURS + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + 3 DANSEURS + + 1 danceur + ActionSearchAnnotation + + + TOUS LES DANSEURS + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + TRIGGER + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + AVEC PESANTEUR + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + CONTRE PESANTEUR + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + ALIGNEMENT + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + CONTACT VISUEL + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + MOUVEMENT CONTRAINTE + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + CONTACT TABLE-DANSEUR + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + FingersDanceAnnotationButtonNiveau2 + Annotation + + + Cinématographique + + + MVT IMAGE AVANT + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + MVT IMAGE ARRIERE + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + TRAVELLING HAUT + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + TRAVELLING BAS + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + TRAVELLING GAUCHE + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + TRAVELLING DROITE + + FingersDanceAnnotationButtonNiveau4 + ActionSearchAnnotation + + + FingersDanceAnnotationButtonNiveau2 + Annotation + + + FingersDanceAnnotationButtonNiveau1 + + + + \ No newline at end of file