1793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler///////////////////////////////////////////////////////////////////////////
2793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
3793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
4793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// Digital Ltd. LLC
5793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
6793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// All rights reserved.
7793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
8793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// Redistribution and use in source and binary forms, with or without
9793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// modification, are permitted provided that the following conditions are
10793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// met:
11793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// *       Redistributions of source code must retain the above copyright
12793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// notice, this list of conditions and the following disclaimer.
13793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// *       Redistributions in binary form must reproduce the above
14793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// copyright notice, this list of conditions and the following disclaimer
15793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// in the documentation and/or other materials provided with the
16793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// distribution.
17793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// *       Neither the name of Industrial Light & Magic nor the names of
18793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// its contributors may be used to endorse or promote products derived
19793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// from this software without specific prior written permission.
20793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
21793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
33793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler///////////////////////////////////////////////////////////////////////////
34793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
35793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
36793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//-----------------------------------------------------------------------------
37793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
38793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//	class TimeCodeAttribute
39793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//
40793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler//-----------------------------------------------------------------------------
41793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
42793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include <ImfTimeCodeAttribute.h>
43793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
44793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslernamespace Imf {
45793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
46793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
47793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertemplate <>
48793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerconst char *
49793ee12c6df9cad3806238d32528c49a3ff9331dNoah PreslerTimeCodeAttribute::staticTypeName ()
50793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler{
51793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    return "timecode";
52793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler}
53793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
54793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
55793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertemplate <>
56793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslervoid
57793ee12c6df9cad3806238d32528c49a3ff9331dNoah PreslerTimeCodeAttribute::writeValueTo (OStream &os, int) const
58793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler{
59793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    Xdr::write <StreamIO> (os, _value.timeAndFlags());
60793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    Xdr::write <StreamIO> (os, _value.userData());
61793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler}
62793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
63793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
64793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertemplate <>
65793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslervoid
66793ee12c6df9cad3806238d32528c49a3ff9331dNoah PreslerTimeCodeAttribute::readValueFrom (IStream &is, int, int)
67793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler{
68793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    unsigned int tmp;
69793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
70793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    Xdr::read <StreamIO> (is, tmp);
71793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    _value.setTimeAndFlags (tmp);
72793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
73793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    Xdr::read <StreamIO> (is, tmp);
74793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    _value.setUserData (tmp);
75793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler}
76793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
77793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
78793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler} // namespace Imf
79