Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* ====================================================================
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
     The ASF licenses this file to You under the Apache License, Version 2.0
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
 
 package org.apache.poi.hslf.record;
 
 
An atom record that specifies information about external audio or video data.

Author(s):
Yegor Kozlov
 
 public final class ExMediaAtom extends RecordAtom
 {

    
A bit that specifies whether the audio or video data is repeated continuously during playback.
 
     public static final int fLoop = 1;
    
A bit that specifies whether the audio or video data is rewound after playing.
 
     public static final int fRewind = 2;
    
A bit that specifies whether the audio data is recorded narration for the slide show. It MUST be FALSE if this ExMediaAtom record is contained by an ExVideoContainer record.
 
     public static final int fNarration = 4;

    
Record header.
 
     private byte[] _header;

    
record data
 
     private byte[] _recdata;

    
Constructs a brand new link related atom record.
 
     protected ExMediaAtom() {
          = new byte[8];
 
          = new byte[8];
         LittleEndian.putShort(, 2, (short)getRecordType());
         LittleEndian.putInt(, 4, .);
     }

    
Constructs the link related atom record from its source data.

Parameters:
source the source data as a byte array.
start the start offset into the byte array.
len the length of the slice in the byte array.
 
     protected ExMediaAtom(byte[] sourceint startint len) {
         // Get the header
          = new byte[8];
         System.arraycopy(source,start,,0,8);
 
         // Grab the record data
          = new byte[len-8];
         System.arraycopy(source,start+8,,0,len-8);
     }

    
Gets the record type.

Returns:
the record type.
 
     public long getRecordType() { return ..; }

    
Write the contents of the record back, so it can be written to disk

Parameters:
out the output stream to write to.
Throws:
java.io.IOException if an error occurs.
 
     public void writeOut(OutputStream outthrows IOException {
         out.write();
        out.write();
    }

    
A 4-byte unsigned integer that specifies an ID for an external object.

Returns:
A 4-byte unsigned integer that specifies an ID for an external object.
    public int getObjectId(){
        return LittleEndian.getInt(, 0);
    }

    
A 4-byte unsigned integer that specifies an ID for an external object.

Parameters:
id A 4-byte unsigned integer that specifies an ID for an external object.
    public void setObjectId(int id){
         LittleEndian.putInt(, 0, id);
    }

    
A bit mask specifying options for displaying headers and footers

Returns:
A bit mask specifying options for displaying headers and footers
    public int getMask(){
        return LittleEndian.getInt(, 4);
    }

    
A bit mask specifying options for displaying video

Parameters:
mask A bit mask specifying options for displaying video
    public void setMask(int mask){
        LittleEndian.putInt(, 4, mask);
    }

    

Parameters:
bit the bit to check
Returns:
whether the specified flag is set
    public boolean getFlag(int bit){
        return (getMask() & bit) != 0;
    }

    

Parameters:
bit the bit to set
value whether the specified bit is set
    public void setFlag(int bitboolean value){
        int mask = getMask();
        if(valuemask |= bit;
        else mask &= ~bit;
        setMask(mask);
    }
    public String toString(){
        StringBuffer buf = new StringBuffer();
        buf.append("ExMediaAtom\n");
        buf.append("\tObjectId: " + getObjectId() + "\n");
        buf.append("\tMask    : " + getMask() + "\n");
        buf.append("\t  fLoop        : " + getFlag() + "\n");
        buf.append("\t  fRewind   : " + getFlag() + "\n");
        buf.append("\t  fNarration    : " + getFlag() + "\n");
        return buf.toString();
    }
New to GrepCode? Check out our FAQ X