Code Monkey home page Code Monkey logo

Comments (2)

ashahabov avatar ashahabov commented on May 25, 2024

Sorry for the answer delay.

Such feature is not available yet. We will take a look.

from shapecrawler.

Joe-Blaze avatar Joe-Blaze commented on May 25, 2024

Given a slidepart, and using DocumentFormat.OpenXml.Presentation;, I used brute force, but I could not determine the audio duration accurately so set it to indefinite:

                        IEnumerable<DocumentFormat.OpenXml.Presentation.Timing> animationTimings = slidePart.Slide.Descendants<DocumentFormat.OpenXml.Presentation.Timing>();
                        foreach (DocumentFormat.OpenXml.Presentation.Timing animationTiming in animationTimings)
                        {
                            animationTiming.Remove();
                            //^ Remove any pre-existing slide animations
                        }

                        var slide = slidePart.Slide;
                        string timing = @"<p:timing xmlns:p=""http://schemas.openxmlformats.org/presentationml/2006/main""><p:tnLst><p:par><p:cTn id=""1"" dur=""indefinite"" restart=""never"" nodeType=""tmRoot""><p:childTnLst><p:seq concurrent=""1"" nextAc=""seek""><p:cTn id=""2"" dur=""indefinite"" nodeType=""mainSeq""><p:childTnLst><p:par><p:cTn id=""3"" fill=""hold""><p:stCondLst><p:cond delay=""indefinite""/><p:cond evt=""onBegin"" delay=""0""><p:tn val=""2""/></p:cond></p:stCondLst><p:childTnLst><p:par><p:cTn id=""4"" fill=""hold""><p:stCondLst><p:cond delay=""0""/></p:stCondLst><p:childTnLst><p:par><p:cTn id=""5"" presetID=""1"" presetClass=""mediacall"" presetSubtype=""0"" fill=""hold"" nodeType=""withEffect""><p:stCondLst><p:cond delay=""2000""/></p:stCondLst><p:childTnLst><p:cmd type=""call"" cmd=""playFrom(0.0)""><p:cBhvr><p:cTn id=""6"" dur=""indefinite"" fill=""hold""/><p:tgtEl><p:spTgt spid=""4""/></p:tgtEl></p:cBhvr></p:cmd></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn></p:par></p:childTnLst></p:cTn><p:prevCondLst><p:cond evt=""onPrev"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:prevCondLst><p:nextCondLst><p:cond evt=""onNext"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:nextCondLst></p:seq><p:audio><p:cMediaNode vol=""80000""><p:cTn id=""7"" display=""0""><p:stCondLst><p:cond delay=""indefinite""/></p:stCondLst><p:endCondLst><p:cond evt=""onStopAudio"" delay=""0""><p:tgtEl><p:sldTgt/></p:tgtEl></p:cond></p:endCondLst></p:cTn><p:tgtEl><p:spTgt spid=""4""/></p:tgtEl></p:cMediaNode></p:audio></p:childTnLst></p:cTn></p:par></p:tnLst></p:timing>";
                        //^ For id=""6"", the dur has been set to ""indefinite"", rather than the duration of the audio.
                        XElement xElt = XElement.Parse(timing, LoadOptions.PreserveWhitespace);

                        var newChild = new DocumentFormat.OpenXml.Presentation.Timing(timing);
                        slide.AddChild(newChild);

from shapecrawler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.