summaryrefslogtreecommitdiff
path: root/Master
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
parentd5edbfb2290391fa1e9cd218c042f0711c0ea78b (diff)
movie15 update
git-svn-id: svn://tug.org/texlive/trunk@1586 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/movie15/README37
-rw-r--r--Master/texmf-dist/doc/latex/movie15/dice.u3dbin160832 -> 160672 bytes
-rw-r--r--Master/texmf-dist/doc/latex/movie15/dice.vws14
-rw-r--r--Master/texmf-dist/doc/latex/movie15/movie15.pdfbin208125 -> 245353 bytes
-rw-r--r--Master/texmf-dist/doc/latex/movie15/movie15.tex174
-rw-r--r--Master/texmf-dist/tex/latex/movie15/movie15.sty2214
-rw-r--r--Master/texmf-dist/tpm/movie15.tpm6
7 files changed, 1634 insertions, 811 deletions
diff --git a/Master/texmf-dist/doc/latex/movie15/README b/Master/texmf-dist/doc/latex/movie15/README
index a5f00d314d8..0718bcd6681 100644
--- a/Master/texmf-dist/doc/latex/movie15/README
+++ b/Master/texmf-dist/doc/latex/movie15/README
@@ -24,7 +24,8 @@ Description:
available somewhere on Adobe's web site (http://www.adobe.com).
Note, this file only gives a summary of usage and available command
- options. Please refer to the documentation `movie15.pdf' for details.
+ options. Please refer to the documentation `movie15.pdf' in the `doc/'
+ directory for details.
Usage:
@@ -47,11 +48,16 @@ Usage:
with <label spec> using the `label' option of the inclusion command.
Provides a means to control the playback state and properties of the
- referenced media.
+ referenced media. In 3D context, it can be used to define an additional view
+ of the object, to access a particular view from the list of predefined views
+ by index or to run a JavaScript. Moreover, links can be created for
+ calculating 3D camera settings.
- In addition to `play' (default), `stop', `resume', `pause', `reset' and
- `close' it accepts `controls', `repeat', `palindrome', `startat', `endat',
- `mouse', `rate' and `volume' from the subsequent list of command options.
+ In addition to `play' (default), `stop', `resume', `pause', `reset', `close',
+ `3Dviewindex' and `3Dcalculate' it accepts `controls', `repeat',
+ `palindrome', `startat', `endat', `mouse', `rate', `volume', `3Dcoo',
+ `3Dc2c', `3Droo', `3Dcaa' and `3Djscript' from the subsequent list of command
+ options.
Options:
@@ -108,6 +114,13 @@ Usage:
palindrome[=true|false] Play media forward and backward.
+ playerid=<playerid> Forces a particular media player plugin to be used
+ instead of the default one. Currently, the
+ following values are recognised:
+ AAPL_QuickTime, MACR_FlashPlayer, RNWK_RealPlayer,
+ MSFT_WindowsMediaPlayer, ADBE_MCI (Adobe builtin
+ player).
+
poster The first frame of the movie or the frame at the
beginning of the movie section specified by the
`startat' and `endat' options is shown.
@@ -231,6 +244,17 @@ Usage:
close Immediately closes the media player.
+ 3Dviewindex=<index> Opens the first `F', last `L', next `N' or
+ previous `P' view from the list of additional
+ views, or the one indexed by an integer. `D' gives
+ access to the default view.
+
+ 3Dcalculate[=<aac angle>] Creates a link for calculating `3Droo' and `3Dcoo'
+ settings of the virtual camera. The default
+ aperture angle of 30 degrees is used for the
+ calculation unless an optional <aac angle> has
+ been provided.
+
Known file name extensions:
@@ -241,12 +265,13 @@ Known file name extensions:
au, snd audio/basic NeXT/Sun Audio Format
avi video/avi AVI (Audio/Video Inter-
leaved)
+ gif image/gif (animated) GIF
mid, rmi audio/midi MIDI (Musical Instrument
Digital Interface)
mov, qt video/quicktime Apple QuickTime
mp3, m3u audio/x-mp3 MPEG Audio Layer-3
mp4 video/mp4 MPEG-4 Video/Audio
- mpeg, mpg video/mpeg MPEG-2 Video
+ mpeg, mpg video/mpeg MPEG-1 & 2 Video
ra, ram, rm audio/x-pn-realaudio Real Media
smil application/smil Synchronized Multimedia
Integration Language
diff --git a/Master/texmf-dist/doc/latex/movie15/dice.u3d b/Master/texmf-dist/doc/latex/movie15/dice.u3d
index 242dbdc35b5..ae14b756a16 100644
--- a/Master/texmf-dist/doc/latex/movie15/dice.u3d
+++ b/Master/texmf-dist/doc/latex/movie15/dice.u3d
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/movie15/dice.vws b/Master/texmf-dist/doc/latex/movie15/dice.vws
index 33db68cf58d..96894f51dd4 100644
--- a/Master/texmf-dist/doc/latex/movie15/dice.vws
+++ b/Master/texmf-dist/doc/latex/movie15/dice.vws
@@ -1,7 +1,7 @@
-[Top]{0 0 0}{0 0 1}{30}{30}
-[Bottom]{0 0 0}{0 0 -1}{30}{30}
-[Front]{0 0 0}{0 -1 0}{30}{30}
-[Back]{0 0 0}{0 1 0}{30}{30}
-[Left]{0 0 0}{-1 0 0}{30}{30}
-[Right]{0 0 0}{1 0 0}{30}{30}
-[Fish Eye at Centre]{0 0 0}{0 -1 0}{0.0001}{130}
+[Front]{0 0 0}{0 -1 0}{28}{30}
+[Back]{0 0 0}{0 1 0}{28}{30}
+[Left]{0 0 0}{-1 0 0}{28}{30}
+[Right]{0 0 0}{1 0 0}{28}{30}
+[Top]{0 0 0}{0 0 1}{28}{30}
+[Bottom]{0 0 0}{0 0 -1}{28}{30}
+[Fish Eye at Centre]{0 0 0}{0 -1 0}{0.00001}{130}
diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.pdf b/Master/texmf-dist/doc/latex/movie15/movie15.pdf
index d0e996408fa..9ed36dfae1e 100644
--- a/Master/texmf-dist/doc/latex/movie15/movie15.pdf
+++ b/Master/texmf-dist/doc/latex/movie15/movie15.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.tex b/Master/texmf-dist/doc/latex/movie15/movie15.tex
index 7c2f32ee3d6..7bae57c9ecb 100644
--- a/Master/texmf-dist/doc/latex/movie15/movie15.tex
+++ b/Master/texmf-dist/doc/latex/movie15/movie15.tex
@@ -4,27 +4,16 @@
% http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
% for the details of that license.
%
-
\documentclass[a4paper]{article}
-%please use pdfLaTeX
-\usepackage{ifthen}
-\ifthenelse{\isundefined{\pdfoutput}}{%
- \errmessage{Use pdfLaTeX, please!}
-}{%
- \ifthenelse{\number\pdfoutput<1}{%
- \errmessage{Use pdfLaTeX, please!}
- }{}
-}
-
\usepackage[3D]{movie15}
-
\usepackage{ragged2e}
\usepackage{amssymb}
\usepackage[UKenglish]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{hyperref}
+\usepackage{textcomp}
\pdfpagewidth595bp
\pdfpageheight842bp
\parindent0pt
@@ -80,7 +69,7 @@ If PDF is generated via DVI and Postscript by the usual \verb+latex+ $\rightarro
In the case of pdf\LaTeX{}, the `graphicx' and `hyperref' packages are not required.
-Note, that more than one run may be necessary to resolve internally created cross-references. Appropriate warnings will be emitted in such cases.
+Note that more than one run may be necessary to resolve internally created cross-references. Appropriate warnings will be issued in such cases.
\section{Requirements}
pdf\LaTeX{}, version $\ge1.20$, is needed for direct PDF output.
@@ -95,13 +84,13 @@ Movies, sounds and 3D objects are embedded into the document using the command
\begin{verbatim}
\includemovie[<options>]{<width>}{<height>}{<media file>}
\end{verbatim}
-Unless left empty (cf. option `\verb+text+') the \verb+<width>+ and \verb+<height>+ arguments must be given in valid \TeX{} dimensions. Horizontal and vertical dimensions of the media clip are scaled independently to fit \verb+<width>+ and \verb+<height>+. \verb+<media file>+ specifies the file name of the media clip. If the media file is embedded as part of the final PDF output, which is the default, it may reside wherever \TeX{} or Ghostscript search for input files, depending on the PDF producing method.
+Unless left empty, the \verb+<width>+ and \verb+<height>+ arguments must be given in valid \TeX{} dimensions. Horizontal and vertical dimensions of the media clip are scaled independently to fit \verb+<width>+ and \verb+<height>+ or, if the two latter are empty, to fit the size of the text box, given as argument to the `\verb+text+' option (see \hyperlink{lnk:textoption}{below}). \verb+<media file>+ specifies the file name of the media clip. If the media file is embedded as part of the final PDF output, which is the default, it may reside wherever \TeX{} or Ghostscript search for input files, depending on the PDF producing method.
Below, common options to \verb+\includemovie+ are listed. Options specific to embedding of 3D content are discussed separately in section~\ref{3dtut}.
\begin{verbatim}
attach[=false]
\end{verbatim}
-By default, the embedded data stream is re-used as embedded file attachment. This makes `movie15' a little more portable to PDF Readers which do not have a multimedia plugin because it gives the user the opportunity to extract the media file and to save it to disk for later playback with an external player. However, support of file attachments is required. Re-use as file attachment can be suppressed with option `\verb+attach=false+'. Note, that `\verb+attach=false+' is a poor method to prevent the user from obtaining a copy of the media file. There are several (free) tools for decompressing and extracting stream objects from PDF files.
+By default, the embedded data stream is re-used as embedded file attachment. This makes `movie15' a little more portable to PDF Readers which do not have a multimedia plugin because it gives the user the opportunity to extract the media file and to save it to disk for later playback with an external player. However, support of file attachments is required. Re-use as file attachment can be suppressed with option `\verb+attach=false+'. Note that `\verb+attach=false+' is a poor method to prevent the user from obtaining a copy of the media file. There are several (free) tools for decompressing and extracting stream objects from PDF files.
\begin{verbatim}
autopause
\end{verbatim}
@@ -142,7 +131,7 @@ This can be suppressed with option `\verb+inline=false+'.
\begin{verbatim}
label=<label spec>
\end{verbatim}
-The media is labelled with \verb+<label spec>+ such that it can be referenced by the \verb+\movieref+ command elsewhere in the document. The \verb+\movieref+ command creates a hyperlink to either stop, pause, resume the media, to play it with different settings, such as frame rate or volume, or to show a different part of it. \verb+<label spec>+ may consist of any sequence of letters, digits or punctuation characters.
+The media is labelled with \verb+<label spec>+ such that it can be referenced by the \verb+\movieref+ command elsewhere in the document. The \verb+\movieref+ command creates a hyperlink to either stop, pause, resume the media, to play it with different settings, such as frame rate or volume, or to show a different part of it. See section~\ref{hyperlinks} for details. \verb+<label spec>+ may consist of any sequence of letters, digits or punctuation characters.
\begin{verbatim}
mimetype=<mimetype>
\end{verbatim}
@@ -156,6 +145,16 @@ palindrome[=true|false]
\end{verbatim}
The media is played forward and backward, if supported by the media player. In combination with option `\verb+repeat+' this forward-and-reverse playback repeats as many times as specified. Each complete forward and reverse playback counts as one repeat.
\begin{verbatim}
+playerid=<playerid>
+\end{verbatim}
+Forces a particular media player plugin to be used instead of the default one. Currently, the following values are recognized:\\[1ex]
+{\tt\phantom{xxxx}AAPL\_QuickTime\\
+\phantom{xxxx}MACR\_FlashPlayer\\
+\phantom{xxxx}RNWK\_RealPlayer\\
+\phantom{xxxx}MSFT\_WindowsMediaPlayer\\
+\phantom{xxxx}ADBE\_MCI} (Adobe builtin player)
+
+\begin{verbatim}
poster
\end{verbatim}
The first frame of the movie or the frame at the beginning of the movie section specified by the `\verb+startat+' and `\verb+endat+' options is shown.
@@ -187,14 +186,22 @@ Some \verb+<offset>+ examples:
frame:100
{marker:"Chapter 1", time:60}
\end{verbatim}
+\hypertarget{lnk:textoption}{}
\begin{verbatim}
text=<text>
\end{verbatim}
-\verb+<text>+ is typeset onto and centred within the media display area which has been specified by the \verb+<width>+ and \verb+<height>+ arguments as well as the `\verb+depth+' option. If either or both of the \verb+<width>+ and \verb+<height>+ arguments are left empty, any unspecified dimension of the media display is scaled to match the corresponding dimension, i.\,e. width and height, of \verb+<text>+. Likewise, the depth of the media display is adjusted to the depth of \verb+<text>+ if the optional `\verb+depth+' has not been given. Therefore, option `\verb+text+' can be used to scale the media display to the natural or scaled dimensions of a poster image file, such as (requires package `graphicx'):
+\verb+<text>+ is typeset onto and centred within the media display area which has been specified by the \verb+<width>+ and \verb+<height>+ arguments as well as the `\verb+depth+' option. If either or both of the \verb+<width>+ and \verb+<height>+ arguments are left empty, any unspecified dimension of the media display is scaled to match the corresponding dimension, i.\,e. width and height, of \verb+<text>+. Likewise, the depth of the media display is adjusted to the depth of \verb+<text>+ if the optional `\verb+depth+' has not been given. Therefore, option `\verb+text+' can be used to scale the media display to the natural or scaled dimensions of a poster image file, such as (requires package `graphicx'; \emph{also note the empty {\tt<width>} and {\tt<height>} arguments!}):
\begin{verbatim}
\includemovie[text={\includegraphics[scale=2]{path/to/poster}}]
{}{}{path/to/movie}
\end{verbatim}
+In combination with the `\verb+poster+' option, where the poster image will be rendered from the movie during runtime, the PDF file size can be reduced somewhat by putting \verb+\includegraphics+ into a \verb+\phantom+ box:
+\begin{verbatim}
+ \includemovie[
+ poster,
+ text={\phantom{\includegraphics[scale=2]{path/to/poster}}}
+ ]{}{}{path/to/movie}
+\end{verbatim}
\begin{verbatim}
textoverposter[=false]
\end{verbatim}
@@ -209,11 +216,11 @@ volume=<percentage of original volume>
The meaning of this option should be self explaining.
\subsection{Inclusion of 3D objects}\label{3dtut}
-The PDF-1.6 specification, which was introduced with the advent of Adobe Acrobat/Reader 7, allows embedding of 3 dimensional graphic objects, such as CAD models or 3D scientific data, and lets the user interactively manipulate them. At time of writing this documentation, the only supported file format is U3D~\cite{3diforg}, and only one commercial software~\cite{dexp} for exporting into U3D format, yet from a number of CAD and 3D vector formats, including DXF and VRML, was known. However, a tryout version of~\cite{dexp} can be downloaded from the Web site.
+The PDF-1.6 specification, which was introduced with the advent of Adobe Acrobat/Reader 7, allows embedding of 3-dimensional graphic objects, such as CAD models or 3D scientific data, and lets the user interactively manipulate them. At time of writing this documentation, the only supported file format is U3D~\cite{3diforg}, and only one commercial software~\cite{dexp} for exporting into U3D format, yet from a number of CAD and 3D vector formats, including DXF and VRML, was known. Nevertheless, a tryout version of~\cite{dexp} can be downloaded from the Web site.
-Selection of the `\verb+3D+' package option enables the 3D feature. Most of the command options listed in section~\ref{usrif} do what they are supposed to do in the case of embedded 3D as well. Other options are ignored, in particular `\verb+open+', `\verb+repeat+', `\verb+palindrome+', `\verb+startat+', `\verb+endat+', `\verb+rate+' and `\verb+volume+', because they do not make sense, `\verb+inline+' and `\verb+url+', because 3D files are always fully embedded and finally `\verb+mouse+', because 3D objects are interactive by definition.
+Selection of the `\verb+3D+' package option enables the 3D feature. Most of the command options listed in section~\ref{usrif} do what they are supposed to do in the case of embedded 3D as well. Other options are ignored, in particular `\verb+repeat+', `\verb+palindrome+', `\verb+startat+', `\verb+endat+', `\verb+rate+' and `\verb+volume+', because they do not make sense and `\verb+mouse+', because 3D objects are interactive by definition. Options `\verb+inline=false+' and `\verb+url+' are supported, but imply option `{\tt{}externalview\-er}', because the 3D Reader plugin handles embedded files only.
-There are a few options to \verb+\includemovie+ which define how the 3D object is positioned within the viewport of a virtual camera, or conversely, how the virtual camera is positioned and oriented within a coordinate system, called `The World', which bears the 3D object at a fixed position. Fig.~\ref{3dscene} should help to visualise the scenery: The virtual camera is orbiting at a distance of $ROO$ around the centre of orbit, specified by the position vector $\overrightarrow{COO}$; $\sphericalangle AAC$ is the camera's aperture angle. In addition, the direction vector $\overrightarrow{C2C}$ is needed to specify the initial camera position.
+There are a few options to \verb+\includemovie+ which define how the 3D object is positioned within the viewport of a virtual camera, or conversely, how the virtual camera is positioned and oriented within a coordinate system, called `The World', which bears the 3D object at a fixed position. Fig.~\ref{3dscene} should help to visualize the scenery: The virtual camera is orbiting at a distance of $ROO$ around the centre of orbit, specified by the position vector $\overrightarrow{COO}$; $\sphericalangle AAC$ is the camera's aperture angle. In addition, the direction vector $\overrightarrow{C2C}$ is needed to specify the initial camera position.
\begin{figure}[ht]
\resizebox{\linewidth}{!}{\input{3dsystem}}
\caption{Camera and 3D object in the World System $XYZ$; centre of orbit position vector $\vec{COO}$, centre of orbit to camera direction vector $\vec{C2C}$, radius of orbit $ROO$, aperture angle of camera $\sphericalangle AAC$.}\label{3dscene}
@@ -223,30 +230,37 @@ The \emph{default view}, i. e. the view that is shown initially after activating
\begin{verbatim}
3Daac=<angle>
\end{verbatim}
-This option sets the aperture angle of the camera, measured in degrees. Fixed point real numbers between 0 and 180 are admissible. A sensible value of 30 is preset by default. Larger values can be used to achieve wide-angle or fish-eye effects, cf. example 2 in section~\ref{examples}.
+This option sets the aperture angle of the camera, measured in degrees. Fixed point real numbers between 0 and 180 are admissible. A sensible value of 30 is preset by default. Larger values can be used to achieve wide-angle or fish-eye effects, see example~\ref{ex3d} in section~\ref{examples}.
\begin{verbatim}
3Dc2c=<x> <y> <z>
\end{verbatim}
-\verb+<x> <y> <z>+ specify a direction vector $\overrightarrow{C2C}$ of arbitrary length, originating in the centre of orbit and pointing to the virtual camera; cf. option `\verb+3Dcoo+' for the number format of \verb+<x> <y> <z>+. Note, that \emph{top} ({\tt 3Dc2c=0 0 1}) and \emph{bottom views} ({\tt 3Dc2c=0 0 -1}) as well as views with \emph{very small but larger than zero inclination angles} relative to the world axes should be avoided when going the {\tt latex} $\rightarrow$ {\tt dvips} $\rightarrow$ {\tt ps2pdf} route. Due to a bug in Ghostscript they lead to unusable 3D inclusions. This restriction does not apply to pdf\LaTeX!
+\verb+<x> <y> <z>+ specify a direction vector $\overrightarrow{C2C}$ of arbitrary length, originating in the centre of orbit and pointing to the virtual camera. Only fixed point numbers in the range from\\[1ex]
+\phantom{xxxx}$-999999999999999999.999999999999999999$\\
+to\\
+\phantom{xxxx}$+999999999999999999.999999999999999999$\\[1ex]
+are allowed.
+%Note that views with \emph{very small but larger than zero} inclination angles relative to the world axes \emph{may} lead to broken 3D inclusions when going the {\tt latex} $\rightarrow$ {\tt dvips} $\rightarrow$ {\tt ps2pdf} route. If this happens chances are great that a Ghostscript version prior to 8.53 has been used for PS to PDF conversion. This issue has been resolved since version 8.53.
\begin{verbatim}
3Dcoo=<x> <y> <z>
\end{verbatim}
-\verb+<x> <y> <z>+ specify the positional vector $\overrightarrow{COO}$ of the centre of orbit. Only fixed point numbers in the range from -999999999999999999.999999999999999999 to +999999999999999999.999999999999999999 are allowed.
+\verb+<x> <y> <z>+ specify the positional vector $\overrightarrow{COO}$ of the centre of orbit. See option `\verb+3Dc2c+' for the number format of \verb+<x> <y> <z>+.
\begin{verbatim}
3Droo=<r>
\end{verbatim}
-\verb+<r>+ (always positive!) specifies the radius of orbit $ROO$ of the virtual camera; cf. option `\verb+3Dcoo+' for the number format
+\verb+<r>+ (always positive!) specifies the radius of orbit $ROO$ of the virtual camera. See option `\verb+3Dc2c+' for the number format of \verb+<r>+.
-Without the above options the immovable camera sits at the origin $(0,0,0)$ of the World, and looks in the positive $Y$ direction, i. e. default settings of \verb+3Droo=0+, \verb+3Dcoo=0 0 0+ and \verb+3Dc2c=0 -1 0+ are assumed. (Note, that $\overrightarrow{C2C}$ is the opposite of the view vector!)
+Without the above options the immovable camera sits at the origin $(0,0,0)$ of the World, looking in the positive $Y$ direction, i. e. default settings of \verb+3Droo=0+, \verb+3Dcoo=0 0 0+ and \verb+3Dc2c=0 -1 0+ are assumed. (Note that $\overrightarrow{C2C}$ is the opposite of the view vector!)
-Therefore, in order to get a `front view' of the 3D object it would be sufficient to gradually increase the radius $ROO$ from \LaTeX{} run to \LaTeX{} run until the object or group of objects can be fully seen in the viewport. Since the object size in terms of world coordinate units may differ in orders of magnitude between U3D files, the optimal `\verb+3Droo+' setting might be found by experimenting with a series of geometrically increasing numbers, such as 1, 10, 100, 1000, 10000, 100000 etc. to get a rough approximation and by a subsequent fine tuning using smaller changes.
+Thus, in order to get a `front view' of the 3D object it is sufficient to gradually increase the radius $ROO$ from \LaTeX{} run to \LaTeX{} run until the object or group of objects can be fully seen in the viewport. Since the object size in terms of world coordinate units may differ in orders of magnitude between U3D files, the optimal `\verb+3Droo+' setting might be found by experimenting with a series of geometrically increasing numbers, such as 1, 10, 100, 1000, 10000 etc. to get a rough approximation and by subsequent fine tuning using smaller changes.
-Ideally, there should be no need for changing the default setting of \verb+3Dcoo=0 0 0+ for the centre of orbit. However, this requires that the 3D object or group of objects be centred around the world origin $(0,0,0)$ during file export into the U3D format. (This is the default setting with~\cite{dexp}.) If the 3D object apparently pivots around an orbital centre that lies outside of the object's cubature, either the file export could be repeated with appropriate settings or the centre of orbit could be moved into the object centre using the `\verb+3Dcoo+' option. Regarding the latter method, this can be easily achieved if the object is examined from two different directions, say from left (\verb+3Dc2c=-1 0 0+) in order to adjust the \verb+<y>+ and \verb+<z>+ coordinates of `\verb+3Dcoo+' and from front (\verb+3Dc2c=0 -1 0+) in order to adjust the remaining \verb+<x>+ coordinate.
+Ideally, there should be no need for changing the default setting of \verb+3Dcoo=0 0 0+ for the centre of orbit. However, this requires that the 3D object or group of objects be centred around the world origin $(0,0,0)$ during file export into U3D format. (This is the default setting with~\cite{dexp}.) If the 3D object apparently pivots around an orbital centre that lies outside of the object's cubature, either the file export could be repeated with appropriate settings or the centre of orbit could be moved into the object centre using the `\verb+3Dcoo+' option. Regarding the latter method, this can be easily achieved if the object is examined from two different directions, say from left (\verb+3Dc2c=-1 0 0+) in order to adjust the \verb+<y>+ and \verb+<z>+ coordinates of `\verb+3Dcoo+' and from front (\verb+3Dc2c=0 -1 0+) in order to adjust the remaining \verb+<x>+ coordinate.
+
+Alternatively, good values for the `\verb+3Droo+' and `\verb+3Dcoo+' options can be found easily by temporarily inserting a hyperlink using the \verb+\movieref+ command together with the `\verb+3Dcalculate+' option. See section \ref{hyperlinks} for an explanantion and example \ref{ex3d} in section \ref{examples}.
\begin{verbatim}
3Dviews=<views file>
\end{verbatim}
-Instead of or in addition to the default view, further \emph{named, predefined views} can be set in an auxiliary file specified by the `\verb+3Dviews+' option. The predefined views can later be selected from a drop down list in the tool bar that is associated with every activated 3D object in the Reader. The file \verb+<views file>+ contains lines which obey the syntax:
+Instead of or in addition to the default view, further \emph{named views} can be set in an auxiliary file specified by the `\verb+3Dviews+' option. The additional views can later be selected from a drop down list in the tool bar that is associated with every activated 3D object in the Reader. The file \verb+<views file>+ contains lines which obey the syntax:
\begin{verbatim}
[<name>]{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<aac>}
\end{verbatim}
@@ -260,16 +274,16 @@ This option sets the background colour of the canvas. Only fixed point real numb
\begin{verbatim}
3Djscript=<JavaScipt file>
\end{verbatim}
-Things like animation, lighting, background colour etc. may also be script driven. Option `\verb+3Djscript+' associates a \verb+<JavaScipt file>+ with the 3D object. The script will be executed upon activation of the object. Refer to the Acrobat 3D JavaScript Reference~\cite{jscript} for details.
+Things like animation, lighting, background colour etc. may also be script driven. Option `\verb+3Djscript+' associates a \verb+<JavaScipt file>+ with the 3D object. The script will be executed upon activation of the object. Refer to the Acrobat 3D JavaScript Reference~\cite{jscript3D} for details.
-\subsection{Media hyperlinks}
-A movie or sound may serve as the destination of hyperlinks, which are inserted into the document using the command
+\subsection{Media hyperlinks}\label{hyperlinks}
+A movie, sound or 3D object may serve as the destination of hyperlinks, which are inserted into the document using the command
\begin{verbatim}
\movieref[<options>]{<label spec>}{<text>}
\end{verbatim}
-It makes \verb+<text>+ a hyperlink to a movie or sound that has been labelled with \verb+<label spec>+ using the `\verb+label+' option of the \verb+\includemovie+ command. Media hyperlinks can be inserted at any location within the document. Clicking onto the hyperlink causes the Reader to open the page containing the media it is pointing to. Referencing of 3D objects has not been implemented yet.
+It makes \verb+<text>+ a hyperlink to the media that has been labelled with \verb+<label+ \verb+spec>+ using the `\verb+label+' option of the \verb+\includemovie+ command. Media hyperlinks can be inserted at any location within the document. Clicking onto the hyperlink causes the Reader to open the page containing the media it is pointing to. The primary purpose of media hyperlinks, however, is to provide a means to control the playback.
-The primary purpose of media hyperlinks, however, is to provide a means to control the playback of media. Depending on the \verb+<options>+ being in effect, clicking onto the hyperlink causes the media to stop, pause or resume, or to restart at different settings, such as frame rate, volume, starting and ending positions.
+\emph{In 2D context}, clicking onto the hyperlink causes the media to stop, pause or resume, or to restart at different settings, such as frame rate, volume, starting and ending positions, depending on the \verb+<options>+ being in effect.
Options that control the playback \emph{characteristics} are: `\verb+controls+', `\verb+endat+', `\verb+mouse+', `\verb+palindrome+', `\verb+rate+', `\verb+repeat+', `\verb+startat+' and `\verb+volume+'. Their meaning is the same as for the \verb+\includemovie+ command and can be looked up in section~\ref{usrif}. They take effect in combination with the `\verb+play+' option only.
@@ -299,6 +313,34 @@ close
\end{verbatim}
Immediately closes the media player.
+\emph{In 3D context}, \verb+\movieref+ can be used to define an additional view of the object, to access a particular view from the list of predefined views or to run a JavaScript. Moreover, a link can be created for calculating the camera settings `\verb+3Droo+' and `\verb+3Dcoo+', instead of finding them manually. The following options are recognized:
+\begin{verbatim}
+3Dviewindex=<index>
+\end{verbatim}
+Go to a predefined view of the 3D object. \verb+<index>+ can take `\verb+F+', `\verb+L+', `\verb+N+' or `\verb+P+' to access the first, last, next or previous element of the list of additional views, cf. option `\verb+3Dviews+' of {\tt \string\include\-movie}, or an integer specifying an index into the list. In the case of `\verb+N+' and `\verb+P+', repeated clicking onto the hyperlink allows to cycle through the list in forward or backward direction. `\verb+D+' gives access to the default view.
+
+\begin{verbatim}
+3Daac=<angle>
+3Dc2c=<x> <y> <z>
+3Dcoo=<x> <y> <z>
+3Droo=<r>
+\end{verbatim}
+Instead of referencing an existing view of the 3D object, a new one can be defined using any of these options, cf. section~\ref{3dtut}.
+
+\begin{verbatim}
+3Dcalculate[=<aac angle>]
+\end{verbatim}
+Creates a link for calculating `\verb+3Droo+' and `\verb+3Dcoo+' settings of the virtual camera. Clicking the link opens a dialog box from which the settings can be copied to the clipboard for later insertion into the option list of \verb+\includemovie+. The default aperture angle of $30$\textdegree{} is used for the calculation unless an optional \verb+<aac angle>+ has been provided.
+
+\begin{verbatim}
+3Djscript=<JavaScipt file>
+\end{verbatim}
+Runs the script \verb+<JavaScipt file>+ after clicking the link. Unlike the script that has been associated with the 3D annotation during object embedding, this JavaScript is not directly run by the JavaScript engine of the 3D plugin, but is run by Acrobat's own scripting engine. However, full access to the API of the 3D script engine is provided through the `\verb+context3D+' property of the `\verb+Annot3D+' object. For convenience, an associative array `\verb+annot3D+' has been provided for use within \verb+<JavaScipt file>+, in order to easily access the `\verb+Annot3D+' object of the annotation the enclosing link is pointing to. The particular element of the array is referenced by the annotation's label \verb+<label spec>+, enclosed in quotation marks. As an example, the `\verb+scene+' object can be referenced within \verb+<JavaScipt file>+ by
+\begin{verbatim}
+ annot3D["<label spec>"].context3D.scene
+\end{verbatim}
+For details about Acrobat JavaScript and its Annot3D object, see \cite{jscript}.
+
\subsection{Compatibility commands}
Two user commands have been provided that make `movie15' a replacement for the `multimedia' package which is part of Till Tantau's `Beamer' Class:
\begin{verbatim}
@@ -336,8 +378,9 @@ Start playback at the specified temporal offset. The trailing `\verb+s+' is mand
\begin{verbatim}
duration=<duration in seconds>s
\end{verbatim}
-The duration of the media segment to be played. The trailing `\verb+s+' is mandatory. Note, that `\verb+duration+' cannot be used together with option `startat' from \verb+\includemovie+. The following options can be combined in order to define a media segment: `\verb+startat+'/`\verb+endat+', `\verb+start+'/`\verb+endat+', `\verb+start+'/`\verb+duration+'.
+The duration of the media segment to be played. The trailing `\verb+s+' is mandatory. Note that `\verb+duration+' cannot be used together with option `\verb+startat+' from \verb+\includemovie+. In order to define a media segment options can be combined as follows: `\verb+startat+'/`\verb+endat+', `\verb+start+'/`\verb+endat+', `\verb+start+'/`\verb+duration+'.
+%\newpage
\section{Examples}\label{examples}
\begin{enumerate}
\item A short circular MPEG movie, taken from \href{http://www.linux-video.net/Samples/}{\tt http://www.linux-video.net/} \href{http://www.linux-video.net/Samples/}{\tt Samples/}
@@ -362,12 +405,46 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda
\end{center}
\end{minipage}
-\item Embedded U3D file. It is based on a VRML model by Peter Whitehouse \href{mailto:pwhitehouse@optusnet.com.au}{\tt <pwhitehouse@optusnet.com.au>}. Conversion to U3D has been made with DeepExploration\textsuperscript{\scriptsize\textregistered}\cite{dexp}. A file `{\tt dice.vws}' that provides predefined views and a JavaScript `{\tt dice.js}' defining light sources have been associated with the 3D object.
+%\enlargethispage{15ex}\thispagestyle{empty}
+\item Another MPEG movie, loaded on the fly from \href{http://www.linux-video.net/Samples/}{\tt http://www.linux-video} \href{http://www.linux-video.net/Samples/}{\tt .net/Samples/}. Hence, a working Internet connection is required. This time, we force the QuickTime plugin to be used instead of MediaPlayer (Windows boxes only). Well, the latter seems to be bugged. Quod erat expectandum.
\begin{minipage}{0.5\linewidth}
{\tt%
\string\includemovie[\\
\phantom{xx}poster,\\
+ \phantom{xx}label=alien,\\
+ \phantom{xx}text=(AlienSong.mpg),\\
+ \phantom{xx}url,\\
+ \phantom{xx}playerid=AAPL\_QuickTime,\\
+ \phantom{xx}repeat\\
+ ]\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}.375\string\linewidth\\
+ \string}\string{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg\string}\\
+ \string\movieref[rate=0.5]\string{alien\string}\string{Slow\string}\\
+ \string\movieref\string{alien\string}\string{Normal\string}\\
+ \string\movieref[rate=2]\string{alien\string}\string{Fast\string}\\
+ \string\movieref[pause]\string{alien\string}\string{Pause/Resume\string}
+}
+\end{minipage}%
+\begin{minipage}{0.5\linewidth}
+\begin{center}
+ \includemovie[poster, label=alien, text=(AlienSong.mpg), url, playerid=AAPL_QuickTime, repeat]{\linewidth}{.75\linewidth}{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg}\\
+\movieref[rate=0.5]{alien}{Slow}\hfill
+\movieref{alien}{Normal}\hfill
+\movieref[rate=2]{alien}{Fast}\hfill
+\movieref[pause]{alien}{Pause/Resume}\vspace{19 ex}
+\end{center}
+\end{minipage}
+\newpage
+\item\label{ex3d} Embedded U3D file. It is based on a VRML model by Peter Whitehouse \href{mailto:pwhitehouse@optusnet.com.au}{\tt <pwhitehouse@optusnet.com.au>}. Conversion to U3D has been made with DeepExploration\textsuperscript{\scriptsize\textregistered}\cite{dexp}. A file `{\tt dice.vws}' that provides additional views and a JavaScript `{\tt dice.js}' defining light sources have been associated with the 3D object.
+
+\begin{minipage}{0.5\linewidth}
+{\tt%
+ \string\includemovie[\\
+ \phantom{xx}poster,\\
+ \phantom{xx}label=dice,\\
\phantom{xx}text=(dice.u3d),\\
\phantom{xx}3Droo=28,\\
\phantom{xx}3Dc2c=1 -1 1,\\
@@ -378,21 +455,39 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda
\phantom{xx}.5\string\linewidth\\
\string}\string{\\
\phantom{xx}.5\string\linewidth\\
- \string}\string{dice.u3d\string}%
+ \string}\string{dice.u3d\string}\\
+ \string\movieref[\\
+ \phantom{xx}3Dviewindex=N\\
+ ]\string{dice\string}\string{Click here\string} \dots\\
+ \string\movieref[\\
+ \phantom{xx}3Dcalculate=60\\
+ ]\string{dice\string}\string{This link\string} \dots
}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\begin{center}
- \includemovie[poster, text=(dice.u3d), 3Droo=28, 3Dc2c=1 -1 1, 3Dbg=1 1 1, 3Dviews=dice.vws, 3Djscript=dice.js]{\linewidth}{\linewidth}{dice.u3d}
+ \includemovie[
+ poster,
+ label=dice,
+ text=(dice.u3d),
+ 3Droo=28,
+ 3Dc2c=1 -1 1,
+ 3Dbg=1 1 1,
+ 3Dviews=dice.vws,
+ 3Djscript=dice.js]{\linewidth}{\linewidth}{dice.u3d}
\end{center}
+\movieref[3Dviewindex=N]{dice}{Click here} to cycle through the list of additional views. \movieref[3Dcalculate=60]{dice}{This link} calculates 3D option settings for a 60\textdegree{} aperture angle of the virtual camera.
+
\end{minipage}
+
\end{enumerate}
\begin{thebibliography}{9}
\bibitem{pdfspec} Adobe Systems Inc.: \emph{PDF Reference, fifth edition: Adobe Portable Document Format version 1.6}, 2004, Implementation note 144, Appendix H.3, available at: \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/PDFReference.pdf}{\tt http://partners.adobe.com/public/developer/en/acrobat/sdk/} \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/PDFReference.pdf}{\tt pdf/pdf\_creation\_apis\_and\_specs/PDFReference.pdf}.
\bibitem{3diforg} \href{http://www.3dif.org/}{\tt http://www.3dif.org/}
\bibitem{dexp} \href{http://www.righthemisphere.com/products/dexp/}{\tt http://www.righthemisphere.com/products/dexp/}
- \bibitem{jscript} Adobe Systems Inc.: \emph{Adobe Acrobat 7.0 3D JavaScript Reference}, 2005, available at \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acro3DJS.pdf}{\tt http://partners.adobe.com/public/developer/en/ac} \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acro3DJS.pdf}{\tt robat/sdk/pdf/javascript/Acro3DJS.pdf}
+ \bibitem{jscript3D} Adobe Systems Inc.: \emph{Adobe Acrobat 7.0 3D JavaScript Reference}, 2005, available at \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acro3DJS.pdf}{\tt http://partners.adobe.com/public/developer/en/ac} \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/Acro3DJS.pdf}{\tt robat/sdk/pdf/javascript/Acro3DJS.pdf}
+ \bibitem{jscript} Adobe Systems Inc.: \emph{Adobe Acrobat 7.0.5 JavaScript Scripting Reference}, 2005, available at \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf}{\tt http://partners.adobe.com/public/developer/en/ac} \href{http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf}{\tt robat/sdk/pdf/javascript/AcroJS.pdf}
\end{thebibliography}
\begin{table}[h]
@@ -403,11 +498,12 @@ Extension & MIME type & Description\\\hline\hline\\[-2.5ex]
aif, aifc, aiff & audio/aiff & Audio Interchange File Format\\
au, snd & audio/basic & NeXT/Sun Audio Format\\
avi & video/avi & Audio/Video Interleaved\\
+gif & image/gif & (animated) GIF\\
mid, rmi & audio/midi & Musical Instrument Digital Interface\\
mov, qt & video/quicktime & Apple QuickTime\\
mp3, m3u & audio/x-mp3 & MPEG Audio Layer-3\\
mp4 & video/mp4 & MPEG-4 Video/Audio\\
-mpeg, mpg & video/mpeg & MPEG-2 Video\\
+mpeg, mpg & video/mpeg & MPEG-1 \& 2 Video\\
ra, ram, rm & audio/x-pn-realaudio & Real Media\\
smil & application/smil & Synchronized Multimedia Integration Language\\
swf & application/x-shockwave-flash & (Adobe?) Macromedia Flash\\
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]}%
diff --git a/Master/texmf-dist/tpm/movie15.tpm b/Master/texmf-dist/tpm/movie15.tpm
index a127259b4f3..9ef68886a34 100644
--- a/Master/texmf-dist/tpm/movie15.tpm
+++ b/Master/texmf-dist/tpm/movie15.tpm
@@ -3,7 +3,7 @@
<rdf:Description about="http://texlive.dante.de/texlive/Package/movie15.zip">
<TPM:Name>movie15</TPM:Name>
<TPM:Type>Package</TPM:Type>
- <TPM:Date>2006/01/09 00:44:40</TPM:Date>
+ <TPM:Date>2006/05/22 12:37:00</TPM:Date>
<TPM:Version>2005/07/01</TPM:Version>
<TPM:Creator>rahtz</TPM:Creator>
<TPM:Title>Multimedia inclusion package.</TPM:Title>
@@ -17,11 +17,11 @@ played back synchronously.
<TPM:Author>Alexander Grahn</TPM:Author>
<TPM:Size>538282</TPM:Size>
<TPM:Build/>
- <TPM:RunFiles size="68628">
+ <TPM:RunFiles size="93438">
texmf-dist/tex/latex/movie15/movie15.sty
texmf-dist/tpm/movie15.tpm
</TPM:RunFiles>
- <TPM:DocFiles size="469654">
+ <TPM:DocFiles size="514686">
texmf-dist/doc/latex/movie15/3dsystem.fig
texmf-dist/doc/latex/movie15/3dsystem.pdf
texmf-dist/doc/latex/movie15/3dsystem.tex