summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-07 23:23:32 +0000
committerKarl Berry <karl@freefriends.org>2014-02-07 23:23:32 +0000
commite768bd4467a0c031caef65ceb6ca960a4ee11208 (patch)
tree76e382ccbfa040dd12cba3f8143ab79853a63729
parent187f01497820820a6075023f1825aacdac0e86cc (diff)
animate (7feb14)
git-svn-id: svn://tug.org/texlive/trunk@32909 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/animate/ChangeLog8
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.pdfbin3648946 -> 3676476 bytes
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.tex131
-rw-r--r--Master/texmf-dist/doc/latex/animate/files/exp.mp10
-rw-r--r--Master/texmf-dist/doc/latex/animate/files/scarab.mp4
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty797
6 files changed, 506 insertions, 444 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/ChangeLog b/Master/texmf-dist/doc/latex/animate/ChangeLog
index c95abc40a49..0d11ad656ad 100644
--- a/Master/texmf-dist/doc/latex/animate/ChangeLog
+++ b/Master/texmf-dist/doc/latex/animate/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-06
+ * New: JavaScript API for animation control
+ * Fix: broken PDF-XChange Viewer support due to [2013-07-19] changes
+
2013-09-24
* Fix: Adobe Reader prompting for "save changes" for documents without
animations
@@ -27,7 +31,7 @@
* minor, non-vital fix
2012-05-11
- * new: optional fourth field in timeline files for calling JavaScript;
+ * New: optional fourth field in timeline files for calling JavaScript;
ticking PSTricks metronome example by Manuel Luque added to docs
2011-12-21
@@ -103,7 +107,7 @@
* New: the transparency stack can now be cleared using `c' in the
timeline file
* improved documentation of the timeline option
- * new animateinline example (Lorenz Attractor)
+ * New animateinline example (Lorenz Attractor)
* Fix: animfp.sty: trailing zeros are now removed from the fractional part
of the result of the addition of two reals
diff --git a/Master/texmf-dist/doc/latex/animate/animate.pdf b/Master/texmf-dist/doc/latex/animate/animate.pdf
index 5d64badb9c2..6b2c3894fa1 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.pdf
+++ b/Master/texmf-dist/doc/latex/animate/animate.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex
index b2b7179d9df..dc05de8ca28 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.tex
+++ b/Master/texmf-dist/doc/latex/animate/animate.tex
@@ -29,6 +29,7 @@
\usepackage{breakurl}
\usepackage{amsmath}
\usepackage{fancyvrb}
+\usepackage{tabularx}
\usepackage[all]{hypcap}
\clubpenalty=10000
\widowpenalty=10000
@@ -47,11 +48,11 @@
\ifpdf
\makeatletter
- \@latex@error{This document contains PSTricks code.\MessageBreak Please compile it using the following commands:\MessageBreak\MessageBreak latex, dvips, ps2pdf\MessageBreak\MessageBreak Don't use option `-Ppdf` with dvips}
+ \@latex@error{This document contains PSTricks code.\MessageBreak Please compile it using the following commands:\MessageBreak\MessageBreak latex, dvips, ps2pdf -dNOSAFER\MessageBreak\MessageBreak Don't use option `-Ppdf` with dvips}
\makeatother
\fi
-\def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Adobe Reader}
+\def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Adobe Reader PDF-XChange Viewer}
\hypersetup{
pdftitle={The animate Package},
pdfsubject={Documentation},
@@ -75,6 +76,7 @@
\def\day{#3}
}
+\hyphenation{Ja-va-Script}
\begin{document}
\title{The {\sffamily animate} Package}
\begingroup
@@ -82,13 +84,13 @@
\def\@anim@sanitize{}\def\@anim@endsanitize{}
\expandafter\parsedate\@anim@version\relax %set current date to package date
\makeatother
-\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding. Animations may run slowly if viewed in the Adobe Reader browser plugin.}\\[1ex]\includegraphics[height=2.7ex]{mailto}}
+\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animations may run slowly if viewed in the Adobe Reader browser plugin.} \protect\footnote{In PDF-XChange, animations are rendered upside-down if the document was produced via the {\tt dvips}$\rightarrow${\tt ps2pdf} route.}\\[1ex]\includegraphics[height=2.7ex]{mailto}}
\maketitle
\endgroup
\begin{abstract}
\raggedright
-\noindent A LaTeX package for creating portable, JavaScript driven PDF animations from sets of vector graphics or rasterized image files or from inline graphics.
+\noindent A LaTeX package for creating portable, JavaScript driven PDF animations from sets of vector graphics or raster image files or from inline graphics.
\vskip 0.2\baselineskip
\emph{Keywords}: \keywords
@@ -102,7 +104,7 @@ This package provides an interface to create PDFs with animated content from set
Package `animate' supports the usual PDF making workflows, i.\,e. pdf\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+.
-The final PDF can be viewed in current Adobe Readers on all supported platforms.
+The final PDF can be viewed in current Adobe Readers on all supported platforms or in PDF-XChange Viewer.
%The `animate' package relies on Optional Content Groups (OCG), also known as PDF layers, which is a feature provided by the PDF-1.5 specification. Each frame of an animation is associated with an OCG that is hidden or made visible in a dynamic fashion by means of Adobe Reader's built-in JavaScript engine.
@@ -112,7 +114,7 @@ The final PDF can be viewed in current Adobe Readers on all supported platforms.
\item pdf\TeX{}, version $\ge1.20$ for direct PDF output
\item Ghostscript, version $\ge8.31$ or Adobe Distiller for PS to PDF conversion
\item dvipdfmx, version $\ge20080607$ for DVI to PDF conversion
-\item Adobe Reader, version $\ge7$
+\item Adobe Reader, version $\ge7$ or PDF-XChange Viewer
\end{trivlist}
\section{Installation}
@@ -150,7 +152,7 @@ poster[=first | none | last]
\end{verbatim}
Except for `\verb+dvipdfmx+' and `\verb+xetex+', the options above are also available (among others) as command options and will be explained shortly. However, if used as package options they have global scope, taking effect on all animations in the document. In turn, command options locally override global settings. Options without an argument are boolean options and can be negated, with the exception of package-only options `\verb+dvipdfmx+' and `\verb+xetex+', by appending `\verb+=false+'.
-If PDF is generated via DVI and Postscript by the command sequence \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+, the `graphicx' package is required. \begin{animateinline}[autoplay,loop]{1.5}\strut\emph{Important:}\newframe\newframe[5]\end{animateinline} The \verb+dvips+ option `\verb+-Ppdf+' should \emph{not} be set when converting the intermediate DVI into Postscript. If you cannot do without, put `\verb+-D 1200+' \emph{after} `\verb+-Ppdf+' on the command line. Users of \LaTeX-aware text editors with menu-driven toolchain invocation, such as \TeX{}nicCenter, should check the configuration of the \verb+dvips+ call.
+If PDF is generated via DVI and Postscript by the command sequence \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+, the `graphicx' package is required. \begin{animateinline}[autoplay,loop]{1}\strut\emph{Important:}\newframe[3]\end{animateinline} The \verb+dvips+ option `\verb+-Ppdf+' should \emph{not} be set when converting the intermediate DVI into Postscript. If you cannot do without, put `\verb+-D 1200+' \emph{after} `\verb+-Ppdf+' on the command line. Users of \LaTeX-aware text editors with menu-driven toolchain invocation, such as \TeX{}nicCenter, should check the configuration of the \verb+dvips+ call.
Sometimes, if the same animation sequence made from graphics files is to be embedded multiple times into the document, more compact PDF output may be obtained by passing option `\verb+-dMaxInlineImageSize=0+' to \verb+ps2pdf+.
@@ -195,7 +197,7 @@ All files of the sequence should exist and be consecutively numbered. (Exception
Command \verb+\graphicspath{}+ from the `graphicx' package can be used to specify directories to be browsed for graphics files.
-No file name extension may be specified as a parameter. The possible file formats depend on the output driver being used. In the case of \LaTeX{}+\verb+dvips+, files with the `eps' extension are at first searched for, followed by `mps' (\MP-generated Postscript) and `ps'. With pdf\LaTeX{} the searching order is: (1)~`pdf', (2)~`mps', (3)~`png', (4)~`jpg', (5)~`jpeg', (6)~`jbig2', (7)~`jb2', (8)~`jp2'\footnotemark[1], (9)~`j2k'\footnotemark[1], (10)~`jpx'\footnotemark[1]\footnotetext[1]{JPEG2000 is not yet supported by pdf\TeX.} and with \XeLaTeX{} or \LaTeX{}+\verb+dvipdfmx+: (1)~`pdf', (2)~`mps', (3)~`eps', (4)~`ps', (5)~`png', (6)~`jpg', (7)~`jpeg', (8)~`bmp'. That is, files capable of storing vector graphics are found first. Make sure that all file names have \emph{lower case} extensions.
+No file name extension may be specified as a parameter. The possible file formats depend on the output driver being used. In the case of \LaTeX{}+\verb+dvips+, files with the `eps' extension are at first searched for, followed by `mps' (\MP-generated Postscript) and `ps'. With pdf\LaTeX{} the searching order is: (1)~`pdf', (2)~`mps', (3)~`png', (4)~`jpg', (5)~`jpeg', (6)~`jbig2', (7)~`jb2', (8)~`jp2'\footnotemark[1], (9)~`j2k'\footnotemark[1], (10)~`jpx'\footnotemark[1]\footnotetext[1]{Only Lua\LaTeX currently supports JPEG2000.} and with \XeLaTeX{} or \LaTeX{}+\verb+dvipdfmx+: (1)~`pdf', (2)~`mps', (3)~`eps', (4)~`ps', (5)~`png', (6)~`jpg', (7)~`jpeg', (8)~`bmp'. That is, files capable of storing vector graphics are found first. Make sure that all file names have \emph{lower case} extensions.
For example, given the sequence `frame\_5.png' through `frame\_50.png' from a possibly larger set that shall be used to build an animation running at 12 frames per second, the correct inclusion command would read
\begin{verbatim}
@@ -215,6 +217,10 @@ would create an animation from all pages of the file `frames.pdf', running at 12
The following options to \verb+\animategraphics+ and `\verb+animateinline+' have been provided:
\subsection{Basic options}
\begin{verbatim}
+label=<label text>
+\end{verbatim}
+The animation is given a label, \verb+<label text>+, which should be unique. Labelling an animation enables its JavaScript programming interface by defining \verb+anim['<label text>']+, which is a JavaScript reference to the animation object. The animation object provides a number of properties and methods that can be used for controlling the animation playback from within user defined JavaScript. For details, see Sect.~\ref{sect:api}.
+\begin{verbatim}
poster[=first | none | last]
\end{verbatim}
Specifies which frame (first, last or none) to display and print if the animation is not activated. The first frame is shown by default. Thus `\verb+poster+' or `\verb+poster=first+' need not be explicitly set.
@@ -312,6 +318,7 @@ A short note on the `\verb+tikzpicture+' environment: Unlike `\verb+pspicture+',
end={\end{tikzpicture}}
\end{verbatim}
+\clearpage
\subsection{The `{\tt timeline}' option}\label{sect:timeline}
\begin{verbatim}
timeline=<timeline file>
@@ -327,12 +334,10 @@ Each line of the timeline file that is not blank and which does not begin with a
\begin{verbatim}
[*]:[<frame rate>]:[<transparencies>][:<JavaScript>]
\end{verbatim}
-While any field may be left blank, the first two colons are mandatory.
+While any field may be left blank, the first two colons are mandatory. The \verb+<JavaScript>+ field is explained on p.~\pageref{sect:jsfield}.
An asterisk (`\verb+*+') in the leftmost field causes the animation to pause at that frame, very much as a \verb+\newframe*+ would do; a number in the second field changes the frame rate of the animation section that follows. In connection with the `\verb+timeline+' option, the asterisk extension and the optional \verb+<frame rate>+ argument of \verb+\newframe+ cease to make sense and will be tacitly ignored if present.
-The optional fourth field takes JavaScript code to be executed at that frame. This could could be used, for instance, to play a sound that was embedded using the media9 \LaTeX{} package \cite{media9}. The backslash `\verb+\+' and percent `\verb+%+' characters retain their special meaning from \LaTeX{} and must be escaped by a backslash `\verb+\+' in the JavaScript code. The same applies to unbalanced braces `\verb+{+' and `\verb+}+'. Thus, a code line such as `\verb+console.println('{}%}{\n');+' would have to look like `\verb+console.println('{}\%\}\{\\n');+' in the timeline file. The first pair of braces are balancing themselves and do not need be escaped.
-
The third field \verb+<transparencies>+ is a comma-separated \emph{list} of \emph{transparency specifications} that determines the transparencies to be put on the stack. Semicolons (\verb+;+) are used to separate sub-stacks (= layers) from each other. A \emph{single} transparency specification obeys the syntax
\begin{verbatim}
<transparency ID>[x<number of frames>]
@@ -401,6 +406,25 @@ frame No. & timeline file & transparency stack\\\hline\hline
See the second animation, Fig.~\ref{fig:scarab}, in Section~\ref{sect:examples} for a working example that makes use of the timeline and the layer concept.
+\myparagraph*{Associate JavaScript actions with animation frames}\label{sect:jsfield}
+The optional fourth field \verb+<JavaScript>+ in a frame specification takes JavaScript code to be executed upon display of that frame. This could be used, for instance, to play a sound that was embedded using the `media9' \LaTeX{} package \cite{media9} or to execute JavaScript methods of the animation object. A non-trivial example is looping over a sub-range of frames which can be programmed by setting the `\verb+pageNum+' property of the animation object. See Sect.~\ref{sect:api} for details of the animation programming interface.
+
+The backslash `\verb+\+' and percent `\verb+%+' characters retain their special meaning from \LaTeX{} and must be escaped by a backslash `\verb+\+' in the JavaScript code. The same applies to unbalanced braces `\verb+{+' and `\verb+}+'. Thus, a code line such as
+\begin{verbatim}
+ console.println('{}%}{\n');
+\end{verbatim}
+would have to look like
+\begin{verbatim}
+ console.println('{}\%\}\{\\n');
+\end{verbatim}
+in the timeline file. The first pair of braces are balancing themselves and do not need to be escaped.
+
+Note that JavaScript is executed at the start of displaying the frame. If something is to be executed at the end of a particular frame, the \verb+<JavaScript>+ field should be added to the next frame in the timeline file. However, this is not possible for the last frame in a timeline file. Here, the `\verb+setTimeOut+' method can be used to delay the execution of commands:
+\begin{verbatim}
+ app.setTimeOut('anim.myanim.frameNum=5;', 0.5*anim.myanim.dt)
+\end{verbatim}
+In this example, the 6th frame will be displayed after half of the current frame's lifetime has elapsed.
+
\myparagraph*{Other things to note}
When designing the timeline, care should be taken not to include a transparency more than once into the \emph{same} animation frame. Besides the useless redundancy, this may slow down the animation speed in the Reader because the graphical objects of a multiply included transparency have to be rendered unnecessarily often at the same time. `animate' is smart enough to detect multiple inclusion and issues a warning message along with the transparency ID and the frame number if it occurs. Here is an example of a poorly designed timeline:
\small
@@ -416,16 +440,76 @@ When designing the timeline, care should be taken not to include a transparency
\normalsize
Also, `animate' finds and warns about transparencies that have never been used in an animation timeline. This may help to avoid dead code in the final PDF.
+\section{Programming interface}\label{sect:api}
+The package provides a simple JavaScript programming interface which gives access to the animation objects in a PDF file. A particular animation property or method can be accessed by
+\begin{verbatim}
+ anim['<anim label>'].<property or method>
+\end{verbatim}
+or
+\begin{verbatim}
+ anim.<anim label>.<property or method>
+\end{verbatim}
+`\verb+anim+' is an array of animation object references. Animations must be labelled using the `\verb+label=...+' command option in order to be present in the `\verb+anim+' array. As usual, properties and methods are accessed via the dot notation. Properties and methods of the animation object are summarized in Tables \ref{tab:props} and \ref{tab:methods}.
+
+One potential use of the JavaScript interface could be within a timeline file associated with an animation. For example, loops over a sub-range of frames can be programmed by setting the `\verb+pageNum+' property. See Section~\ref{sect:timeline}, p.~\pageref{sect:jsfield} for details.
+
+Also, the programming interface can be used to create custom buttons for playback control. The command \verb+\mediabutton+ from the `media9' package provides a convenient way for achieving this:
+\begin{verbatim}
+ \usepackage{media9}
+ \usepackage{animate}
+ ...
+
+ \animategraphics[label=my_anim]{12}{...}{...}{...}
+
+ \mediabutton[
+ jsaction={anim['my_anim'].playFwd();}
+ ]{\fbox{Play}}
+ \mediabutton[
+ jsaction={anim['my_anim'].frameNum=5;}
+ ]{\fbox{Goto 6th frame}}
+\end{verbatim}
+
+\begin{table}[hbp]
+\centering
+\caption{Animation object properties}\label{tab:props}
+\begin{tabularx}{\linewidth}[t]{lllX}\hline
+name & type & access & description\\\hline\hline
+{\tt numFrames} & Integer & read-only & Holds the total number of animation frames.\\
+{\tt frameNum} & Integer & read+write & Gets or sets the current frame being/to\,be displayed. Note that the values are zero-based. Assigning values less than zero or greater than {\tt numFrames-1} results in an error.\\
+{\tt fps} & Number & read+write & Gets or sets the animation frame rate (frames per second). Assigning values less than zero results in an error.\\
+{\tt dt} & Number & read-only & Holds the time span (milliseconds) for display of the current frame.\\
+{\tt isPlaying} & Boolean & read-only & Holds the value {\tt true} if the animation is currently playing, {\tt false} otherwise.\\
+{\tt playsFwd} & Boolean & read-only & Holds the value {\tt true} if the animation is played forward, independently of whether the animation is currently paused or not.\\
+\hline
+\end{tabularx}
+\end{table}
+
+\begin{table}[hbp]
+\centering
+\caption{Animation object methods}\label{tab:methods}
+\begin{tabularx}{\linewidth}[t]{lX}\hline
+name & description\\\hline\hline
+{\tt playFwd()} & Starts playing the animation in the forward direction, setting the properties {\tt isPlaying} and {\tt playsFwd} to {\tt true}.\\
+{\tt playBwd()} & Starts playing the animation in the backward direction, setting {\tt isPlaying} to {\tt true} and {\tt playsFwd} to {\tt false}.\\
+{\tt pause()} & Pauses animation, setting {\tt isPlaying} to {\tt false}.\\
+{\tt stopFirst()} & Stops animation and rewinds to the first frame. {\tt isPlaying} is set to false.\\
+{\tt stopLast()} & Stops animation and goes to the last frame. {\tt isPlaying} is set to false.\\
+\hline
+\end{tabularx}
+\end{table}
+
+\clearpage
\section{Examples}
\subsection[Animations from sets of files, using `animategraphics' command]{Animations from sets of files, using {\tt \string\animategraphics} command}\label{sect:examples}
Animations in this section are made from graphics files that were prepared with \MP. Run `\verb+mpost --tex=latex+' on the files ending in `.mp' in the `files' directory to generate the graphics files. Both examples make use of the `\verb+timeline+' option to reduce the resulting PDF file size.
-The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~\cite{hol}, shows the exponential function $y=e^x$ and its approximation by Taylor polynomials of different degree.
+The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~\cite{hol}, shows the exponential function $y=e^x$ and its approximation by Taylor polynomials of different degree. Below the animation, a custom button was inserted using the JavaScript programming interface and the \verb+\mediabutton+ command from the `media9' package.
\small
\begin{verbatim}
\documentclass{article}
\usepackage{animate}
+\usepackage{media9}
\usepackage{graphicx}
\begin{filecontents}{timeline.txt}
@@ -444,9 +528,19 @@ The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~
\begin{center}
\animategraphics[
+ label=taylor,
controls, loop,
timeline=timeline.txt
]{4}{exp_}{0}{8}
+
+ \mediabutton[
+ jsaction={
+ if(anim['taylor'].isPlaying)
+ anim['taylor'].pause();
+ else
+ anim['taylor'].playFwd();
+ }
+ ]{\fbox{Play/Pause}}
\end{center}
\end{document}
@@ -465,7 +559,16 @@ The first example, Fig.~\ref{fig:taylor}, originally written by Jan Hole\v{c}ek~
::7
::8
\end{VerbatimOut}
-\animategraphics[controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8}
+\animategraphics[label=taylor,controls,loop,timeline=timeline.txt]{4}{exp_}{0}{8}
+
+\mediabutton[
+ jsaction={
+ if(anim['taylor'].isPlaying)
+ anim['taylor'].pause();
+ else
+ anim['taylor'].playFwd();
+ }
+]{\fbox{Play/Pause}}
\caption{}\label{fig:taylor}
\end{figure}
@@ -765,7 +868,7 @@ A timeline file, written on-the-fly, is used to assemble the curve segments fram
\end{verbatim}
\normalsize
-The last inline example in Fig.~\ref{fig:metronome} is a ticking metronome written by Manuel Luque~\cite{luque12}. The short clicking sound was embedded by means of the media9 package. Whenever the pendulum reaches one of its reversal points, playback of the sound file is started using JavaScript. The JavaScript code was inserted at the corresponding frame specifications in a timeline file. Since the PSTricks macros for drawing the metronome body and the pendulum are quite long they have been moved into an external file, \verb+files/pstmetronome.tex+. Note that the sound can be heard only on Win and Mac platforms. Even then, mileage may vary. A dual core CPU may be necessary for fluent playback.
+The last inline example in Fig.~\ref{fig:metronome} is a ticking metronome written by Manuel Luque~\cite{luque12}. The short clicking sound was embedded by means of the `media9' package. Whenever the pendulum reaches one of its reversal points, playback of the sound file is started using JavaScript. The JavaScript code was inserted at the corresponding frame specifications in a timeline file. Since the PSTricks macros for drawing the metronome body and the pendulum are quite long they have been moved into an external file, \verb+files/pstmetronome.tex+. Note that the sound can be heard only on Win and Mac platforms. Even then, mileage may vary. A dual core CPU may be necessary for fluent playback.
\begin{figure}[hb]
\centering
\begin{VerbatimOut}{files/pstmetronome.tex}
diff --git a/Master/texmf-dist/doc/latex/animate/files/exp.mp b/Master/texmf-dist/doc/latex/animate/files/exp.mp
index f719391fecf..064410ff502 100644
--- a/Master/texmf-dist/doc/latex/animate/files/exp.mp
+++ b/Master/texmf-dist/doc/latex/animate/files/exp.mp
@@ -1,7 +1,15 @@
% Jan Holecek, Alexander Grahn
-% 2008/01/03
+% 2013/10/15
filenametemplate "%j_%c.mps";
+verbatimtex
+\documentclass{article}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{amsmath}
+\begin{document}
+etex
e := 2.718282;
N=8;
diff --git a/Master/texmf-dist/doc/latex/animate/files/scarab.mp b/Master/texmf-dist/doc/latex/animate/files/scarab.mp
index bef95226e24..7f4a53ee483 100644
--- a/Master/texmf-dist/doc/latex/animate/files/scarab.mp
+++ b/Master/texmf-dist/doc/latex/animate/files/scarab.mp
@@ -1,11 +1,13 @@
% Maxime Chupin, Alexander Grahn
-% 2008/01/03
+% 2013/10/15
filenametemplate "%j_%c.mps";
verbatimtex
\documentclass{article}
\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
\usepackage{amsmath}
\begin{document}
etex
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty
index d493f0fa054..96771b6038b 100644
--- a/Master/texmf-dist/tex/latex/animate/animate.sty
+++ b/Master/texmf-dist/tex/latex/animate/animate.sty
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}
-\def\@anim@version{2013/09/24}
+\def\@anim@version{2014/02/06}
\ProvidesPackage{animate}
[\@anim@version\space PDF animations from files and inline graphics]
@@ -91,35 +91,8 @@
be embedded using pdfTeX%
}
}}
- %macro for adding AcroForm entry to PDF Catalog
- \def\@anim@acroform{%
- \ifdefined\Acro@Form@added\else%
- \pdfcatalog{/AcroForm<</Fields []/NeedAppearances true>>}%
- \gdef\Acro@Form@added{}%
- \fi%
- }
\else
- \if@anim@@dvipdfmx
- %macro for adding AcroForm entry to PDF Catalog
- \def\@anim@acroform{%
- \ifdefined\Acro@Form@added\else%
- \special{pdf:put @catalog <<%
- /AcroForm<</Fields []/NeedAppearances true>>>>}%
- \gdef\Acro@Form@added{}%
- \fi%
- }
- \else % dvips
- %macro for adding AcroForm entry to PDF Catalog
- \def\@anim@acroform{%
- \ifdefined\Acro@Form@added\else%
- \special{ps:
- mark {Catalog} <<%
- /AcroForm <</Fields []/NeedAppearances true>>%
- >> /PUT pdfmark
- }%
- \gdef\Acro@Form@added{}%
- \fi%
- }
+ \if@anim@@dvipdfmx\else % dvips
%if geometry package is loaded, execute `\geometry{dvips}' right before
% `\begin{document}'
\let\@anim@document\document
@@ -240,12 +213,13 @@
\newboolean{@anim@useocg}
% true if any of `autoplay' or `autoresume' options is set
\newboolean{@anim@autoplayorresume}
-% true if any of `controls' or `palindrome' options is set
-\newboolean{@anim@ctrlorplndrm}
+% true if any of `controls' or `palindrome' or `label' options is set
+\newboolean{@anim@morejs}
\newboolean{@anim@timeline} %true if `timeline' option is set
\newboolean{@anim@multipage} % multipage document?
-%add OCProperties entries to Catalog
+%add AcroForm and OCProperties entries to Catalog
+\ifdefined\@anim@fields\else\def\@anim@fields{}\fi %takes Field object refs
\ifpdf
\newcount\@anim@@ocgs
\pdfobj reserveobjnum
@@ -261,6 +235,23 @@
>>
>>
}
+ %macro for adding AcroForm entry to PDF Catalog
+ \def\@anim@acroform{%
+ \ifdefined\Acro@Form@added\else%
+ \newcount\@anim@@fields%
+ \pdfobj reserveobjnum%
+ \global\@anim@@fields=\pdflastobj%
+ \pdfcatalog{%
+ /AcroForm <</Fields \the\@anim@@fields\space 0 R /NeedAppearances true>>%
+ }%
+ \AtEndDocument{%
+ \immediate\pdfobj useobjnum \@anim@@fields {%
+ [\@anim@fields]%
+ }%
+ }%
+ \gdef\Acro@Form@added{}%
+ \fi%
+ }
\def\@anim@ocgs{}
\def\@anim@offocgs{}
\AtEndDocument{%
@@ -285,6 +276,19 @@
/D <</BaseState/ON /OFF @anim@offocgs>>
>>
>>}
+ %macro for adding AcroForm entry to PDF Catalog
+ \def\@anim@acroform{%
+ \ifdefined\Acro@Form@added\else%
+ %array which takes refs to all widget annotations
+ \special{pdf:obj @anim@fields [ ]}%
+ \special{pdf:put @catalog <<%
+ /AcroForm <</Fields @anim@fields /NeedAppearances true>>>>}%
+ \AtEndDocument{%
+ \special{pdf:put @anim@fields \@anim@fields}%
+ }%
+ \gdef\Acro@Form@added{}%
+ \fi%
+ }
\else
\special{ps:
mark /_objdef {@anim@ocgs} /type/array /OBJ pdfmark
@@ -294,7 +298,22 @@
/OCGs {@anim@ocgs}
/D <</BaseState/ON /OFF {@anim@offocgs}>>
>>
- >> /PUT pdfmark
+ >> /PUT pdfmark%
+ }
+ %macro for adding AcroForm entry to PDF Catalog
+ \def\@anim@acroform{%
+ \ifdefined\Acro@Form@added\else%
+ \special{ps:
+ mark /_objdef {@anim@fields} /type/array /OBJ pdfmark
+ mark {Catalog} <<%
+ /AcroForm <</Fields {@anim@fields} /NeedAppearances true>>
+ >> /PUT pdfmark%
+ }%
+ \AtEndDocument{%
+ \special{ps: mark {@anim@fields} 0 [\@anim@fields] /PUTINTERVAL pdfmark}%
+ }%
+ \gdef\Acro@Form@added{}%
+ \fi%
}
\fi
\fi
@@ -535,12 +554,12 @@
}{% flip around horizontal axis in portrait mode
[1 0 0 -1 0 frame@lly frame@ury add] concat%
}ifelse
- }?pdfmark
+ }?pdfmark%
}%
\begin{picture}(0,0)\put(0,0){\box#3}\end{picture}%
\special{ps:
mark /EP pdfmark
- grestore
+ grestore%
}%
\xdef\@anim@lastxform{@anim@frm@#1@#2}%
\@anim@newkey{img@#2}{{@anim@frm@#1@#2}}%
@@ -579,7 +598,7 @@
\special{ps:
mark /_objdef {@anim@ocg@#1@#2} /type/dict /OBJ pdfmark
mark {@anim@ocg@#1@#2} <</Type/OCG /Name (#1.#2)>> /PUT pdfmark
- mark {@anim@ocgs} {@anim@ocg@#1@#2} /APPEND pdfmark
+ mark {@anim@ocgs} {@anim@ocg@#1@#2} /APPEND pdfmark%
}%
}
\fi
@@ -646,9 +665,10 @@
\fi%
/FT/Btn/Ff 65537% non-interactive push button
/BS <</W 0>>%
- /AP <</N \the\pdflastxform\space 0 R>>%
+ /MK <</TP 1/I \the\pdflastxform\space 0 R/IF<</S/A/FB true>>>>%
/T (#1.#2)%
}%
+ \xdef\@anim@fields{\@anim@fields\the\pdflastannot\space 0 R\space}%
}
\else
\if@anim@@dvipdfmx
@@ -706,10 +726,11 @@
\if@anim@useocg/OC @anim@ocg@#1@#2\fi%
/FT/Btn/Ff 65537%
/BS <</W 0>>%
- /AP <</N @anim@anmfrm@#1@#2>>%
+ /MK <</TP 1/I @anim@anmfrm@#1@#2/IF<</S/A/FB true>>>>%
/T (#1.#2)%
>>%
}%
+ \xdef\@anim@fields{\@anim@fields @annot@\the\@anim@fieldnum\space}%
\global\advance\@anim@fieldnum by \@ne%
}
\else
@@ -723,7 +744,7 @@
/Type/XObject/Subtype/Form/FormType 1
/BBox [frame@llx frame@lly frame@urx frame@ury]
/Resources <</XObject <<\@anim@getkeyval{frmxobject@#2}>>>>
- >> /PUT pdfmark
+ >> /PUT pdfmark%
}%
\if@anim@useocg%
\@anim@newocg{#1}{#2}%
@@ -783,10 +804,11 @@
\if@anim@useocg/OC {@anim@ocg@#1@#2}\fi%
/FT/Btn/Ff 65537
/BS <</W 0>>%
- /AP <</N {@anim@anmfrm@#1@#2}>>%
+ /MK <</TP 1/I {@anim@anmfrm@#1@#2}/IF<</S/A/FB true>>>>%
/T (#1.#2)%
- /ANN pdfmark
+ /ANN pdfmark%
}%
+ \xdef\@anim@fields{\@anim@fields{annot@\the\@anim@fieldnum}\space}%
\global\advance\@anim@fieldnum by \@ne%
}
\fi
@@ -859,7 +881,7 @@
/Properties <</oc0 {#1.Play#2} /oc1 {#1.Pause#2}>>%
/XObject <</im0 {btnPlay#2:#3} /im1 {btnPause#2:#3}>>%
>>%
- >> /PUT pdfmark
+ >> /PUT pdfmark%
}%
}
\fi
@@ -1043,7 +1065,7 @@
}if
#2
}?pdfmark mark /EP pdfmark
- grestore
+ grestore%
}%
}
\else
@@ -1527,8 +1549,11 @@
\setboolean{@anim@autoplayorresume}{true}%
}{}%
\ifthenelse{\boolean{@anim@controls}\OR\boolean{@anim@palindrome}}{%
- \setboolean{@anim@ctrlorplndrm}{true}%
+ \setboolean{@anim@morejs}{true}%
}{}%
+ \ifx\empty\@anim@label\empty\else%
+ \setboolean{@anim@morejs}{true}%
+ \fi%
\ifthenelse{\NOT\boolean{@anim@controls}\AND\boolean{@anim@step}}{%
\setboolean{@anim@loop}{true}%
}{}%
@@ -1588,8 +1613,14 @@
\@anim@getkeyval{btncol:\@anim@bgcolour:\@anim@fgcolour}}%
\fi%
\fi%
- \xdef\@anim@fps{#2}% current frame rate
- \xdef\@anim@nfps{#2}%
+ \xdef\@anim@nfps{#2\space}% current frame rate
+ \xdef\@anim@nfps{\expandafter\zap@space\@anim@nfps\@empty}%
+ \ifdim\@anim@nfps\p@<\z@%
+ \PackageError{animate}{%
+ Negative frame rate `\@anim@nfps' is not allowed%
+ }{}%
+ \fi%
+ \xdef\@anim@fps{\@anim@nfps}%
%
%read all frames of the sequence
\loop\ifnum\@anim@curframe\@anim@relop\@anim@last\else%
@@ -1623,6 +1654,7 @@
\fi%
\endgroup%
\global\advance\@anim@num by \@ne%
+ \@anim@acroform%
}%
%adjust catcodes of several characters within \animategraphics
\let\@anim@animategraphics\animategraphics
@@ -1768,7 +1800,7 @@
\@anim@otherjscriptkey%
>>%
}%
- \@anim@acroform%
+ \xdef\@anim@fields{\@anim@fields\the\pdflastannot\space 0 R\space}%
\hbox to \@anim@animwidth\p@ {%
\vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@%
\hss%
@@ -1796,7 +1828,7 @@
>>
>>%
}%
- \@anim@acroform%
+ \xdef\@anim@fields{\@anim@fields @annot@\the\@anim@fieldnum\space}%
\global\advance\@anim@fieldnum by \@ne%
\hbox to \@anim@animwidth\p@ {%
\vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@%
@@ -1839,9 +1871,9 @@
>>%
\@anim@otherjscriptkey%
>>%
- /ANN pdfmark
+ /ANN pdfmark%
}%
- \@anim@acroform%
+ \xdef\@anim@fields{\@anim@fields{annot@\the\@anim@fieldnum}\space}%
\global\advance\@anim@fieldnum by \@ne%
\hbox to \@anim@animwidth\p@ {%
\vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@%
@@ -1866,11 +1898,12 @@
/FT/Btn/Ff 65536% push button
/BS <</W 0>>%
/H/I%
- /AP <</N \@anim@getkeyval{btn#3}>>%
+ /MK <</TP 1/I \@anim@getkeyval{btn#3}/IF<</S/A/FB true>>>>%
/T (#1.#2)%
\@anim@tooltip%
/A <</S/JavaScript/JS (\@anim@upjscriptstring)>>%
}%
+ \xdef\@anim@fields{\@anim@fields\the\pdflastannot\space 0 R\space}%
\vrule width 0pt height \@anim@tmpdima depth 0pt%
\hss%
}%
@@ -1888,12 +1921,13 @@
/FT/Btn/Ff 65536%
/BS <</W 0>>%
/H/I%
- /AP <</N @btn#3>>%
+ /MK <</TP 1/I @btn#3/IF<</S/A/FB true>>>>%
/T (#1.#2)%
\@anim@tooltip%
/A <</S/JavaScript/JS (\@anim@upjscriptstring)>>%
>>%
}%
+ \xdef\@anim@fields{\@anim@fields @annot@\the\@anim@fieldnum\space}%
\global\advance\@anim@fieldnum by \@ne%
\vrule width 0pt height \@anim@tmpdima depth 0pt%
\hss%
@@ -1926,12 +1960,13 @@
/FT/Btn/Ff 65536
/BS <</W 0>>
/H/I
- /AP <</N {btn#3}>>%
+ /MK <</TP 1/I {btn#3}/IF<</S/A/FB true>>>>%
/T (#1.#2)%
\@anim@tooltip%
/A <</S/JavaScript/JS (\@anim@upjscriptstring)>>%
- /ANN pdfmark
+ /ANN pdfmark%
}%
+ \xdef\@anim@fields{\@anim@fields{annot@\the\@anim@fieldnum}\space}%
\global\advance\@anim@fieldnum by \@ne%
\hbox to \the\@anim@tmpdima {%
\vrule width 0pt height \the\@anim@tmpdima\space depth 0pt%
@@ -1968,11 +2003,16 @@
\setboolean{@anim@autoplayorresume}{true}%
}{}%
\ifthenelse{\boolean{@anim@controls}\OR\boolean{@anim@palindrome}}{%
- \setboolean{@anim@ctrlorplndrm}{true}%
+ \setboolean{@anim@morejs}{true}%
}{}%
+ \ifx\empty\@anim@label\empty\else%
+ \setboolean{@anim@morejs}{true}%
+ \fi%
\ifthenelse{\NOT\boolean{@anim@controls}\AND\boolean{@anim@step}}{%
\setboolean{@anim@loop}{true}%
}{}%
+ \global\@anim@curframe@zb=\z@%
+ \global\@anim@skipfram=\z@%
\if@anim@draft\else%
%create button faces if necessary
\if@anim@controls%
@@ -1988,11 +2028,11 @@
\@anim@getkeyval{btncol:\@anim@bgcolour:\@anim@fgcolour}}%
\fi%
\fi%
- \xdef\@anim@fps{#2}%
- \xdef\@anim@nfps{#2}% current frame rate (for use in \newframe)
+ \if@anim@step\else%
+ \xdef\@anim@nfps{-1}%
+ \@anim@processfpsarg{#2}%
+ \fi%
\fi%
- \global\@anim@curframe@zb=\z@%
- \global\@anim@skipfram=\z@%
\@anim@beginframe%
\ignorespaces%
}{%
@@ -2015,6 +2055,7 @@
\endgroup%
\global\advance\@anim@num by \@ne%
\setboolean{@anim@inside}{false}%
+ \@anim@acroform%
}
\let\@anim@animateinline\animateinline
\def\animateinline{\@anim@sanitize\@anim@animateinline}
@@ -2032,37 +2073,42 @@
\@anim@endframe{\the\@anim@num}{\the\@anim@curframe@zb}%
\@ifstar\@anim@newframestar\@anim@newframe%
}
+\def\@anim@processfpsarg#1{%
+ %process frame rate argument
+ \xdef\@anim@pfps{\@anim@nfps}%
+ \xdef\@anim@nfps{#1\space}%
+ \xdef\@anim@nfps{\expandafter\zap@space\@anim@nfps\@empty}%
+ \ifx\@anim@nfps\@empty% no change of frame rate
+ \xdef\@anim@nfps{\@anim@pfps}%
+ \fi%
+ \ifnum\@anim@curframe@zb=\z@%
+ \xdef\@anim@fps{\@anim@nfps}% default fps
+ \xdef\@anim@nfpsat{\@anim@nfps}%
+ \else%
+ \xdef\@anim@nfpsat{\@anim@nfpsat,\@anim@nfps}%
+ \fi%
+ \ifdim\@anim@nfps\p@=\@anim@pfps\p@\else%
+ \ifnum\@anim@curframe@zb=\z@\else%
+ \setboolean{@anim@chfps}{true}% change fps
+ \fi%
+ \fi%
+ \ifdim\@anim@nfps\p@<\z@%
+ \PackageError{animate}{%
+ Negative frame rate `\@anim@nfps' is not allowed%
+ }{}%
+ \fi%
+}%
\newcommand{\@anim@newframe}[1][]{% #1: new frame rate
\ifnum\@anim@skipfram=\z@%
+ \global\advance\@anim@curframe@zb by \@ne%
\if@anim@draft\else%
\if@anim@step\else%
\if@anim@timeline\else%
- \edef\@anim@pfps{\@anim@nfps}%
- \edef\@anim@nfps{#1}%
- \ifx\@anim@nfps\@empty%
- \edef\@anim@nfps{\@anim@pfps}%
- \else%
- \ifdim\@anim@nfps\p@=\@anim@pfps\p@\else%
- \ifnum\@anim@curframe@zb=\z@%
- \xdef\@anim@fps{#1}%
- \fi%
- %build JavaScript commands to fill the `nFpsAt' & `pFpsAt' arrays
- \xdef\@anim@nfpsat{%
- \@anim@nfpsat%
- a\the\@anim@num.nFpsAt[\the\@anim@curframe@zb]=Math.abs(#1);%
- }%
- \xdef\@anim@pfpsat{%
- \@anim@pfpsat%
- a\the\@anim@num.pFpsAt[\the\@anim@curframe@zb]=%
- Math.abs(\@anim@pfps);%
- }%
- \setboolean{@anim@chfps}{true}% change fps
- \fi%
- \fi%
+ %process frame rate argument
+ \@anim@processfpsarg{#1}%
\fi%
\fi%
\fi%
- \global\advance\@anim@curframe@zb by \@ne%
\fi%
\@anim@beginframe%
\ignorespaces%
@@ -2078,32 +2124,18 @@
a\the\@anim@num.pauseAt[\the\@anim@curframe@zb]=1;%
}%
\setboolean{@anim@pauseframes}{true}%
- \xdef\@anim@pfps{\@anim@nfps}%
- \xdef\@anim@nfps{#1}%
- \ifx\@anim@nfps\@empty%
- \xdef\@anim@nfps{\@anim@pfps}%
- \else%
- \ifdim\@anim@nfps\p@=\@anim@pfps\p@\else%
- \ifnum\@anim@curframe@zb=\z@%
- \xdef\@anim@fps{#1}%
- \fi%
- %build JavaScript commands to fill the `nFpsAt' & `pFpsAt' arrays
- \xdef\@anim@nfpsat{%
- \@anim@nfpsat%
- a\the\@anim@num.nFpsAt[\the\@anim@curframe@zb]=Math.abs(#1);%
- }%
- \xdef\@anim@pfpsat{%
- \@anim@pfpsat%
- a\the\@anim@num.pFpsAt[\the\@anim@curframe@zb]=%
- Math.abs(\@anim@pfps);%
- }%
- \setboolean{@anim@chfps}{true}% change fps
- \fi%
- \fi%
\fi%
\fi%
\fi%
\global\advance\@anim@curframe@zb by \@ne%
+ \if@anim@draft\else%
+ \if@anim@step\else%
+ \if@anim@timeline\else%
+ %process frame rate argument
+ \@anim@processfpsarg{#1}%
+ \fi%
+ \fi%
+ \fi%
\fi%
\@anim@beginframe%
\ignorespaces%
@@ -2522,28 +2554,7 @@
\or%
\if@anim@step\else%
%second field: new frame rate
- \xdef\@anim@pfps{\@anim@nfps}%
- \xdef\@anim@nfps{#1\space}%
- \xdef\@anim@nfps{\expandafter\zap@space\@anim@nfps\@empty}%
- \ifx\@anim@nfps\@empty% no change of frame rate
- \xdef\@anim@nfps{\@anim@pfps}%
- \else%
- \ifdim\@anim@nfps\p@=\@anim@pfps\p@\else%
- \ifnum\@anim@curframe@zb=\z@%
- \xdef\@anim@fps{#1}%
- \fi%
- %build JavaScript commands to fill the `nFpsAt' & `pFpsAt' arrays
- \xdef\@anim@nfpsat{%
- \@anim@nfpsat%
- a\the\@anim@num.nFpsAt[\the\@anim@curframe@zb]=Math.abs(#1);%
- }%
- \xdef\@anim@pfpsat{%
- \@anim@pfpsat%
- a\the\@anim@num.pFpsAt[\the\@anim@curframe@zb]=Math.abs(\@anim@pfps);%
- }%
- \setboolean{@anim@chfps}{true}% change fps
- \fi%
- \fi%
+ \@anim@processfpsarg{#1}%
\fi%
\global\advance\@anim@curfield by \@ne%
\@anim@parseline#2\@nil%
@@ -2713,6 +2724,22 @@
}
%command options
+\define@key{anim@user}{label}{%
+ \gdef\@anim@label{#1}%
+ \ifcsname @anim@#1\endcsname%
+ \PackageWarning{animate}{Label #1 multiply defined}
+ \ifdefined\@anim@multlabel\else
+ \gdef\@anim@multlabel{}%
+ \AtEndDocument{%
+ \PackageWarningNoLine{animate}{%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak
+ @@ There were multiply-defined labels! @@\MessageBreak
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
+ }%
+ \fi%
+ \fi%
+ \expandafter\gdef\csname @anim@#1\endcsname{}%
+}
%setting the widget size
\define@key{anim@user}{width}{%
\gdef\@anim@widtharg{#1}%
@@ -2909,6 +2936,10 @@
\if@anim@grxloaded\g@addto@macro\@anim@gropts{, trim=#1}%
\else\@anim@missing{graphicx}\fi%
}
+\define@key{anim@user}{angle}{%
+ \if@anim@grxloaded\g@addto@macro\@anim@gropts{, angle=#1}%
+ \else\@anim@missing{graphicx}\fi%
+}
\newboolean{@anim@meas}
\define@key{anim@user}{measure}[true]{%
\setboolean{@anim@meas}{#1}%
@@ -2928,6 +2959,7 @@
%macro to reset macros and booleans
\def\@anim@reset{%
+ \gdef\@anim@label{}%
\gdef\@anim@boxscale{1.0}%
\global\@anim@resize\z@%
\gdef\@anim@widtharg{\width}%
@@ -2969,7 +3001,7 @@
\setboolean{@anim@multipage}{false}%
\setboolean{@anim@meas}{false}%
\setboolean{@anim@autoplayorresume}{false}%
- \setboolean{@anim@ctrlorplndrm}{false}%
+ \setboolean{@anim@morejs}{false}%
}
%package options
@@ -3161,7 +3193,7 @@
\def\@anim@pojscript#1{%
\special{ps:
mark /_objdef {a#1@pojscript} /type/stream /OBJ pdfmark
- mark {a#1@pojscript} (\@anim@@pojscript{#1}) /PUT pdfmark
+ mark {a#1@pojscript} (\@anim@@pojscript{#1}) /PUT pdfmark%
}%
}
\fi
@@ -3174,14 +3206,13 @@
var a#1_intd;%
\fi
var a#1,a#1_int;%
- if(typeof(a#1)=='undefined'){% initialize animation
- a#1=new Object();%
+ if(typeof(a#1)==='undefined'){% initialize animation
+ a#1=new Object();% animation object
%takes references to frame ocgs/Field objects belonging to the current
%animation
a#1.fr=new Array();%
\if@anim@controls
a#1.btn=new Array();%takes references to control button face ocgs
- a#1.sm=1;% speed multiplier
\fi%
%initialize fr & btn properties
\if@anim@useocg
@@ -3224,18 +3255,14 @@
\fi%
\ifx\@anim@poster\@anim@posterlast % set default frame
%holds index of the frame to be displayed
- a#1.idx=\@anim@maxframe;%
+ a#1.on=a#1.idx=\@anim@maxframe;%
\else % first & none
- a#1.idx=0;%
+ a#1.on=a#1.idx=0;%
\fi%
%playing state and direction
- \if@anim@step%
- \if@anim@palindrome
- a#1.playsRight=true;%
- \fi%
- \else
- a#1.isPlaying=false;%
- a#1.playsRight=true;%
+ \if@anim@morejs a#1.playsRight=true;\fi%
+ \if@anim@step\else
+ a#1.playing=false;%
a#1.isPaused=false;%
\if@anim@pauseframes
%this array takes the frame numbers at which to pause playback
@@ -3244,13 +3271,19 @@
\fi%
\if@anim@chfps
%arrays that take frame numbers (array index) and fps values
- a#1.nFpsAt=new Array();%
- \@anim@nfpsat%
- a#1.pFpsAt=new Array();%
- \@anim@pfpsat%
- a#1.fps=Math.abs(\@anim@fps);%
+ a#1.nFpsAt=new Array(\@anim@nfpsat);%
\fi
- a#1.dt=1000/(1e-6+Math.abs(\@anim@fps));%
+ a#1.fps=\@anim@fps;a#1.sm=1;%
+ a#1.setFps=function(f){%
+ a#1.fps=f;%
+ if(a#1.playing){%
+ \if@anim@morejs
+ if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
+ \else
+ a#1.playRight();%
+ \fi%
+ }%
+ };%
\fi%
\if@anim@usrjs
%array to take frame numbers (array index) and user provided JavaScript
@@ -3258,189 +3291,125 @@
\@anim@usrjsat%
\fi%
%actions
- a#1.actnEndLeft=function(){%
- \if@anim@step\else
- a#1.actnPause();%
- a#1.isPaused=false;% because it has been explicitly stopped
+ a#1.seekFrame=function(f){%
+ if(f>\@anim@maxframe||f<0){return(-1);}%
+ var old=a#1.idx;a#1.idx=f;%
+ \if@anim@usrjs
+ if(a#1.usrJSat[f]){%
+ var ret=app.setTimeOut('try{a#1.usrJSat[a#1.idx]();}catch(e){%
+ console.show();console.println(e);}',1);%
+ }%
\fi%
\if@anim@useocg
- a#1.fr[a#1.idx].state=false;%
- a#1.idx=0;%
- a#1.fr[0].state=true;%
+ a#1.fr[a#1.on].state=false;%
\else
- a#1.fr[a#1.idx].display=display.hidden;%
- a#1.idx=0;%
- a#1.fr[0].display=display.visible;%
- curdoc.dirty=false;%
- \fi%
- \if@anim@chfps
- a#1.fps=Math.abs(\@anim@fps);%
- a#1.dt=1000/(1e-6+a#1.fps);%
- \fi%
- };%
- a#1.actnEndRight=function(){%
- \if@anim@step\else
- a#1.actnPause();%
- a#1.isPaused=false;%
+ a#1.fr[a#1.on].display=display.hidden;%
\fi%
\if@anim@useocg
- a#1.fr[a#1.idx].state=false;%
- a#1.idx=\@anim@maxframe;%
- a#1.fr[a#1.idx].state=true;%
+ a#1.fr[f].state=true;%
\else
- a#1.fr[a#1.idx].display=display.hidden;%
- a#1.idx=\@anim@maxframe;%
- a#1.fr[a#1.idx].display=display.visible;%
+ a#1.fr[f].display=display.visible;%
curdoc.dirty=false;%
+ \fi
+ a#1.on=f;%
+ \if@anim@step\else%
+ \if@anim@chfps
+ if(a#1.nFpsAt[f]!=a#1.fps){%
+ a#1.setFps(a#1.nFpsAt[f]);%
+ }%
+ \fi%
\fi%
- \if@anim@chfps %frame rate from the last fps change (\@anim@nfps)
- a#1.fps=Math.abs(\@anim@nfps);%
- a#1.dt=1000/(1e-6+a#1.fps);%
- \fi%
+ \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi
+ return(old);%
};%
- a#1.actnNext=function(){%
- \if@anim@useocg
- a#1.fr[a#1.idx].state=false;%
- \else
- a#1.fr[a#1.idx].display=display.hidden;%
+ a#1.stopFirst=function(){%
+ \if@anim@step\else
+ a#1.pause();%
+ a#1.isPaused=false;% because it has been explicitly stopped
\fi
- try{%
- \if@anim@useocg
- a#1.fr[++a#1.idx].state=true;%
- \else
- a#1.fr[++a#1.idx].display=display.visible;%
- curdoc.dirty=false;%
- \fi%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi%
- }catch(e){%
- --a#1.idx;%
+ a#1.seekFrame(0);%
+ };%
+ a#1.stopLast=function(){%
+ \if@anim@step\else
+ a#1.pause();%
+ a#1.isPaused=false;%
+ \fi
+ a#1.seekFrame(\@anim@maxframe);%
+ };%
+ a#1.gotoNext=function(){%
+ if(a#1.seekFrame(a#1.idx+1)<0){%
\if@anim@palindrome%
\if@anim@step
- a#1.actnEndRight();%
+ a#1.stopLast();%
a#1.playsRight=false;%
- \else%
- if(a#1.isPlaying){--a#1.idx;}%
- \if@anim@useocg
- a#1.fr[a#1.idx].state=true;%
- \else
- a#1.fr[a#1.idx].display=display.visible;%
- curdoc.dirty=false;%
- \fi%
- \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
- if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayLeft();}%
+ \else
+ if(a#1.playing){%
+ \if@anim@meas a#1.stopMeas();\fi
+ a#1.seekFrame(a#1.idx-1);%
+ a#1.playLeft();%
+ }%
\fi%
\else%
\if@anim@step
- a#1.actnEndRight();%
+ a#1.stopLast();%
\else%
\if@anim@loop
- if(a#1.isPlaying){%
- \if@anim@chfps
- a#1.fps=Math.abs(\@anim@fps);%
- a#1.dt=1000/(1e-6+a#1.fps);%
- \fi
- a#1.actnEndLeft();%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- a#1.actnPlayRight();%
- }else{a#1.actnEndRight();}%
+ if(a#1.playing){%
+ a#1.seekFrame(0);%
+ a#1.setFps(\@anim@fps);%
+ }else{a#1.stopLast();}%
\else
- a#1.actnEndRight();%
+ a#1.stopLast();%
\fi%
\fi%
- \fi%
+ \fi
}%
\if@anim@step\else%
- \if@anim@chfps
- if(%
- a#1.nFpsAt[a#1.idx]>=0&&%
- a#1.nFpsAt[a#1.idx]!=a#1.fps%
- ){%
- a#1.fps=a#1.nFpsAt[a#1.idx];%
- a#1.dt=1000/(1e-6+a#1.fps);%
- if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayRight();}%
- }%
- \fi%
\if@anim@pauseframes
- if(a#1.isPlaying&&a#1.pauseAt[a#1.idx]){a#1.actnPause();}%
+ if(a#1.playing&&a#1.pauseAt[a#1.idx]){a#1.pause();}%
\fi%
\fi%
};%
- \if@anim@ctrlorplndrm
- a#1.actnPrev=function(){%
- \if@anim@useocg
- a#1.fr[a#1.idx].state=false;%
- \else
- a#1.fr[a#1.idx].display=display.hidden;%
- \fi
- try{%
- \if@anim@useocg
- a#1.fr[--a#1.idx].state=true;%
- \else
- a#1.fr[--a#1.idx].display=display.visible;%
- curdoc.dirty=false;%
- \fi%
- \if@anim@step\else\if@anim@meas a#1.frcnt++;\fi\fi%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- }catch(e){%
- ++a#1.idx;%
+ \if@anim@morejs
+ a#1.gotoPrev=function(){%
+ if(a#1.seekFrame(a#1.idx-1)<0){%
\if@anim@palindrome%
\if@anim@step
- a#1.actnEndLeft();%
+ a#1.stopFirst();%
a#1.playsRight=true;%
- \else%
- if(a#1.isPlaying){++a#1.idx;}%
- \if@anim@useocg
- a#1.fr[a#1.idx].state=true;%
- \else
- a#1.fr[a#1.idx].display=display.visible;%
- curdoc.dirty=false;%
- \fi%
- \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
- if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayRight();}%
+ \else
+ if(a#1.playing){%
+ \if@anim@meas a#1.stopMeas();\fi
+ a#1.seekFrame(a#1.idx+1);%
+ a#1.playRight();%
+ }%
\fi%
\else%
\if@anim@step
- a#1.actnEndLeft();%
+ a#1.stopFirst();%
\else%
\if@anim@loop
- if(a#1.isPlaying){%
- \if@anim@chfps
- a#1.fps=Math.abs(\@anim@nfps);%
- a#1.dt=1000/(1e-6+a#1.fps);%
- \fi
- a#1.actnEndRight();%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- a#1.actnPlayLeft();%
- }else{a#1.actnEndLeft();}%
+ if(a#1.playing){%
+ a#1.seekFrame(\@anim@maxframe);%
+ }else{a#1.stopFirst();}%
\else
- a#1.actnEndLeft();%
+ a#1.stopFirst();%
\fi%
\fi%
\fi%
}%
\if@anim@step\else%
- \if@anim@chfps
- if(%
- a#1.pFpsAt[a#1.idx]>=0&&%
- a#1.pFpsAt[a#1.idx]!=a#1.fps%
- ){%
- a#1.fps=a#1.pFpsAt[a#1.idx];%
- a#1.dt=1000/(1e-6+a#1.fps);%
- if(a#1.isPlaying){a#1.isPaused=true;a#1.actnPlayLeft();}%
- }%
- \fi%
\if@anim@pauseframes
- if(a#1.isPlaying&&a#1.pauseAt[a#1.idx]){a#1.actnPause();}%
+ if(a#1.playing&&a#1.pauseAt[a#1.idx]){a#1.pause();}%
\fi%
\fi%
};%
\fi%
\if@anim@step\else
- a#1.actnPause=function(){%
- \if@anim@meas if(a#1.isPlaying){a#1.stopMeas();}\fi
+ a#1.pause=function(){%
+ \if@anim@meas if(a#1.playing){a#1.stopMeas();}\fi
try{app.clearInterval(a#1_int);}catch(e){}%
- a#1.isPlaying=false;%
+ a#1.playing=false;%
a#1.isPaused=true;%
\if@anim@controls
a#1.btn['PauseLeft'].state=false;%
@@ -3449,10 +3418,10 @@
a#1.btn['PlayRight'].state=true;%
\fi%
};%
- a#1.actnPlayRight=function(){%
+ a#1.playRight=function(){%
try{app.clearInterval(a#1_int);}catch(e){}%
- a#1.playsRight=true;%
- a#1.isPlaying=true;%
+ \if@anim@morejs a#1.playsRight=true;\fi
+ a#1.playing=true;%
a#1.isPaused=false;%
\if@anim@controls
a#1.btn['PauseLeft'].state=true;%
@@ -3461,15 +3430,14 @@
a#1.btn['PlayRight'].state=false;%
\fi%
\if@anim@meas a#1.startMeas();\fi
- a#1_int=app.setInterval(%
- 'a#1.actnNext()',a#1.dt\if@anim@controls/a#1.sm\fi%
- );%
+ a#1_int=app.setInterval('a#1.gotoNext()',%
+ 1000/(1e-6+a#1.fps)/a#1.sm);%
};%
- \if@anim@ctrlorplndrm
- a#1.actnPlayLeft=function(){%
+ \if@anim@morejs
+ a#1.playLeft=function(){%
try{app.clearInterval(a#1_int);}catch(e){}%
a#1.playsRight=false;%
- a#1.isPlaying=true;%
+ a#1.playing=true;%
a#1.isPaused=false;%
\if@anim@controls
a#1.btn['PauseLeft'].state=true;%
@@ -3478,48 +3446,24 @@
a#1.btn['PlayRight'].state=false;%
\fi%
\if@anim@meas a#1.startMeas();\fi
- a#1_int=app.setInterval(%
- 'a#1.actnPrev()',a#1.dt\if@anim@controls/a#1.sm\fi%
- );%
+ a#1_int=app.setInterval('a#1.gotoPrev()',%
+ 1000/(1e-6+a#1.fps)/a#1.sm);%
};%
\fi%
\if@anim@controls
- a#1.actnIncr=function(){% speed up animation
- try{app.clearInterval(a#1_int);}catch(e){}%
- a#1.sm*=1.2;%
- if(a#1.isPlaying){%
- if(a#1.playsRight){%
- a#1_int=app.setInterval('a#1.actnNext()',a#1.dt/a#1.sm);%
- }else{%
- a#1_int=app.setInterval('a#1.actnPrev()',a#1.dt/a#1.sm);%
- }%
- }%
+ a#1.fpsIncr=function(){% speed up animation
+ a#1.sm*=1.1;%
+ a#1.setFps(a#1.fps);%
};%
- a#1.actnDecr=function(){% slow down animation
- try{app.clearInterval(a#1_int);}catch(e){}%
- a#1.sm/=1.2;%
- if(a#1.isPlaying){%
- if(a#1.playsRight){%
- a#1_int=app.setInterval('a#1.actnNext()',a#1.dt/a#1.sm);%
- }else{%
- a#1_int=app.setInterval('a#1.actnPrev()',a#1.dt/a#1.sm);%
- }%
- }%
+ a#1.fpsDecr=function(){% slow down animation
+ a#1.sm/=1.1;%
+ a#1.setFps(a#1.fps);%
};%
- a#1.actnReset=function(){% reset to default speed
+ a#1.fpsReset=function(){% reset to default speed
a#1.sm=1;%
- try{app.clearInterval(a#1_int);}catch(e){}%
- if(a#1.isPlaying){%
- if(a#1.playsRight){%
- a#1_int=app.setInterval('a#1.actnNext()',a#1.dt/a#1.sm);%
- }else{%
- a#1_int=app.setInterval('a#1.actnPrev()',a#1.dt/a#1.sm);%
- }%
- }%
+ a#1.setFps(a#1.fps);%
};%
\fi%
- \fi%
- \if@anim@step\else%
\if@anim@meas
var spc=String.fromCharCode(32);%
a#1.frcnt=0;% frame counter for speed measurements
@@ -3531,58 +3475,87 @@
};%
a#1.stopMeas=function(){%
a#1.msEnd=(new Date()).getTime();%
- app.alert({%
- cMsg:'av.'+spc+'frame'+spc+'rate:'+spc+%
- 1e3*a#1.frcnt/(a#1.msEnd-a#1.msStart)+spc+'fps',%
- nIcon:3%
- });
+ console.show();console.println(%
+ 'av.'+spc+'frame'+spc+'rate:'+spc+%
+ 1e3*a#1.frcnt/(a#1.msEnd-a#1.msStart)+spc+'fps'%
+ );%
};%
\fi%
\fi%
- }%
- \if@anim@step\else%
- \if@anim@autoplay%
- \if@anim@useocg%
- \if@anim@ctrlorplndrm
- if(a#1.playsRight){a#1.actnPlayRight();}else{a#1.actnPlayLeft();}%
- \else%
- a#1.actnPlayRight();%
- \fi%
+ \if@anim@morejs%
+ \if@anim@step
+ a#1.stepBwd=function(){a#1.seekFrame(a#1.idx-1);};%
+ a#1.stepFwd=function(){a#1.seekFrame(a#1.idx+1);};%
\else
- \if@anim@ctrlorplndrm
- if(a#1.playsRight){%
- a#1_intd=app.setTimeOut('a#1.actnPlayRight()',1);%
- }else{%
- a#1_intd=app.setTimeOut('a#1.actnPlayLeft()',1);%
- }%
- \else%
- a#1_intd=app.setTimeOut('a#1.actnPlayRight()',1);%
- \fi%
+ a#1.stepBwd=function(){if(!a#1.playing){a#1.seekFrame(a#1.idx-1);}};%
+ a#1.stepFwd=function(){if(!a#1.playing){a#1.seekFrame(a#1.idx+1);}};%
+ a#1.playBwd=function(){%
+ if(a#1.idx==0){a#1.stopLast();}%
+ a#1.playLeft();%
+ };%
+ a#1.playFwd=function(){%
+ if(a#1.idx==\@anim@maxframe){a#1.stopFirst();}%
+ a#1.playRight();%
+ };%
\fi%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
\fi%
- \if@anim@autoresume
- if(a#1.isPaused){%
- \if@anim@useocg%
- \if@anim@ctrlorplndrm
- if(a#1.playsRight){a#1.actnPlayRight();}else{a#1.actnPlayLeft();}%
- \else
- a#1.actnPlayRight();%
- \fi%
- \else%
- \if@anim@ctrlorplndrm
- if(a#1.playsRight){%
- a#1_intd=app.setTimeOut('a#1.actnPlayRight()',1);%
- }else{%
- a#1_intd=app.setTimeOut('a#1.actnPlayLeft()',1);%
+ \ifx\empty\@anim@label\empty\else
+ if(typeof(anim)==='undefined'){anim=new Array();}%
+ if(typeof(anim['\@anim@label'])==='undefined'){%
+ anim['\@anim@label']={%
+ \if@anim@step\else
+ playBwd: a#1.playBwd,%
+ playFwd: a#1.playFwd,%
+ pause: a#1.pause,%
+ get isPlaying(){return(a#1.playing);},%
+ get fps(){return(a#1.fps);},%
+ set fps(f){%
+ if(f>=0){a#1.setFps(f);}else{%
+ console.show();console.println('Error:fpsNotAllowed');%
+ }%
+ },%
+ get dt(){return(1000/(1e-6+a#1.fps)/a#1.sm);},%
+ \fi
+ get playsFwd(){return(a#1.playsRight);},%
+ get numFrames(){return(\@anim@frames);},%
+ get frameNum(){return(a#1.idx);},%
+ set frameNum(f){%
+ f=Math.floor(f);%
+ if(f<0||f>\@anim@maxframe||isNaN(f)){%
+ console.show();console.println('Error:frameNumNotInRange');%
+ return;%
}%
- \else
- a#1_intd=app.setTimeOut('a#1.actnPlayRight()',1);%
- \fi%
- \fi%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
+ \if@anim@step
+ a#1.seekFrame(f);%
+ \else
+ if(a#1.playing){%
+ a#1.pause();a#1.seekFrame(f);%
+ if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
+ }else{a#1.seekFrame(f);}%
+ \fi%
+ },%
+ stopFirst: a#1.stopFirst,%
+ stopLast: a#1.stopLast%
+ };%
}%
\fi%
+ a#1.seekFrame(a#1.on);%
+ }%
+ curdoc.dirty=false;%
+ \if@anim@step\else%
+ \if@anim@autoplayorresume%
+ \if@anim@autoresume
+ if(a#1.isPaused){%
+ \fi%
+ \if@anim@morejs
+ if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
+ \else
+ a#1.playRight();%
+ \fi%
+ \if@anim@autoresume%
+ }%
+ \fi%
+ \fi%
\fi%
}
@@ -3593,10 +3566,10 @@
\if@anim@step\else
if(%
\if@anim@autopause
- a#1.isPlaying||%
+ a#1.playing||%
\fi
a#1.isPaused%
- ){a#1.actnPause();}%
+ ){a#1.pause();}%
else{%
\if@anim@controls
a#1.playsRight=true;%
@@ -3606,18 +3579,10 @@
\fi%
\fi%
\fi%
- \ifx\@anim@poster\@anim@posterlast%
- \if@anim@useocg
- a#1.actnEndRight();%
- \else
- a#1_intd=app.setTimeOut('a#1.actnEndRight()',1);%
- \fi%
- \else%
- \if@anim@useocg
- a#1.actnEndLeft();%
- \else
- a#1_intd=app.setTimeOut('a#1.actnEndLeft()',1);%
- \fi%
+ \ifx\@anim@poster\@anim@posterlast
+ a#1.stopLast();%
+ \else
+ a#1.stopFirst();%
\fi%
\if@anim@step\else%
}%
@@ -3627,7 +3592,7 @@
/D <</S/JavaScript/JS (% pause on MouseDown
%disable focus rectangle
app.focusRect=false;%
- try{if(a#1.isPlaying){a#1.actnPause();}}catch(e){}%
+ try{if(a#1.playing){a#1.pause();}}catch(e){}%
)>>%
\fi%
/U <</S/JavaScript/JS (% play/resume on MouseUp
@@ -3636,39 +3601,37 @@
\if@anim@palindrome
if(a#1.idx==\@anim@maxframe){%
a#1.playsRight=false;%
- a#1.actnPrev();%
+ a#1.gotoPrev();%
}else if(a#1.idx==0){%
a#1.playsRight=true;%
- a#1.actnNext();%
+ a#1.gotoNext();%
}else if(a#1.playsRight){%
- a#1.actnNext();%
+ a#1.gotoNext();%
}else{%
- a#1.actnPrev();%
+ a#1.gotoPrev();%
}%
\else
if(a#1.idx==\@anim@maxframe){%
- a#1.actnEndLeft();%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
+ a#1.stopFirst();%
}else{%
- a#1.actnNext();%
+ a#1.gotoNext();%
}%
\fi%
\else%
- \if@anim@palindrome%
+ \if@anim@palindrome
if(a#1.idx==\@anim@maxframe){%
- a#1.actnPlayLeft();%
+ a#1.playLeft();%
}else if(a#1.idx==0){%
- a#1.actnPlayRight();%
+ a#1.playRight();%
}else if(a#1.playsRight){%
- a#1.actnPlayRight();%
+ a#1.playRight();%
}else{%
- a#1.actnPlayLeft();%
+ a#1.playLeft();%
}%
\else
- if(a#1.idx==\@anim@maxframe){a#1.actnEndLeft();}%
- a#1.actnPlayRight();%
+ if(a#1.idx==\@anim@maxframe){a#1.stopFirst();}%
+ a#1.playRight();%
\fi%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
\fi%
}catch(e){}%
)>>%
@@ -3689,49 +3652,31 @@
\xdef\@anim@upjscriptstring{%
app.focusRect=false;%
\ifx\@anim@action\@anim@EndLeft
- a#1.actnEndLeft();%
+ a#1.stopFirst();%
\else%
- \ifx\@anim@action\@anim@StepLeft%
- \if@anim@step
- if(a#1.idx!=0){a#1.actnPrev();}%
- \else
- if(!a#1.isPlaying&&a#1.idx!=0){a#1.isPaused=true;a#1.actnPrev();}%
- \fi%
+ \ifx\@anim@action\@anim@StepLeft
+ a#1.stepBwd();%
\else%
\ifx\@anim@action\@anim@PlayPauseLeft
- if(a#1.isPlaying){a#1.actnPause();}else{%
- if(a#1.idx==0){a#1.actnEndRight();}%
- a#1.actnPlayLeft();%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- }%
+ if(a#1.playing){a#1.pause();}else{a#1.playBwd();}%
\else%
\ifx\@anim@action\@anim@PlayPauseRight
- if(a#1.isPlaying){a#1.actnPause();}else{%
- if(a#1.idx==\@anim@maxframe){a#1.actnEndLeft();}%
- a#1.actnPlayRight();%
- \if@anim@usrjs try{a#1.usrJSat[a#1.idx]();}catch(e){}\fi%
- }%
+ if(a#1.playing){a#1.pause();}else{a#1.playFwd();}%
\else%
- \ifx\@anim@action\@anim@StepRight%
- \if@anim@step
- if(a#1.idx!=\@anim@maxframe){a#1.actnNext();}%
- \else
- if(!a#1.isPlaying&&a#1.idx!=\@anim@maxframe){%
- a#1.isPaused=true;a#1.actnNext();%
- }%
- \fi%
+ \ifx\@anim@action\@anim@StepRight
+ a#1.stepFwd();%
\else%
\ifx\@anim@action\@anim@EndRight
- a#1.actnEndRight();%
+ a#1.stopLast();%
\else%
\ifx\@anim@action\@anim@Minus
- a#1.actnDecr();%
+ a#1.fpsDecr();%
\else%
\ifx\@anim@action\@anim@Reset
- a#1.actnReset();%
+ a#1.fpsReset();%
\else%
\ifx\@anim@action\@anim@Plus
- a#1.actnIncr();%
+ a#1.fpsIncr();%
\fi\fi\fi\fi\fi\fi\fi\fi\fi%
}%
}