code
stringlengths 11
173k
| docstring
stringlengths 2
593k
| func_name
stringlengths 2
189
| language
stringclasses 1
value | repo
stringclasses 844
values | path
stringlengths 11
294
| url
stringlengths 60
339
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public VideoStreamChunk(final BigInteger chunkLen)
{
super(GUID.GUID_VIDEOSTREAM, chunkLen);
} |
Creates an instance.
@param chunkLen Length of the entire chunk (including guid and size)
| VideoStreamChunk::VideoStreamChunk | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public byte[] getCodecId()
{
return this.codecId.clone();
} |
@return Returns the codecId.
| VideoStreamChunk::getCodecId | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public String getCodecIdAsString()
{
String result;
if (this.codecId == null)
{
result = "Unknown";
}
else
{
result = new String(getCodecId());
}
return result;
} |
Returns the {@link #getCodecId()}, as a String, where each byte has been
converted to a <code>char</code>.
@return Codec Id as String.
| VideoStreamChunk::getCodecIdAsString | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public long getPictureHeight()
{
return this.pictureHeight;
} |
@return Returns the pictureHeight.
| VideoStreamChunk::getPictureHeight | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public long getPictureWidth()
{
return this.pictureWidth;
} |
@return Returns the pictureWidth.
| VideoStreamChunk::getPictureWidth | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public void setCodecId(final byte[] codecIdentifier)
{
this.codecId = codecIdentifier.clone();
} |
@param codecIdentifier The codecId to set.
| VideoStreamChunk::setCodecId | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public void setPictureHeight(final long picHeight)
{
this.pictureHeight = picHeight;
} |
@param picHeight
| VideoStreamChunk::setPictureHeight | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
public void setPictureWidth(final long picWidth)
{
this.pictureWidth = picWidth;
} |
@param picWidth
| VideoStreamChunk::setPictureWidth | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/VideoStreamChunk.java | Apache-2.0 |
protected static boolean chunkstartsUnique(final ChunkContainer container)
{
boolean result = true;
final Set<Long> chunkStarts = new HashSet<Long>();
final Collection<Chunk> chunks = container.getChunks();
for (final Chunk curr : chunks)
{
result &= chunkStarts.add(curr.getPosition());
}
return result;
} |
Tests whether all stored chunks have a unique starting position among
their brothers.
@param container the container to test.
@return <code>true</code> if all chunks are located at an unique
position. However, no intersection is tested.
| ChunkContainer::chunkstartsUnique | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public ChunkContainer(final GUID chunkGUID, final long pos, final BigInteger length)
{
super(chunkGUID, pos, length);
this.chunkTable = new Hashtable<GUID, List<Chunk>>();
} |
Creates an instance.
@param chunkGUID the GUID which identifies the chunk.
@param pos the position of the chunk within the stream.
@param length the length of the chunk.
| ChunkContainer::ChunkContainer | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public void addChunk(final Chunk toAdd)
{
final List<Chunk> list = assertChunkList(toAdd.getGuid());
if (!list.isEmpty() && !MULTI_CHUNKS.contains(toAdd.getGuid()))
{
throw new IllegalArgumentException("The GUID of the given chunk indicates, that there is no more instance allowed."); //$NON-NLS-1$
}
list.add(toAdd);
assert chunkstartsUnique(this) : "Chunk has equal start position like an already inserted one."; //$NON-NLS-1$
} |
Adds a chunk to the container.<br>
@param toAdd The chunk which is to be added.
@throws IllegalArgumentException If a chunk of same type is already added, except for
{@link StreamChunk}.
| ChunkContainer::addChunk | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
protected List<Chunk> assertChunkList(final GUID lookFor)
{
List<Chunk> result = this.chunkTable.get(lookFor);
if (result == null)
{
result = new ArrayList<Chunk>();
this.chunkTable.put(lookFor, result);
}
return result;
} |
This method asserts that a {@link List} exists for the given {@link GUID}
, in {@link #chunkTable}.<br>
@param lookFor The GUID to get list for.
@return an already existing, or newly created list.
| ChunkContainer::assertChunkList | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public Collection<Chunk> getChunks()
{
final List<Chunk> result = new ArrayList<Chunk>();
for (final List<Chunk> curr : this.chunkTable.values())
{
result.addAll(curr);
}
return result;
} |
Returns a collection of all contained chunks.<br>
@return all contained chunks
| ChunkContainer::getChunks | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
protected Chunk getFirst(final GUID lookFor, final Class<? extends Chunk> instanceOf)
{
Chunk result = null;
final List<Chunk> list = this.chunkTable.get(lookFor);
if (list != null && !list.isEmpty())
{
final Chunk chunk = list.get(0);
if (instanceOf.isAssignableFrom(chunk.getClass()))
{
result = chunk;
}
}
return result;
} |
Looks for the first stored chunk which has the given GUID.
@param lookFor GUID to look up.
@param instanceOf The class which must additionally be matched.
@return <code>null</code> if no chunk was found, or the stored instance
doesn't match.
| ChunkContainer::getFirst | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public boolean hasChunkByGUID(final GUID lookFor)
{
return this.chunkTable.containsKey(lookFor);
} |
This method checks if a chunk has been {@linkplain #addChunk(Chunk)
added} with specified {@linkplain Chunk#getGuid() GUID}.<br>
@param lookFor GUID to look up.
@return <code>true</code> if chunk with specified GUID has been added.
| ChunkContainer::hasChunkByGUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public String prettyPrint(final String prefix, final String containerInfo)
{
final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
result.append(containerInfo);
result.append(prefix).append(" |").append(Utils.LINE_SEPARATOR);
final ArrayList<Chunk> list = new ArrayList<Chunk>(getChunks());
Collections.sort(list, new ChunkPositionComparator());
for (Chunk curr : list)
{
result.append(curr.prettyPrint(prefix + " |"));
result.append(prefix).append(" |").append(Utils.LINE_SEPARATOR);
}
return result.toString();
} |
Nearly the same as {@link #prettyPrint(String)} however, additional
information can be injected below the {@link Chunk#prettyPrint(String)}
output and the listing of the contained chunks.<br>
@param prefix The prefix to prepend.
@param containerInfo Information to inject.
@return Information of current Chunk Object.
| ChunkContainer::prettyPrint | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/ChunkContainer.java | Apache-2.0 |
public static boolean assertGUID(final int[] value)
{
return value != null && value.length == GUID.GUID_LENGTH;
} |
This method checks if the given <code>value</code> is matching the GUID
specification of ASF streams. <br>
@param value possible GUID.
@return <code>true</code> if <code>value</code> matches the specification
of a GUID.
| GUID::assertGUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public static GUID getConfigured(final GUID orig)
{
// safe against null
return GUID_TO_CONFIGURED.get(orig);
} |
This method looks up a GUID instance from {@link #KNOWN_GUIDS} which
matches the value of the given GUID.
@param orig GUID to look up.
@return a GUID instance from {@link #KNOWN_GUIDS} if available.
<code>null</code> else.
| GUID::getConfigured | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public static String getGuidDescription(final GUID guid)
{
String result = null;
if (guid == null)
{
throw new IllegalArgumentException("Argument must not be null.");
}
if (getConfigured(guid) != null)
{
result = getConfigured(guid).getDescription();
}
return result;
} |
This method searches a GUID in {@link #KNOWN_GUIDS}which is equal to the
given <code>guidData</code> and returns its description. <br>
This method is useful if a GUID was read out of a file and no
identification has been done yet.
@param guid GUID, which description is needed.
@return description of the GUID if found. Else <code>null</code>
| GUID::getGuidDescription | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public static GUID parseGUID(final String guid) throws GUIDFormatException
{
if (guid == null)
{
throw new GUIDFormatException("null");
}
if (!GUID_PATTERN.matcher(guid).matches())
{
throw new GUIDFormatException("Invalid guidData format.");
}
final int[] bytes = new int[GUID_LENGTH];
/*
* Don't laugh, but did not really come up with a nicer solution today
*/
final int[] arrayIndices = {3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15};
int arrayPointer = 0;
for (int i = 0; i < guid.length(); i++)
{
if (guid.charAt(i) == '-')
{
continue;
}
bytes[arrayIndices[arrayPointer++]] = Integer.parseInt(guid.substring(i, i + 2), 16);
i++;
}
return new GUID(bytes);
} |
This method parses a String as GUID.<br>
The format is like the one in the ASF specification.<br>
An Example: <code>C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA</code><br>
@param guid the string to parse.
@return the GUID.
@throws GUIDFormatException If the GUID has an invalid format.
| GUID::parseGUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public GUID(final byte[] value)
{
assert value != null;
final int[] tmp = new int[value.length];
for (int i = 0; i < value.length; i++)
{
tmp[i] = (0xFF & value[i]);
}
setGUID(tmp);
} |
Creates an instance and assigns given <code>value</code>.<br>
@param value GUID, which should be assigned. (will be converted to int[])
| GUID::GUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public GUID(final int[] value)
{
setGUID(value);
} |
Creates an instance and assigns given <code>value</code>.<br>
@param value GUID, which should be assigned.
| GUID::GUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public GUID(final int[] value, final String desc)
{
this(value);
if (desc == null)
{
throw new IllegalArgumentException("Argument must not be null.");
}
this.description = desc;
} |
Creates an instance like {@link #GUID(int[])}and sets the optional
description. <br>
@param value GUID, which should be assigned.
@param desc Description for the GUID.
| GUID::GUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public GUID(final String guidString, final String desc)
{
this(parseGUID(guidString).getGUID());
if (desc == null)
{
throw new IllegalArgumentException("Argument must not be null.");
}
this.description = desc;
} |
Creates an instance like {@link #GUID(int[])} and sets the optional
description. (the int[] is obtained by {@link GUID#parseGUID(String)}) <br>
@param guidString GUID, which should be assigned.
@param desc Description for the GUID.
| GUID::GUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public byte[] getBytes()
{
final byte[] result = new byte[this.guidData.length];
for (int i = 0; i < result.length; i++)
{
result[i] = (byte) (this.guidData[i] & 0xFF);
}
return result;
} |
This method returns the GUID as an array of bytes. <br>
@return The GUID as a byte array.
@see #getGUID()
| GUID::getBytes | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public String getDescription()
{
return this.description;
} |
@return Returns the description.
| GUID::getDescription | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public int[] getGUID()
{
final int[] copy = new int[this.guidData.length];
System.arraycopy(this.guidData, 0, copy, 0, this.guidData.length);
return copy;
} |
This method returns the GUID of this object. <br>
@return stored GUID.
| GUID::getGUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
private String[] getHex(final byte[] bytes)
{
final String[] result = new String[bytes.length];
final StringBuilder tmp = new StringBuilder();
for (int i = 0; i < bytes.length; i++)
{
tmp.delete(0, tmp.length());
tmp.append(Integer.toHexString(0xFF & bytes[i]));
if (tmp.length() == 1)
{
tmp.insert(0, "0");
}
result[i] = tmp.toString();
}
return result;
} |
Convenience method to get 2digit hex values of each byte.
@param bytes bytes to convert.
@return each byte as 2 digit hex.
| GUID::getHex | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public boolean isValid()
{
return assertGUID(getGUID());
} |
This method checks if the currently stored GUID ({@link #guidData}) is
correctly filled. <br>
@return <code>true</code> if it is.
| GUID::isValid | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public String prettyPrint()
{
final StringBuilder result = new StringBuilder();
String descr = getDescription();
if (Utils.isBlank(descr))
{
descr = getGuidDescription(this);
}
if (!Utils.isBlank(descr))
{
result.append("Description: ").append(descr).append(Utils.LINE_SEPARATOR).append(" ");
}
result.append(this);
return result.toString();
} |
This method gives a hex formatted representation of {@link #getGUID()}
@return hex formatted representation.
| GUID::prettyPrint | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
private void setGUID(final int[] value)
{
if (assertGUID(value))
{
this.guidData = new int[GUID_LENGTH];
System.arraycopy(value, 0, this.guidData, 0, GUID_LENGTH);
}
else
{
throw new IllegalArgumentException("The given guidData doesn't match the GUID specification.");
}
} |
This method saves a copy of the given <code>value</code> as the
represented value of this object. <br>
The given value is checked with {@link #assertGUID(int[])}.<br>
@param value GUID to assign.
| GUID::setGUID | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUID.java | Apache-2.0 |
public MetadataDescriptor(final ContainerType type, final String propName, final int propType)
{
this(type, propName, propType, 0, 0);
} |
Creates an Instance.<br>
@param type the container type, this descriptor is resctricted to.
@param propName Name of the MetadataDescriptor.
@param propType Type of the metadata descriptor. See {@link #descriptorType}
| MetadataDescriptor::MetadataDescriptor | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public MetadataDescriptor(final ContainerType type, final String propName, final int propType, final int stream, final int language)
{
assert type != null;
type.assertConstraints(propName, new byte[0], propType, stream, language);
this.containerType = type;
this.name = propName;
this.descriptorType = propType;
this.streamNumber = stream;
this.languageIndex = language;
} |
Creates an Instance.
@param type The container type the values (the whole descriptor) is
restricted to.
@param propName Name of the MetadataDescriptor.
@param propType Type of the metadata descriptor. See {@link #descriptorType}
@param stream the number of the stream the descriptor refers to.
@param language the index of the language entry in a {@link LanguageList} this
descriptor refers to.<br>
<b>Consider</b>: No checks performed if language entry exists.
| MetadataDescriptor::MetadataDescriptor | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public MetadataDescriptor(final String propName)
{
this(propName, TYPE_STRING);
} |
Creates an instance.<br>
Capabilities are set to {@link ContainerType#METADATA_LIBRARY_OBJECT}.<br>
@param propName name of the metadata descriptor.
| MetadataDescriptor::MetadataDescriptor | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public MetadataDescriptor(final String propName, final int propType)
{
this(ContainerType.METADATA_LIBRARY_OBJECT, propName, propType, 0, 0);
} |
Creates an Instance.<br>
Capabilities are set to {@link ContainerType#METADATA_LIBRARY_OBJECT}.<br>
@param propName Name of the MetadataDescriptor.
@param propType Type of the metadata descriptor. See {@link #descriptorType}
| MetadataDescriptor::MetadataDescriptor | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public BigInteger asNumber()
{
BigInteger result = null;
switch (this.descriptorType)
{
case TYPE_BOOLEAN:
case TYPE_WORD:
case TYPE_DWORD:
case TYPE_QWORD:
case TYPE_BINARY:
if (this.content.length > 8)
{
throw new NumberFormatException("Binary data would exceed QWORD");
}
break;
case TYPE_GUID:
throw new NumberFormatException("GUID cannot be converted to a number.");
case TYPE_STRING:
result = new BigInteger(getString(), 10);
break;
default:
throw new IllegalStateException();
}
if (result == null)
{
final byte[] copy = new byte[this.content.length];
for (int i = 0; i < copy.length; i++)
{
copy[i] = this.content[this.content.length - (i + 1)];
}
result = new BigInteger(1, copy);
}
return result;
} |
Converts the descriptors value into a number if possible.<br>
A boolean will be converted to "1" if <code>true</code>,
otherwise "0".<br>
String will be interpreted as number with radix "10".<br>
Binary data will be interpreted as the default WORD,DWORD or QWORD binary
representation, but only if the data does not exceed 8 bytes. This
precaution is done to prevent creating a number of a multi kilobyte
image.<br>
A GUID cannot be converted in any case.
@return number representation.
@throws NumberFormatException If no conversion is supported.
| MetadataDescriptor::asNumber | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int compareTo(final MetadataDescriptor other)
{
return getName().compareTo(other.getName());
} |
{@inheritDoc}
| MetadataDescriptor::compareTo | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public MetadataDescriptor createCopy()
{
final MetadataDescriptor result = new MetadataDescriptor(this.containerType, this.name, this.descriptorType, this.streamNumber, this.languageIndex);
result.content = getRawData();
return result;
} |
This method creates a copy of the current object. <br>
All data will be copied, too. <br>
@return A new metadata descriptor containing the same values as the
current one.
| MetadataDescriptor::createCopy | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public boolean getBoolean()
{
return this.content.length > 0 && this.content[0] != 0;
} |
Returns the value of the MetadataDescriptor as a Boolean. <br>
If no Conversion is Possible false is returned. <br>
<code>true</code> if first byte of {@link #content}is not zero.
@return boolean representation of the current value.
| MetadataDescriptor::getBoolean | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public ContainerType getContainerType()
{
return this.containerType;
} |
Returns the container type this descriptor ist restricted to.
@return the container type
| MetadataDescriptor::getContainerType | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int getCurrentAsfSize(final ContainerType type)
{
/*
* 2 bytes name length, 2 bytes name zero term, 2 bytes type, 2 bytes
* content length
*/
int result = 8;
if (type != ContainerType.EXTENDED_CONTENT)
{
// Stream number and language index (respectively reserved field).
// And +2 bytes, because data type is 32 bit, not 16
result += 6;
}
result += getName().length() * 2;
if (this.getType() == TYPE_BOOLEAN)
{
result += 2;
if (type == ContainerType.EXTENDED_CONTENT)
{
// Extended content description boolean values are stored with
// 32-bit
result += 2;
}
}
else
{
result += this.content.length;
if (TYPE_STRING == this.getType())
{
result += 2; // zero term of content string.
}
}
return result;
} |
Returns the size (in bytes) this descriptor will take when written to an
ASF file.<br>
@param type the container type for which the size is calculated.
@return size of the descriptor in an ASF file.
| MetadataDescriptor::getCurrentAsfSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public GUID getGuid()
{
GUID result = null;
if (getType() == TYPE_GUID && this.content.length == GUID.GUID_LENGTH)
{
result = new GUID(this.content);
}
return result;
} |
Returns the GUID value, if content could represent one.
@return GUID value
| MetadataDescriptor::getGuid | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int getLanguageIndex()
{
return this.languageIndex;
} |
Returns the index of the language that is referred (see
{@link LanguageList}):
@return the language index
| MetadataDescriptor::getLanguageIndex | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public String getName()
{
return this.name;
} |
This method returns the name of the metadata descriptor.
@return Name.
| MetadataDescriptor::getName | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public long getNumber()
{
int bytesNeeded;
switch (getType())
{
case TYPE_BOOLEAN:
bytesNeeded = 1;
break;
case TYPE_DWORD:
bytesNeeded = 4;
break;
case TYPE_QWORD:
bytesNeeded = 8;
break;
case TYPE_WORD:
bytesNeeded = 2;
break;
default:
throw new UnsupportedOperationException("The current type doesn't allow an interpretation as a number. (" + getType() + ")");
}
if (bytesNeeded > this.content.length)
{
throw new IllegalStateException("The stored data cannot represent the type of current object.");
}
long result = 0;
for (int i = 0; i < bytesNeeded; i++)
{
result |= (((long) this.content[i] & 0xFF) << (i * 8));
}
return result;
} |
This method returns the value of the metadata descriptor as a long. <br>
Converts the needed amount of byte out of {@link #content}to a number. <br>
Only possible if {@link #getType()}equals on of the following: <br>
@return integer value.
@see #TYPE_BOOLEAN
@see #TYPE_DWORD
@see #TYPE_QWORD
@see #TYPE_WORD
| MetadataDescriptor::getNumber | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public byte[] getRawData()
{
final byte[] copy = new byte[this.content.length];
System.arraycopy(this.content, 0, copy, 0, this.content.length);
return copy;
} |
This method returns a copy of the content of the descriptor. <br>
@return The content in binary representation, as it would be written to
asf file. <br>
| MetadataDescriptor::getRawData | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int getRawDataSize()
{
return this.content.length;
} |
Returns the size (in bytes) the binary representation of the content
uses. (length of {@link #getRawData()})<br>
@return size of binary representation of the content.
| MetadataDescriptor::getRawDataSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int getStreamNumber()
{
return this.streamNumber;
} |
Returns the stream number this descriptor applies to.<br>
@return the stream number.
| MetadataDescriptor::getStreamNumber | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public String getString()
{
String result = null;
switch (getType())
{
case TYPE_BINARY:
result = "binary data";
break;
case TYPE_BOOLEAN:
result = String.valueOf(getBoolean());
break;
case TYPE_GUID:
result = getGuid() == null ? "Invalid GUID" : getGuid().toString();
break;
case TYPE_QWORD:
case TYPE_DWORD:
case TYPE_WORD:
result = String.valueOf(getNumber());
break;
case TYPE_STRING:
result = new String(this.content, StandardCharsets.UTF_16LE);
break;
default:
throw new IllegalStateException("Current type is not known.");
}
return result;
} |
Returns the value of the MetadataDescriptor as a String. <br>
@return String - Representation Value
| MetadataDescriptor::getString | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int getType()
{
return this.descriptorType;
} |
Returns the type of the metadata descriptor. <br>
@return the value of {@link #descriptorType}
@see #TYPE_BINARY
@see #TYPE_BOOLEAN
@see #TYPE_DWORD
@see #TYPE_GUID
@see #TYPE_QWORD
@see #TYPE_STRING
@see #TYPE_WORD
| MetadataDescriptor::getType | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public boolean isEmpty()
{
return this.content.length == 0;
} |
This method checks if the binary data is empty. <br>
Disregarding the type of the descriptor its content is stored as a byte
array.
@return <code>true</code> if no value is set.
| MetadataDescriptor::isEmpty | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setBinaryValue(final byte[] data) throws IllegalArgumentException
{
this.containerType.assertConstraints(this.name, data, this.descriptorType, this.streamNumber, this.languageIndex);
this.content = data.clone();
this.descriptorType = TYPE_BINARY;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_BINARY}.<br>
@param data Value to set.
@throws IllegalArgumentException if data is invalid for {@linkplain #getContainerType()
container}.
| MetadataDescriptor::setBinaryValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setBooleanValue(final boolean value)
{
this.content = new byte[]{value ? (byte) 1 : 0};
this.descriptorType = TYPE_BOOLEAN;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_BOOLEAN}.<br>
@param value Value to set.
| MetadataDescriptor::setBooleanValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setDWordValue(final long value)
{
if (value < 0 || value > DWORD_MAXVALUE)
{
throw new IllegalArgumentException("value out of range (0-" + DWORD_MAXVALUE + ")");
}
this.content = Utils.getBytes(value, 4);
this.descriptorType = TYPE_DWORD;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_DWORD}.
@param value Value to set.
| MetadataDescriptor::setDWordValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setGUIDValue(final GUID value)
{
this.containerType.assertConstraints(this.name, value.getBytes(), TYPE_GUID, this.streamNumber, this.languageIndex);
this.content = value.getBytes();
this.descriptorType = TYPE_GUID;
} |
Sets the value of the metadata descriptor.<br>
Using this method will change {@link #descriptorType} to
{@link #TYPE_GUID}
@param value value to set.
| MetadataDescriptor::setGUIDValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setLanguageIndex(final int language)
{
this.containerType.assertConstraints(this.name, this.content, this.descriptorType, this.streamNumber, language);
this.languageIndex = language;
} |
Sets the index of the referred language (see {@link LanguageList}).<br>
<b>Consider</b>: The {@linkplain #containerType requirements} must be
held.
@param language the language index to set
| MetadataDescriptor::setLanguageIndex | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setQWordValue(final BigInteger value) throws IllegalArgumentException
{
if (value == null)
{
throw new NumberFormatException("null");
}
if (BigInteger.ZERO.compareTo(value) > 0)
{
throw new IllegalArgumentException("Only unsigned values allowed (no negative)");
}
if (MetadataDescriptor.QWORD_MAXVALUE.compareTo(value) < 0)
{
throw new IllegalArgumentException("Value exceeds QWORD (64 bit unsigned)");
}
this.content = new byte[8];
final byte[] valuesBytes = value.toByteArray();
if (valuesBytes.length <= 8)
{
for (int i = valuesBytes.length - 1; i >= 0; i--)
{
this.content[valuesBytes.length - (i + 1)] = valuesBytes[i];
}
}
else
{
/*
* In case of 64-Bit set
*/
Arrays.fill(this.content, (byte) 0xFF);
}
this.descriptorType = TYPE_QWORD;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_QWORD}
@param value Value to set.
@throws NumberFormatException on <code>null</code> values.
@throws IllegalArgumentException on illegal values or values exceeding range.
| MetadataDescriptor::setQWordValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setQWordValue(final long value)
{
if (value < 0)
{
throw new IllegalArgumentException("value out of range (0-" + MetadataDescriptor.QWORD_MAXVALUE + ")");
}
this.content = Utils.getBytes(value, 8);
this.descriptorType = TYPE_QWORD;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_QWORD}
@param value Value to set.
| MetadataDescriptor::setQWordValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setStreamNumber(final int stream)
{
this.containerType.assertConstraints(this.name, this.content, this.descriptorType, stream, this.languageIndex);
this.streamNumber = stream;
} |
Sets the stream number the descriptor applies to.<br>
<b>Consider</b>: The {@linkplain #containerType requirements} must be
held.
@param stream the stream number to set
| MetadataDescriptor::setStreamNumber | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setString(final String value) throws IllegalArgumentException
{
try
{
switch (getType())
{
case TYPE_BINARY:
throw new IllegalArgumentException("Cannot interpret binary as string.");
case TYPE_BOOLEAN:
setBooleanValue(Boolean.parseBoolean(value));
break;
case TYPE_DWORD:
setDWordValue(Long.parseLong(value));
break;
case TYPE_QWORD:
setQWordValue(new BigInteger(value, 10));
break;
case TYPE_WORD:
setWordValue(Integer.parseInt(value));
break;
case TYPE_GUID:
setGUIDValue(GUID.parseGUID(value));
break;
case TYPE_STRING:
setStringValue(value);
break;
default:
// new Type added but not handled.
throw new IllegalStateException();
}
}
catch (final NumberFormatException nfe)
{
throw new IllegalArgumentException("Value cannot be parsed as Number or is out of range (\"" + value + "\")", nfe);
}
} |
This method converts the given string value into the current
{@linkplain #getType() data type}.
@param value value to set.
@throws IllegalArgumentException If conversion was impossible.
| MetadataDescriptor::setString | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public void setWordValue(final int value) throws IllegalArgumentException
{
if (value < 0 || value > WORD_MAXVALUE)
{
throw new IllegalArgumentException("value out of range (0-" + WORD_MAXVALUE + ")");
}
this.content = Utils.getBytes(value, 2);
this.descriptorType = TYPE_WORD;
} |
Sets the Value of the current metadata descriptor. <br>
Using this method will change {@link #descriptorType}to
{@link #TYPE_WORD}
@param value Value to set.
@throws IllegalArgumentException on negative values. ASF just supports unsigned values.
| MetadataDescriptor::setWordValue | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public int writeInto(final OutputStream out, final ContainerType contType) throws IOException
{
final int size = getCurrentAsfSize(contType);
/*
* Booleans are stored as one byte, if a boolean is written, the data
* must be converted according to the container type.
*/
byte[] binaryData;
if (this.descriptorType == TYPE_BOOLEAN)
{
binaryData = new byte[contType == ContainerType.EXTENDED_CONTENT ? 4 : 2];
binaryData[0] = (byte) (getBoolean() ? 1 : 0);
}
else
{
binaryData = this.content;
}
// for Metadata objects the stream number and language index
if (contType != ContainerType.EXTENDED_CONTENT)
{
Utils.writeUINT16(getLanguageIndex(), out);
Utils.writeUINT16(getStreamNumber(), out);
}
Utils.writeUINT16(getName().length() * 2 + 2, out);
// The name for the metadata objects come later
if (contType == ContainerType.EXTENDED_CONTENT)
{
out.write(Utils.getBytes(getName(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
}
// type and content len follow up are identical
final int type = getType();
Utils.writeUINT16(type, out);
int contentLen = binaryData.length;
if (TYPE_STRING == type)
{
contentLen += 2; // Zero Term
}
if (contType == ContainerType.EXTENDED_CONTENT)
{
Utils.writeUINT16(contentLen, out);
}
else
{
Utils.writeUINT32(contentLen, out);
}
// Metadata objects now write their descriptor name
if (contType != ContainerType.EXTENDED_CONTENT)
{
out.write(Utils.getBytes(getName(), AsfHeader.ASF_CHARSET));
out.write(AsfHeader.ZERO_TERM);
}
// The content.
out.write(binaryData);
if (TYPE_STRING == type)
{
out.write(AsfHeader.ZERO_TERM);
}
return size;
} |
Writes this descriptor into the specified output stream.<br>
@param out stream to write into.
@param contType the container type this descriptor is written to.
@return amount of bytes written.
@throws IOException on I/O Errors
| MetadataDescriptor::writeInto | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataDescriptor.java | Apache-2.0 |
public GUIDFormatException(final String detail)
{
super(detail);
} |
Creates an instance.
@param detail detail message.
| GUIDFormatException::GUIDFormatException | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/GUIDFormatException.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/GUIDFormatException.java | Apache-2.0 |
public FileHeader(final BigInteger chunckLen, final BigInteger size, final BigInteger fileTime, final BigInteger pkgCount, final BigInteger dur, final BigInteger timestampStart, final BigInteger timestampEnd, final long headerFlags, final long minPkgSize, final long maxPkgSize, final long uncmpVideoFrameSize)
{
super(GUID.GUID_FILE, chunckLen);
this.fileSize = size;
this.packageCount = pkgCount;
this.duration = dur;
this.timeStartPos = timestampStart;
this.timeEndPos = timestampEnd;
this.flags = headerFlags;
this.minPackageSize = minPkgSize;
this.maxPackageSize = maxPkgSize;
this.uncompressedFrameSize = uncmpVideoFrameSize;
this.fileCreationTime = Utils.getDateOf(fileTime).getTime();
} |
Creates an instance.
@param chunckLen Length of the file header (chunk)
@param size Size of file or stream
@param fileTime Time file or stream was created. Time is calculated since 1st
january of 1601 in 100ns steps.
@param pkgCount Number of stream packages.
@param dur Duration of media clip in 100ns steps
@param timestampStart Timestamp of start {@link #timeStartPos}
@param timestampEnd Timestamp of end {@link #timeEndPos}
@param headerFlags some stream related flags.
@param minPkgSize minimum size of packages
@param maxPkgSize maximum size of packages
@param uncmpVideoFrameSize Size of an uncompressed Video Frame.
| FileHeader::FileHeader | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public BigInteger getDuration()
{
return this.duration;
} |
@return Returns the duration.
| FileHeader::getDuration | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public int getDurationInSeconds()
{
return this.duration.divide(new BigInteger("10000000")).intValue();
} |
This method converts {@link #getDuration()}from 100ns steps to normal
seconds.
@return Duration of the media in seconds.
| FileHeader::getDurationInSeconds | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public Date getFileCreationTime()
{
return new Date(this.fileCreationTime.getTime());
} |
@return Returns the fileCreationTime.
| FileHeader::getFileCreationTime | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public BigInteger getFileSize()
{
return this.fileSize;
} |
@return Returns the fileSize.
| FileHeader::getFileSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public long getFlags()
{
return this.flags;
} |
@return Returns the flags.
| FileHeader::getFlags | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public long getMaxPackageSize()
{
return this.maxPackageSize;
} |
@return Returns the maxPackageSize.
| FileHeader::getMaxPackageSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public long getMinPackageSize()
{
return this.minPackageSize;
} |
@return Returns the minPackageSize.
| FileHeader::getMinPackageSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public BigInteger getPackageCount()
{
return this.packageCount;
} |
@return Returns the packageCount.
| FileHeader::getPackageCount | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public float getPreciseDuration()
{
return (float) (getDuration().doubleValue() / 10000000d);
} |
This method converts {@link #getDuration()} from 100ns steps to normal
seconds with a fractional part taking milliseconds.<br>
@return The duration of the media in seconds (with a precision of
milliseconds)
| FileHeader::getPreciseDuration | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public BigInteger getTimeEndPos()
{
return this.timeEndPos;
} |
@return Returns the timeEndPos.
| FileHeader::getTimeEndPos | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public BigInteger getTimeStartPos()
{
return this.timeStartPos;
} |
@return Returns the timeStartPos.
| FileHeader::getTimeStartPos | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public long getUncompressedFrameSize()
{
return this.uncompressedFrameSize;
} |
@return Returns the uncompressedFrameSize.
| FileHeader::getUncompressedFrameSize | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/FileHeader.java | Apache-2.0 |
public AudioStreamChunk(final BigInteger chunkLen)
{
super(GUID.GUID_AUDIOSTREAM, chunkLen);
} |
Creates an instance.
@param chunkLen Length of the entire chunk (including guid and size)
| AudioStreamChunk::AudioStreamChunk | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public long getAverageBytesPerSec()
{
return this.averageBytesPerSec;
} |
@return Returns the averageBytesPerSec.
| AudioStreamChunk::getAverageBytesPerSec | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public int getBitsPerSample()
{
return this.bitsPerSample;
} |
@return Returns the bitsPerSample.
| AudioStreamChunk::getBitsPerSample | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public long getBlockAlignment()
{
return this.blockAlignment;
} |
@return Returns the blockAlignment.
| AudioStreamChunk::getBlockAlignment | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public long getChannelCount()
{
return this.channelCount;
} |
@return Returns the channelCount.
| AudioStreamChunk::getChannelCount | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public byte[] getCodecData()
{
return this.codecData.clone();
} |
@return Returns the codecData.
| AudioStreamChunk::getCodecData | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public String getCodecDescription()
{
final StringBuilder result = new StringBuilder(Long.toHexString(getCompressionFormat()));
String furtherDesc = " (Unknown)";
for (final String[] aCODEC_DESCRIPTIONS : CODEC_DESCRIPTIONS)
{
if (aCODEC_DESCRIPTIONS[0].equalsIgnoreCase(result.toString()))
{
furtherDesc = aCODEC_DESCRIPTIONS[1];
break;
}
}
if (result.length() % 2 == 0)
{
result.insert(0, "0x");
}
else
{
result.insert(0, "0x0");
}
result.append(furtherDesc);
return result.toString();
} |
This method will take a look at {@link #compressionFormat}and returns a
String with its hex value and if known a textual note on what coded it
represents. <br>
@return A description for the used codec.
| AudioStreamChunk::getCodecDescription | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public long getCompressionFormat()
{
return this.compressionFormat;
} |
@return Returns the compressionFormat.
| AudioStreamChunk::getCompressionFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public GUID getErrorConcealment()
{
return this.errorConcealment;
} |
@return Returns the errorConcealment.
| AudioStreamChunk::getErrorConcealment | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public int getKbps()
{
return (int) getAverageBytesPerSec() * 8 / 1000;
} |
This method takes the value of {@link #getAverageBytesPerSec()}and
calculates the kbps out of it, by simply multiplying by 8 and dividing by
1000. <br>
@return amount of bits per second in kilo bits.
| AudioStreamChunk::getKbps | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public long getSamplingRate()
{
return this.samplingRate;
} |
@return Returns the samplingRate.
| AudioStreamChunk::getSamplingRate | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public boolean isErrorConcealed()
{
return getErrorConcealment().equals(GUID.GUID_AUDIO_ERROR_CONCEALEMENT_INTERLEAVED);
} |
This mehtod returns whether the audio stream data is error concealed. <br>
For now only interleaved concealment is known. <br>
@return <code>true</code> if error concealment is used.
| AudioStreamChunk::isErrorConcealed | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setAverageBytesPerSec(final long avgeBytesPerSec)
{
this.averageBytesPerSec = avgeBytesPerSec;
} |
@param avgeBytesPerSec The averageBytesPerSec to set.
| AudioStreamChunk::setAverageBytesPerSec | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setBitsPerSample(final int bps)
{
this.bitsPerSample = bps;
} |
Sets the bitsPerSample
@param bps
| AudioStreamChunk::setBitsPerSample | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setBlockAlignment(final long align)
{
this.blockAlignment = align;
} |
Sets the blockAlignment.
@param align
| AudioStreamChunk::setBlockAlignment | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setChannelCount(final long channels)
{
this.channelCount = channels;
} |
@param channels The channelCount to set.
| AudioStreamChunk::setChannelCount | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setCodecData(final byte[] codecSpecificData)
{
if (codecSpecificData == null)
{
throw new IllegalArgumentException();
}
this.codecData = codecSpecificData.clone();
} |
Sets the codecData
@param codecSpecificData
| AudioStreamChunk::setCodecData | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setCompressionFormat(final long cFormatCode)
{
this.compressionFormat = cFormatCode;
} |
@param cFormatCode The compressionFormat to set.
| AudioStreamChunk::setCompressionFormat | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setErrorConcealment(final GUID errConc)
{
this.errorConcealment = errConc;
} |
This method sets the error concealment type which is given by two GUIDs. <br>
@param errConc the type of error concealment the audio stream is stored as.
| AudioStreamChunk::setErrorConcealment | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public void setSamplingRate(final long sampRate)
{
this.samplingRate = sampRate;
} |
@param sampRate The samplingRate to set.
| AudioStreamChunk::setSamplingRate | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/AudioStreamChunk.java | Apache-2.0 |
public DescriptorPointer(final MetadataDescriptor descriptor)
{
setDescriptor(descriptor);
} |
Creates an instance.
@param descriptor the metadata descriptor to identify.
| DescriptorPointer::DescriptorPointer | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | Apache-2.0 |
private DescriptorPointer setDescriptor(final MetadataDescriptor descriptor)
{
assert descriptor != null;
this.desc = descriptor;
return this;
} |
Sets the descriptor to identify.
@param descriptor the descriptor to identify.
@return this instance.
| DescriptorPointer::setDescriptor | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | Apache-2.0 |
private static ContainerType determineType(final GUID guid) throws IllegalArgumentException
{
assert guid != null;
ContainerType result = null;
for (final ContainerType curr : ContainerType.values())
{
if (curr.getContainerGUID().equals(guid))
{
result = curr;
break;
}
}
if (result == null)
{
throw new IllegalArgumentException("Unknown metadata container specified by GUID (" + guid + ")");
}
return result;
} |
Looks up all {@linkplain ContainerType#getContainerGUID() guids} and
returns the matching type.
@param guid GUID to look up
@return matching container type.
@throws IllegalArgumentException if no container type matches
| DescriptorPointer::determineType | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | Apache-2.0 |
public MetadataContainer(final ContainerType type)
{
this(type, 0, BigInteger.ZERO);
} |
Creates an instance.
@param type determines the type of the container
| DescriptorPointer::MetadataContainer | java | ZTFtrue/MonsterMusic | app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | https://github.com/ZTFtrue/MonsterMusic/blob/master/app/src/main/java/org/jaudiotagger/audio/asf/data/MetadataContainer.java | Apache-2.0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.