% Copyright 2004 Alexander Grahn % % This material is subject to the LaTeX Project Public License. See % http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html % for the details of that license. % % This package allows inclusion of multimedia content into PDF files % following Adobe's PDF-1.5 and 1.6 specifications. % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{movie15}[2006/07/27] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} \newboolean{@MXV@iiiDfeat}% enable 3D features from PDF-1.6 spec? \setboolean{@MXV@iiiDfeat}{false}% \newboolean{@MXV@iiid}%set to true if a 3D file is being embedded \DeclareOption{3D}{% \setboolean{@MXV@iiiDfeat}{true}% } \DeclareOption*{\PackageWarning{movie15}{Unknown Option \CurrentOption}} \ProcessOptions\relax %correct pdfTeX version? \ifpdf% \ifnum\pdftexversion<120% \PackageError{movie15}{% pdf(La)TeX version >= 1.20 required for direct PDF output }{% Install a more recent version! }% \fi% \fi% %for conditionals where \ifthenelse doesn't work \gdef\@MXV@if#1{\csname if#1\endcsname}% \newboolean{@MXV@presentation} %used with presentation making package? \newboolean{@MXV@hide} %contents hidden on the current slide? \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \newcount\@MXV@iiidoncurpage%index of 3D annot on current page \global\@MXV@iiidoncurpage=0% \gdef\@MXV@oldpage{0}% needed together with previous counter }{} \RequirePackage{everyshi}% \newcount\@MXV@page% counter for absolute page number \EveryShipout{% \global\advance\@MXV@page by 1% } %define our own label making commands \def\@MXV@newlabel#1#2{{% \expandafter\xdef\csname#1\endcsname{#2}}}% \def\@MXV@getlabelvalue#1{% \expandafter\ifx\csname#1\endcsname\relax% undefined% \else% \csname#1\endcsname% \fi% }% %macro for writing labels to external *.aux file \def\@MXV@labeltoaux#1#2{% \@bsphack\protected@write\@auxout{}{% \string\@MXV@newlabel{#1}{#2}% \string\@MXV@newlabel{@#1@}{\@MXV@getlabelvalue{#1}}% }\@esphack% \ifthenelse{% \equal{\@MXV@getlabelvalue{#1}}{undefined}\OR% %double check that the value hasn't changed \NOT\equal{\@MXV@getlabelvalue{#1}}{\@MXV@getlabelvalue{@#1@}}% }{% \ifthenelse{\isundefined{\@MXV@warning}}{%issue warning only once, at end \gdef\@MXV@warning{}% of document \AtEndDocument{% \PackageWarningNoLine{movie15}{% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak @@ Rerun to get cross-references right! @@\MessageBreak @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}% }% }{}% }{}% }% % \ifpdf% %for storing pdf object numbers (must be counters) \newcount\@MXV@adict% \newcount\@MXV@aadict% % %returns pdf page object number \def\@MXV@pdfpageref#1{% \expandafter\ifx\csname#1\endcsname\relax% 0% \else% \expandafter\pdfpageref\csname#1\endcsname\space% \fi% }% \else% \PassOptionsToPackage{pdfmark}{hyperref}% \fi %counter for absolute number of inclusions, %used for labelling each annotation \newcount\@MXV@includes %counter for absolute number of movie players \newcount\@MXV@players %counter for absolute number of movierefs \newcount\@MXV@links %measuring things %textbox \newdimen\@MXV@width \newdimen\@MXV@height \newdimen\@MXV@depth \newdimen\@MXV@totalheight \newdimen\@MXV@@boxdepth %for centring the textbox within display box \newdimen\@MXV@traiselen \newdimen\@MXV@braiselen %for compatibility options \newdimen\@MXV@start \newdimen\@MXV@end %stores textbox given as argument to text option \newsavebox{\@MXV@textbox} %some booleans we need \newboolean{@MXV@autoplay} \newboolean{@MXV@autostop} \newboolean{@MXV@autoresume} \newboolean{@MXV@autoclose} \newboolean{@MXV@autopause} \newboolean{@MXV@mouse}%mouse interaction \newboolean{@MXV@inline}%inline movie data \newboolean{@MXV@attachment}%make embedded file extractable? \newboolean{@MXV@externalviewer}%if true, screen annot will be removed \newboolean{@MXV@url} \newboolean{@MXV@boxopt}%true if text option is set \newboolean{@MXV@textoverposter} \newboolean{@MXV@runposter}% render poster from movie at runtime \newboolean{@MXV@linkplay}% for \movieref command \newboolean{@MXV@linkpause} \newboolean{@MXV@linkresume} \newboolean{@MXV@linkstop} \newboolean{@MXV@linkclose} \newboolean{@MXV@linkreset} %macro to reset all macros and booleans \def\@MXV@reset{% \setboolean{@MXV@autoplay}{false}% \setboolean{@MXV@autostop}{true}% \setboolean{@MXV@autoresume}{false}% \setboolean{@MXV@autopause}{false}% \setboolean{@MXV@autoclose}{false}% \setboolean{@MXV@mouse}{false}% \setboolean{@MXV@inline}{true}% \setboolean{@MXV@attachment}{true}% \setboolean{@MXV@externalviewer}{false}% \setboolean{@MXV@url}{false}% \setboolean{@MXV@boxopt}{false}% \setboolean{@MXV@textoverposter}{true}% \setboolean{@MXV@runposter}{false}% \setboolean{@MXV@linkplay}{true}% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkreset}{false}% \gdef\@MXV@label{}% for movieref \gdef\@MXV@@label{}% for movieref \gdef\@MXV@mime{@MXV@auto}% \gdef\@MXV@player{}% \gdef\@MXV@fsentry{}% \gdef\@MXV@repeat{}% \gdef\@MXV@@repeat{}% \gdef\@MXV@volume{100}% \gdef\@MXV@@volume{}% \gdef\@MXV@ctrls{}% \gdef\@MXV@@ctrls{}% \gdef\@MXV@palindrome{}% \gdef\@MXV@rate{}% \gdef\@MXV@startat{}% \gdef\@MXV@endat{}% \gdef\@MXV@poevent{}% \gdef\@MXV@pcevent{}% \gdef\@MXV@box##1##2##3{\raisebox{0pt}[##2][##3]{\makebox[##1]{}}}% \setlength{\@MXV@depth}{0pt}% \setlength{\@MXV@height}{0pt}% \setlength{\@MXV@width}{0pt}% \setlength{\@MXV@braiselen}{0pt}% \setlength{\@MXV@traiselen}{0pt}% \gdef\@MXV@boxdepth{}% \gdef\@MXV@boxheight{}% \gdef\@MXV@boxwidth{}% % \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \setboolean{@MXV@iiid}{false}% \gdef\@MXV@aac{30}% aperture angle of camera \gdef\@MXV@background{}% \gdef\@MXV@jscriptiiidfile{}% \gdef\@MXV@coo{0 0 0}% centre of orbit \gdef\@MXV@ctoc{0 -1 0}% centre of orbit to camera vector \gdef\@MXV@roo{0}% radius of orbit \gdef\@MXV@viewsfile{}% file containing views of the 3D object \setboolean{@MXV@viewsprovided}{false}% \setboolean{@MXV@defaultviewprovided}{false}% \gdef\@MXV@iiidview{}% %show controls for 3D content by default, otherwise the 3D model %would be noninteractive, i. e. would not respond to mouse events \setboolean{@MXV@iiidctrls}{true}% \gdef\@MXV@calc{}% camera aperture for coo and roo calculation }{}% }% %missing package error message \def\@MXV@missing#1{% \PackageError{movie15}{% Package `#1' has not been loaded yet }{% Put the line `\protect\usepackage{#1}' somewhere after `\protect\usepackage{movie15}' to the preamble of your document! }% } %3D-need-be-enabled error message \def\@MXV@neediiiD{% \PackageError{movie15}{% If you wish to embed 3D objects, enable the\MessageBreak 3D feature first by passing option `3D' to movie15!\MessageBreak Make sure the `fp' package for fixed point calculus\MessageBreak is installed in your TeX system }{Package `fp' is available from CTAN.}% } %macro to guess the mime type of the media file \def\@MXV@guessmime#1#2{% \ifthenelse{\equal{#2}{aiff}\OR\equal{#2}{AIFF}\OR% \equal{#2}{aif}\OR\equal{#2}{AIF}\OR% \equal{#2}{aifc}\OR\equal{#2}{AIFC}}{% \gdef\@MXV@mime{audio/aiff}% }{% \ifthenelse{\equal{#2}{wav}\OR\equal{#2}{WAV}}{% \gdef\@MXV@mime{audio/wav}% }{% \ifthenelse{\equal{#2}{wma}\OR\equal{#2}{WMA}}{% \gdef\@MXV@mime{audio/x-ms-wma}% }{% \ifthenelse{\equal{#2}{wmv}\OR\equal{#2}{WMV}}{% \gdef\@MXV@mime{video/x-ms-wmv}% }{% \ifthenelse{\equal{#2}{au}\OR\equal{#2}{AU}\OR% \equal{#2}{snd}\OR\equal{#2}{SND}}{% \gdef\@MXV@mime{audio/basic}% }{% \ifthenelse{\equal{#2}{mid}\OR\equal{#2}{MID}\OR% \equal{#2}{rmi}\OR\equal{#2}{RMI}}{% \gdef\@MXV@mime{audio/midi}% }{% \ifthenelse{\equal{#2}{mov}\OR\equal{#2}{MOV}\OR% \equal{#2}{qt}\OR\equal{#2}{QT}}{% \gdef\@MXV@mime{video/quicktime}% }{% \ifthenelse{\equal{#2}{mp3}\OR\equal{#2}{MP3}\OR% \equal{#2}{m3u}\OR\equal{#2}{M3U}}{% \gdef\@MXV@mime{audio/x-mp3}% }{% \ifthenelse{\equal{#2}{mp4}\OR\equal{#2}{MP4}}{% \gdef\@MXV@mime{video/mp4}% }{% \ifthenelse{\equal{#2}{avi}\OR\equal{#2}{AVI}}{% \gdef\@MXV@mime{video/avi}% }{% \ifthenelse{\equal{#2}{gif}\OR\equal{#2}{GIF}}{% \gdef\@MXV@mime{image/gif}% }{% \ifthenelse{\equal{#2}{mpeg}\OR\equal{#2}{MPEG}\OR% \equal{#2}{mpg}\OR\equal{#2}{MPG}}{% \gdef\@MXV@mime{video/mpeg}% }{% \ifthenelse{\equal{#2}{smil}\OR\equal{#2}{SMIL}}{% \gdef\@MXV@mime{application/smil}% }{% \ifthenelse{\equal{#2}{swf}\OR\equal{#2}{SWF}}{% \gdef\@MXV@mime{application/x-shockwave-flash}% }{% \ifthenelse{\equal{#2}{u3d}\OR\equal{#2}{U3D}}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \setboolean{@MXV@iiid}{true}% \gdef\@MXV@mime{model/u3d}% (unofficial) \gdef\@MXV@iiidsubtype{U3D}% }{% \@MXV@neediiiD% }% }{% \ifthenelse{\equal{#2}{ra}\OR\equal{#2}{RA}\OR% \equal{#2}{ram}\OR\equal{#2}{RAM}\OR% \equal{#2}{rm}\OR\equal{#2}{RM}}{% \gdef\@MXV@mime{audio/x-pn-realaudio}% }{% \PackageError{movie15}{% I couldn't determine MIME type of file:\MessageBreak`#1':\MessageBreak Unknown file name extension: `#2' }{% When using media files of unknown type or with a\MessageBreak non-standard file name extension, the MIME type must\MessageBreak explicitly be specified. Try option `mimetype='! }% }}}}}}}}}}}}}}}}% } \ifthenelse{\boolean{@MXV@iiiDfeat}}{% 3D related definitions and macros \RequirePackage{fp}% needed for fixed point calculus \newcount\@MXV@viewscount%counter for number of 3D views per inclusion \newboolean{@MXV@viewsprovided}%3d views file provided? \newboolean{@MXV@iiidctrls}% show controls? \newboolean{@MXV@defaultviewprovided}%default 3D view provided? %macro for building the transformation matrix \def\@MXV@ciiwmatrix#1 #2 #3 #4 #5 #6 #7 {% % #1,#2,#3 centre of orbit coordinates (coo) % #4,#5,#6 centre of orbit to camera direction vector (c2c) % #7 orbital radius (roo) %view vector (opposite to c2c) \FPupn\@MXV@viewx{#4 neg}% \FPupn\@MXV@viewy{#5 neg}% \FPupn\@MXV@viewz{#6 neg}% %normalize view vector \FPupn\@MXV@modulo{\@MXV@viewx{} copy mul % \@MXV@viewy{} copy mul + % \@MXV@viewz{} copy mul + 2 swap root% }% \FPupn\@MXV@viewx{\@MXV@viewx{} \@MXV@modulo{} div}% \FPupn\@MXV@viewy{\@MXV@viewy{} \@MXV@modulo{} div}% \FPupn\@MXV@viewz{\@MXV@viewz{} \@MXV@modulo{} div}% %rotation matrix \FPifneg\@MXV@viewz% top view \xdef\@MXV@matrix{-1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 -1.0}% \else% bottom view \xdef\@MXV@matrix{-1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0}% \fi% \FPupn\@MXV@sumxy{\@MXV@viewx{} abs \@MXV@viewy{} abs add}% \FPifeq\@MXV@sumxy{0}\else% other views than top and bottom %up vector = up_world - (up_world dot view) view \FPupn\@MXV@upx{\@MXV@viewz{} \@MXV@viewx{} mul neg}% \FPupn\@MXV@upy{\@MXV@viewz{} \@MXV@viewy{} mul neg}% \FPupn\@MXV@upz{\@MXV@viewz{} \@MXV@viewz{} mul neg 1.0 add}% %normalize up vector \FPupn\@MXV@modulo{\@MXV@upx{} copy mul \@MXV@upy{} copy % mul + \@MXV@upz{} copy mul + 2 swap root}% \FPupn\@MXV@upx{\@MXV@upx{} \@MXV@modulo{} div}% \FPupn\@MXV@upy{\@MXV@upy{} \@MXV@modulo{} div}% \FPupn\@MXV@upz{\@MXV@upz{} \@MXV@modulo{} div}% %left vector = up x view \FPupn\@MXV@leftx{\@MXV@viewy{} \@MXV@upz{} mul % \@MXV@viewz{} \@MXV@upy{} mul sub}% \FPupn\@MXV@lefty{\@MXV@viewz{} \@MXV@upx{} mul % \@MXV@viewx{} \@MXV@upz{} mul sub}% \FPupn\@MXV@leftz{\@MXV@viewx{} \@MXV@upy{} mul % \@MXV@viewy{} \@MXV@upx{} mul sub}% %normalize left vector \FPupn\@MXV@modulo{\@MXV@leftx{} copy mul \@MXV@lefty{} % copy mul + \@MXV@leftz{} copy mul + 2 swap root}% \FPupn\@MXV@leftx{\@MXV@leftx{} \@MXV@modulo{} div}% \FPupn\@MXV@lefty{\@MXV@lefty{} \@MXV@modulo{} div}% \FPupn\@MXV@leftz{\@MXV@leftz{} \@MXV@modulo{} div}% \xdef\@MXV@matrix{\@MXV@leftx\space\@MXV@lefty\space\@MXV@leftz\space% \@MXV@upx\space\@MXV@upy\space\@MXV@upz\space% \@MXV@viewx\space\@MXV@viewy\space\@MXV@viewz}% \fi% %translation vector \FPupn\@MXV@transx{#1 #7 abs \@MXV@viewx{} mul sub}% \FPupn\@MXV@transy{#2 #7 abs \@MXV@viewy{} mul sub}% \FPupn\@MXV@transz{#3 #7 abs \@MXV@viewz{} mul sub}% %transformation matrix \xdef\@MXV@matrix{% \@MXV@matrix\space\@MXV@transx\space\@MXV@transy\space\@MXV@transz% }% } %macro for parsing one line of 3D views file \newcommand{\@MXV@parseline}[5][]{% \xdef\@MXV@xname{#1}% name of the view (optional) \xdef\@MXV@coo{#2}% \xdef\@MXV@ctoc{#3}% \xdef\@MXV@roo{#4}% \xdef\@MXV@aac{#5}% } %macro for generating an array of 3D views (varray) \def\@MXV@buildva{% \global\@MXV@viewscount=0% \xdef\@MXV@varray{}% empty varray % %default view \edef\@MXV@args{\@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space}% \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix \xdef\@MXV@xname{Default}% \@MXV@viewobj% create pdf object of 3D view \edef\@MXV@defaultview{\@MXV@@viewobj}% % %read out 3D views file \IfFileExists{\@MXV@viewsfile}{% \edef\@MXV@endlinechar{\the\endlinechar}% \endlinechar=-1% suppress trailing space at input line end \edef\@MXV@coo{}\edef\@MXV@ctoc{}\edef\@MXV@roo{}% \newread\@MXV@@viewsfile% \openin\@MXV@@viewsfile=\@MXV@viewsfile% \loop% \read\@MXV@@viewsfile to \@MXV@inputline% \if\@MXV@inputline\relax\else% \expandafter\@MXV@parseline\@MXV@inputline% \edef\@MXV@args{\@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space}% \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix \global\advance\@MXV@viewscount by 1% \ifthenelse{\equal{\@MXV@xname}{}}{% \xdef\@MXV@xname{View \the\@MXV@viewscount}% }{}% \@MXV@viewobj% create pdf object of 3D view %append current view obj ref to VA array \xdef\@MXV@varray{\@MXV@varray\space\@MXV@@viewobj}% \setboolean{@MXV@viewsprovided}{true}% \repeat% \closein\@MXV@@viewsfile% \endlinechar=\@MXV@endlinechar% reset endlinechar }{}% % %make the first view in the VA array the default view, if no default one has %explicitly been provided, but if the VA array itself is empty too (no %additional views provided) use our fallback view (c2c=0 -1 0) as default \ifthenelse{\NOT\boolean{@MXV@defaultviewprovided}% \AND\boolean{@MXV@viewsprovided}}{% \xdef\@MXV@defaultview{/3DV /F}% }{% \xdef\@MXV@defaultview{/3DV \@MXV@defaultview}% }% } %following macros, including the 3D inclusion macro have driver specific %implementations \ifpdf% %pdfLaTeX versions %macro for creating 3D view object \def\@MXV@viewobj{% %projection dict \pdfobj {<>}% \pdfrefobj\pdflastobj% % \pdfobj {<<% /MS/M% define the view as C2W matrix /CO \@MXV@roo% orbital radius /P \the\pdflastobj\space 0 R% /C2W [\@MXV@matrix]% /XN(\@MXV@xname)% name of the view appearing in the drop down list \@MXV@background% >>}\pdfrefobj\pdflastobj% \xdef\@MXV@@viewobj{\the\pdflastobj\space 0 R}% }% %3D inclusion macro \def\@MXV@includeiiid#1#2#3#4{% %insert box or poster \@MXV@box{#1}{#2}{#3}% % \if@MXV@externalviewer\else% %java script file, stream object \IfFileExists{\@MXV@jscriptiiidfile}{% \pdfobj stream file {\@MXV@jscriptiiidfile}% \pdfrefobj\pdflastobj% \xdef\@MXV@jscriptiiid{/OnInstantiate \the\pdflastobj\space 0 R}% }{\xdef\@MXV@jscriptiiid{}}% % %build the array of 3D views \@MXV@buildva% \fi% % %3D stream object \if@MXV@inline% \ifthenelse{% \NOT\boolean{@MXV@presentation}\OR% \equal{\@MXV@getlabelvalue{\@MXV@label.3dstream}}{undefined}% }{% \pdfobj stream% attr {% /Subtype/\@MXV@iiidsubtype% \if@MXV@externalviewer\else% /VA [\@MXV@varray]% /DV/F% use first entry in VA as default view \@MXV@jscriptiiid% \fi% }% file {#4}% \pdfrefobj\pdflastobj% \edef\@MXV@iiidstream{\the\pdflastobj}% \if@MXV@presentation% \@MXV@newlabel{\@MXV@label.3dstream}{\@MXV@iiidstream}% \fi% }{% \edef\@MXV@iiidstream{\@MXV@getlabelvalue{\@MXV@label.3dstream}}% }% \fi% % \makebox[0pt][r]{\makebox[#1][l]{% %insert FileAttachment annotation \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}% % since Reader 7.0.7, we cannot place a file attachment annot behind % the 3D annot :-( % \OR\boolean{@MXV@attachment}% }{% \pdfannot width #1 height #2 depth #3 {% /Subtype /FileAttachment% /F 0% /T (\@MXV@filename)% /Contents (3D Object (\@MXV@mime))% \if@MXV@externalviewer% /Name/Paperclip% /C [1 1 1]% \else /AP <>/R<<>>/D<<>>>>% \fi /FS <<% /F(#4)% /Type/Filespec% /EF << /F \@MXV@iiidstream\space 0 R >>% >>% }% }{% \if@MXV@url% %insert Link annotation, if 3D file is a URL \pdfannot width #1 height #2 depth #3 {% /Subtype /Link% /F 0% \if@MXV@externalviewer% \@MXV@urlattr% \else% /H /N% /Border [0 0 0]% \fi% /A <>% /Contents (3D Object (\@MXV@mime))% }% \else% %else insert Launch action for local external 3D file \if@MXV@inline\else% \pdfannot width #1 height #2 depth #3 {% /Subtype /Link% /F 0% \if@MXV@externalviewer% \@MXV@runattr% \else% /H /N% /Border [0 0 0]% \fi% /A <<% /F (#4)% /S /Launch% >>% /Contents (3D Object (\@MXV@mime))% }% \fi% \fi% }% % \if@MXV@externalviewer\else% %appearance dict dummy, to be shared by all 3D annots \ifthenelse{\isundefined{\@MXV@apdict}}{% \pdfobj stream {}\pdfrefobj\pdflastobj% \xdef\@MXV@apdict{/AP << /N \the\pdflastobj\space 0 R >>}% }{}% %3D reference dict \if@MXV@presentation% \ifthenelse{% \equal{\@MXV@getlabelvalue{\@MXV@label.3dref}}{undefined}% }{% \pdfobj {<<% /Type/3DRef% /3DD \@MXV@iiidstream\space 0 R% 3D stream object >>}\pdfrefobj\pdflastobj% \edef\@MXV@iiidstreamorref{\the\pdflastobj}% \@MXV@newlabel{\@MXV@label.3dref}{\the\pdflastobj}% }{% \edef\@MXV@iiidstreamorref{\@MXV@getlabelvalue{\@MXV@label.3dref}}% }% \else% \edef\@MXV@iiidstreamorref{\@MXV@iiidstream}% \fi% %annotation object of subtype `3D'% \pdfannot width #1 height #2 depth #3 {% /Subtype/3D% /F 4% we cannot put F 5 here; bug in Reader; 3D annot would be /T (\@MXV@filename)% disabled even if plugin were available /Contents (3D Object (\@MXV@mime))% \ifx\@MXV@@label\@empty\else% /NM (\@MXV@@label)% \fi% /P \@MXV@pdfpageref{@MXV@annot\the\@MXV@includes.page} 0 R% \@MXV@apdict% /AP <>/R<<>>/D<<>>>> doesn't work here \@MXV@defaultview% /3DI \if@MXV@iiidctrls true\else false\fi% /3DD \@MXV@iiidstreamorref\space 0 R% 3D stream or reference object /3DA << \@MXV@activation\@MXV@deactivation >>% }% %label for later annot obj number determination, to be used in %movieref's \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\pdflastannot}% \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\pdflastannot}% \fi% \fi}}% }% \else% %dvips versions %macro for creating 3D view object and associated projection dict \def\@MXV@viewobj{% %projection dict \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {pdict\the\@MXV@includes_\the\@MXV@viewscount}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {pdict\the\@MXV@includes_\the\@MXV@viewscount} <<% /Subtype/P/FOV \@MXV@aac/PS/Min% >>% }% }% % \pdfmark{% pdfmark=/OBJ,% Raw={% /type/dict% /_objdef {viewobj\the\@MXV@includes_\the\@MXV@viewscount}% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {viewobj\the\@MXV@includes_\the\@MXV@viewscount} <<% /MS/M% /CO \@MXV@roo% /P {pdict\the\@MXV@includes_\the\@MXV@viewscount}% /C2W[\@MXV@matrix]% /XN(\@MXV@xname)% \@MXV@background% >>% }% }% \xdef\@MXV@@viewobj{{viewobj\the\@MXV@includes_\the\@MXV@viewscount}}% }% % %3D inclusion macro \def\@MXV@includeiiid#1#2#3#4{% % \if@MXV@externalviewer\else% %java script file, stream object \IfFileExists{\@MXV@jscriptiiidfile}{% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {jscriptiiid\the\@MXV@includes}% /type/stream% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {jscriptiiid\the\@MXV@includes}% (\@MXV@jscriptiiidfile) (r) file% }% }% \xdef\@MXV@jscriptiiid{% /OnInstantiate {jscriptiiid\the\@MXV@includes}% }% }{\def\@MXV@jscriptiiid{}}% % %build the array of 3D views \@MXV@buildva% \fi% % %3D stream object \if@MXV@inline% \ifthenelse{% \NOT\boolean{@MXV@presentation}\OR% \equal{\@MXV@getlabelvalue{\@MXV@label.3dstream}}{undefined}% }{% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {iiiDfile\the\@MXV@includes}% /type/stream% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {iiiDfile\the\@MXV@includes} <<% /Subtype/\@MXV@iiidsubtype% \if@MXV@externalviewer\else% /VA [\@MXV@varray]% /DV/F% use first entry in VA as default view \@MXV@jscriptiiid% \fi% >>% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {iiiDfile\the\@MXV@includes}% (#4) (r) file% }% }% \edef\@MXV@iiidstream{iiiDfile\the\@MXV@includes}% \if@MXV@presentation% \@MXV@newlabel{\@MXV@label.3dstream}{\@MXV@iiidstream}% \fi% }{% \edef\@MXV@iiidstream{\@MXV@getlabelvalue{\@MXV@label.3dstream}}% }% \fi% % %insert FileAttachment annotation \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}% % \OR\boolean{@MXV@attachment}% }{% \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/FileAttachment,% Raw={% /F 0% /T (\@MXV@filename)% /Contents (3D Object (\@MXV@mime))% \if@MXV@externalviewer% /Name/Paperclip% /C [1 1 1]% \else /AP <>/R<<>>/D<<>>>>% \fi /FS <<% /F(#4)% /Type/Filespec% /EF <>% >>% }% }% }% }{% \if@MXV@url% %insert Link annotation, if 3D file is a URL \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/Link,% Raw={% /F 0% \if@MXV@externalviewer% /C [\@urlbordercolor]% /H \@pdfhighlight% \else% /H /N% /Border [0 0 0]% \fi% /A <>% /Contents (3D Object (\@MXV@mime))% }% }% }% \else% %else insert Launch action for local external 3D file \if@MXV@inline\else% \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/Link,% Raw={% /F 0% \if@MXV@externalviewer% /C [\@urlbordercolor]% /H \@pdfhighlight% \else% /H /N% /Border [0 0 0]% \fi% /A <<% /F (#4)% /S /Launch% >>% /Contents (3D Object (\@MXV@mime))% }% }% }% \fi% \fi% }% \if@MXV@externalviewer% \phantom{\@MXV@box{#1}{#2}{#3}}% \else% %appearance dict dummy, to be shared by all 3D annots \ifthenelse{\isundefined{\@MXV@apdict}}{% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {apdict}% /type/stream% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {apdict}% ()% }% }% \xdef\@MXV@apdict{/AP << /N {apdict}>>}% }{}% %3D reference dict \if@MXV@presentation% \ifthenelse{% \equal{\@MXV@getlabelvalue{\@MXV@label.3dref}}{undefined}% }{% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {iiiDref\the\@MXV@includes}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {iiiDref\the\@MXV@includes} <<% /Type/3DRef% /3DD {\@MXV@iiidstream}% 3D stream object >>% }% }% \edef\@MXV@iiidstreamorref{iiiDref\the\@MXV@includes}% \@MXV@newlabel{\@MXV@label.3dref}{\@MXV@iiidstreamorref}% }{% \edef\@MXV@iiidstreamorref{\@MXV@getlabelvalue{\@MXV@label.3dref}}% }% \else% \edef\@MXV@iiidstreamorref{\@MXV@iiidstream}% \fi% %annotation object of subtype `3D' \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/3D,% Raw={% /_objdef {3Dannot\the\@MXV@includes}% /F 4% /T (\@MXV@filename)% \ifx\@MXV@@label\@empty\else% /NM (\@MXV@@label)% \fi% /Contents (3D Object (\@MXV@mime))% /P {ThisPage}% \@MXV@apdict% /AP <>/R<<>>/D<<>>>> doesn't work here \@MXV@defaultview% /3DI \if@MXV@iiidctrls true\else false\fi% /3DD {\@MXV@iiidstreamorref}% 3D stream or reference object /3DA << \@MXV@activation\@MXV@deactivation >>% }% }% \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}% \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}% \fi% \fi% }% \fi% }{} %settings for newly opened media players \def\@MXV@settings#1#2#3#4#5#6#7{% var settings={% privateData: {% paused: false }, autoPlay: false, visible: false, volume: #7 #1% showUI (controls) #2% palindrome #3% repeat #4% rate #5% startAt #6% endAt }; } %JavaScript event handler routines for 2D media activation \def\@MXV@events#1#2#3{% #1: playerid, #2: mouse?, #3: autoplay? var events=new app.media.Events({% %on focus change from one movie to another, events are fired in the %following order: (1) onBlur, (2) onFocus, (3) afterBlur, (4) afterFocus onBlur: function (e) {% if(focusonplayer > 0){% focusonplayer=0; } }, afterBlur: function (e) {% %only resume if we click outside of any media if(focusonplayer==0){% try{ e.target.settings.privateData.paused=false; e.target.play(); }catch(e){} } }, onFocus: function (e) {% focusonplayer=#1; }, afterFocus: function (e) {% if(!e.target.isPlaying){%play on click if paused try{ e.target.settings.privateData.paused=false; e.target.play(); if(!e.target.isPlaying){%still not playing?! %sometimes play() fails, in particular if the movie has reached %its end before getting the focus; but this works: if( e.target.settings.startAt.time || e.target.settings.startAt.frame || e.target.settings.startAt.marker || e.target.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ e.target.seek(e.target.settings.startAt); }else{ e.target.stop(); } e.target.play(); } } catch (e){} } \@MXV@if{#2}% else{% %media can only be paused if mouse option is set try{ e.target.pause(); e.target.settings.privateData.paused=true; }catch (e){} } \fi% e.target.visible=true; }, onPlay: function (e) {% e.target.settings.privateData.paused=false; }, onPause: function (e) {% e.target.settings.privateData.paused=true; }, afterReady: function (e) {% try{ if( e.target.settings.startAt.time || e.target.settings.startAt.frame || e.target.settings.startAt.marker ){ e.target.play(); e.target.pause(); e.target.stop(); e.target.settings.privateData.paused=false; e.target.seek(e.target.settings.startAt); } e.target.visible=true; \@MXV@if{#3} e.target.settings.privateData.paused=false; e.target.play(); \fi } catch (e){} } }); }% %output driver specific implementations of the 2D inclusion macro \ifpdf% %pdfLaTeX version \def\@MXV@includemovie#1#2#3#4{% %insert box or poster \@MXV@box{#1}{#2}{#3}% % \if@MXV@externalviewer\else% %new action dict \pdfobj reserveobjnum% \@MXV@adict=\pdflastobj% % %new additional actions dict \pdfobj reserveobjnum% \@MXV@aadict=\pdflastobj% % \fi% %embedded file entry `/EF' \if@MXV@inline% %embed the same media file only once \ifthenelse{\equal{\@MXV@getlabelvalue{#4}}{undefined}}{% \pdfobj stream % attr {% /Type/EmbeddedFile% /Subtype (\@MXV@mime)% }% file {#4}% \pdfrefobj\pdflastobj% \edef\@MXV@efentry{% /EF << /F \the\pdflastobj\space 0 R >>% }% \@MXV@newlabel{#4}{\the\pdflastobj}% }{% \edef\@MXV@efentry{% /EF << /F \@MXV@getlabelvalue{#4}\space 0 R >>% }% }% \else\def\@MXV@efentry{}\fi% % \ifthenelse{\boolean{@MXV@externalviewer}\AND\NOT\boolean{@MXV@inline}}{}{% %new file specification object \pdfobj {<<% /F(#4)% \@MXV@fsentry% \@MXV@efentry% /Type/Filespec% >>}\pdfrefobj\pdflastobj% \edef\@MXV@filespec{\the\pdflastobj}% }% % \makebox[0pt][r]{\makebox[#1][l]{% %insert FileAttachment annotation \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR% \boolean{@MXV@attachment}% }{% \pdfannot width #1 height #2 depth #3 {% /Subtype /FileAttachment% /F 0% /T (\@MXV@filename)% /Contents (Media File (\@MXV@mime))% \if@MXV@externalviewer% %a coloured border, as with external links, would be much nicer /Name/Paperclip% /C [1 1 1]% \else% /AP <>/R<<>>/D<<>>>>% \fi% /FS \@MXV@filespec\space 0 R% }% }{% \if@MXV@url% %insert Link annotation, if media file is a URL \pdfannot width #1 height #2 depth #3 {% /Subtype /Link% /F 0% \if@MXV@externalviewer% \@MXV@urlattr% \else% /H /N% /Border [0 0 0]% \fi% /A <>% /Contents (Media File (\@MXV@mime))% }% \else% %else insert Launch action for local external media file \if@MXV@inline\else% \pdfannot width #1 height #2 depth #3 {% /Subtype /Link% /F 0% \if@MXV@externalviewer% \@MXV@runattr% \else% /H /N% /Border [0 0 0]% \fi% /A <<% /F (#4)% /S /Launch% >>% /Contents (Media File (\@MXV@mime))% }% \fi% \fi% }% % \if@MXV@externalviewer\else% %new annotation object of subtype `Screen'% \pdfannot width #1 height #2 depth #3 {% /Subtype /Screen% /Border [0 0 0]% no border (PDF-1.1) /BS <>% no border (PDF-1.5) /F 5% disable annot if multimedia is not available /T (\@MXV@filename)% /Contents (Media File (\@MXV@mime))% /P \@MXV@pdfpageref{@MXV@annot\the\@MXV@includes.page} 0 R% /A \the\@MXV@adict\space 0 R% /AA \the\@MXV@aadict\space 0 R% /AP <>/R<<>>/D<<>>>>% }\edef\@MXV@screenannot{\the\pdflastannot}% %label for later annot obj number determination, to be used in %movieref's only \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\@MXV@screenannot}% \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\@MXV@screenannot}% \fi% % %new media clip object of subtype `Media Clip Data' (/S/MCD) \pdfobj {<<% /D \@MXV@filespec\space 0 R% /P <>% /S/MCD% /CT (\@MXV@mime)% >>}\pdfrefobj\pdflastobj% % %new rendition object of subtype `Media Rendition' (/S/MR) \pdfobj {<<% /C \the\pdflastobj\space 0 R% /S/MR% /SP <>>>% /P <<% \@MXV@player% /BE <<% /F 2% \@MXV@@repeat\@MXV@@volume\@MXV@@ctrls% /D <>% >>% >>% >>}\edef\@MXV@mediarendition{\the\pdflastobj}\pdfrefobj\pdflastobj% %label for later rendition obj number determination \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.rendition}{\@MXV@mediarendition}% \@MXV@newlabel{@MXV@\@MXV@@label.rendition}{\@MXV@mediarendition}% \fi% % %action dictionary \pdfobj useobjnum \@MXV@adict {<<% /R \@MXV@mediarendition\space 0 R% /S/Rendition% /OP 0% fallback if /JS doesn't work or is empty \@MXV@activationjsentry% /AN \@MXV@screenannot\space 0 R% >>}\pdfrefobj\pdflastobj% % %create play/stop/resume/pause actions \pdfobj {<<% /R \@MXV@mediarendition\space 0 R% /S/Rendition% \@MXV@pageopenopentry% /OP fallback if /JS doesn't work \@MXV@pageopenjsentry% /AN \@MXV@screenannot\space 0 R% >>}\edef\@MXV@pageopenaction{\the\pdflastobj}\pdfrefobj\pdflastobj% % \pdfobj {<<% /R \@MXV@mediarendition\space 0 R% /S/Rendition% \@MXV@pagecloseopentry% \@MXV@pageclosejsentry% /AN \@MXV@screenannot\space 0 R% >>}\edef\@MXV@pagecloseaction{\the\pdflastobj}\pdfrefobj\pdflastobj% % %populate additional actions dictionary \pdfobj useobjnum \@MXV@aadict {<<% /PO \@MXV@pageopenaction\space 0 R% /PC \@MXV@pagecloseaction\space 0 R% >>}\pdfrefobj\pdflastobj% \fi}}% }% \else% %dvips version \def\@MXV@includemovie#1#2#3#4{% %insert FileAttachment annotation \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR% \boolean{@MXV@attachment}% }{% \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/FileAttachment,% Raw={% /F 0% /T (\@MXV@filename)% /Contents (Media File (\@MXV@mime))% \if@MXV@externalviewer% /Name/Paperclip% /C [1 1 1]% \else% /AP <>/R<<>>/D<<>>>>% \fi% /FS {filespec\the\@MXV@includes}% }% }% }% }{% \if@MXV@url% %insert Link annotation, if media file is a URL \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/Link,% Raw={% /F 0% \if@MXV@externalviewer% /C [\@urlbordercolor]% /H \@pdfhighlight% \else% /H /N% /Border [0 0 0]% \fi% /A <>% /Contents (Media File (\@MXV@mime))% }% }% }% \else% %else insert Launch action for local external media file \if@MXV@inline\else% \makebox[0pt][l]{% \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{% pdfmark=/ANN,% Subtype=/Link,% Raw={% /F 0% \if@MXV@externalviewer% /C [\@urlbordercolor]% /H \@pdfhighlight% \else% /H /N% /Border [0 0 0]% \fi% /A <<% /F (#4)% /S /Launch% >>% /Contents (Media File (\@MXV@mime))% }% }% }% \fi% \fi% }% % \if@MXV@externalviewer% \@MXV@box{#1}{#2}{#3}% \else% %new annotation object of subtype `Screen'% \pdfmark[\@MXV@box{#1}{#2}{#3}]{% pdfmark=/ANN,% Subtype=/Screen,% Border={0 0 0},% Raw={% /_objdef {screenannot\the\@MXV@includes}% /F 5% /T (\@MXV@filename)% /Contents (Media File (\@MXV@mime))% /BS <>% no border (PDF-1.5) /P {ThisPage}% /AA {aadict\the\@MXV@includes}% /AP <>/R<<>>/D<<>>>>% }% }% \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}% \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}% \fi% % %entire action entry moved outside screen annotation \pdfmark{% pdfmark=/PUT,% Raw={% {screenannot\the\@MXV@includes} <<% /A <<% /R {mediarendition\the\@MXV@includes}% /S/Rendition% /OP 0% fallback, if /JS doesn't work or is empty \@MXV@activationjsentry% /AN {screenannot\the\@MXV@includes}% >>% >>% }% }% % %new rendition object of subtype `Media Rendition' (/S/MR) \pdfmark{% pdfmark=/OBJ,% Raw={% /type/dict% /_objdef {mediarendition\the\@MXV@includes}% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {mediarendition\the\@MXV@includes} <<% /C {mediaclipdata\the\@MXV@includes}% /S/MR% /SP <>>>% %screen parameters: fully transparent /P <<%Media Play Parameters \@MXV@player% /BE <<%Parameters need only be honored by the player in %the best effort sense /F 2%scale media's width and height to fit the %annotation rectangle \@MXV@@repeat\@MXV@@volume\@MXV@@ctrls% /D <>%movie remains opened >>% >>% >>% }% }% % %new media clip object of subtype `Media Clip Data' (/S/MCD) \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {mediaclipdata\the\@MXV@includes}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {mediaclipdata\the\@MXV@includes} <<% /D {filespec\the\@MXV@includes}% /P <>% /S/MCD% /CT (\@MXV@mime)% mime type >>% }% }% \fi% % %new file specification object \ifthenelse{\boolean{@MXV@externalviewer}\AND\NOT\boolean{@MXV@inline}}{}{% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {filespec\the\@MXV@includes}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {filespec\the\@MXV@includes} <<% \@MXV@fsentry /F(#4)% file name /Type/Filespec% >>% }% }% }% % %embedded file entry `/EF' \if@MXV@inline% %embed the same media file only once \ifthenelse{\equal{\@MXV@getlabelvalue{#4}}{undefined}}{% %new stream object \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {fstream\the\@MXV@includes}% /type/stream% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {fstream\the\@MXV@includes}% (#4) (r) file% read in file contents }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {fstream\the\@MXV@includes} <<% /Type/EmbeddedFile% /Subtype(\@MXV@mime)% >>% }% }% \edef\@MXV@moviestream{fstream\the\@MXV@includes}% \@MXV@newlabel{#4}{fstream\the\@MXV@includes}% }{% \edef\@MXV@moviestream{\@MXV@getlabelvalue{#4}}% }% % put the embedded file entry into file spec object \pdfmark{% pdfmark=/PUT,% Raw={% {filespec\the\@MXV@includes} <<% /EF << /F {\@MXV@moviestream} >>% >>% }% }% \fi% % \if@MXV@externalviewer\else% %create actions for page open/close events \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {pageopenaction\the\@MXV@includes}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {pageopenaction\the\@MXV@includes} <<% /R {mediarendition\the\@MXV@includes}% /S/Rendition% \@MXV@pageopenopentry% /OP fallback, if /JS doesn't work \@MXV@pageopenjsentry% /AN {screenannot\the\@MXV@includes}% >>% }% }% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {pagecloseaction\the\@MXV@includes}% /type/dict% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {pagecloseaction\the\@MXV@includes} <<% /R {mediarendition\the\@MXV@includes}% /S/Rendition% \@MXV@pagecloseopentry% \@MXV@pageclosejsentry% /AN {screenannot\the\@MXV@includes}% >>% }% }% % %create and populate additional actions dictionary, always add entries %for page open/close events \pdfmark{% pdfmark=/OBJ,% Raw={% /type/dict% /_objdef {aadict\the\@MXV@includes}% }% }% % \pdfmark{% pdfmark=/PUT,% Raw={% {aadict\the\@MXV@includes} <<% /PO {pageopenaction\the\@MXV@includes}% /PC {pagecloseaction\the\@MXV@includes}% >>% }% }% \fi% }% \fi %definition of user command `\includemovie' \newcommand{\includemovie}[4][]{% \leavevmode% \@MXV@reset% all macros and options \setkeys{movie15}{#1}% parse options % %total height of text \@MXV@totalheight=\@MXV@height% \advance\@MXV@totalheight by \@MXV@depth% %traiselen=distance at which text is to be raised to centre it vertically %braiselen=vertical centre of media box (auxiliary measure) \@MXV@traiselen=0.5\@MXV@height% \advance\@MXV@traiselen by -0.5\@MXV@depth% % \ifthenelse{\equal{#3}{}}{% no height argument \@MXV@braiselen=0.5\@MXV@height% }{%override height of text, height argument given \@MXV@braiselen=#3% \@MXV@braiselen=0.5\@MXV@braiselen% \setlength{\@MXV@height}{#3}% }% % \ifthenelse{\equal{\@MXV@boxdepth}{}}{% no depth option given \ifthenelse{\lengthtest{\@MXV@totalheight>\@MXV@height}}{% %depth of text only taken into account, if the total height %is smaller than the height of the display box \advance\@MXV@braiselen by -0.5\@MXV@depth% }{% \@MXV@depth=0pt% }% }{%override depth of text, depth option given \setlength{\@MXV@@boxdepth}{\@MXV@boxdepth}% \advance\@MXV@braiselen by -0.5\@MXV@@boxdepth% \setlength{\@MXV@depth}{\@MXV@boxdepth}% }% %finally centre text vertically \ifthenelse{\NOT\equal{#3}{}\OR\NOT\equal{\@MXV@boxdepth}{}}{% \advance\@MXV@traiselen by -\@MXV@braiselen% \@MXV@traiselen=-\@MXV@traiselen% \savebox{\@MXV@textbox}{\raisebox{\@MXV@traiselen}[0pt][0pt]{% \usebox{\@MXV@textbox}}}% }{}% \ifthenelse{\equal{#2}{}}{}{%override horiz. dimension of text \setlength{\@MXV@width}{#2}% %centre text horizontally \savebox{\@MXV@textbox}{\makebox[\@MXV@width][c]{\usebox{\@MXV@textbox}}}% }% % %find out if some presentation making package is being used %and whether the contents should be hidden or not on the current slide \setboolean{@MXV@presentation}{false}% \setboolean{@MXV@hide}{false}% \ifx\ifpd@overlay\@undefined\relax% \else% powerdot \setboolean{@MXV@presentation}{true}% \ifthenelse{\boolean{pd@overlay}}{}{% \ifthenelse{\pd@method=2}{}{% \setboolean{@MXV@hide}{true}% }% }% \fi% \ifx\ifbeamer@anotherslide\@undefined\relax\else% \setboolean{@MXV@presentation}{true}% \ifthenelse{\boolean{beamer@anotherslide}}{% \setboolean{@MXV@hide}{true}% }{}% \fi% % \ifthenelse{\boolean{@MXV@hide}}{% %insert whitespace instead of annot \phantom{\vrule width \@MXV@width height \@MXV@height depth \@MXV@depth}% }{% \ifthenelse{\NOT\boolean{@MXV@url}\AND\NOT\boolean{@MXV@inline}}{% \IfFileExists{#4}{}{% \PackageError{movie15}{% File `#4' cannot be opened for embedding.\MessageBreak Did you forget to set option `url' or `inline=false'? }{% Try any of the options `url' or `inline=false'! }% }% }{}% % %guess the mime type based on the filename extension \filename@parse{#4}% \ifthenelse{\equal{\@MXV@mime}{@MXV@auto}}{% \@MXV@guessmime{#4}{\filename@ext}}{}% \if\filename@ext\relax% \xdef\@MXV@filename{\filename@base}% \else% \xdef\@MXV@filename{\filename@base.\filename@ext}% \fi% % %if 3D object is not embedded inline we must use some external player :( \ifthenelse{% \boolean{@MXV@iiid} \AND\NOT\boolean{@MXV@inline} }{% \setboolean{@MXV@externalviewer}{true}% }{}% % %some link attributes (if hyperref not loaded) \ifthenelse{\isundefined{\@pdfborder}}{% \def\@MXV@urlattr{}% \def\@MXV@runattr{}% }{% \edef\@MXV@urlattr{% \ifx\beamer@version\@undefined% /Border [\@pdfborder]% \else% /Border [1 1 1]% \fi% /C [\@urlbordercolor]% /H \@pdfhighlight% }% \edef\@MXV@runattr{% \ifx\beamer@version\@undefined% /Border [\@pdfborder]% \else% /Border [1 1 1]% \fi% /C [\@runbordercolor]% /H \@pdfhighlight% }% }% % \global\advance\@MXV@includes by 1%increment counter % %label this annotation for later page number determination \@MXV@labeltoaux{@MXV@annot\the\@MXV@includes.page}{% \noexpand\the\@MXV@page}% % %label this annotation for later annot id number determination & %check for multiply-defined labels % \@MXV@label --> automatic (presentation mode) or user defined label % \@MXV@@label = \@MXV@label (non presentation doc classes) % \@MXV@@label = \@MXV@label + physical page No. (presentation mode) \ifx\@MXV@label\@empty% %when used with presentation packages, annots must be labelled, %use the media file name, if no label provided \ifthenelse{\boolean{@MXV@presentation}}{% \xdef\@MXV@label{#4}% }{}% \fi% \ifx\@MXV@label\@empty\else% \ifthenelse{\boolean{@MXV@presentation}}{% %in presentation mode, the label must be extended by the physical page No. \xdef\@MXV@@label{\@MXV@label.\@MXV@getlabelvalue{@MXV@annot\the\@MXV@includes.page}}% }{% \xdef\@MXV@@label{\@MXV@label}% }% \fi% \ifx\@MXV@@label\@empty\else% \ifthenelse{% \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{undefined}% \AND% \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{% \the\@MXV@includes}% }{% \PackageWarning{movie15}{% Label `\@MXV@label' multiply defined% }% \ifthenelse{\isundefined{\@MXV@multiwarning}}{% \gdef\@MXV@multiwarning{}% \AtEndDocument{% \PackageWarningNoLine{movie15}{% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak @@ There were multiply-defined labels! @@\MessageBreak @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}% }% }{}% }{}% \@MXV@labeltoaux{@MXV@\@MXV@@label.annotid}{\the\@MXV@includes}% \@MXV@newlabel{@MXV@\@MXV@@label.annotid}{\the\@MXV@includes}% \fi% % \ifthenelse{\boolean{@MXV@externalviewer}}{% \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.externalviewer}{true}% \@MXV@newlabel{@MXV@\@MXV@label.externalviewer}{true}% \fi% }{% %what is to be put into movie link annot depends on the following \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.externalviewer}{false}% \@MXV@newlabel{@MXV@\@MXV@label.externalviewer}{false}% \fi% % %test for hyperref package \ifthenelse{\NOT\boolean{pdf}\AND\isundefined{\pdfmark}}{% \@MXV@missing{hyperref}% }{}% % %depending on options do content specific stuff \ifthenelse{\boolean{@MXV@iiid}}{% % #### 3D #### \ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@autoresume}}{% \def\@MXV@activation{/A/PV/AIS/L}% open 3D object, run animation }{% \if@MXV@runposter% \def\@MXV@activation{/A/PV/AIS/I}%open 3D obj but don't run animation \else% \def\@MXV@activation{/A/XA}% explicit activation by user \fi% }% \if@MXV@autostop% \def\@MXV@deactivation{/D/PI/DIS/I}% \else% \if@MXV@autopause% \def\@MXV@deactivation{/D/PI/DIS/I}% \else% \if@MXV@autoclose% \def\@MXV@deactivation{/D/PI/DIS/U}% \else%@MXV@continue \def\@MXV@deactivation{/D/PI/DIS/L}% \fi% \fi% \fi% \if@MXV@externalviewer\else% %counter for 3D inclusion on current page \ifthenelse{% \equal{% \@MXV@getlabelvalue{@MXV@annot\the\@MXV@includes.page}% }{\@MXV@oldpage}% }{% \global\advance\@MXV@iiidoncurpage by 1% }{% \global\@MXV@iiidoncurpage=1% }% \xdef\@MXV@oldpage{\@MXV@getlabelvalue{% @MXV@annot\the\@MXV@includes.page}}% \fi% \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{true}% \@MXV@newlabel{@MXV@\@MXV@label.3D}{true}% \fi% \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.3Doncurpage}{\the\@MXV@iiidoncurpage}% \@MXV@newlabel{@MXV@\@MXV@@label.3Doncurpage}{\the\@MXV@iiidoncurpage}% \fi% }{%#### 2D #### %get the player ID \if@MXV@presentation% \ifthenelse{% \equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{undefined}% }{% \global\advance\@MXV@players by 1%increment counter }{% \global\@MXV@players=\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}% }% \@MXV@labeltoaux{@MXV@\@MXV@label.playerid}{\the\@MXV@players}% \@MXV@newlabel{@MXV@\@MXV@label.playerid}{\the\@MXV@players}% \edef\@MXV@currplayer{\the\@MXV@players}% \else% \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.playerid}{\the\@MXV@includes}% \@MXV@newlabel{@MXV@\@MXV@label.playerid}{\the\@MXV@includes}% \fi% \edef\@MXV@currplayer{\the\@MXV@includes}% \fi% % \ifx\@MXV@startat\@empty% default start position \gdef\@MXV@startat{, startAt: 0}% \fi% %write player settings to aux file \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.mouse}{% \if@MXV@mouse true\else false\fi}% \@MXV@labeltoaux{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}% \@MXV@labeltoaux{@MXV@\@MXV@label.palindrome}{\@MXV@palindrome}% \@MXV@labeltoaux{@MXV@\@MXV@label.repeat}{\@MXV@repeat}% \@MXV@labeltoaux{@MXV@\@MXV@label.rate}{\@MXV@rate}% \@MXV@labeltoaux{@MXV@\@MXV@label.startAt}{\@MXV@startat}% \@MXV@labeltoaux{@MXV@\@MXV@label.endAt}{\@MXV@endat}% \@MXV@labeltoaux{@MXV@\@MXV@label.volume}{\@MXV@volume}% \@MXV@labeltoaux{@MXV@\@MXV@label.autoplay}{% \if@MXV@autoplay true\else false\fi}% \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{false}% \@MXV@newlabel{@MXV@\@MXV@label.mouse}{% \if@MXV@mouse true\else false\fi}% \@MXV@newlabel{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}% \@MXV@newlabel{@MXV@\@MXV@label.palindrome}{\@MXV@palindrome}% \@MXV@newlabel{@MXV@\@MXV@label.repeat}{\@MXV@repeat}% \@MXV@newlabel{@MXV@\@MXV@label.rate}{\@MXV@rate}% \@MXV@newlabel{@MXV@\@MXV@label.startAt}{\@MXV@startat}% \@MXV@newlabel{@MXV@\@MXV@label.endAt}{\@MXV@endat}% \@MXV@newlabel{@MXV@\@MXV@label.volume}{\@MXV@volume}% \@MXV@newlabel{@MXV@\@MXV@label.autoplay}{% \if@MXV@autoplay true\else false\fi}% \@MXV@newlabel{@MXV@\@MXV@label.3D}{false}% \fi% % \ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@runposter}}{% \xdef\@MXV@pageopenopentry{/OP 4}% }{% \if@MXV@autoresume% \xdef\@MXV@pageopenopentry{/OP 3}% \else% \xdef\@MXV@pageopenopentry{/OP 2}% \fi% }% % \if@MXV@autostop% \xdef\@MXV@pagecloseopentry{/OP 1}% \else% \if@MXV@autopause% \xdef\@MXV@pagecloseopentry{/OP 2}% \else% \if@MXV@autoclose% \xdef\@MXV@pagecloseopentry{/OP 1}% \else% @MXV@continue \xdef\@MXV@pagecloseopentry{/OP 3}% \fi% \fi% \fi% % %JavaScripts for playback control %script for page invisible event \if@MXV@autopause% \xdef\@MXV@pageclosejsentry{% /JS ( try{% if(player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.pause(); player\@MXV@currplayer.settings.privateData.paused=true; } focusonplayer=-1; %page change player\@MXV@currplayer.visible=false; } catch(e){} )% }% \else% \if@MXV@autostop% \xdef\@MXV@pageclosejsentry{% /JS ( try{% player\@MXV@currplayer.settings.privateData.paused=false; %players tend to be bugged, always stop from playing state if(!player\@MXV@currplayer.isPlaying){ player\@MXV@currplayer.play(); } player\@MXV@currplayer.stop(); if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek(% player\@MXV@currplayer.settings.startAt); } focusonplayer=-1; player\@MXV@currplayer.visible=false; } catch(e){} )% }% \else% \if@MXV@autoclose% \xdef\@MXV@pageclosejsentry{% /JS ( try{% player\@MXV@currplayer.close(app.media.closeReason.general); focusonplayer=-1; %page change player\@MXV@currplayer.visible=false; } catch(e){} )% }% \else% \xdef\@MXV@pageclosejsentry{%@MXV@continue /JS ( try{% focusonplayer=-1; %page change player\@MXV@currplayer.visible=false; } catch(e){} )% }% \fi% \fi% \fi% % %script for activation/resume on page open event \xdef\@MXV@pageopenjsentry{% /JS ( try{% if(player\@MXV@currplayer.isOpen){% %drag the player on the current slide (presentation mode) player\@MXV@currplayer.page=this.pageNum; %... and make it visible player\@MXV@currplayer.visible=true; % %start or resume media which have autoplay option set; %also resume paused media which have autoresume option set \if@MXV@autoplay% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); if(!player\@MXV@currplayer.isPlaying){% still not playing?! if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id=='vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek( player\@MXV@currplayer.settings.startAt); }else{ player\@MXV@currplayer.stop(); } player\@MXV@currplayer.play(); } \else% \if@MXV@autoresume% if(player\@MXV@currplayer.settings.privateData.paused){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); if(!player\@MXV@currplayer.isPlaying){% if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek(% player\@MXV@currplayer.settings.startAt); }else{ player\@MXV@currplayer.stop();% } player\@MXV@currplayer.play(); } } \fi% \fi% } else{% throw "isClosed"; } } catch(e){% \@MXV@if{\if@MXV@autoplay true\else\if@MXV@runposter true\else % false\fi\fi}% if(focusonplayer==undefined){% var focusonplayer=0; %shared by all annots } \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}% {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}% \@MXV@events{\@MXV@currplayer}% {\if@MXV@mouse true\else false\fi}% {\if@MXV@autoplay true\else false\fi}% var player\@MXV@currplayer=app.media.openPlayer({% settings: settings, events: events }); \fi% }% ) }% % %script for normal activation by mouse click \xdef\@MXV@activationjsentry{% /JS ( if(focusonplayer==undefined){% var focusonplayer=0; %shared by all annots } \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}% {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}% \@MXV@events{\@MXV@currplayer}{\if@MXV@mouse true\else false\fi}% {true}% var player\@MXV@currplayer=app.media.openPlayer({% settings: settings, events: events }); ) }% }% }% % %insert link target, if media has been labelled \ifthenelse{\NOT\equal{\@MXV@@label}{}}{% \raisebox{\@MXV@height}{% \ifpdf% \pdfdest name {@MXV@\@MXV@@label} xyz % \else% \hypertarget{@MXV@\@MXV@@label}{}% \fi% }% }{}% % %insert textbox, obscured by poster \ifthenelse{\boolean{@MXV@boxopt}\AND\NOT\boolean{@MXV@textoverposter}}{% \makebox[0pt][l]{\usebox{\@MXV@textbox}}% }{}% % %insert annotation \ifthenelse{\boolean{@MXV@iiid}}{% \@MXV@includeiiid{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}% }{% \@MXV@includemovie{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}% }% % %insert textbox, overprinting the poster \ifthenelse{\boolean{@MXV@boxopt}\AND\boolean{@MXV@textoverposter}}{% \makebox[0pt][r]{\usebox{\@MXV@textbox}}% }{}% }% } %for remote control of media \newcommand\movieref[3][]{% \leavevmode% \savebox{\@MXV@textbox}{#3}% save text argument % %find out if some presentation making package is being used %and whether the contents should be hidden or not on the current slide \setboolean{@MXV@presentation}{false}% \setboolean{@MXV@hide}{false}% \ifx\ifpd@overlay\@undefined\relax% \else% powerdot \setboolean{@MXV@presentation}{true}% \ifthenelse{\boolean{pd@overlay}}{}{% \ifthenelse{\pd@method=2}{}{% \setboolean{@MXV@hide}{true}% }% }% \fi% \ifx\ifbeamer@anotherslide\@undefined\relax\else% \setboolean{@MXV@presentation}{true}% \ifthenelse{\boolean{beamer@anotherslide}}{% \setboolean{@MXV@hide}{true}% }{}% \fi% % \ifthenelse{\boolean{@MXV@hide}}{% %put whitespace instead of link annot \phantom{\usebox{\@MXV@textbox}}% }{% \@MXV@reset% % \xdef\@MXV@label{#2}% % \global\advance\@MXV@links by 1%increment link counter % %label this link for later page number determination \@MXV@labeltoaux{@MXV@link\the\@MXV@links.page}{% \noexpand\the\@MXV@page}% % \ifthenelse{\boolean{@MXV@presentation}}{% %in presentation mode the label must be extended by the physical page No. \xdef\@MXV@@label{\@MXV@label.\@MXV@getlabelvalue{@MXV@link\the\@MXV@links.page}}% }{% \xdef\@MXV@@label{\@MXV@label}% }% % %check if label is defined at all \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{undefined}}{% \usebox{\@MXV@textbox}% write out text box \PackageWarning{movie15}{% Reference `\@MXV@label' on page \thepage \space undefined% }% \ifthenelse{\isundefined{\@MXV@undefwarning}}{% \gdef\@MXV@undefwarning{}% \AtEndDocument{% \PackageWarningNoLine{movie15}{% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak% @@ There were undefined references! @@\MessageBreak% @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}% }% }{}% }{% \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.externalviewer}}{true}}{% \setboolean{@MXV@externalviewer}{true}% }{% \setboolean{@MXV@externalviewer}{false}% }% \if@MXV@externalviewer\else% %movieref used in 3D context? \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3D}}{true}}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \setboolean{@MXV@iiid}{true}% }{% \@MXV@neediiiD% }% }{}% % %actions completely different in 3D & 2D context \ifthenelse{\boolean{@MXV@iiid}}{% #### 3D #### \setkeys{movie15}{#1}% \if@MXV@defaultviewprovided% define a new view, %using any of the coo, c2c, roo, caa options \edef\@MXV@args{\@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space}% \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix \@MXV@viewobj% create pdf object of 3D view \edef\@MXV@iiidview{\@MXV@@viewobj}% %else use the indexed view specified by option `3Dviewindex' \fi% % %java script action \ifthenelse{\NOT\equal{\@MXV@jscriptiiidfile}{}% \OR\NOT\equal{\@MXV@calc}{}% }{% \ifx\@MXV@jscriptiiidfile\@empty\else% \ifthenelse{% \equal{\@MXV@getlabelvalue{\@MXV@jscriptiiidfile}}{undefined}% }{% \ifpdf% \pdfobj stream file {\@MXV@jscriptiiidfile}% \pdfrefobj\pdflastobj% \edef\@MXV@jscriptiiid{/JS \the\pdflastobj\space 0 R}% \@MXV@newlabel{\@MXV@jscriptiiidfile}{\the\pdflastobj}% \else% \pdfmark{% pdfmark=/OBJ,% Raw={% /_objdef {linkjscriptiiid\the\@MXV@links}% /type/stream% }% }% \pdfmark{% pdfmark=/PUT,% Raw={% {linkjscriptiiid\the\@MXV@links}% (\@MXV@jscriptiiidfile) (r) file% }% }% \edef\@MXV@jscriptiiid{% /JS {linkjscriptiiid\the\@MXV@links}% }% \@MXV@newlabel{\@MXV@jscriptiiidfile}% {linkjscriptiiid\the\@MXV@links}% \fi% }{% \ifpdf% \edef\@MXV@jscriptiiid{% /JS \@MXV@getlabelvalue{\@MXV@jscriptiiidfile}\space 0 R% }% \else% \edef\@MXV@jscriptiiid{% /JS {\@MXV@getlabelvalue{\@MXV@jscriptiiidfile}}% }% \fi% }% \fi% \edef\@MXV@jscriptiiidaction{% /Next <<% /S/JavaScript% fill hash (annot3D) with refs to Annot3D objects /JS (% for use within the user provided script try{% annot3D["\@MXV@label"]=getAnnots3D(% \@MXV@getlabelvalue{% @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page% }-1% )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1]; annot3D["\@MXV@label"].activated=true; }catch(e){% try{% annot3D=new Array; annot3D["\@MXV@label"]=getAnnots3D(% \@MXV@getlabelvalue{% @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page% }-1% )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1]; annot3D["\@MXV@label"].activated=true; }catch(e){% spc=String.fromCharCode(32); app.alert("3D" + spc + "annotation" + spc + "could" + spc + "not" + spc + "be" + spc + "activated!"); }% }% )% %JavaScript for calculating 3Droo and 3Dcoo settings for a given %aperture angle \ifx\@MXV@calc\@empty\else% /Next <<% /S/JavaScript% /JS (try{% %aperture angle of the virtual camera var aac = \@MXV@calc; % %list of nodes var nodes = annot3D["\@MXV@label"].context3D.scene.nodes; var cnt = nodes.count; % %auxiliary vectors var dir = new annot3D["\@MXV@label"].context3D.Vector3(); var up = new annot3D["\@MXV@label"].context3D.Vector3(); var corner = new annot3D["\@MXV@label"].context3D.Vector3(); % %auxiliary 4x4 matrix var bbox4x4 = new annot3D["\@MXV@label"].context3D.Matrix4x4(); % %centre of global bounding box --> centre of orbit var coo = % annot3D["\@MXV@label"].context3D.scene.computeBoundingBox().center; % %radius of bounding sphere var rBSphere = 0; % %iterate over all nodes in the scene for(i=0; i) seems %to be bugged, therefore we must resort to the %multiply() method using an auxiliary matrix %which contains the local bounding box corner coordinates % %auxiliary matrix from bbox.min coordinates bbox4x4.setView(bbox.min, dir, up); % %transform to world coordinates bbox4x4 = trans.multiply(bbox4x4.transpose); % %extract the transformed coordinates corner.set(bbox4x4.transpose.translation); % %vector from centre of orbit to bbox corner position corner.subtractInPlace(coo); % %update bounding sphere radius rBSphere = Math.max(rBSphere, corner.length); % %the same procedure with bbox.max bbox4x4.setView(bbox.max, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % %and with all remaining 6 bbox corners corner.set(bbox.min.x, bbox.max.y, bbox.max.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % corner.set(bbox.min.x, bbox.min.y, bbox.max.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % corner.set(bbox.min.x, bbox.max.y, bbox.min.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % corner.set(bbox.max.x, bbox.min.y, bbox.min.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % corner.set(bbox.max.x, bbox.min.y, bbox.max.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); % corner.set(bbox.max.x, bbox.max.y, bbox.min.z); bbox4x4.setView(corner, dir, up); bbox4x4 = trans.multiply(bbox4x4.transpose); corner.set(bbox4x4.transpose.translation); corner.subtractInPlace(coo); rBSphere = Math.max(rBSphere, corner.length); }% }% % %radius of orbit var roo = rBSphere / Math.sin(aac * Math.PI / 360.); % %assemble result string var res = ''; spc=String.fromCharCode(32); if(aac != 30){% res += util.printf('3Daac=\%s,' + spc, % (Math.abs(aac) < 1.001e-6 && Math.abs(aac) > 0 ? % util.printf('\%.18f', aac): aac), 32% ); }% if(coo.length){% res += util.printf( '3Dcoo=\%s' + spc + '\%s' + spc + '\%s,' + spc, % (Math.abs(coo.x) < 1.001e-6 && Math.abs(coo.x) > 0 ? % util.printf('\%.18f', coo.x): coo.x), % (Math.abs(coo.y) < 1.001e-6 && Math.abs(coo.y) > 0 ? % util.printf('\%.18f', coo.y): coo.y), % (Math.abs(coo.z) < 1.001e-6 && Math.abs(coo.z) > 0 ? % util.printf('\%.18f', coo.z): coo.z)% ); }% res += '3Droo=' + roo + ','; % %open pop-up displaying the result string var settings = {% initialize: function(dialog) {% dialog.load({% "text": res% }); }, % description: {% name: '3D' + spc + 'Camera' + spc + 'Settings', % elements: [% {% type: "static_text", % name: 'Copy' + spc + 'and' + spc + 'paste' + spc + 'the' + spc + 'following' + spc + 'to' + spc + 'the' + spc + 'option' + spc + 'list' + spc + 'of' + spc + '\string\\\string\\includemovie!'% }, {% type: "edit_text", % item_id: "text", % alignment: "align_fill", % readonly: false% }, % {% type: "ok", % ok_name: "Close"% }% ]% }% }; app.execDialog(settings); }catch(e){})% \fi% \ifx\@MXV@jscriptiiidfile\@empty\else% /Next <<% /S/JavaScript% \@MXV@jscriptiiid% user provided script >>% \fi% \ifx\@MXV@calc\@empty\else% >>% \fi% >>% }% }{\edef\@MXV@jscriptiiidaction{}}% }{% #### 2D #### %retrieve original settings \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.mouse}}{true}}{% \setboolean{@MXV@mouse}{true}% }{% \setboolean{@MXV@mouse}{false}% }% \edef\@MXV@ctrls{\@MXV@getlabelvalue{@MXV@\@MXV@label.showUI}}% \edef\@MXV@palindrome{\@MXV@getlabelvalue{@MXV@\@MXV@label.palindrome}}% \edef\@MXV@repeat{\@MXV@getlabelvalue{@MXV@\@MXV@label.repeat}}% \edef\@MXV@rate{\@MXV@getlabelvalue{@MXV@\@MXV@label.rate}}% \edef\@MXV@startat{\@MXV@getlabelvalue{@MXV@\@MXV@label.startAt}}% \edef\@MXV@endat{\@MXV@getlabelvalue{@MXV@\@MXV@label.endAt}}% \edef\@MXV@volume{\@MXV@getlabelvalue{@MXV@\@MXV@label.volume}}% \setkeys{movie15}{#1}%override with new settings % \edef\@MXV@operation{}% % %get the player ID \edef\@MXV@currplayer{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}% % %create /OP and /JS entries \if@MXV@linkplay% \edef\@MXV@operation{% /OP 0% /JS (% if(focusonplayer==undefined){% var focusonplayer=0; %shared by all annots }% \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}% {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}% \@MXV@events{\@MXV@currplayer}% {\if@MXV@mouse true\else false\fi}{true}% try{% if(player\@MXV@currplayer.isOpen){% player\@MXV@currplayer.close(% app.media.closeReason.general); player\@MXV@currplayer=null; }% }% catch(e){}% % try{% var player\@MXV@currplayer=app.media.openPlayer({% settings: settings,% events: events% }); }% catch (e){}% )% }% \fi% \if@MXV@linkresume% resume/pause \edef\@MXV@operation{% /OP 3% /JS (% try{% player\@MXV@currplayer.visible=true; if(!player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); if(!player\@MXV@currplayer.isPlaying){% %media at end will restart from beginning if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek( player\@MXV@currplayer.settings.startAt); }else{ player\@MXV@currplayer.stop(); } player\@MXV@currplayer.play(); }% }% else{% player\@MXV@currplayer.pause(); player\@MXV@currplayer.settings.privateData.paused=true; }% }% catch(e){}% )% }% \fi% \if@MXV@linkstop% \edef\@MXV@operation{% /OP 1% /JS (% try{% if(!player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); }% player\@MXV@currplayer.stop(); if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek(% player\@MXV@currplayer.settings.startAt); } }% catch(e){}% )% }% \fi% \if@MXV@linkpause% pause/resume \edef\@MXV@operation{% /OP 2% /JS (% try{% player\@MXV@currplayer.visible=true; if(!player\@MXV@currplayer.isPlaying){% player\@MXV@currplayer.settings.privateData.paused=false; player\@MXV@currplayer.play(); if(!player\@MXV@currplayer.isPlaying){% %media at end will restart from beginning if( player\@MXV@currplayer.settings.startAt.time || player\@MXV@currplayer.settings.startAt.frame || player\@MXV@currplayer.settings.startAt.marker || player\@MXV@currplayer.id == 'vnd.adobe.swname:AAPL_QuickTime' ){ player\@MXV@currplayer.seek( player\@MXV@currplayer.settings.startAt); }else{ player\@MXV@currplayer.stop(); } player\@MXV@currplayer.play(); }% }% else{% player\@MXV@currplayer.pause(); player\@MXV@currplayer.settings.privateData.paused=true; }% }% catch(e){}% )% }% \fi% \if@MXV@linkclose% \edef\@MXV@operation{% /OP 1% /JS (% try{% player\@MXV@currplayer.close(% app.media.closeReason.general); player\@MXV@currplayer=null; }% catch(e){}% )% }% \fi% \if@MXV@linkreset% reset to orig. settings %retrieve original settings \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.mouse}}{true}}{% \setboolean{@MXV@mouse}{true}% }{% \setboolean{@MXV@mouse}{false}% }% \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.autoplay}}{true}}{% \setboolean{@MXV@autoplay}{true}% }{% \setboolean{@MXV@autoplay}{false}% }% % \edef\@MXV@operation{% /OP 0% /JS (% if(focusonplayer==undefined){% var focusonplayer=0; %shared by all annots }% \@MXV@settings{\@MXV@getlabelvalue{@MXV@\@MXV@label.showUI}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.palindrome}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.repeat}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.rate}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.startAt}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.endAt}}% {\@MXV@getlabelvalue{@MXV@\@MXV@label.volume}}% \@MXV@events{\@MXV@currplayer}% {\if@MXV@mouse true\else false\fi}% {\if@MXV@autoplay true\else false\fi}% try{% if(player\@MXV@currplayer.isOpen){% player\@MXV@currplayer.close(% app.media.closeReason.general); player\@MXV@currplayer=null; }% }% catch(e){}% % try{% var player\@MXV@currplayer=app.media.openPlayer({% settings: settings,% events: events% }); }% catch (e){}% )% }% \fi% }% \fi% % \ifpdf% \ifthenelse{\isundefined{\@pdfborder}}{% \def\@MXV@linkattr{}% }{% \edef\@MXV@linkattr{% \ifx\beamer@version\@undefined% /Border [\@pdfborder]% \else% /Border [1 1 1]% \fi% /C [\@linkbordercolor]% /H \@pdfhighlight% }% }% % \pdfstartlink% attr{\@MXV@linkattr}% user{% /Subtype /Link% /A <<% /S/GoTo% /D (@MXV@\@MXV@label)% \if@MXV@externalviewer\else% \if@MXV@iiid% \ifx\@MXV@iiidview\@empty\else% /Next <<% /S/GoTo3DView% /TA \@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}\space 0 R% /V \@MXV@iiidview% \fi% \@MXV@jscriptiiidaction% \ifx\@MXV@iiidview\@empty\else% >>% \fi% \else% /Next <<% /S/Rendition% /R \@MXV@getlabelvalue{@MXV@\@MXV@@label.rendition}\space 0 R% /AN \@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}\space 0 R% \@MXV@operation% >>% \fi% \fi% >>% }% \usebox{\@MXV@textbox}% write out text box \pdfendlink% \else% \pdfmark[{\usebox{\@MXV@textbox}}]{% pdfmark=/ANN,% Subtype=/Link,% Color=\@linkbordercolor,% AcroHighlight=\@pdfhighlight,% Raw={% /_objdef {linkannot\the\@MXV@links}% }% }% % %entire action entry moved outside \pdfmark{% pdfmark=/PUT,% Raw={% {linkannot\the\@MXV@links} <<% /A <<% /S/GoTo% /D (@MXV@\@MXV@label)% \if@MXV@externalviewer\else% \if@MXV@iiid% \ifx\@MXV@iiidview\@empty\else% /Next <<% /S/GoTo3DView% /TA {3Dannot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}}% /V \@MXV@iiidview% \fi% \@MXV@jscriptiiidaction% \ifx\@MXV@iiidview\@empty\else% >>% \fi% \else% /Next <<% /S /Rendition% /R {mediarendition\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}% /AN {screenannot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}}% \@MXV@operation% >>% \fi% \fi% >>% >>% }% }% \fi% }% }% } %key definitions for options to \includemovie \define@key{movie15}{label}{%for use with movieref \gdef\@MXV@label{#1}% } \define@key{movie15}{controls}[true]{% \xdef\@MXV@ctrls{, showUI: #1}% \xdef\@MXV@@ctrls{/C #1}% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \setboolean{@MXV@iiidctrls}{#1}% }{}% } \define@key{movie15}{volume}{% \def\@MXV@@volume{/V #1}% \def\@MXV@volume{#1}% } \define@key{movie15}{mimetype}{% \ifthenelse{\equal{#1}{model/u3d}}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \setboolean{@MXV@iiid}{true}% \xdef\@MXV@iiidsubtype{U3D}% }{\@MXV@neediiiD}% }{}% \def\@MXV@mime{#1}% } \define@key{movie15}{playerid}{% \def\@MXV@player{% /PL<>>>]>>% }% } \define@key{movie15}{autoplay}[true]{% \setboolean{@MXV@autoplay}{#1}% \if@MXV@autoplay% \setboolean{@MXV@autoresume}{false}% \fi% } \define@key{movie15}{autostop}[true]{% \setboolean{@MXV@autostop}{#1}% \if@MXV@autostop% \setboolean{@MXV@autopause}{false}% \fi% } \define@key{movie15}{autoresume}[true]{% \setboolean{@MXV@autoresume}{#1}% \if@MXV@autoresume% \setboolean{@MXV@autoplay}{false}% \setboolean{@MXV@autoclose}{false}% \fi% } \define@key{movie15}{autopause}[true]{% \setboolean{@MXV@autopause}{#1}% \if@MXV@autopause% \setboolean{@MXV@autostop}{false}% \setboolean{@MXV@autoclose}{false}% \fi% } \define@key{movie15}{autoclose}[true]{% \setboolean{@MXV@autoclose}{#1}% \if@MXV@autoclose% \setboolean{@MXV@autostop}{false}% \setboolean{@MXV@autopause}{false}% \fi% } \define@key{movie15}{continue}[true]{% \setboolean{@MXV@autostop}{false}% \setboolean{@MXV@autopause}{false}% \setboolean{@MXV@autoclose}{false}% } \define@key{movie15}{open}[true]{% %no longer supported; once open, media remains loaded %to avoid reloading when media is to be played again } \define@key{movie15}{mouse}[true]{% \setboolean{@MXV@mouse}{#1}% } \define@key{movie15}{palindrome}[true]{% \xdef\@MXV@palindrome{, palindrome: #1}% } \define@key{movie15}{rate}{% \xdef\@MXV@rate{, rate: #1}% } \define@key{movie15}{repeat}[Infinity]{% \ifthenelse{% \equal{#1}{Infinity}\OR% \equal{#1}{0}% }{% \xdef\@MXV@repeat{, repeat: Infinity}% \xdef\@MXV@@repeat{/RC 0}% }{% \xdef\@MXV@repeat{, repeat: #1}% \xdef\@MXV@@repeat{/RC #1}% }% } \define@key{movie15}{startat}{% \xdef\@MXV@startat{, startAt: {#1}}% } \define@key{movie15}{endat}{% \xdef\@MXV@endat{, endAt: {#1}}% } \define@key{movie15}{poster}[true]{% \ifthenelse{\equal{#1}{true}}{% option without arg \setboolean{@MXV@runposter}{true}% }{% \def\@MXV@box##1##2##3{% \ifpdf% \mbox{\pdfximage width ##1 height ##2 depth ##3 {#1}}% \pdfrefximage\pdflastximage% \else% \ifthenelse{\isundefined{\includegraphics}}{% \@MXV@missing{graphicx}% }{% \@MXV@totalheight=##2% \advance\@MXV@totalheight by ##3% \raisebox{-##3}[##2][##3]{% \includegraphics[% width=##1,height=##2,totalheight=\@MXV@totalheight,clip]{#1}% }% }% \fi% }% }% } \define@key{movie15}{externalviewer}[true]{% \setboolean{@MXV@externalviewer}{#1}% } \define@key{movie15}{inline}[true]{% \if@MXV@url% \setboolean{@MXV@inline}{false}% \else% \setboolean{@MXV@inline}{#1}% \fi% \if@MXV@inline\else% \setboolean{@MXV@attachment}{false}% \fi% } \define@key{movie15}{url}[true]{% \setboolean{@MXV@url}{#1}% \if@MXV@url% \setboolean{@MXV@inline}{false}% \setboolean{@MXV@attachment}{false}% \def\@MXV@fsentry{/FS /URL}% \fi% } \define@key{movie15}{attach}[true]{% \setboolean{@MXV@attachment}{#1}% \if@MXV@attachment% \setboolean{@MXV@inline}{true}% \fi% } \define@key{movie15}{text}{% \setboolean{@MXV@boxopt}{true}% \savebox{\@MXV@textbox}{#1}% \@MXV@width=\wd\@MXV@textbox% \@MXV@height=\ht\@MXV@textbox% \@MXV@depth=\dp\@MXV@textbox% } \define@key{movie15}{textoverposter}[true]{% \setboolean{@MXV@textoverposter}{#1}% } \define@key{movie15}{depth}{%set depth of display area \gdef\@MXV@boxdepth{#1}% } %3D specific options \define@key{movie15}{3Dbg}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \def\@MXV@background{/BG<>}% }{\@MXV@neediiiD}% } \define@key{movie15}{3Djscript}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \IfFileExists{#1}{% \def\@MXV@jscriptiiidfile{#1}% }{% \PackageError{movie15}{Script file `#1' cannot be opened for embedding% }{% Make sure file `#1' exists and is readable!% }% }% }{\@MXV@neediiiD}% } \define@key{movie15}{3Dcoo}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \def\@MXV@coo{#1}% \setboolean{@MXV@defaultviewprovided}{true}% }{\@MXV@neediiiD}% } \define@key{movie15}{3Dc2c}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \def\@MXV@ctoc{#1}% \setboolean{@MXV@defaultviewprovided}{true}% }{\@MXV@neediiiD}% } \define@key{movie15}{3Droo}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \def\@MXV@roo{#1}% \setboolean{@MXV@defaultviewprovided}{true}% }{\@MXV@neediiiD}% } \define@key{movie15}{3Daac}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \def\@MXV@aac{#1}% \setboolean{@MXV@defaultviewprovided}{true}% }{\@MXV@neediiiD}% } \define@key{movie15}{3Dviews}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \IfFileExists{#1}{% \def\@MXV@viewsfile{#1}% }{% \PackageError{movie15}{3D views file `#1' cannot be opened% }{% Make sure file `#1' exists and is readable!% }% }% }{\@MXV@neediiiD}% } \define@key{movie15}{3Dcalculate}[30]{% %calculates optimal 3D settings for roo and coo for a given aac \gdef\@MXV@calc{#1}% } %options for \movieref command \define@key{movie15}{play}[true]{% \setboolean{@MXV@linkplay}{#1}% \if@MXV@linkplay% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkreset}{false}% \fi% } \define@key{movie15}{pause}[true]{% \setboolean{@MXV@linkpause}{#1}% \if@MXV@linkpause% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkreset}{false}% \setboolean{@MXV@linkplay}{false}% \fi% } \define@key{movie15}{resume}[true]{% \setboolean{@MXV@linkresume}{#1}% \if@MXV@linkresume% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkreset}{false}% \setboolean{@MXV@linkplay}{false}% \fi% } \define@key{movie15}{stop}[true]{% \setboolean{@MXV@linkstop}{#1}% \if@MXV@linkstop% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkreset}{false}% \setboolean{@MXV@linkplay}{false}% \fi% } \define@key{movie15}{close}[true]{% \setboolean{@MXV@linkclose}{#1}% \if@MXV@linkclose% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkreset}{false}% \setboolean{@MXV@linkplay}{false}% \fi% } \define@key{movie15}{reset}[true]{% \setboolean{@MXV@linkreset}{#1}% \if@MXV@linkreset% \setboolean{@MXV@linkpause}{false}% \setboolean{@MXV@linkresume}{false}% \setboolean{@MXV@linkstop}{false}% \setboolean{@MXV@linkclose}{false}% \setboolean{@MXV@linkplay}{false}% \fi% } \define@key{movie15}{3Dviewindex}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \ifthenelse{% \equal{#1}{F}% \OR\equal{#1}{L}% \OR\equal{#1}{N}% \OR\equal{#1}{P}% \OR\equal{#1}{D}% }{% \gdef\@MXV@iiidview{/#1}% any of F, L, N, P, D }{% \gdef\@MXV@iiidview{#1}% number (index) }% \setboolean{@MXV@defaultviewprovided}{false}% }{\@MXV@neediiiD}% } %compatibility macros \providecommand\movie[3][]{% \leavevmode% \@MXV@reset% \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}% \def\@MXV@starttime{}\def\@MXV@durationtime{}% \setkeys{movie15}{#1}% % %sanity checks \if@MXV@boxopt% \PackageError{movie15}{% Option `text' cannot be used with command `\string\movie'.\MessageBreak Instead, put text into the 1st argument of `\string\movie' }{}% \fi% % \ifx\@MXV@durationtime\@empty\else\ifx\@MXV@startat\@empty\else% \PackageError{movie15}{% Options `startat' and `duration' cannot be used\MessageBreak together.\MessageBreak Possible combinations are `startat'/`endat',\MessageBreak `start'/`endat' or `start'/`duration' }{}% \fi\fi% % %option list \edef\@MXV@movieoptions{#1\@MXV@autostart\@MXV@loop\@MXV@showcontrols}% % %determine playback section \ifx\@MXV@starttime\@empty\else% \edef\@MXV@movieoptions{\@MXV@movieoptions, % startat=time:\strip@pt\@MXV@start}% \fi% \ifx\@MXV@durationtime\@empty\else% \advance\@MXV@end by \@MXV@start% \edef\@MXV@movieoptions{\@MXV@movieoptions, % endat=time:\strip@pt\@MXV@end}% \fi% % %text option from 2nd argument \savebox{\@MXV@textbox}{#2}% \edef\@MXV@movieoptions{[\@MXV@movieoptions, text={\noexpand\usebox{% \noexpand\@MXV@textbox}}]}% \expandafter\includemovie\@MXV@movieoptions{\@MXV@boxwidth}{\@MXV@boxheight}% {#3}% } \newcommand\hyperlinkmovie[3][]{% \leavevmode% \@MXV@reset% \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}% \def\@MXV@starttime{}\def\@MXV@durationtime{}% \setkeys{movie15}{#1}% % %sanity check \ifx\@MXV@durationtime\@empty\else\ifx\@MXV@startat\@empty\else% \PackageError{movie15}{% Options `startat' and `duration' cannot be used\MessageBreak together.\MessageBreak Possible combinations are `startat'/`endat',\MessageBreak `start'/`endat' or `start'/`duration' }{}% \fi\fi% % %option list \edef\@MXV@movieoptions{#1\@MXV@autostart\@MXV@loop\@MXV@showcontrols}% % %determine playback section \ifx\@MXV@starttime\@empty\else% \edef\@MXV@movieoptions{\@MXV@movieoptions, % startat=time:\strip@pt\@MXV@start}% \fi% \ifx\@MXV@durationtime\@empty\else% \advance\@MXV@end by \@MXV@start% \edef\@MXV@movieoptions{\@MXV@movieoptions, % endat=time:\strip@pt\@MXV@end}% \fi% % \edef\@MXV@movieoptions{[\@MXV@movieoptions]}% \expandafter\movieref\@MXV@movieoptions{#2}{#3}% } %compatibility options for \movie and \hyperlinkmovie commands \define@key{movie15}{borderwidth}{% %ignored; acroread doesn't draw borders around screen annots anyway } \define@key{movie15}{height}{%set height of display area \gdef\@MXV@boxheight{#1}% } \define@key{movie15}{width}{%set width of display area \gdef\@MXV@boxwidth{#1}% } \define@key{movie15}{autostart}[true]{% \xdef\@MXV@autostart{, autoplay=#1}% } \define@key{movie15}{loop}[Infinity]{% \xdef\@MXV@loop{, repeat=#1}% } \define@key{movie15}{once}[]{% \xdef\@MXV@loop{, repeat=1}% } \define@key{movie15}{showcontrols}[true]{% \xdef\@MXV@showcontrols{, controls=#1}% } \define@key{movie15}{start}{% \gdef\@MXV@starttime##1s{% \global\@MXV@start=##1pt% }% \@MXV@starttime #1% } \define@key{movie15}{duration}{% \gdef\@MXV@durationtime##1s{% \global\@MXV@end=##1pt% }% \@MXV@durationtime #1% }