# HG changeset patch # User totetm <> # Date 1264585059 -3600 # Node ID b6df6fce6e5dd8c03d3fabf46d46182e25e932a7 # Parent 43bb1b8ed5552b6eb9c2ee9be92a2c623ba8918b Sync init XML download. ProductionVideo from URI source diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs --- a/client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/Converter/PolemicTypeColorConverter.cs Wed Jan 27 10:37:39 2010 +0100 @@ -22,55 +22,9 @@ public static Brush Convert(object value) { SolidColorBrush returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); - if (value is PolemicElementType) - { - PolemicElementType dt = (PolemicElementType)value; - - switch (dt) - { - case PolemicElementType.Basic: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); - break; - case PolemicElementType.Polemic: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 0, B = 0 }); - break; - case PolemicElementType.Adhesion: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 255, B = 0 }); - break; - case PolemicElementType.Reference: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0, G = 0, B = 255 }); - break; - case PolemicElementType.Question: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 0 }); - break; - default: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 255, G = 255, B = 255 }); - break; - } - - } - else if(value is VideoChapterType) - { - VideoChapterType dt = (VideoChapterType)value; - switch (dt) - { - case VideoChapterType.Modernite: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xBF, G = 0xA8, B = 0x4E }); - break; - case VideoChapterType.Modernisation: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xD6, G = 0xA3, B = 0x82 }); - break; - case VideoChapterType.Postmodernite: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0xB5, G = 0xCB, B = 0x29 }); - break; - case VideoChapterType.Ouverture: - returnBrush = new SolidColorBrush(new Color() { A = 255, R = 0x5B, G = 0xCC, B = 0x5B }); - break; - default: - break; - } + - } + return returnBrush; } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/View/AnnotationMaker/AnnotationMaker.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/AnnotationMaker/AnnotationMaker.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/AnnotationMaker/AnnotationMaker.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -14,12 +14,9 @@ { public AnnotationMaker() { - // Required to initialize variables + InitializeComponent(); - //RectPolemic.Resources.Add("PolemicType", PolemicElementType.Polemic); - //RectAdhesion.Resources.Add("PolemicType", PolemicElementType.Adhesion); - //RectQuestion.Resources.Add("PolemicType", PolemicElementType.Question); - //RectReferences.Resources.Add("PolemicType", PolemicElementType.Reference); + } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/View/ClickMenu/ClickMenuPanelContextualiser.xaml --- a/client/src/Iri.Modernisation.Controls/View/ClickMenu/ClickMenuPanelContextualiser.xaml Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/ClickMenu/ClickMenuPanelContextualiser.xaml Wed Jan 27 10:37:39 2010 +0100 @@ -12,7 +12,7 @@ - + diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/View/ConsultationBookView/ConsultationBookView.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/ConsultationBookView/ConsultationBookView.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/ConsultationBookView/ConsultationBookView.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -17,7 +17,7 @@ { // Required to initialize variables InitializeComponent(); - // VideoViewer.DataContext = new VideoViewerVM(); + // VideoViewer.DataContext = new VideoViewerVM(); Commands.TimeChange.Executed += new EventHandler(TimeChange_Executed); } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProduction.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProduction.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/HeaderProduction/HeaderProduction.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -20,256 +20,21 @@ // Required to initialize variables InitializeComponent(); - /* ModernisationEditionController.Active(); - - ModernisationEditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; - ModernisationIndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel; - - ModerniteEditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; - ModerniteIndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel; - - - PostModerniteEditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; - PostModerniteIndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel; - - - OuvertureEditionController.Text = Iri.Modernisation.Lang.LangResource.EditingLabel; - OuvertureIndexController.Text = Iri.Modernisation.Lang.LangResource.IndexingLabel;*/ - - /////////////////////////-- - /*ModernisationEditionController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - ModernisationIndexController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - - ModerniteEditionController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - ModerniteIndexController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - - PostModerniteEditionController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - PostModerniteIndexController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - - OuvertureEditionController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - OuvertureIndexController.HeaderProductionPartSelected += new EventHandler(HeaderProductionPartSelected); - ////////////////////// - ModernisationEditionController.HeaderProductionPartSelected += new EventHandler(ModernisationEditionController_HeaderProductionPartSelected); - ModernisationIndexController.HeaderProductionPartSelected += new EventHandler(ModernisationIndexController_HeaderProductionPartSelected); - - ModerniteEditionController.HeaderProductionPartSelected += new EventHandler(ModerniteEditionController_HeaderProductionPartSelected); - ModerniteIndexController.HeaderProductionPartSelected += new EventHandler(ModerniteIndexController_HeaderProductionPartSelected); - - PostModerniteEditionController.HeaderProductionPartSelected += new EventHandler(PostModerniteEditionController_HeaderProductionPartSelected); - PostModerniteIndexController.HeaderProductionPartSelected += new EventHandler(PostModerniteIndexController_HeaderProductionPartSelected); - - OuvertureEditionController.HeaderProductionPartSelected += new EventHandler(OuvertureEditionController_HeaderProductionPartSelected); - OuvertureIndexController.HeaderProductionPartSelected += new EventHandler(OuvertureIndexController_HeaderProductionPartSelected); - ////////////////////// - ModernisationEditionController.HeaderProductionPartFinished += new EventHandler(ModernisationEditionControler_HeaderProductionPartFinished); - ModernisationIndexController.HeaderProductionPartFinished += new EventHandler(ModernisationIndexControl_HeaderProductionPartFinished); - - ModerniteEditionController.HeaderProductionPartFinished += new EventHandler(ModerniteEditionControler_HeaderProductionPartFinished); - ModerniteIndexController.HeaderProductionPartFinished += new EventHandler(ModerniteIndexController_HeaderProductionPartFinished); - - PostModerniteEditionController.HeaderProductionPartFinished += new EventHandler(PostModerniteEditionController_HeaderProductionPartFinished); - PostModerniteIndexController.HeaderProductionPartFinished += new EventHandler(PostModerniteIndexController_HeaderProductionPartFinished); - - OuvertureEditionController.HeaderProductionPartFinished += new EventHandler(OuvertureEditionController_HeaderProductionPartFinished); - OuvertureIndexController.HeaderProductionPartFinished += new EventHandler(OuvertureIndexController_HeaderProductionPartFinished); - */ - } - - /* void OuvertureIndexController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart != null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.IndexationMessage.Replace("{0}", "Ouverture"); - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Ouverture, true)); - } - } - - void OuvertureEditionController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart != null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.EditionSecondMessage; - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Ouverture, false)); - } - } - - void PostModerniteIndexController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart != null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.IndexationMessage.Replace("{0}", "Post-Modernité"); - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Postmodernite, true)); - } - } - - void PostModerniteEditionController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart != null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.EditionSecondMessage; - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Postmodernite, false)); - } - } - - void ModerniteIndexController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart != null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.IndexationMessage.Replace("{0}", "Modernité"); - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Modernite, true)); - } - } - - void ModerniteEditionController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart!=null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.EditionSecondMessage; - - SelectedPart(sender,new HeaderProductionEventArgs(VideoChapterType.Modernite,false)); - } } - void ModernisationIndexController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart!=null) - { - if (MessageBoxResult.OK == MessageBox.Show("Voulez Vous passer à l'indexation ?", "Question", MessageBoxButton.OKCancel)) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.IndexationMessage.Replace("{0}", "Modernisation"); - SelectedPart(sender, new HeaderProductionEventArgs(VideoChapterType.Modernisation, true)); - } - else - { - UnselectAll(); - } - } - } - - void ModernisationEditionController_HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - if (SelectedPart!=null) - { - InstructionText.Text = Iri.Modernisation.Lang.LangResource.EditionFirstMessage; - SelectedPart(sender,new HeaderProductionEventArgs(VideoChapterType.Modernisation,false)); - } - } - - void OuvertureIndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap04IndexingOkClick.Execute(); - if (FinishedPart != null) - { - FinishedPart(sender,new HeaderProductionEventArgs()); - } - - } - - void PostModerniteIndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap03IndexingOkClick.Execute(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - - void ModerniteIndexController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap02IndexingOkClick.Execute(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - - void OuvertureEditionController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap04EditingOkClick.Execute(); - OuvertureIndexController.Active(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - - void PostModerniteEditionController_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap03EditingOkClick.Execute(); - PostModerniteIndexController.Active(); - OuvertureEditionController.Active(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - - void ModerniteEditionControler_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - - Commands.HeaderProduction.Chap02EditingOkClick.Execute(); - ModerniteIndexController.Active(); - PostModerniteEditionController.Active(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - - void ModernisationIndexControl_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap01IndexingOkClick.Execute(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - } - private void UnselectAll() - { - ModernisationEditionController.UnSelect(); - ModernisationIndexController.UnSelect(); - - ModerniteEditionController.UnSelect(); - ModerniteIndexController.UnSelect(); - - PostModerniteEditionController.UnSelect(); - PostModerniteIndexController.UnSelect(); - - OuvertureEditionController.UnSelect(); - OuvertureIndexController.UnSelect(); - } - private void HeaderProductionPartSelected(object sender, HeaderProductionPartControlerEventArgs e) - { - UnselectAll(); - ((HeaderProductionPartControler)sender).Select(); - } - - void ModernisationEditionControler_HeaderProductionPartFinished(object sender, HeaderProductionPartControlerEventArgs e) - { - Commands.HeaderProduction.Chap01EditingOkClick.Execute(); - ModernisationIndexController.Active(); - ModerniteEditionController.Active(); - if (FinishedPart != null) - { - FinishedPart(sender, new HeaderProductionEventArgs()); - } - - } - public event EventHandler SelectedPart; - public event EventHandler FinishedPart; -*/ + } public class HeaderProductionEventArgs : EventArgs { - public VideoChapterType ChapterType; + public bool IsIndexPart; public HeaderProductionEventArgs() { } - public HeaderProductionEventArgs(VideoChapterType chapterType,bool isIndexpPrt) + public HeaderProductionEventArgs(bool isIndexpPrt) { - ChapterType = chapterType; + IsIndexPart = isIndexpPrt; } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs --- a/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -56,7 +56,10 @@ void VideoScreen_MediaOpened(object sender, RoutedEventArgs e) { - + /* + * In Order to begin + */ + VideoScreen.Position = ((VideoViewerVM)DataContext).BeginIn; //VideoScreen.Play(); //VideoPositionTimer.Start(); diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/AnnotationMaker/AnnotationMakerVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -386,7 +386,8 @@ new KeyValuePair("newAnnotation", newfile.ToString()), new KeyValuePair("msg", "303")); helper.ResponseComplete += new HttpResponseCompleteEventHandler(helper_ResponseComplete); - helper.Execute(); + // helper.Execute(); + MessageBox.Show(newfile.ToString()); _refElement = null; OnPropertyChanged("IsControlEnable"); diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationView/ConsultationViewVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -142,7 +142,7 @@ { //Préparation du loader _loaderVideoBook = new Loader(LDTFileReader.ConvertToVideoBook); - _loaderVideoBook.LoaderFinished += new EventHandler>(LoaderVideoBook_LoaderFinished); + _loaderVideoBook.LoaderFinished += new EventHandler(LoaderVideoBook_LoaderFinished); _loaderVideoBook.Load(((VideoBook)e.Parameter).LdtPath); } @@ -154,9 +154,9 @@ /// /// /// - private void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs e) + private void LoaderVideoBook_LoaderFinished(object sender, EventArgs e) { - VideoBook addedVideoBook = e.CreatedObject; + VideoBook addedVideoBook = ((LoaderEventArgs)e).CreatedObject; ///------- /// addedVideoBook.LdtPath = _loaderVideoBook.Path; ///-----------------/// diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/Main/MainVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/Main/MainVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/Main/MainVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -12,6 +12,7 @@ using Iri.Modernisation.Data.Models; using Iri.Modernisation.BaseMVVM.Commands; using Iri.Modernisation.BaseMVVM.ViewModel; +using System.Collections.ObjectModel; namespace Iri.Modernisation.Controls.ViewModel { /// @@ -87,15 +88,16 @@ } } - public MainVM(List videoBooks) + public MainVM() { InitializeCommands(); - List SelectedVideoBooks = videoBooks; + List SelectedVideoBooks = new List(); + SelectedVideoBooks = SettingsProject.ListVideoBook; // Initialisation des Components // - ViewModelProductionView = new ProductionViewVM(); + ViewModelProductionView = new ProductionViewVM() { RecordedVideoSequences = new ObservableCollection(SettingsProject.ProductionVideo) }; ViewModelConsultationView = new ConsultationViewVM(); ViewModelNavigationBar = new NavigationBarVM() { ConsultMenuViewModel = new ConsultMenuVM(SelectedVideoBooks) }; ViewModelHeaderControl = new HeaderControlVM(); diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableIndexElementVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableIndexElementVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableIndexElementVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -70,7 +70,7 @@ { get { - //MessageBox.Show(((TimeSpan)(TimerOut - TimerIn)).TotalMilliseconds.ToString()); + return ((TimeSpan)(TimerOut - TimerIn)).TotalMilliseconds * ProductionTimeLine.ScaleTime; } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableVideoElementVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableVideoElementVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/CustomableVideoElementVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -92,19 +92,7 @@ } - private VideoChapterType _chapter; - public VideoChapterType Chapter - { - get - { - return _chapter; - } - set - { - _chapter = value; - OnPropertyChanged("Chapter"); - } - } + private Color _chapterColor; public Color ChapterColor diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionTimeLine/ProductionTimeLineVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -240,23 +240,9 @@ } } - private VideoChapterType _selectedChapterType; + - /// - /// Chapitre en cours - /// - public VideoChapterType SelectedChapterType - { - get - { - return _selectedChapterType; - } - set - { - _selectedChapterType = value; - OnPropertyChanged("SelectedChapterType"); - } - } + private void InitializeCommands() { @@ -304,7 +290,7 @@ InitializeCommands(); } - + private void TimeChange_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { double newValue = ((double)e.Parameter); @@ -317,15 +303,19 @@ if (Vs.TimerIn.TotalMilliseconds <= newValue && Vs.TimerOut.TotalMilliseconds > newValue) { ActualVideoSequence = Vs; - ViewModelVideoViewer.Source = ActualVideoSequence.Path; - ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn +Vs.BeginTrim); + + /**/ + ViewModelVideoViewer.BeginIn = TimeSpan.FromMilliseconds(newValue)+ Vs.BeginTrim; + ViewModelVideoViewer.Source = ActualVideoSequence.Path; + ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - Vs.TimerIn + Vs.BeginTrim); + ViewModelVideoViewer.BeginIn = Vs.BeginTrim; } } } else { - ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - ActualVideoSequence.TimerIn); + ViewModelVideoViewer.GoTo(TimeSpan.FromMilliseconds(newValue) - ActualVideoSequence.TimerIn + ActualVideoSequence.BeginTrim); } @@ -378,12 +368,12 @@ private void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e) { - SelectedChapter = (int)((HeaderProductionEventArgs)e.Source).ChapterType; - SelectedChapterType = ((HeaderProductionEventArgs)e.Source).ChapterType ; + + IsIndexing = ((HeaderProductionEventArgs)e.Source).IsIndexPart; } - public event EventHandler SwitchVideo; + } public class ProductionTimeLineVMEventArgs : EventArgs diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/ProductionView/ProductionViewVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -132,7 +132,7 @@ private void InitializeCommands() { Commands.ProductionView.ClickAddSelectedRecord.Executed += new EventHandler(ClickAddSelectedRecord_Executed); - ViewModelProductionTimeLine.SwitchVideo += new EventHandler(ViewModelProductionTimeLine_SwitchVideo); + ViewModelMasterVideoViewer.Tick += new EventHandler(ViewModelMasterVideoViewer_Tick); ViewModelHeaderProduction.Change += new EventHandler(ViewModelHeaderProduction_Change); Commands.HeaderProduction.PublishClick.Executed += new EventHandler(PublishClick_Executed); @@ -147,24 +147,9 @@ ViewModelMasterVideoViewer = new VideoViewerVM(true, false); ViewModelProductionTimeLine.ViewModelVideoViewer = ViewModelMasterVideoViewer; - Random rndNumbers = new Random(); - _recordedVideoSequences.Add(new VideoSequence() - { - Path = Application.Current.Host.Source.Host.ToString() + "/test.wmv", - RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0), - BeginTrim = new TimeSpan(0, 0, 0), - EndTrim = new TimeSpan(0, 0, 0), - }); - - - _recordedVideoSequences.Add(new VideoSequence() - { - Path = "/video.mp4", - RunTime = new TimeSpan(0, rndNumbers.Next(10, 60), 0), - BeginTrim = new TimeSpan(0, 0, 0), - EndTrim = new TimeSpan(0, 0, 0), - }); + + InitializeCommands(); OnPropertyChanged(String.Empty); @@ -234,20 +219,24 @@ ViewModelProductionTimeLine.SelectedChapter = e.ChapterHeader.ChapterDescription.Id ; } - private void ViewModelProductionTimeLine_SwitchVideo(object sender, ProductionTimeLineVMEventArgs e) - { - ViewModelMasterVideoViewer.Source = (e.VideoSequence.Path); - ViewModelMasterVideoViewer.GoTo(e.BeginAt); - } + private void ViewModelMasterVideoViewer_Tick(object sender, VideoViewerVMEventArgs e) { - double newPos = ViewModelProductionTimeLine.ActualVideoSequence.TimerIn.TotalMilliseconds+e.Position.TotalMilliseconds; + double newPos = ViewModelProductionTimeLine.ActualVideoSequence.TimerIn.TotalMilliseconds + e.Position.TotalMilliseconds; if (ViewModelProductionTimeLine.ActualVideoSequence.TimerOut.TotalMilliseconds <= newPos) { - ViewModelProductionTimeLine.ActualVideoSequence = ViewModelProductionTimeLine.TimeLine[ViewModelProductionTimeLine.TimeLine.IndexOf(ViewModelProductionTimeLine.ActualVideoSequence) + 1]; - ViewModelMasterVideoViewer.Source = ViewModelProductionTimeLine.ActualVideoSequence.Path; - ViewModelMasterVideoViewer.GoTo(ViewModelProductionTimeLine.ActualVideoSequence.BeginTrim); + if (ViewModelProductionTimeLine.TimeLine.IndexOf(ViewModelProductionTimeLine.ActualVideoSequence) + 1 < ViewModelProductionTimeLine.TimeLine.Count) + { + ViewModelProductionTimeLine.ActualVideoSequence = ViewModelProductionTimeLine.TimeLine[ViewModelProductionTimeLine.TimeLine.IndexOf(ViewModelProductionTimeLine.ActualVideoSequence) + 1]; + ViewModelMasterVideoViewer.BeginIn = ViewModelProductionTimeLine.ActualVideoSequence.BeginTrim; + ViewModelMasterVideoViewer.Source = ViewModelProductionTimeLine.ActualVideoSequence.Path; + ViewModelMasterVideoViewer.GoTo(ViewModelProductionTimeLine.ActualVideoSequence.BeginTrim); + } + else + { + ViewModelMasterVideoViewer.Pause(); + } } ViewModelProductionTimeLine.Position = newPos; } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs --- a/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Wed Jan 27 10:37:39 2010 +0100 @@ -117,13 +117,12 @@ { _playControl = playControl; _recordControl = recordControl; - InitializeCommands(); AutoPlay = false; } - + public TimeSpan BeginIn { get; set; } public event EventHandler Tick; private void InitializeCommands() @@ -147,7 +146,7 @@ { if(Tick!=null) { - Tick(this, new VideoViewerVMEventArgs(Pos)); + Tick(this, new VideoViewerVMEventArgs(Pos-BeginIn)); } } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Iri.Modernisation.Data.csproj --- a/client/src/Iri.Modernisation.Data/Iri.Modernisation.Data.csproj Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Iri.Modernisation.Data.csproj Wed Jan 27 10:37:39 2010 +0100 @@ -109,6 +109,7 @@ + diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs --- a/client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/FactoryVideoLivre.cs Wed Jan 27 10:37:39 2010 +0100 @@ -15,10 +15,11 @@ public static class FactoryVideoLivre { public static WebClient xmlClient = new WebClient(); - private static XDocument _configDoc; + private static XDocument _configDoc; public static VideoChapterDescription[] VideoChapterDescriptions {get;private set;} public static PolemicTypeDescription[] AnnotationDescriptions { get; private set; } public static String VideoBookListPath; + public static String ProductionVideoPath; public static int NumberOfChapters { get @@ -58,6 +59,7 @@ List temp_an = new List(); int nb = 0; VideoBookListPath = _configDoc.Root.Attribute("VideoBookList").Value; + ProductionVideoPath = _configDoc.Root.Attribute("ProductionVideo").Value; foreach (XElement XChapter in _configDoc.Root.Element("VideoBook").Elements()) { temp.Add(new VideoChapterDescription(nb, XChapter.Attribute("name").Value, XChapter.Attribute("color").Value)); diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/Loader.cs --- a/client/src/Iri.Modernisation.Data/Models/Loader.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/Loader.cs Wed Jan 27 10:37:39 2010 +0100 @@ -14,17 +14,20 @@ using System.Threading; namespace Iri.Modernisation.Data.Models { - + /// + /// Interface permettant une utilisation dans la classe Sync + /// public interface ILoader { - event EventHandler> LoaderFinished; + + event EventHandler LoaderFinished; } /// /// Classe permettant de charger un XML et de convertir son contenu en un type ReturnType désiré /// /// Type Désiré - public class Loader + public class Loader : ILoader { private AutoResetEvent Are { get; set; } @@ -95,7 +98,7 @@ Load(this.Path); } - public event EventHandler> LoaderFinished; + public event EventHandler LoaderFinished; } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/PolemicElement.cs --- a/client/src/Iri.Modernisation.Data/Models/PolemicElement.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/PolemicElement.cs Wed Jan 27 10:37:39 2010 +0100 @@ -12,18 +12,7 @@ namespace Iri.Modernisation.Data.Models { - /// - /// Types Polémique - /// - public enum PolemicElementType - { - Basic=0, - Polemic=1, - Adhesion, - Reference, - Question - - }; + /// /// Classe PolemicElement diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/SettingsProject.cs --- a/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/SettingsProject.cs Wed Jan 27 10:37:39 2010 +0100 @@ -12,6 +12,8 @@ using System.Threading; namespace Iri.Modernisation.Data.Models { + + /// /// /// @@ -19,12 +21,21 @@ { + + static public List ListVideoBook { get; set; } - + static public List ProductionVideo { get; set; } + static public Sync Synchronizer { get; set; } static SettingsProject() { - //_internalDictionary.Add(new Loader>(VideoBook.GetListVideoBook), - // new KeyValuePair("", null)); + Synchronizer = new Sync(); + Synchronizer.Completed += new EventHandler(Synchronizer_Completed); + } + + static void Synchronizer_Completed(object sender, EventArgs e) + { + if (SettingsLoaded != null) + SettingsLoaded(sender, e); } /// /// (Télé)Chargement des données; @@ -39,7 +50,7 @@ } /// - /// + /// Une fois que le fichier config du projet est chargé /// /// /// @@ -47,20 +58,34 @@ { Loader> loaderListVideoBook = new Loader>(VideoBook.GetListVideoBook); - loaderListVideoBook.LoaderFinished += new EventHandler>>(LoaderVideoBook_LoaderFinished); - loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath); - // VideoBookLoaderHelper LoaderVideoBook = new VideoBookLoaderHelper(FactoryVideoLivre.VideoBookListPath); - // LoaderVideoBook.LoaderFinished += new EventHandler>>(LoaderVideoBook_LoaderFinished); + + loaderListVideoBook.LoaderFinished += new EventHandler(LoaderVideoBook_LoaderFinished); + Synchronizer.RegisterLoader(loaderListVideoBook); + + + Loader> loaderProductionVideo = new Loader>(VideoSequence.GetProductionVideo); + loaderProductionVideo.LoaderFinished += new EventHandler(loaderProductionVideo_LoaderFinished); + Synchronizer.RegisterLoader(loaderProductionVideo); + + loaderProductionVideo.Load(FactoryVideoLivre.ProductionVideoPath); + loaderListVideoBook.Load(FactoryVideoLivre.VideoBookListPath); + + + } + + static void loaderProductionVideo_LoaderFinished(object sender, EventArgs e) + { + SettingsProject.ProductionVideo = ((LoaderEventArgs>)e).CreatedObject; + } - static void LoaderVideoBook_LoaderFinished(object sender, LoaderEventArgs> e) + static void LoaderVideoBook_LoaderFinished(object sender, EventArgs e) { - SettingsProject.ListVideoBook = e.CreatedObject; - if (SettingsLoaded != null) - SettingsLoaded(sender, e); + SettingsProject.ListVideoBook = ((LoaderEventArgs>)e).CreatedObject; + } /// /// Evenement prévenant quand tout est pret diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/Sync.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/Iri.Modernisation.Data/Models/Sync.cs Wed Jan 27 10:37:39 2010 +0100 @@ -0,0 +1,54 @@ +using System; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace Iri.Modernisation.Data.Models +{ + /// + /// Classe servant à synchroniser les Loaders + /// On créé la classe, on enregistre les Loader a synchroniser. + /// /* Utilisation */ + /// Attention /!\ Il faut enregistrer le loader APRES s'êtres abonnée à son event LoaderFinished. + /// + public class Sync + { + /// + /// Constructeur par défaut + /// + public Sync() + { _registeredLoader = 0; } + private int _registeredLoader { get; set; } + + /// + /// Méthode permettant d'enregistrer les Loader au sein d'un même Sync + /// + /// Loader à enregistrer + public void RegisterLoader(ILoader loader) + { + _registeredLoader++; + loader.LoaderFinished += new EventHandler(loader_LoaderFinished); + } + + private void loader_LoaderFinished(object sender, EventArgs e) + { + _registeredLoader--; + if (_registeredLoader == 0) + { + Completed(this, new EventArgs()); + } + } + + /// + /// Evenement déclanché une fois tous les Loader fini + /// + public event EventHandler Completed; + + } +} diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/VideoBook.cs --- a/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/VideoBook.cs Wed Jan 27 10:37:39 2010 +0100 @@ -110,19 +110,19 @@ { _iriFile = new Loader(IRIFile.FromXML); _ldtFile = new Loader(LDTFile.FromXML); - _ldtFile.LoaderFinished += new EventHandler>(_ldtFile_LoaderFinished); - _iriFile.LoaderFinished += new EventHandler>(_iriFile_LoaderFinished); + _ldtFile.LoaderFinished += new EventHandler(_ldtFile_LoaderFinished); + _iriFile.LoaderFinished += new EventHandler(_iriFile_LoaderFinished); } - void _iriFile_LoaderFinished(object sender, LoaderEventArgs e) + void _iriFile_LoaderFinished(object sender, EventArgs e) { - _loadedIriFile = e.CreatedObject; + _loadedIriFile = ((LoaderEventArgs)e).CreatedObject; LoaderFinished(this,new LoaderEventArgs(LDTFileReader.ConvertToVideoBook(_loadedLdtFile,_loadedIriFile))); } - void _ldtFile_LoaderFinished(object sender, LoaderEventArgs e) + void _ldtFile_LoaderFinished(object sender, EventArgs e) { - _loadedLdtFile = e.CreatedObject; + _loadedLdtFile = ((LoaderEventArgs)e).CreatedObject; _iriFile.Load(_loadedLdtFile.Medias[0].Src); } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/VideoChapter.cs --- a/client/src/Iri.Modernisation.Data/Models/VideoChapter.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/VideoChapter.cs Wed Jan 27 10:37:39 2010 +0100 @@ -11,13 +11,7 @@ using System.Collections.Generic; namespace Iri.Modernisation.Data.Models { - public enum VideoChapterType - { - Modernisation = 0, - Modernite=1, - Postmodernite=2, - Ouverture=3 - } + /// /// Chapitre d'un VideoLivre @@ -29,10 +23,6 @@ /// public VideoBook Book {get;set;} - /// - /// Chapitre - /// - public VideoChapterType Type { get; set; } /// /// Titre du chapitre diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation.Data/Models/VideoSequence.cs --- a/client/src/Iri.Modernisation.Data/Models/VideoSequence.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation.Data/Models/VideoSequence.cs Wed Jan 27 10:37:39 2010 +0100 @@ -8,7 +8,8 @@ using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; - +using System.Xml.Linq; +using System.Collections.Generic; namespace Iri.Modernisation.Data.Models { /// @@ -73,7 +74,26 @@ return TimerIn + Duration; } } - + + static public List GetProductionVideo(XDocument xdoc) + { + List returnList = new List(); + foreach (XElement XVideo in xdoc.Root.Elements()) + { + + returnList.Add( + new VideoSequence() + { + Path = XVideo.Attribute("mediafile").Value, + RunTime = TimeSpan.FromMilliseconds(double.Parse(XVideo.Attribute("dur").Value)), + BeginTrim = new TimeSpan(0, 0, 0), + EndTrim = new TimeSpan(0, 0, 0), + } + ); + } + return returnList; + } + } } diff -r 43bb1b8ed555 -r b6df6fce6e5d client/src/Iri.Modernisation/MainPage.xaml.cs --- a/client/src/Iri.Modernisation/MainPage.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/src/Iri.Modernisation/MainPage.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -30,7 +30,7 @@ FactoryVideoLivre.Load("ProjectConfig.xml"); InitializeComponent(); - MainElement.DataContext = new MainVM(new List()); + MainElement.DataContext = new MainVM(); } void xmlClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) diff -r 43bb1b8ed555 -r b6df6fce6e5d client/test/WebTest/WebTest/WebTest.Web/ProductionContent/ProductionVideo.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/test/WebTest/WebTest/WebTest.Web/ProductionContent/ProductionVideo.xml Wed Jan 27 10:37:39 2010 +0100 @@ -0,0 +1,11 @@ + + + diff -r 43bb1b8ed555 -r b6df6fce6e5d client/test/WebTest/WebTest/WebTest.Web/ProjectConfig.xml --- a/client/test/WebTest/WebTest/WebTest.Web/ProjectConfig.xml Mon Jan 25 09:30:22 2010 +0100 +++ b/client/test/WebTest/WebTest/WebTest.Web/ProjectConfig.xml Wed Jan 27 10:37:39 2010 +0100 @@ -1,7 +1,7 @@ diff -r 43bb1b8ed555 -r b6df6fce6e5d client/test/WebTest/WebTest/WebTest.Web/WebTest.Web.csproj --- a/client/test/WebTest/WebTest/WebTest.Web/WebTest.Web.csproj Mon Jan 25 09:30:22 2010 +0100 +++ b/client/test/WebTest/WebTest/WebTest.Web/WebTest.Web.csproj Wed Jan 27 10:37:39 2010 +0100 @@ -75,7 +75,7 @@ False True - 2222 + 5979 / diff -r 43bb1b8ed555 -r b6df6fce6e5d client/test/WebTest/WebTest/WebTest/MainPage.xaml.cs --- a/client/test/WebTest/WebTest/WebTest/MainPage.xaml.cs Mon Jan 25 09:30:22 2010 +0100 +++ b/client/test/WebTest/WebTest/WebTest/MainPage.xaml.cs Wed Jan 27 10:37:39 2010 +0100 @@ -25,8 +25,7 @@ //FactoryVideoLivre.xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xmlClient_DownloadStringCompleted); - List SelectedVideoBooks = new List(); - SelectedVideoBooks = SettingsProject.ListVideoBook; + //Loader.RegisterType("ldt", LDTFileReader.ConvertToVideoBook); @@ -37,7 +36,7 @@ // SelectedVideoBooks = Loader.ListVideoBook; InitializeComponent(); - MainElement.DataContext = new MainVM(SelectedVideoBooks); + MainElement.DataContext = new MainVM(); @@ -45,18 +44,7 @@ } - void xmlClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) - { - if (e.Error == null) - { - - - } - else - { - //MessageBox.Show(e.Error.InnerException.Message); - } - } +