Changeset 7408


Ignore:
Timestamp:
11/22/17 05:54:02 (17 months ago)
Author:
avneesh-singh
Message:

added command for importing audio files in each section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Obi/Obi/ProjectView/ProjectView.cs

    r7400 r7408  
    28202820                                    if (createSectionForEachPhrase) 
    28212821                                    { 
    2822                                         CompositeCommand createSectionsCommand = GetImportSectionsFromAudioCommands(phraseNodes, phrase_SectionNameMap, dialog.CharacterCountToTruncateFromStart, dialog.CharactersToBeReplacedWithSpaces, dialog.PageIdentificationString); 
     2822                                       CompositeCommand createSectionsCommand = GetImportSectionsFromAudioCommands(phraseNodes, phrase_SectionNameMap, dialog.CharacterCountToTruncateFromStart, dialog.CharactersToBeReplacedWithSpaces, dialog.PageIdentificationString); 
    28232823 
    28242824                                        mPresentation.Do(createSectionsCommand); 
     
    30853085            return command; 
    30863086            } 
     3087 
     3088 
     3089        private CompositeCommand GetCommandForImportAudioFileInEachSection(List<PhraseNode> phraseNodesList) 
     3090        { 
     3091            List<PhraseNode> phraseNodes = new List<PhraseNode>(); 
     3092            phraseNodes.AddRange(phraseNodesList); 
     3093            CompositeCommand command = Presentation.CreateCompositeCommand(Localizer.Message("import_phrases")); 
     3094             
     3095            if (Selection != null) command.ChildCommands.Insert(command.ChildCommands.Count, new Commands.UpdateSelection(this, new NodeSelection(Selection.Node, Selection.Control))); 
     3096            SectionNode firstSection = mPresentation.FirstSection; 
     3097            int phraseCounter = 0 ; 
     3098 
     3099            for (SectionNode section = firstSection; section != null; section = section.FollowingSection) 
     3100            { 
     3101                if (phraseNodes.Count <= phraseCounter) break; 
     3102 
     3103                Commands.Node.AddNode addCmd = new Commands.Node.AddNode(this, phraseNodes[phraseCounter], section, section.PhraseChildCount, false); 
     3104                command.ChildCommands.Insert(command.ChildCommands.Count, addCmd); 
     3105                phraseCounter++; 
     3106            } 
     3107//if ( != null) command.ChildCommands.Insert(command.ChildCommands.Count, new Commands.UpdateSelection(this, new NodeSelection(newSectionNode, mContentView))); 
     3108            return command; 
     3109        } 
    30873110 
    30883111        private PhraseNode CreatePagePhraseWithNegligibleAudio(PageNumber pgNumber, double durationInSeconds) 
Note: See TracChangeset for help on using the changeset viewer.