summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/movie15
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-05-23 20:55:07 +0000
committerKarl Berry <karl@freefriends.org>2006-05-23 20:55:07 +0000
commit42cb90508c7d60d9183533b23d65ac36e35ea4c0 (patch)
treec178ed8f87bfa7f492ae1f05c7f349810ea065da /Master/texmf-dist/tex/latex/movie15
parentd5edbfb2290391fa1e9cd218c042f0711c0ea78b (diff)
movie15 update
git-svn-id: svn://tug.org/texlive/trunk@1586 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/movie15')
-rw-r--r--Master/texmf-dist/tex/latex/movie15/movie15.sty2214
1 files changed, 1458 insertions, 756 deletions
diff --git a/Master/texmf-dist/tex/latex/movie15/movie15.sty b/Master/texmf-dist/tex/latex/movie15/movie15.sty
index e952abb967d..cae17c79f0f 100644
--- a/Master/texmf-dist/tex/latex/movie15/movie15.sty
+++ b/Master/texmf-dist/tex/latex/movie15/movie15.sty
@@ -9,11 +9,13 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{movie15}[2005/10/13]
+\ProvidesPackage{movie15}[2006/05/22]
\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 beeing embedded
\DeclareOption{3D}{%
@@ -23,42 +25,35 @@
\DeclareOption*{\PackageWarning{movie15}{Unknown Option \CurrentOption}}
\ProcessOptions\relax
-%find out which LaTeX is being used
-\newboolean{@MXV@pdf}%
-\ifthenelse{\isundefined{\pdfoutput}}{%
- %latex with dvips
- \setboolean{@MXV@pdf}{false}%
-}{%
- \ifthenelse{\number\pdfoutput<1}{%
- %pdflatex in DVI mode
- \setboolean{@MXV@pdf}{false}%
- }{%
- %pdflatex in PDF mode
- \ifthenelse{\pdftexversion<120}{%
- \PackageError{movie15}{%
- pdfTeX/pdfLaTeX version >= 1.20 required for direct PDF output
- }{%
- Try to install a more recent version!
- }%
+%correct pdfTeX version?
+\ifpdf%
+ \ifnum\pdftexversion<120%
+ \PackageError{movie15}{%
+ pdf(La)TeX version >= 1.20 required for direct PDF output
}{%
- \setboolean{@MXV@pdf}{true}%
+ Install a more recent version!
}%
- }%
-}
+ \fi%
+\fi%
%for conditionals where \ifthenelse doesn't work
\gdef\@MXV@if#1{\csname if#1\endcsname}%
-%maintaining a counter for absolute page number
+\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%
+\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{{%
- \global\expandafter\def\csname#1\endcsname{#2}}}%
+ \expandafter\xdef\csname#1\endcsname{#2}}}%
\def\@MXV@getlabelvalue#1{%
\expandafter\ifx\csname#1\endcsname\relax%
@@ -86,7 +81,7 @@
}{}%
}%
%
-\ifthenelse{\boolean{@MXV@pdf}}{%
+\ifpdf%
%for storing pdf object numbers (must be counters)
\newcount\@MXV@adict%
\newcount\@MXV@aadict%
@@ -99,11 +94,11 @@
\expandafter\pdfpageref\csname#1\endcsname\space%
\fi%
}%
-}{%
+\else%
\PassOptionsToPackage{pdfmark}{hyperref}%
%counter for absolute number of movierefs
\newcount\@MXV@links
-}
+\fi
%counter for absolute number of inclusions,
%used for labelling each annotation
@@ -168,6 +163,7 @@
\setboolean{@MXV@linkreset}{false}%
\gdef\@MXV@label{}% for movieref
\gdef\@MXV@mime{@MXV@auto}%
+ \gdef\@MXV@player{}%
\gdef\@MXV@fsentry{}%
\gdef\@MXV@repeat{}%
\gdef\@MXV@@repeat{}%
@@ -192,6 +188,7 @@
\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{}%
@@ -201,9 +198,11 @@
\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
}{}%
}%
@@ -229,55 +228,57 @@
}
%macro to guess the mime type of the media file
-\def\@MXV@guessmime#1{%
- \filename@parse{#1}%
- \ifthenelse{\equal{\filename@ext}{aiff}\OR\equal{\filename@ext}{AIFF}\OR%
- \equal{\filename@ext}{aif}\OR\equal{\filename@ext}{AIF}\OR%
- \equal{\filename@ext}{aifc}\OR\equal{\filename@ext}{AIFC}}{%
+\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{\filename@ext}{wav}\OR\equal{\filename@ext}{WAV}}{%
+ \ifthenelse{\equal{#2}{wav}\OR\equal{#2}{WAV}}{%
\gdef\@MXV@mime{audio/wav}%
}{%
- \ifthenelse{\equal{\filename@ext}{wma}\OR\equal{\filename@ext}{WMA}}{%
+ \ifthenelse{\equal{#2}{wma}\OR\equal{#2}{WMA}}{%
\gdef\@MXV@mime{audio/x-ms-wma}%
}{%
- \ifthenelse{\equal{\filename@ext}{wmv}\OR\equal{\filename@ext}{WMV}}{%
+ \ifthenelse{\equal{#2}{wmv}\OR\equal{#2}{WMV}}{%
\gdef\@MXV@mime{video/x-ms-wmv}%
}{%
- \ifthenelse{\equal{\filename@ext}{au}\OR\equal{\filename@ext}{AU}\OR%
- \equal{\filename@ext}{snd}\OR\equal{\filename@ext}{SND}}{%
+ \ifthenelse{\equal{#2}{au}\OR\equal{#2}{AU}\OR%
+ \equal{#2}{snd}\OR\equal{#2}{SND}}{%
\gdef\@MXV@mime{audio/basic}%
}{%
- \ifthenelse{\equal{\filename@ext}{mid}\OR\equal{\filename@ext}{MID}\OR%
- \equal{\filename@ext}{rmi}\OR\equal{\filename@ext}{RMI}}{%
+ \ifthenelse{\equal{#2}{mid}\OR\equal{#2}{MID}\OR%
+ \equal{#2}{rmi}\OR\equal{#2}{RMI}}{%
\gdef\@MXV@mime{audio/midi}%
}{%
- \ifthenelse{\equal{\filename@ext}{mov}\OR\equal{\filename@ext}{MOV}\OR%
- \equal{\filename@ext}{qt}\OR\equal{\filename@ext}{QT}}{%
+ \ifthenelse{\equal{#2}{mov}\OR\equal{#2}{MOV}\OR%
+ \equal{#2}{qt}\OR\equal{#2}{QT}}{%
\gdef\@MXV@mime{video/quicktime}%
}{%
- \ifthenelse{\equal{\filename@ext}{mp3}\OR\equal{\filename@ext}{MP3}\OR%
- \equal{\filename@ext}{m3u}\OR\equal{\filename@ext}{M3U}}{%
+ \ifthenelse{\equal{#2}{mp3}\OR\equal{#2}{MP3}\OR%
+ \equal{#2}{m3u}\OR\equal{#2}{M3U}}{%
\gdef\@MXV@mime{audio/x-mp3}%
}{%
- \ifthenelse{\equal{\filename@ext}{mp4}\OR\equal{\filename@ext}{MP4}}{%
+ \ifthenelse{\equal{#2}{mp4}\OR\equal{#2}{MP4}}{%
\gdef\@MXV@mime{video/mp4}%
}{%
- \ifthenelse{\equal{\filename@ext}{avi}\OR\equal{\filename@ext}{AVI}}{%
+ \ifthenelse{\equal{#2}{avi}\OR\equal{#2}{AVI}}{%
\gdef\@MXV@mime{video/avi}%
}{%
- \ifthenelse{\equal{\filename@ext}{mpeg}\OR\equal{\filename@ext}{MPEG}\OR%
- \equal{\filename@ext}{mpg}\OR\equal{\filename@ext}{MPG}}{%
+ \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{\filename@ext}{smil}\OR\equal{\filename@ext}{SMIL}}{%
+ \ifthenelse{\equal{#2}{smil}\OR\equal{#2}{SMIL}}{%
\gdef\@MXV@mime{application/smil}%
}{%
- \ifthenelse{\equal{\filename@ext}{swf}\OR\equal{\filename@ext}{SWF}}{%
+ \ifthenelse{\equal{#2}{swf}\OR\equal{#2}{SWF}}{%
\gdef\@MXV@mime{application/x-shockwave-flash}%
}{%
- \ifthenelse{\equal{\filename@ext}{u3d}\OR\equal{\filename@ext}{U3D}}{%
+ \ifthenelse{\equal{#2}{u3d}\OR\equal{#2}{U3D}}{%
\ifthenelse{\boolean{@MXV@iiiDfeat}}{%
\setboolean{@MXV@iiid}{true}%
\gdef\@MXV@mime{model/u3d}% (unofficial)
@@ -286,20 +287,20 @@
\@MXV@neediiiD%
}%
}{%
- \ifthenelse{\equal{\filename@ext}{ra}\OR\equal{\filename@ext}{RA}\OR%
- \equal{\filename@ext}{ram}\OR\equal{\filename@ext}{RAM}\OR%
- \equal{\filename@ext}{rm}\OR\equal{\filename@ext}{RM}}{%
+ \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: `\filename@ext'
+ 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=<mime type>'!
}%
- }}}}}}}}}}}}}}}%
+ }}}}}}}}}}}}}}}}%
}
\ifthenelse{\boolean{@MXV@iiiDfeat}}{% 3D related definitions and macros
@@ -309,77 +310,66 @@
\newboolean{@MXV@iiidctrls}% show controls?
\newboolean{@MXV@defaultviewprovided}%default 3D view provided?
- %macro to compute the transformation matrix
+ %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)
- \def\@MXV@viewx{-#4}\def\@MXV@viewy{-#5}\def\@MXV@viewz{-#6}%
- %
+ \FPupn\@MXV@viewx{#4 neg}%
+ \FPupn\@MXV@viewy{#5 neg}%
+ \FPupn\@MXV@viewz{#6 neg}%
%normalize view vector
- \FPupn\@MXV@modulo{\@MXV@viewx{} \@MXV@viewx{} mul
- \@MXV@viewy{} \@MXV@viewy{} mul +
- \@MXV@viewz{} \@MXV@viewz{} mul + 2 swap root
+ \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}%
- \FPtrunc\@MXV@viewx\@MXV@viewx{12}%
\FPupn\@MXV@viewy{\@MXV@viewy{} \@MXV@modulo{} div}%
- \FPtrunc\@MXV@viewy\@MXV@viewy{12}%
\FPupn\@MXV@viewz{\@MXV@viewz{} \@MXV@modulo{} div}%
- %
- %top and bottom views (@MXV@viewx == @MXV@viewy == 0) need special treatment
+ %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}%
- %slightly incline the view vector,
- %otherwise top and bottom views snap at 180 degrees around z-axis
- \def\@MXV@viewy{0.000000001}%
- \else%
+ \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%
- %
- %rotational axis vector (cross product of [0 0 1] & view vector)
- \def\@MXV@rotx{-\@MXV@viewy}\def\@MXV@roty{\@MXV@viewx}%
- %
- %sin of enclosed angle between [0 0 1] & view vector (from cross product)
- \FPupn\@MXV@rotsin{\@MXV@rotx{} \@MXV@rotx{} mul \@MXV@roty{} \@MXV@roty{} %
- mul + 2 swap root}%
- %
- %cos of enclosed angle between [0 0 1] & view vector (from dot product)
- \def\@MXV@rotcos{\@MXV@viewz}%
- \FPupn\@MXV@onerotcos{1 \@MXV@rotcos{} sub}% 1 - rotcos
- %
- %now we have to normalize the rot vector
- \FPupn\@MXV@rotx{\@MXV@rotx{} \@MXV@rotsin{} div}%
- \FPupn\@MXV@roty{\@MXV@roty{} \@MXV@rotsin{} div}%
- %
- %build the transformation matrix (right handed system)
- \FPupn\@MXV@element{\@MXV@rotx{} \@MXV@rotx{} mul \@MXV@onerotcos{} mul %
- \@MXV@rotcos{} add -1 mul}%
- \xdef\@MXV@matrix{\@MXV@element}%
- \FPupn\@MXV@element{%
- \@MXV@rotx{} \@MXV@roty{} mul \@MXV@onerotcos{} mul -1 mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@roty{} \@MXV@rotsin{} mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@rotx{} \@MXV@roty{} mul \@MXV@onerotcos{} mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@roty{} \@MXV@roty{} mul \@MXV@onerotcos{} mul %
- \@MXV@rotcos{} add}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@rotx{} \@MXV@rotsin{} mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@roty{} \@MXV@rotsin{} mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@rotx{} \@MXV@rotsin{} mul -1 mul}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@rotcos}%
- \FPupn\@MXV@element{\@MXV@viewx{} #7 abs mul -1 mul #1 add}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@viewy{} #7 abs mul -1 mul #2 add}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
- \FPupn\@MXV@element{\@MXV@viewz{} #7 abs mul -1 mul #3 add}%
- \xdef\@MXV@matrix{\@MXV@matrix\space\@MXV@element}%
+ %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
@@ -393,11 +383,7 @@
%macro for generating an array of 3D views (varray)
\def\@MXV@buildva{%
- \ifthenelse{\boolean{@MXV@defaultviewprovided}}{%
- \global\@MXV@viewscount=1%
- }{%
- \global\@MXV@viewscount=0%
- }%
+ \global\@MXV@viewscount=0%
\xdef\@MXV@varray{}% empty varray
%
%default view
@@ -433,43 +419,43 @@
\endlinechar=\@MXV@endlinechar% reset endlinechar
}{}%
%
- %prepend default view obj ref to VA array, if
- %explicitly given or no additional views from views file available
- \ifthenelse{\boolean{@MXV@defaultviewprovided}\OR%
- \NOT\boolean{@MXV@viewsprovided}}{%
- \xdef\@MXV@varray{\@MXV@defaultview\@MXV@varray}%
- }{}%
+ %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
- \ifthenelse{\boolean{@MXV@pdf}}{%
- %pdflatex versions
+ \ifpdf%
+ %pdfLaTeX versions
%macro for creating 3D view object
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- \def\@MXV@viewobj{%
- %projection dict
- \pdfobj {<</Subtype/P/FOV \@MXV@aac/PS/Min>>}%
- \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}%
- }%
- }{}
+ \def\@MXV@viewobj{%
+ %projection dict
+ \pdfobj {<</Subtype/P/FOV \@MXV@aac/PS/Min>>}%
+ \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}%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ \if@MXV@externalviewer\else%
%java script file, stream object
\IfFileExists{\@MXV@jscriptiiidfile}{%
\pdfobj stream file {\@MXV@jscriptiiidfile}%
@@ -479,109 +465,170 @@
%
%build the array of 3D views
\@MXV@buildva%
- }{}%
+ \fi%
%
- %3D stream object, 3D files are always embedded inline
- \IfFileExists{#4}{%
- \pdfobj stream%
- attr {%
- /Subtype/\@MXV@iiidsubtype%
- /VA [\@MXV@varray]%
- /DV/F% use first entry in VA as default view
- \@MXV@jscriptiiid%
+ %3D stream object
+ \if@MXV@inline%
+ \IfFileExists{#4}{%
+ \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}%
+ }{%
+ \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'!
}%
- file {#4}%
- \pdfrefobj\pdflastobj%
- %
- %insert FileAttachment annotation
- \ifthenelse{\boolean{@MXV@attachment}}{%
- \pdfannot width -#1 height #2 depth #3 {%
- /Subtype /FileAttachment%
+ }%
+ \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 <</N<<>>/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%
- /T (#4)
+ \if@MXV@externalviewer%
+ \@MXV@urlattr%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /A <</URI (#4) /S/URI>>%
/Contents (3D Object (\@MXV@mime))%
- /AP <</N<<>>/R<<>>/D<<>>>>%
- /FS <<%
- /F(#4)%
- /Type/Filespec%
- /EF << /F \the\pdflastobj\space 0 R >>%
- >>%
}%
- }{}%
- %
- }{%
- \PackageError{movie15}{%
- File `#4' cannot be opened for embedding.\MessageBreak
- 3D files are always embedded inline and must be readable
- }{%
- Make sure file `#4' exists and is readable!
- }%
+ \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%
}%
%
- %new annotation object of subtype `3D'%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- \pdfannot width -#1 height #2 depth #3 {%
+ \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 >>}%
+ }{}%
+ %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 (#4)% disabled even if plugin were available
+ /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@player\the\@MXV@includes.page} 0 R%
- \@MXV@apdict%
+ \@MXV@apdict% /AP <</N<<>>/R<<>>/D<<>>>> doesn't work here
+ \@MXV@defaultview%
/3DI \if@MXV@iiidctrls true\else false\fi%
- /3DD \the\pdflastobj\space 0 R% 3D stream object
+ /3DD \@MXV@iiidstream\space 0 R% 3D stream object
/3DA << \@MXV@activation\@MXV@deactivation >>%
}%
- }{}%
+ %label for later annot obj number determination
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.annot}{\the\pdflastannot}%
+ \fi%
+ \fi}}%
}%
- }{%
+ \else%
%dvips versions
%macro for creating 3D view object and associated projection dict
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- \def\@MXV@viewobj{%
- %projection dict
- \pdfmark{%
- pdfmark=/OBJ,%
- Raw={%
- /_objdef {pdict\the\@MXV@includes_\the\@MXV@viewscount}%
- /type/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=/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=/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%
- >>%
- }%
+ }%
+ \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}}%
}%
- }{}%
+ \xdef\@MXV@@viewobj{{viewobj\the\@MXV@includes_\the\@MXV@viewscount}}%
+ }%
%
%3D inclusion macro
\def\@MXV@includeiiid#1#2#3#4{%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ %
+ \if@MXV@externalviewer\else%
%java script file, stream object
\IfFileExists{\@MXV@jscriptiiidfile}{%
\pdfmark{%
@@ -598,93 +645,179 @@
(\@MXV@jscriptiiidfile) (r) file%
}%
}%
- \def\@MXV@jscriptiiid{/OnInstantiate {jscriptiiid\the\@MXV@includes}}%
+ \xdef\@MXV@jscriptiiid{%
+ /OnInstantiate {jscriptiiid\the\@MXV@includes}%
+ }%
}{\def\@MXV@jscriptiiid{}}%
%
%build the array of 3D views
\@MXV@buildva%
- }{}%
+ \fi%
%
- %3D stream object, 3D files are always embedded inline
- \IfFileExists{#4}{%
- \pdfmark{%
- pdfmark=/OBJ,%
- Raw={%
- /_objdef {iiiDfile\the\@MXV@includes}%
- /type/stream%
+ %3D stream object
+ \if@MXV@inline%
+ \IfFileExists{#4}{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {iiiDfile\the\@MXV@includes}%
+ /type/stream%
+ }%
}%
- }%
- \pdfmark{%
- pdfmark=/PUT,%
- Raw={%
- {iiiDfile\the\@MXV@includes} <<%
- /Subtype/\@MXV@iiidsubtype%
- /VA [\@MXV@varray]%
- /DV/F%
- \@MXV@jscriptiiid%
- >>%
+ \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%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {iiiDfile\the\@MXV@includes}%
+ (#4) (r) file%
+ }%
}%
- }%
- }{%
- \PackageError{movie15}{%
- File `#4' cannot be opened for embedding.\MessageBreak
- 3D files are always embedded inline and must be readable
+ \edef\@MXV@iiidstream{iiiDfile\the\@MXV@includes}%
}{%
- Make sure file `#4' exists and is readable!
+ \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'!
+ }%
}%
- }%
+ \fi%
%
%insert FileAttachment annotation
- \ifthenelse{\boolean{@MXV@attachment}}{%
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}%
+% \OR\boolean{@MXV@attachment}%
+ }{%
\makebox[0pt][l]{%
- \pdfmark[\@MXV@box{#1}{#2}{#3}]{%
+ \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{%
pdfmark=/ANN,%
Subtype=/FileAttachment,%
Raw={%
/F 0%
- /T (#4)
+ /T (\@MXV@filename)%
/Contents (3D Object (\@MXV@mime))%
- /AP <</N<<>>/R<<>>/D<<>>>>%
+ \if@MXV@externalviewer%
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ \fi
/FS <<%
/F(#4)%
/Type/Filespec%
- /EF <</F {iiiDfile\the\@MXV@includes}>>%
+ /EF <</F {\@MXV@iiidstream}>>%
>>%
}%
}%
}%
- }{}%
- %annotation object of subtype `3D'
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- \pdfmark[\@MXV@box{#1}{#2}{#3}]{%
+ }{%
+ \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 <</URI (#4) /S/URI>>%
+ /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}>>}%
+ }{}%
+ %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 (#4)
+ /T (\@MXV@filename)%
+ \ifx\@MXV@label\@empty\else%
+ /NM (\@MXV@label)%
+ \fi%
/Contents (3D Object (\@MXV@mime))%
/P {ThisPage}%
- \@MXV@apdict%
+ \@MXV@apdict% /AP <</N<<>>/R<<>>/D<<>>>> doesn't work here
+ \@MXV@defaultview%
/3DI \if@MXV@iiidctrls true\else false\fi%
- /3DD {iiiDfile\the\@MXV@includes}%
+ /3DD {\@MXV@iiidstream}%
/3DA << \@MXV@activation\@MXV@deactivation >>%
}%
}%
- }{}%
+ \fi%
}%
- }%
+ \fi%
}{}
%settings for newly opened media players
\def\@MXV@settings#1#2#3#4#5#6#7{%
- var settings = {%
+ var settings={%
privateData: {%
paused: false
},
@@ -702,22 +835,22 @@
%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({%
+ 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;
+ focusonplayer=0;
}
},
afterBlur: function (e) {%
%only resume if we click outside of any media
- if(focusonplayer == 0){%
+ if(focusonplayer==0){%
try{e.target.play();}catch(e){}
}
},
onFocus: function (e) {%
- focusonplayer = #1;
+ focusonplayer=#1;
},
afterFocus: function (e) {%
if(!e.target.isPlaying){%play on click if paused
@@ -726,7 +859,15 @@
if(!e.target.isPlaying){%still not playing?!
%sometimes play() fails, in particular if the movie has reached
%its end while having the focus; but this works:
- e.target.seek(e.target.settings.startAt);
+ if(
+ e.target.settings.startAt.time
+ || e.target.settings.startAt.frame
+ || e.target.settings.startAt.marker
+ ){
+ e.target.seek(e.target.settings.startAt);
+ }else{
+ e.target.stop();
+ }
e.target.play();
}
}
@@ -738,22 +879,28 @@
try{e.target.pause();}catch (e){}
}
\fi%
- e.target.visible = true;
+ e.target.visible=true;
},
onPlay: function (e) {%
- e.target.settings.privateData.paused = false;
+ e.target.settings.privateData.paused=false;
},
onPause: function (e) {%
- e.target.settings.privateData.paused = true;
+ e.target.settings.privateData.paused=true;
},
afterReady: function (e) {%
try{
- 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;
+ 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.play();\fi
}
catch (e){}
@@ -762,13 +909,13 @@
}%
%output driver specific implementations of the 2D inclusion macro
-\ifthenelse{\boolean{@MXV@pdf}}{%
+\ifpdf%
%pdfLaTeX version
\def\@MXV@includemovie#1#2#3#4{%
%insert box or poster
\@MXV@box{#1}{#2}{#3}%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ \if@MXV@externalviewer\else%
%new action dict
\pdfobj reserveobjnum%
\@MXV@adict=\pdflastobj%
@@ -777,14 +924,27 @@
\pdfobj reserveobjnum%
\@MXV@aadict=\pdflastobj%
%
- }{}%
+ \fi%
%embedded file entry `/EF'
- \ifthenelse{\boolean{@MXV@inline}}{%
+ \if@MXV@inline%
\IfFileExists{#4}{%
- \pdfobj stream file {#4}%
- \pdfrefobj\pdflastobj%
- \edef\@MXV@efentry{%
- /EF << /F \the\pdflastobj\space 0 R >>%
+ %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 >>%
+ }%
}%
}{%
\PackageError{movie15}{%
@@ -794,42 +954,88 @@
Try any of the options `url' or `inline=false'!
}%
}%
- }{\def\@MXV@efentry{}}%
+ \else\def\@MXV@efentry{}\fi%
%
- %new file specification object
- \pdfobj {<<%
- /F(#4)%
- \@MXV@fsentry%
- \@MXV@efentry%
- /Type/Filespec%
- >>}\pdfrefobj\pdflastobj%
- \edef\@MXV@filespec{\the\pdflastobj}%
+ \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@attachment}}{%
- \pdfannot width -#1 height #2 depth #3 {%
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR%
+ \boolean{@MXV@attachment}%
+ }{%
+ \pdfannot width #1 height #2 depth #3 {%
/Subtype /FileAttachment%
/F 0%
- /T (#4)
+ /T (\@MXV@filename)%
/Contents (Media File (\@MXV@mime))%
- /AP <</N<<>>/R<<>>/D<<>>>>%
+ \if@MXV@externalviewer%
+ %a coloured border, as with external links, would be much nicer
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/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 <</URI (#4) /S/URI>>%
+ /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%
+ }%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ \if@MXV@externalviewer\else%
%new annotation object of subtype `Screen'%
- \pdfannot width -#1 height #2 depth #3 {%
+ \pdfannot width #1 height #2 depth #3 {%
/Subtype /Screen%
/Border [0 0 0]% no border (PDF-1.1)
- /BS <</Type/Border/S/S/W 0>>% no border (PDF-1.5)
+ /BS <</S/S/W 0>>% no border (PDF-1.5)
/F 5% disable annot if multimedia is not available
- /T (#4)
+ /T (\@MXV@filename)%
/Contents (Media File (\@MXV@mime))%
/P \@MXV@pdfpageref{@MXV@player\the\@MXV@includes.page} 0 R%
/A \the\@MXV@adict\space 0 R%
/AA \the\@MXV@aadict\space 0 R%
- \@MXV@apdict%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
}\edef\@MXV@screenannot{\the\pdflastannot}%
%label for later annot obj number determination
\ifx\@MXV@label\@empty\else%
@@ -848,11 +1054,13 @@
\pdfobj {<<%
/C \the\pdflastobj\space 0 R%
/S/MR%
+ /SP <</BE<</O 0.0>>>>%
/P <<%
+ \@MXV@player%
/BE <<%
/F 2%
\@MXV@@repeat\@MXV@@volume\@MXV@@ctrls%
- /D <</S /F>>%movie remains opened
+ /D <</S /F>>%
>>%
>>%
>>}\edef\@MXV@mediarendition{\the\pdflastobj}\pdfrefobj\pdflastobj%
@@ -892,29 +1100,85 @@
/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@attachment}}{%
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR%
+ \boolean{@MXV@attachment}%
+ }{%
\makebox[0pt][l]{%
- \pdfmark[\@MXV@box{#1}{#2}{#3}]{%
+ \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{%
pdfmark=/ANN,%
Subtype=/FileAttachment,%
Raw={%
/F 0%
- /T (#4)
+ /T (\@MXV@filename)%
/Contents (Media File (\@MXV@mime))%
- /AP <</N<<>>/R<<>>/D<<>>>>%
+ \if@MXV@externalviewer%
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/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 <</URI (#4) /S/URI>>%
+ /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%
+ }%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ \if@MXV@externalviewer%
+ \@MXV@box{#1}{#2}{#3}%
+ \else%
%new annotation object of subtype `Screen'%
\pdfmark[\@MXV@box{#1}{#2}{#3}]{%
pdfmark=/ANN,%
@@ -923,17 +1187,16 @@
Raw={%
/_objdef {screenannot\the\@MXV@includes}%
/F 5%
- /T (#4)
+ /T (\@MXV@filename)%
/Contents (Media File (\@MXV@mime))%
- /BS <</W 0/Type/Border/S/S>>%
+ /BS <</S/S/W 0>>% no border (PDF-1.5)
/P {ThisPage}%
/AA {aadict\the\@MXV@includes}%
- \@MXV@apdict%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
}%
}%
%
%entire action entry moved outside screen annotation
- %to workaround a ghostscript bug
\pdfmark{%
pdfmark=/PUT,%
Raw={%
@@ -963,7 +1226,9 @@
{mediarendition\the\@MXV@includes} <<%
/C {mediaclipdata\the\@MXV@includes}%
/S/MR%
+ /SP <</BE<</O 0.0>>>>% %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
@@ -995,59 +1260,69 @@
>>%
}%
}%
- }{}%
+ \fi%
%
%new file specification object
- \pdfmark{%
- pdfmark=/OBJ,%
- Raw={%
- /_objdef {filespec\the\@MXV@includes}%
- /type/dict%
+ \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%
- >>%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {filespec\the\@MXV@includes} <<%
+ \@MXV@fsentry
+ /F(#4)% file name
+ /Type/Filespec%
+ >>%
+ }%
}%
}%
%
%embedded file entry `/EF'
- \ifthenelse{\boolean{@MXV@inline}}{%
+ \if@MXV@inline%
\IfFileExists{#4}{%
- %new stream object
- \pdfmark{%
- pdfmark=/OBJ,%
- Raw={%
- /_objdef {fstream\the\@MXV@includes}%
- /type/stream%
+ %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}%
+ (#4) (r) file% read in file contents
+ }%
}%
- }%
- \pdfmark{%
- pdfmark=/PUT,%
- Raw={%
- {fstream\the\@MXV@includes} <<%
- /Type/EmbeddedFile%
- >>%
+ \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 {fstream\the\@MXV@includes} >>%
+ /EF << /F {\@MXV@moviestream} >>%
>>%
}%
}%
@@ -1059,9 +1334,9 @@
Try any of the options `url' or `inline=false'!
}%
}%
- }{}%
+ \fi%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
+ \if@MXV@externalviewer\else%
%create actions for page open/close events
\pdfmark{%
pdfmark=/OBJ,%
@@ -1121,9 +1396,9 @@
>>%
}%
}%
- }{}%
+ \fi%
}%
-}
+\fi
%definition of user command `\includemovie'
\newcommand{\includemovie}[4][]{%
@@ -1132,70 +1407,129 @@
\@MXV@reset% all macros and options
\setkeys{movie15}{#1}% parse options
%guess the mime type based on the filename extension
- \ifthenelse{\equal{\@MXV@mime}{@MXV@auto}}{\@MXV@guessmime{#4}}{}%
+ \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}%
+ }{}%
%
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- %label this annotation for later page number determination (if pdfLaTeX or
- % if `label' option is set)
- \ifthenelse{\boolean{@MXV@pdf}\OR\NOT\equal{\@MXV@label}{}}{%
- \@MXV@labeltoaux{@MXV@player\the\@MXV@includes.page}{%
- \noexpand\the\@MXV@page}%
+ %some link attributes (if hyperref not loaded)
+ \ifthenelse{\isundefined{\@pdfborder}}{%
+ \def\@MXV@urlattr{}%
+ \def\@MXV@runattr{}%
+ }{%
+ \edef\@MXV@urlattr{%
+ /Border [\@pdfborder]%
+ /C [\@urlbordercolor]%
+ /H \@pdfhighlight%
+ }%
+ \edef\@MXV@runattr{%
+ /Border [\@pdfborder]%
+ /C [\@runbordercolor]%
+ /H \@pdfhighlight%
+ }%
+ }%
+ %
+ %label this annotation for later player id number determination &
+ %check for multiply-defined labels
+ \ifx\@MXV@label\@empty\else%
+ %
+ \ifthenelse{%
+ \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{undefined}%
+ \AND%
+ \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{%
+ \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.playerid}{\the\@MXV@includes}%
+ \fi%
+ %
+ \ifthenelse{\boolean{@MXV@externalviewer}}{%
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@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}%
+ \fi%
+ %
+ %label this annotation for later page number determination
+ \@MXV@labeltoaux{@MXV@player\the\@MXV@includes.page}{%
+ \noexpand\the\@MXV@page}%
%
%test for hyperref package
- \ifthenelse{\NOT\boolean{@MXV@pdf}\AND\isundefined{\pdfmark}}{%
+ \ifthenelse{\NOT\boolean{pdf}\AND\isundefined{\pdfmark}}{%
\@MXV@missing{hyperref}%
}{}%
%
- %depending on options do content specific settings
- \ifthenelse{\boolean{@MXV@iiiDfeat}\AND\boolean{@MXV@iiid}}{%
+ %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
}{%
- \ifthenelse{\boolean{@MXV@runposter}}{%
+ \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%
}%
- \ifthenelse{\boolean{@MXV@autostop}}{%
+ \if@MXV@autostop%
\def\@MXV@deactivation{/D/PI/DIS/U}%
- }{%
- \ifthenelse{\boolean{@MXV@autopause}}{%
+ \else%
+ \if@MXV@autopause%
\def\@MXV@deactivation{/D/PI/DIS/I}%
- }{%@MXV@continue
+ \else%@MXV@continue
\def\@MXV@deactivation{/D/PI/DIS/L}%
+ \fi%
+ \fi%
+ \if@MXV@externalviewer\else%
+ %counter for 3D inclusion on current page
+ \ifthenelse{%
+ \equal{%
+ \@MXV@getlabelvalue{@MXV@player\the\@MXV@includes.page}%
+ }{\@MXV@oldpage}%
+ }{%
+ \global\advance\@MXV@iiidoncurpage by 1%
+ }{%
+ \global\@MXV@iiidoncurpage=1%
}%
- }%
+ \xdef\@MXV@oldpage{\@MXV@getlabelvalue{@MXV@player\the\@MXV@includes.page}}%
+ \fi%
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{true}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.3Doncurpage}{\the\@MXV@iiidoncurpage}%
+ \fi%
}{%#### 2D ####
\ifx\@MXV@startat\@empty% default start position
\gdef\@MXV@startat{, startAt: 0}%
\fi%
- %label this annotation for later player id number determination (pdftex &
- %dvips) + write player settings to aux file
+ %write player settings to aux file
\ifx\@MXV@label\@empty\else%
- %check for multiply-defined labels first
- \ifthenelse{%
- \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{undefined}%
- \AND%
- \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{%
- \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.playerid}{\the\@MXV@includes}%
\@MXV@labeltoaux{@MXV@\@MXV@label.mouse}{%
\if@MXV@mouse true\else false\fi}%
\@MXV@labeltoaux{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}%
@@ -1207,45 +1541,46 @@
\@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}%
\fi%
%
\ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@runposter}}{%
\xdef\@MXV@pageopenopentry{/OP 4}%
}{%
- \ifthenelse{\boolean{@MXV@autoresume}}{%
+ \if@MXV@autoresume%
\xdef\@MXV@pageopenopentry{/OP 3}%
- }{%
+ \else%
\xdef\@MXV@pageopenopentry{/OP 2}%
- }%
+ \fi%
}%
%
- \ifthenelse{\boolean{@MXV@autostop}}{%
+ \if@MXV@autostop%
\xdef\@MXV@pagecloseopentry{/OP 1}%
- }{%
- \ifthenelse{\boolean{@MXV@autopause}}{%
+ \else%
+ \if@MXV@autopause%
\xdef\@MXV@pagecloseopentry{/OP 2}%
- }{% @MXV@continue
+ \else% @MXV@continue
\xdef\@MXV@pagecloseopentry{/OP 3}%
- }%
- }%
+ \fi%
+ \fi%
%
%JavaScripts for playback control
%script for page invisible event
- \ifthenelse{\boolean{@MXV@autopause}}{%
+ \if@MXV@autopause%
\xdef\@MXV@pageclosejsentry{%
/JS (
try{%
if(player\the\@MXV@includes.isPlaying){%
player\the\@MXV@includes.pause();
}
- focusonplayer = -1; %page change
- player\the\@MXV@includes.visible = false;
+ focusonplayer=-1; %page change
+ player\the\@MXV@includes.visible=false;
}
catch(e){}
)%
}%
- }{%
- \ifthenelse{\boolean{@MXV@autostop}}{%
+ \else%
+ \if@MXV@autostop%
\xdef\@MXV@pageclosejsentry{%
/JS (
try{%
@@ -1254,41 +1589,55 @@
player\the\@MXV@includes.play();
}
player\the\@MXV@includes.stop();
- player\the\@MXV@includes.seek(%
- player\the\@MXV@includes.settings.startAt);
- focusonplayer = -1;
- player\the\@MXV@includes.visible = false;
+ if(
+ player\the\@MXV@includes.settings.startAt.time
+ || player\the\@MXV@includes.settings.startAt.frame
+ || player\the\@MXV@includes.settings.startAt.marker
+ ){
+ player\the\@MXV@includes.seek(%
+ player\the\@MXV@includes.settings.startAt);
+ }
+ focusonplayer=-1;
+ player\the\@MXV@includes.visible=false;
}
catch(e){}
)%
}%
- }{%
+ \else%
\xdef\@MXV@pageclosejsentry{%@MXV@continue
/JS (
try{%
- focusonplayer = -1; %page change
- player\the\@MXV@includes.visible = false;
+ focusonplayer=-1; %page change
+ player\the\@MXV@includes.visible=false;
}
catch(e){}
)%
}%
- }%
- }%
+ \fi%
+ \fi%
%
%script for activation/resume on page open event
\xdef\@MXV@pageopenjsentry{%
/JS (
try{%
if(player\the\@MXV@includes.isOpen){%
- player\the\@MXV@includes.visible = true;
+ player\the\@MXV@includes.visible=true;
%
%start or resume media which have autoplay option set;
%also resume paused media which have autoresume option set
\if@MXV@autoplay%
player\the\@MXV@includes.play();
if(!player\the\@MXV@includes.isPlaying){% still not playing?!
- player\the\@MXV@includes.seek(%
- player\the\@MXV@includes.settings.startAt);
+ if(
+ player\the\@MXV@includes.settings.startAt.time
+ || player\the\@MXV@includes.settings.startAt.frame
+ || player\the\@MXV@includes.settings.startAt.marker
+ ){
+ player\the\@MXV@includes.seek(
+ player\the\@MXV@includes.settings.startAt);
+ }else{
+ player\the\@MXV@includes.stop();
+ }
player\the\@MXV@includes.play();
}
\else%
@@ -1296,8 +1645,16 @@
if(player\the\@MXV@includes.settings.privateData.paused){%
player\the\@MXV@includes.play();
if(!player\the\@MXV@includes.isPlaying){%
- player\the\@MXV@includes.seek(%
- player\the\@MXV@includes.settings.startAt);
+ if(
+ player\the\@MXV@includes.settings.startAt.time
+ || player\the\@MXV@includes.settings.startAt.frame
+ || player\the\@MXV@includes.settings.startAt.marker
+ ){
+ player\the\@MXV@includes.seek(%
+ player\the\@MXV@includes.settings.startAt);
+ }else{
+ player\the\@MXV@includes.stop();%
+ }
player\the\@MXV@includes.play();
}
}
@@ -1305,53 +1662,53 @@
\fi%
}
else{%
- throw "isClosed";%
+ 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
+ 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{\the\@MXV@includes}%
{\if@MXV@mouse true\else false\fi}%
{\if@MXV@autoplay true\else false\fi}%
- var player\the\@MXV@includes\space = app.media.openPlayer({%
+ var player\the\@MXV@includes=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
+ 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{\the\@MXV@includes}{\if@MXV@mouse true\else false\fi}%
{true}%
- var player\the\@MXV@includes\space = app.media.openPlayer({%
+ var player\the\@MXV@includes=app.media.openPlayer({%
settings: settings,
events: events
});
)
}%
}%
- }{}%
+ }%
%
%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)
+ %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%
%
@@ -1365,7 +1722,7 @@
%
\ifthenelse{\equal{\@MXV@boxdepth}{}}{% no depth option given
\ifthenelse{\lengthtest{\@MXV@totalheight>\@MXV@height}}{%
- %depth of text only taken into account, if its total 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%
}{%
@@ -1390,83 +1747,62 @@
}%
%
%insert textbox, obscured by poster
- \ifthenelse{\boolean{@MXV@boxopt}}{%
- \ifthenelse{\boolean{@MXV@textoverposter}}{}{%
+ \if@MXV@boxopt%
+ \if@MXV@textoverposter\else%
\makebox[0pt][l]{\usebox{\@MXV@textbox}}%
- }%
- }{}%
+ \fi%
+ \fi%
%
- %appearance dict dummy, to be shared by all 2D and 3D annots
- \ifthenelse{\NOT\boolean{@MXV@externalviewer}}{%
- \ifthenelse{\isundefined{\@MXV@apdict}}{%
- \ifthenelse{\boolean{@MXV@pdf}}{%
- \pdfobj stream {}\pdfrefobj\pdflastobj%
- \xdef\@MXV@apdict{/AP << /N \the\pdflastobj\space 0 R >>}%
- }{%
- \pdfmark{%
- pdfmark=/OBJ,%
- Raw={%
- /_objdef {apdict}%
- /type/stream%
- }%
- }%
- \pdfmark{%
- pdfmark=/PUT,%
- Raw={%
- {apdict}%
- ()%
- }%
+ \ifthenelse{\NOT\boolean{@MXV@url}\AND\NOT\boolean{@MXV@inline}}{%
+ \IfFileExists{#4}{}{%
+ \AtEndDocument{%
+ \PackageWarning{movie15}{%
+ File: `#4'\MessageBreak
+ could not be found in the current directory.\MessageBreak
+ Maybe it is a URL and you just forgot to set\MessageBreak
+ option `url' ?
}%
- \xdef\@MXV@apdict{/AP << /N {apdict}>>}%
}%
- }{}%
+ }%
}{}%
%
- %insert annotation
- \ifthenelse{\boolean{@MXV@externalviewer}\AND\NOT\boolean{@MXV@inline}}{%
- \ifthenelse{\isundefined{\href}}{%
- \@MXV@missing{hyperref}%
- }{}%
- \ifthenelse{\boolean{@MXV@url}}{%
- \href{#4}{\@MXV@box{\@MXV@width}{\@MXV@height}{\@MXV@depth}}%
- }{%
- \IfFileExists{#4}{%
- \href{run:#4}{\@MXV@box{\@MXV@width}{\@MXV@height}{\@MXV@depth}}%
- }{%
- \AtEndDocument{%
- \PackageWarning{movie15}{%
- File: `#4'\MessageBreak
- could not be found in the current directory.\MessageBreak
- Maybe it is a URL and you simply forgot to set\MessageBreak
- option `url'
- }%
- }%
- }%
+ %insert link target, if media has been labelled
+ \ifx\@MXV@label\@empty\else%
+ \raisebox{\@MXV@height}{%
+ \ifpdf%
+ \pdfdest name {@MXV@\@MXV@label} xyz %
+ \else%
+ \hypertarget{@MXV@\@MXV@label}{}%
+ \fi%
}%
+ \fi%
+ %
+ %insert annotation
+ \ifthenelse{\boolean{@MXV@iiid}}{%
+ \@MXV@includeiiid{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}%
}{%
- \ifthenelse{\boolean{@MXV@iiiDfeat}\AND\boolean{@MXV@iiid}}{%
- \@MXV@includeiiid{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}%
- }{%
- \@MXV@includemovie{\@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}}{%
- \ifthenelse{\boolean{@MXV@textoverposter}}{%
+ \if@MXV@boxopt%
+ \if@MXV@textoverposter%
\makebox[0pt][r]{\usebox{\@MXV@textbox}}%
- }{}%
- }{}%
+ \fi%
+ \fi%
}
%for remote control of media
\newcommand\movieref[3][]{%
\leavevmode%
- %
\@MXV@reset%
+ \ifpdf\else\global\advance\@MXV@links by 1\fi%increment link counter
+ %
+ \savebox{\@MXV@textbox}{#3}% save text argument
%
%check if label is defined at all
\ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.playerid}}{undefined}}{%
+ \usebox{\@MXV@textbox}% write out text box
\PackageWarning{movie15}{%
Reference `#2' on page \thepage \space undefined%
}%
@@ -1474,231 +1810,546 @@
\gdef\@MXV@undefwarning{}%
\AtEndDocument{%
\PackageWarningNoLine{movie15}{%
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak
- @@ There were undefined references! @@\MessageBreak
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
+ @@ There were undefined references! @@\MessageBreak%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
}%
}{}%
- }{}%
+ }{%
%
- %retrieve original settings
- \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.mouse}}{true}}{%
- \setboolean{@MXV@mouse}{true}%
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.externalviewer}}{true}}{%
+ \setboolean{@MXV@externalviewer}{true}%
}{%
- \setboolean{@MXV@mouse}{false}%
+ \setboolean{@MXV@externalviewer}{false}%
}%
- \edef\@MXV@ctrls{\@MXV@getlabelvalue{@MXV@#2.showUI}}%
- \edef\@MXV@palindrome{\@MXV@getlabelvalue{@MXV@#2.palindrome}}%
- \edef\@MXV@repeat{\@MXV@getlabelvalue{@MXV@#2.repeat}}%
- \edef\@MXV@rate{\@MXV@getlabelvalue{@MXV@#2.rate}}%
- \edef\@MXV@startat{\@MXV@getlabelvalue{@MXV@#2.startAt}}%
- \edef\@MXV@endat{\@MXV@getlabelvalue{@MXV@#2.endAt}}%
- \edef\@MXV@volume{\@MXV@getlabelvalue{@MXV@#2.volume}}%
- \setkeys{movie15}{#1}%override with new settings
- %
- %get page number
- \edef\@MXV@playerpage{\@MXV@getlabelvalue{@MXV@player\@MXV@getlabelvalue{@MXV@#2.playerid}.page}}%
- %
- \edef\@MXV@operation{}%
- %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@getlabelvalue{@MXV@#2.playerid}}%
- {\if@MXV@mouse true\else false\fi}{true}%
- try{
- if(player\@MXV@getlabelvalue{@MXV@#2.playerid}.isOpen){%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
- app.media.closeReason.general);
- player\@MXV@getlabelvalue{@MXV@#2.playerid}\space = null;
- }
- }
- catch(e){}
- %
- this.pageNum = \@MXV@playerpage -1;%zero based
- %
- try{
- var player\@MXV@getlabelvalue{@MXV@#2.playerid}\space = %
- app.media.openPlayer({%
- settings: settings,
- events: events
- });
- }
- catch (e){}
- )
- }%
- \fi%
- \if@MXV@linkresume% resume/pause
- \edef\@MXV@operation{%
- /OP 3%
- /JS (
- try{%
- this.pageNum = \@MXV@playerpage - 1;
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.visible = true;
- if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
- if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
- %media at end will restart
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
- }
- }
- else{%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.pause();
- }
- }
- catch(e){}%
- )
- }%
- \fi%
- \if@MXV@linkstop%
- \edef\@MXV@operation{%
- /OP 1%
- /JS (
- try{%
- if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
- }
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.stop();
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
- }
- catch(e){}
- this.pageNum = \@MXV@playerpage - 1;
- )%
- }%
- \fi%
- \if@MXV@linkpause% pause/resume
- \edef\@MXV@operation{%
- /OP 2%
- /JS (
- this.pageNum = \@MXV@playerpage - 1;
- try{%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.visible = true;
- if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
- if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
- %media at end will restart
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
- }
- }
- else{%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.pause();
- }
- }
- catch(e){}%
- )
- }%
- \fi%
- \if@MXV@linkclose%
- \edef\@MXV@operation{%
- /OP 1%
- /JS (
- try{%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
- app.media.closeReason.general);
- player\@MXV@getlabelvalue{@MXV@#2.playerid}\space = null;
- }
- catch(e){}
- this.pageNum = \@MXV@playerpage - 1;
- )%
- }%
- \fi%
- \if@MXV@linkreset% reset to orig. settings
- %retrieve original settings
- \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.mouse}}{true}}{%
- \setboolean{@MXV@mouse}{true}%
- }{%
- \setboolean{@MXV@mouse}{false}%
- }%
- \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.autoplay}}{true}}{%
- \setboolean{@MXV@autoplay}{true}%
- }{%
- \setboolean{@MXV@autoplay}{false}%
- }%
+ \if@MXV@externalviewer\else%
+ %movieref used in 3D context?
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.3D}}{true}}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{true}%
+ }{%
+ \@MXV@neediiiD%
+ }%
+ }{}%
%
- \edef\@MXV@operation{%
- /OP 0%
- /JS (
- if(focusonplayer == undefined){%
- var focusonplayer = 0; %shared by all annots
- }
- \@MXV@settings{\@MXV@getlabelvalue{@MXV@#2.showUI}}%
- {\@MXV@getlabelvalue{@MXV@#2.palindrome}}%
- {\@MXV@getlabelvalue{@MXV@#2.repeat}}%
- {\@MXV@getlabelvalue{@MXV@#2.rate}}%
- {\@MXV@getlabelvalue{@MXV@#2.startAt}}%
- {\@MXV@getlabelvalue{@MXV@#2.endAt}}%
- {\@MXV@getlabelvalue{@MXV@#2.volume}}%
- \@MXV@events{\@MXV@getlabelvalue{@MXV@#2.playerid}}%
- {\if@MXV@mouse true\else false\fi}%
- {\if@MXV@autoplay true\else false\fi}%
- try{
- if(player\@MXV@getlabelvalue{@MXV@#2.playerid}.isOpen){%
- player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
+ %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["#2"]=getAnnots3D(%
+ \@MXV@getlabelvalue{%
+ @MXV@player\@MXV@getlabelvalue{@MXV@#2.playerid}.page%
+ }-1%
+ )[\@MXV@getlabelvalue{@MXV@#2.3Doncurpage}-1];
+ annot3D["#2"].activated=true;
+ }catch(e){%
+ try{%
+ annot3D=new Array;
+ annot3D["#2"]=getAnnots3D(%
+ \@MXV@getlabelvalue{%
+ @MXV@player\@MXV@getlabelvalue{@MXV@#2.playerid}.page%
+ }-1%
+ )[\@MXV@getlabelvalue{@MXV@#2.3Doncurpage}-1];
+ annot3D["#2"].activated=true;
+ }catch(e){%
+ app.alert("3D annotation could not be 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["#2"].context3D.scene.nodes;
+ var cnt = nodes.count;
+ %
+ %auxiliary vectors
+ var dir = new annot3D["#2"].context3D.Vector3();
+ var up = new annot3D["#2"].context3D.Vector3();
+ var corner = new annot3D["#2"].context3D.Vector3();
+ %
+ %auxiliary 4x4 matrix
+ var bbox4x4 = new annot3D["#2"].context3D.Matrix4x4();
+ %
+ %centre of global bounding box --> centre of orbit
+ var coo = %
+ annot3D["#2"].context3D.scene.computeBoundingBox().center;
+ %
+ %radius of bounding sphere
+ var rBSphere = 0;
+ %
+ %iterate over all nodes in the scene
+ for(i=0; i<cnt; i++){%
+ var node = nodes.getByIndex(i);
+ %
+ %but inspect mesh nodes only
+ if(node.constructor.name == 'Mesh'){%
+ %get the bbox of the node (local coordinates)
+ var bbox = node.computeBoundingBox();
+ %
+ %local to parent transformation matrix
+ var trans = node.transform.transpose;
+ %
+ %build local to world transformation matrix by recursively
+ %multiplying the parent's transf. matrix on the left
+ var parent = node.parent;
+ while(parent.constructor.name != 'Scene'){%
+ trans = parent.transform.transpose.multiply(trans);
+ parent = parent.parent;
+ }%
+ %
+ %transform the local bounding box corner coordinates to
+ %world coordinates for bounding sphere radius
+ %determination;
+ %Matrix4x4 method transformDirection(<Vector3>) seems
+ %to be bugged, therefore we must resort to the
+ %multiply(<Matrix4x4>) 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 = '';
+ if(aac != 30){%
+ res += util.printf('3Daac=\%s, ', %
+ (Math.abs(aac) < 1.001e-6 && Math.abs(aac) > 0 ? %
+ util.printf('\%.18f', aac): aac)%
+ );
+ }%
+ if(coo.length){%
+ res += util.printf( '3Dcoo=\%s \%s \%s, ', %
+ (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 Camera Settings", %
+ elements: [%
+ {%
+ type: "static_text", %
+ name: 'Copy and paste the following to the option %
+ list of \string\\\string\\includemovie!', %
+ }, %
+ {%
+ type: "edit_text", %
+ item_id: "text", %
+ alignment: "align_fill", %
+ readonly: true%
+ }, %
+ {%
+ 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@#2.mouse}}{true}}{%
+ \setboolean{@MXV@mouse}{true}%
+ }{%
+ \setboolean{@MXV@mouse}{false}%
+ }%
+ \edef\@MXV@ctrls{\@MXV@getlabelvalue{@MXV@#2.showUI}}%
+ \edef\@MXV@palindrome{\@MXV@getlabelvalue{@MXV@#2.palindrome}}%
+ \edef\@MXV@repeat{\@MXV@getlabelvalue{@MXV@#2.repeat}}%
+ \edef\@MXV@rate{\@MXV@getlabelvalue{@MXV@#2.rate}}%
+ \edef\@MXV@startat{\@MXV@getlabelvalue{@MXV@#2.startAt}}%
+ \edef\@MXV@endat{\@MXV@getlabelvalue{@MXV@#2.endAt}}%
+ \edef\@MXV@volume{\@MXV@getlabelvalue{@MXV@#2.volume}}%
+ \setkeys{movie15}{#1}%override with new settings
+ %
+ \edef\@MXV@operation{}%
+ %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@getlabelvalue{@MXV@#2.playerid}}%
+ {\if@MXV@mouse true\else false\fi}{true}%
+ try{%
+ if(player\@MXV@getlabelvalue{@MXV@#2.playerid}.isOpen){%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
+ app.media.closeReason.general);
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}=null;
+ }%
+ }%
+ catch(e){}%
+ %
+ %
+ try{%
+ var player\@MXV@getlabelvalue{@MXV@#2.playerid}=%
+ app.media.openPlayer({%
+ settings: settings,%
+ events: events%
+ });
+ }%
+ catch (e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkresume% resume/pause
+ \edef\@MXV@operation{%
+ /OP 3%
+ /JS (%
+ try{%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.visible=true;
+ if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
+ if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
+ %media at end will restart from beginning
+ if(
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.time
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.frame
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.marker
+ ){
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
+ }else{
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.stop();
+ }
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
+ }%
+ }%
+ else{%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.pause();
+ }%
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkstop%
+ \edef\@MXV@operation{%
+ /OP 1%
+ /JS (%
+ try{%
+ if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
+ }%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.stop();
+ if(
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.time
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.frame
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.marker
+ ){
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
+ }
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkpause% pause/resume
+ \edef\@MXV@operation{%
+ /OP 2%
+ /JS (%
+ try{%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.visible=true;
+ if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
+ if(!player\@MXV@getlabelvalue{@MXV@#2.playerid}.isPlaying){%
+ %media at end will restart from beginning
+ if(
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.time
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.frame
+ || player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt.marker
+ ){
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.seek(
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.settings.startAt);
+ }else{
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.stop();
+ }
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.play();
+ }%
+ }%
+ else{%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.pause();
+ }%
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkclose%
+ \edef\@MXV@operation{%
+ /OP 1%
+ /JS (%
+ try{%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
app.media.closeReason.general);
- player\@MXV@getlabelvalue{@MXV@#2.playerid}\space = null;
- }
- }
- catch(e){}
- %
- this.pageNum = \@MXV@playerpage - 1;
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}=null;
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkreset% reset to orig. settings
+ %retrieve original settings
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.mouse}}{true}}{%
+ \setboolean{@MXV@mouse}{true}%
+ }{%
+ \setboolean{@MXV@mouse}{false}%
+ }%
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@#2.autoplay}}{true}}{%
+ \setboolean{@MXV@autoplay}{true}%
+ }{%
+ \setboolean{@MXV@autoplay}{false}%
+ }%
%
- try{
- var player\@MXV@getlabelvalue{@MXV@#2.playerid}\space = %
- app.media.openPlayer({%
- settings: settings,
- events: events
- });
- }
- catch (e){}
- )
+ \edef\@MXV@operation{%
+ /OP 0%
+ /JS (%
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }%
+ \@MXV@settings{\@MXV@getlabelvalue{@MXV@#2.showUI}}%
+ {\@MXV@getlabelvalue{@MXV@#2.palindrome}}%
+ {\@MXV@getlabelvalue{@MXV@#2.repeat}}%
+ {\@MXV@getlabelvalue{@MXV@#2.rate}}%
+ {\@MXV@getlabelvalue{@MXV@#2.startAt}}%
+ {\@MXV@getlabelvalue{@MXV@#2.endAt}}%
+ {\@MXV@getlabelvalue{@MXV@#2.volume}}%
+ \@MXV@events{\@MXV@getlabelvalue{@MXV@#2.playerid}}%
+ {\if@MXV@mouse true\else false\fi}%
+ {\if@MXV@autoplay true\else false\fi}%
+ try{%
+ if(player\@MXV@getlabelvalue{@MXV@#2.playerid}.isOpen){%
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}.close(%
+ app.media.closeReason.general);
+ player\@MXV@getlabelvalue{@MXV@#2.playerid}=null;
+ }%
+ }%
+ catch(e){}%
+ %
+ try{%
+ var player\@MXV@getlabelvalue{@MXV@#2.playerid}=%
+ app.media.openPlayer({%
+ settings: settings,%
+ events: events%
+ });
+ }%
+ catch (e){}%
+ )%
+ }%
+ \fi%
}%
\fi%
%
- \savebox{\@MXV@textbox}{#3}% save text argument
- \ifthenelse{\boolean{@MXV@pdf}}{%
- \pdfstartlink%
- attr{
- \ifx\@pdfborder\@empty\else%
+ \ifpdf%
+ \ifthenelse{\isundefined{\@pdfborder}}{%
+ \def\@MXV@linkattr{}%
+ }{%
+ \edef\@MXV@linkattr{%
/Border [\@pdfborder]%
- \fi%
- \ifx\@linkbordercolor\@empty%
- /C [1 0 0]% hyperref default
- \else%
/C [\@linkbordercolor]%
- \fi%
- \ifx\@pdfhighlight\@empty\else%
/H \@pdfhighlight%
- \fi%
}%
+ }%
+ %
+ \pdfstartlink%
+ attr{\@MXV@linkattr}%
user{%
/Subtype /Link%
/A <<%
- /S /Rendition%
- /R \@MXV@getlabelvalue{@MXV@#2.rendition}\space 0 R%
- /AN \@MXV@getlabelvalue{@MXV@#2.annot}\space 0 R%
- \@MXV@operation%
+ /S/GoTo%
+ /D (@MXV@#2)%
+ \if@MXV@externalviewer\else%
+ \if@MXV@iiid%
+ \ifx\@MXV@iiidview\@empty\else%
+ /Next <<%
+ /S/GoTo3DView%
+ /TA \@MXV@getlabelvalue{@MXV@#2.annot}\space 0 R%
+ /V \@MXV@iiidview%
+ \fi%
+ \@MXV@jscriptiiidaction%
+ \ifx\@MXV@iiidview\@empty\else%
+ >>%
+ \fi%
+ \else%
+ /Next <<%
+ /S/Rendition%
+ /R \@MXV@getlabelvalue{@MXV@#2.rendition}\space 0 R%
+ /AN \@MXV@getlabelvalue{@MXV@#2.annot}\space 0 R%
+ \@MXV@operation%
+ >>%
+ \fi%
+ \fi%
>>%
}%
- \usebox{\@MXV@textbox}% write out text box
+ \usebox{\@MXV@textbox}% write out text box
\pdfendlink%
- }{%
- \advance\@MXV@links by 1%increment counter
+ \else%
\pdfmark[{\usebox{\@MXV@textbox}}]{%
pdfmark=/ANN,%
Subtype=/Link,%
- %ghostscript bug leads to wrong border width in final PDF
-% Border=\@pdfborder,
Color=\@linkbordercolor,%
AcroHighlight=\@pdfhighlight,%
Raw={%
@@ -1706,21 +2357,40 @@
}%
}%
%
- %entire action entry moved outside screen annotation
- %to workaround a ghostscript bug
+ %entire action entry moved outside
\pdfmark{%
pdfmark=/PUT,%
Raw={%
{linkannot\the\@MXV@links} <<%
/A <<%
- /S /Rendition%
- /R {mediarendition\@MXV@getlabelvalue{@MXV@#2.playerid}}%
- /AN {screenannot\@MXV@getlabelvalue{@MXV@#2.playerid}}%
- \@MXV@operation%
+ /S/GoTo%
+ /D/@MXV@#2%
+ \if@MXV@externalviewer\else%
+ \if@MXV@iiid%
+ \ifx\@MXV@iiidview\@empty\else%
+ /Next <<%
+ /S/GoTo3DView%
+ /TA {3Dannot\@MXV@getlabelvalue{@MXV@#2.playerid}}%
+ /V \@MXV@iiidview%
+ \fi%
+ \@MXV@jscriptiiidaction%
+ \ifx\@MXV@iiidview\@empty\else%
+ >>%
+ \fi%
+ \else%
+ /Next <<%
+ /S /Rendition%
+ /R {mediarendition\@MXV@getlabelvalue{@MXV@#2.playerid}}%
+ /AN {screenannot\@MXV@getlabelvalue{@MXV@#2.playerid}}%
+ \@MXV@operation%
+ >>%
+ \fi%
+ \fi%
>>%
>>%
}%
}%
+ \fi%
}%
}
@@ -1748,29 +2418,34 @@
}{}%
\def\@MXV@mime{#1}%
}
+\define@key{movie15}{playerid}{%
+ \def\@MXV@player{%
+ /PL<</MU [<</PID<</U (vnd.adobe.swname:#1)>>>>]>>%
+ }%
+}
\define@key{movie15}{autoplay}[true]{%
\setboolean{@MXV@autoplay}{#1}%
- \ifthenelse{\boolean{@MXV@autoplay}}{%
+ \if@MXV@autoplay%
\setboolean{@MXV@autoresume}{false}%
- }{}%
+ \fi%
}
\define@key{movie15}{autostop}[true]{%
\setboolean{@MXV@autostop}{#1}%
- \ifthenelse{\boolean{@MXV@autostop}}{%
+ \if@MXV@autostop%
\setboolean{@MXV@autopause}{false}%
- }{}%
+ \fi%
}
\define@key{movie15}{autoresume}[true]{%
\setboolean{@MXV@autoresume}{#1}%
- \ifthenelse{\boolean{@MXV@autoresume}}{%
+ \if@MXV@autoresume%
\setboolean{@MXV@autoplay}{false}%
- }{}%
+ \fi%
}
\define@key{movie15}{autopause}[true]{%
\setboolean{@MXV@autopause}{#1}%
- \ifthenelse{\boolean{@MXV@autopause}}{%
+ \if@MXV@autopause%
\setboolean{@MXV@autostop}{false}%
- }{}%
+ \fi%
}
\define@key{movie15}{continue}[true]{%
\setboolean{@MXV@autostop}{false}%
@@ -1812,10 +2487,10 @@
\setboolean{@MXV@runposter}{true}%
}{%
\def\@MXV@box##1##2##3{%
- \ifthenelse{\boolean{@MXV@pdf}}{%
+ \ifpdf%
\mbox{\pdfximage width ##1 height ##2 depth ##3 {#1}}%
\pdfrefximage\pdflastximage%
- }{%
+ \else%
\ifthenelse{\isundefined{\includegraphics}}{%
\@MXV@missing{graphicx}%
}{%
@@ -1826,7 +2501,7 @@
width=##1,height=##2,totalheight=\@MXV@totalheight,clip]{#1}%
}%
}%
- }%
+ \fi%
}%
}%
}
@@ -1834,27 +2509,28 @@
\setboolean{@MXV@externalviewer}{#1}%
}
\define@key{movie15}{inline}[true]{%
- \ifthenelse{\boolean{@MXV@url}}{%
+ \if@MXV@url%
\setboolean{@MXV@inline}{false}%
- }{%
+ \else%
\setboolean{@MXV@inline}{#1}%
- }%
- \ifthenelse{\boolean{@MXV@inline}}{}{%
+ \fi%
+ \if@MXV@inline\else%
\setboolean{@MXV@attachment}{false}%
- }%
+ \fi%
}
\define@key{movie15}{url}[true]{%
\setboolean{@MXV@url}{#1}%
- \ifthenelse{\boolean{@MXV@url}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@attachment}}{%
+ \if@MXV@attachment%
\setboolean{@MXV@inline}{true}%
- }{}%
+ \fi%
}
\define@key{movie15}{text}{%
\setboolean{@MXV@boxopt}{true}%
@@ -1871,17 +2547,21 @@
}
%3D specific options
\define@key{movie15}{3Dbg}{%
- \def\@MXV@background{/BG<</CS/DeviceRGB/C[#1]>>}%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@background{/BG<</CS/DeviceRGB/C[#1]>>}%
+ }{\@MXV@neediiiD}%
}
\define@key{movie15}{3Djscript}{%
- \IfFileExists{#1}{%
- \def\@MXV@jscriptiiidfile{#1}%
- }{%
- \PackageError{movie15}{Script file `#1' cannot be opened for embedding%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \IfFileExists{#1}{%
+ \def\@MXV@jscriptiiidfile{#1}%
}{%
- Make sure file `#1' exists and is readable!%
+ \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}}{%
@@ -1908,75 +2588,97 @@
}{\@MXV@neediiiD}%
}
\define@key{movie15}{3Dviews}{%
- \IfFileExists{#1}{%
- \def\@MXV@viewsfile{#1}%
- }{%
- \PackageError{movie15}{3D views file `#1' cannot be opened%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \IfFileExists{#1}{%
+ \def\@MXV@viewsfile{#1}%
}{%
- Make sure file `#1' exists and is readable!%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkplay}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkpause}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkresume}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkstop}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkclose}}{%
+ \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}%
- \ifthenelse{\boolean{@MXV@linkreset}}{%
+ \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
@@ -2010,12 +2712,12 @@
%determine playback section
\ifx\@MXV@starttime\@empty\else%
\edef\@MXV@movieoptions{\@MXV@movieoptions, %
- startat=time:\strip@pt\@MXV@start}%
+ 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}%
+ endat=time:\strip@pt\@MXV@end}%
\fi%
%
%text option from 2nd argument
@@ -2049,12 +2751,12 @@
%determine playback section
\ifx\@MXV@starttime\@empty\else%
\edef\@MXV@movieoptions{\@MXV@movieoptions, %
- startat=time:\strip@pt\@MXV@start}%
+ 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}%
+ endat=time:\strip@pt\@MXV@end}%
\fi%
%
\edef\@MXV@movieoptions{[\@MXV@movieoptions]}%