summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/media9/media9.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-14 23:28:44 +0000
committerKarl Berry <karl@freefriends.org>2012-08-14 23:28:44 +0000
commit4434165a72f0b014b89cb12bcfdc38307a59352e (patch)
treeca6f715d2725a5a4a59b16e3f04147471fdd96aa /Master/texmf-dist/tex/latex/media9/media9.sty
parentc33dd0f6eb3ee533df663d363845fc7d22578ba6 (diff)
media9 (14aug12)
git-svn-id: svn://tug.org/texlive/trunk@27407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9/media9.sty')
-rw-r--r--Master/texmf-dist/tex/latex/media9/media9.sty129
1 files changed, 99 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty
index f860b19cf1e..8c6096b6285 100644
--- a/Master/texmf-dist/tex/latex/media9/media9.sty
+++ b/Master/texmf-dist/tex/latex/media9/media9.sty
@@ -39,8 +39,12 @@
\RequirePackage{l3keys2e}
\RequirePackage{ifpdf}
-\def\g@mix@date@tl{2012/07/31}
-\def\g@mix@version@tl{0.10}
+\def\g@mix@date@tl{2012/08/14}
+\def\g@mix@version@tl{0.11}
+
+\def\g@mix@liiikerneldate{2012/07/16}
+\def\g@mix@liiipkgdate{2012/07/16}
+
\ProvidesExplPackage{media9}{\g@mix@date@tl}{\g@mix@version@tl}
{acrobat-9/X compatible media}
@@ -61,15 +65,15 @@
}
\tex_endinput:D
}
-\@ifpackagelater{expl3}{2012/07/16}{}{
+\@ifpackagelater{expl3}{\g@mix@liiikerneldate}{}{
\msg_error:nnn{media9}{support~outdated}{l3kernel}
\tex_endinput:D
}
-\@ifpackagelater{xparse}{2012/07/16}{}{
+\@ifpackagelater{xparse}{\g@mix@liiipkgdate}{}{
\msg_error:nnn{media9}{support~outdated}{l3packages}
\tex_endinput:D
}
-\@ifpackagelater{l3keys2e}{2012/07/16}{}{
+\@ifpackagelater{l3keys2e}{\g@mix@liiipkgdate}{}{
\msg_error:nnn{media9}{support~outdated}{l3packages}
\tex_endinput:D
}
@@ -97,6 +101,7 @@
perhaps~it~is~spelled~incorrectly.
}
+\bool_new:N\g_mix_pkgbigfiles_bool
\bool_new:N\g_mix_dvipdfmx_bool
\bool_new:N\g_mix_pkgdraft_bool
\tl_gset:Nn\g_mix_pkgact_tl{/XA}
@@ -117,6 +122,11 @@
dvipdfmx .bool_gset:N = \g_mix_dvipdfmx_bool,
xetex .bool_gset:N = \g_mix_dvipdfmx_bool,
+ bigfiles .choice:,
+ bigfiles / true .code:n = {\bool_gset_true:N\g_mix_pkgbigfiles_bool},
+ bigfiles / false .code:n = {\bool_gset_false:N\g_mix_pkgbigfiles_bool},
+ bigfiles .default:n = {true},
+
draft .choice:,
draft / true .code:n = {\bool_gset_true:N\g_mix_pkgdraft_bool},
draft / false .code:n = {\bool_gset_false:N\g_mix_pkgdraft_bool},
@@ -296,7 +306,7 @@
\tl_gset:Nn\g_mix_opt_coo_tl{0~0~0}
\tl_gset:Nn\g_mix_opt_ctoc_tl{0~-1~0}
\tl_gset:Nn\g_mix_opt_ciiw_tl{}
- \fp_gset:Nn\g_mix_opt_roo_fp{1e-8}
+ \fp_gset:Nn\g_mix_opt_roo_fp{1e-9}
\fp_gset:Nn\g_mix_opt_aac_fp{30}
\fp_gset:Nn\g_mix_opt_oscale_fp{1}
\fp_gset:Nn\g_mix_opt_roll_fp{0}
@@ -318,7 +328,7 @@
\tl_set:Nn\l_mix_ctoc_tl{0~-1~0}
\tl_set:Nn\l_mix_ciiw_tl{}
- \fp_set:Nn\l_mix_roo_fp{1e-8}
+ \fp_set:Nn\l_mix_roo_fp{1e-9}
\fp_set:Nn\l_mix_aac_fp{30}
\fp_set:Nn\l_mix_oscale_fp{1}
\fp_set:Nn\l_mix_roll_fp{0}
@@ -492,6 +502,28 @@
ifelse~
}
}
+ \bool_if:NT\g_mix_pkgbigfiles_bool{
+ \special{!~(./\jobname.m9)~run~}
+ %open auxiliary file \jobname.m9 for writing hex encoded streams
+ %of media files. This file is read and executed during ps2pdf
+ %conversion.
+ \iow_new:N\g_mix_mstreams_stream
+ \iow_open:Nn\g_mix_mstreams_stream{\jobname.m9}
+ \iow_now:Nn\g_mix_mstreams_stream{
+ 1~dict~begin~
+ /o{mark/_objdef}bind~def/O{/type/stream/OBJ~pdfmark}bind~def
+ /m~systemdict/mark~get~def
+ /P{/ASCIIHexDecode~filter/PUT~pdfmark}bind~def
+ /C{/CLOSE~pdfmark}bind~def
+ }
+ }
+ }
+ \bool_if:NT\g_mix_pkgbigfiles_bool{
+ \RequirePackage{atenddvi}
+ \AtEndDvi{
+ \iow_now:Nn\g_mix_mstreams_stream{end}
+ \iow_close:N\g_mix_mstreams_stream
+ }
}
\cs_new:Nn\mix_pdfobj:nnn{
@@ -500,14 +532,23 @@
% #3:content (key-value, file, string); may be empty
\tl_set:Nn\l_mix_usenum_tl{}
\tl_if_blank:oTF{#1}{
- \special{ps:~mark~/_objdef~{mix@obj\int_use:N\g_mix_obj_int}~/type
- \str_case:nnn{#2}{
- {dict}{/dict}
- {array}{/array}
- {stream}{/stream}
- {fstream}{/stream}
- }{}~
- /OBJ~pdfmark~
+ \bool_if:nTF{
+ \g_mix_pkgbigfiles_bool &&
+ \str_if_eq_p:nn{#2}{fstream}
+ }{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ o{mix@obj\int_use:N\g_mix_obj_int}O
+ }
+ }{
+ \special{ps:~mark~/_objdef~{mix@obj\int_use:N\g_mix_obj_int}~/type
+ \str_case:nnn{#2}{
+ {dict}{/dict}
+ {array}{/array}
+ {stream}{/stream}
+ {fstream}{/stream}
+ }{}~
+ /OBJ~pdfmark~
+ }
}
\tl_set:Nx\l_mix_usenum_tl{{mix@obj\int_use:N\g_mix_obj_int}}
\int_gincr:N\g_mix_obj_int
@@ -530,19 +571,32 @@
\bool_while_do:nn{
\int_compare_p:n{\l_mix_offset_tl<\l_mix_fsize_tl}
}{
- \special{ps:~
- mark~
- \l_mix_usenum_tl~
- (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})~
- /ASCIIHexDecode~filter~/PUT~
- pdfmark~
+ \bool_if:NTF\g_mix_pkgbigfiles_bool{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ m\l_mix_usenum_tl
+ (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})P
+ }
+ }{
+ \special{ps:~
+ mark~
+ \l_mix_usenum_tl~
+ (\mix_filedump:nnn{\l_mix_offset_tl}{32767}{#3})~
+ /ASCIIHexDecode~filter~/PUT~
+ pdfmark~
+ }
}
\tl_set:Nx\l_mix_offset_tl{\int_eval:n{\l_mix_offset_tl+32767}}
\message{.}
}
\message{>}
- \special{ps:~
- mark~\l_mix_usenum_tl~/CLOSE~pdfmark~
+ \bool_if:NTF\g_mix_pkgbigfiles_bool{
+ \iow_now:Nx\g_mix_mstreams_stream{
+ m\l_mix_usenum_tl~C
+ }
+ }{
+ \special{ps:~
+ mark~\l_mix_usenum_tl~/CLOSE~pdfmark~
+ }
}
}
}{}
@@ -694,6 +748,7 @@
\cs_new:Nn\mix_embedasset:n{ %#1 file name or url
\filename@parse{#1}
+ \tl_set:Nx\l_mix_base_tl{\filename@base}
\tl_set:Nx\l_mix_ext_tl{\filename@ext}
\tl_replace_all:Nnn\l_mix_ext_tl{A}{a}
\tl_replace_all:Nnn\l_mix_ext_tl{B}{b}
@@ -942,8 +997,19 @@
\bool_set_eq:NN\l_mix_url_bool\g_mix_url_bool
\mix_uribegin:
\mix_embedasset:n{#3}
- \bool_gset:Nn\g_mix_iiid_bool{ %test on 3D file type
+ \bool_if:nTF{
\str_if_eq_p:Vn\l_mix_ext_tl{prc}||\str_if_eq_p:Vn\l_mix_ext_tl{u3d}
+ }{
+ \bool_gset_true:N\g_mix_iiid_bool
+ \tl_gset:Nn\g_mix_mainassetsub_tl{3D}
+ }{
+ \str_case_x:nnn{\l_mix_base_tl}{
+ {APlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Sound}}
+ {AudioPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Sound}}
+ {VPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ {VideoPlayer}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ {StrobeMediaPlayback}{\tl_gset:Nn\g_mix_mainassetsub_tl{Video}}
+ }{\tl_gset:Nn\g_mix_mainassetsub_tl{Flash}}
}
\tl_gset:Nx\g_mix_mainasset_tl{~\g_mix_lastasset_tl}
\mix_uriend:
@@ -1020,7 +1086,7 @@
}
\mix_pdfobj:nnn{}{dict}{
- /Subtype/\bool_if:NTF\g_mix_iiid_bool{3D}{Flash}
+ /Subtype/\g_mix_mainassetsub_tl
/Asset~\g_mix_mainasset_tl
\bool_if:NF\g_mix_iiid_bool{
/Params~<<
@@ -1031,7 +1097,10 @@
>>
}
}
- \mix_pdfobj:nnn{}{dict}{/Instances~[\g_mix_pdflastobj_tl]}%
+ \mix_pdfobj:nnn{}{dict}{
+ /Subtype/\g_mix_mainassetsub_tl
+ /Instances~[\g_mix_pdflastobj_tl]
+ }%
\mix_pdfobj:nnn{}{dict}{
/Assets~<</Names~[\g_mix_assets_tl]>>
/Configurations~[\g_mix_pdflastobj_tl]
@@ -1476,8 +1545,8 @@
3Droo .code:n = {
\fp_gset:Nn\g_mix_opt_roo_fp{abs(#1)}
- \fp_compare:nNnT\g_mix_opt_roo_fp=\c_zero_fp{
- \fp_set:Nn\g_mix_opt_roo_fp{1e-8}}
+ \fp_compare:nNnT\g_mix_opt_roo_fp<{1e-9}{
+ \fp_gset:Nn\g_mix_opt_roo_fp{1e-9}}
\bool_gset_true:N\g_mix_opt_iiidview_bool
\bool_set_true:N\l_mix_roo_bool
},
@@ -1700,8 +1769,8 @@
{\g_mix_vfile_tl}{\int_use:N\l_mix_lineno_int}{ROO}{a~VIEW}
}
\fp_set:Nn\l_mix_roo_fp{abs(#1)}
- \fp_compare:nNnT\l_mix_roo_fp=\c_zero_fp{
- \fp_set:Nn\l_mix_roo_fp{1e-8}}
+ \fp_compare:nNnT\l_mix_roo_fp<{1e-9}{
+ \fp_set:Nn\l_mix_roo_fp{1e-9}}
\bool_set_true:N\l_mix_roo_bool
},
ROO .value_required:,