Skip to content

Commit

Permalink
Merge pull request #21 from lavalink-devs/reformat-remaining-files
Browse files Browse the repository at this point in the history
Reformat missed files
  • Loading branch information
nikammerlaan authored Aug 4, 2023
2 parents 0bce048 + e3ef890 commit 61089ff
Show file tree
Hide file tree
Showing 20 changed files with 424 additions and 421 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Reformat code to 4 space indents
9565a0d600a7ab8e302b840b93d2d4e05de7b573

# Reformat missed code to 4 space indents
2d4aa92ef49d27aad40c50ddc454844cf58d7ebe
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* Standard mime types and codec names for supported formats.
*/
public class Formats {
public static final String MIME_AUDIO_WEBM = "audio/webm";
public static final String MIME_VIDEO_WEBM = "video/webm";
public static final String MIME_AUDIO_MP4 = "audio/mp4";
public static final String MIME_VIDEO_MP4 = "video/mp4";
public static final String MIME_AUDIO_WEBM = "audio/webm";
public static final String MIME_VIDEO_WEBM = "video/webm";
public static final String MIME_AUDIO_MP4 = "audio/mp4";
public static final String MIME_VIDEO_MP4 = "video/mp4";

public static final String CODEC_OPUS = "opus";
public static final String CODEC_VORBIS = "vorbis";
public static final String CODEC_AAC_LC = "mp4a.40.2";
public static final String CODEC_OPUS = "opus";
public static final String CODEC_VORBIS = "vorbis";
public static final String CODEC_AAC_LC = "mp4a.40.2";
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,50 @@
* ADTS packet header.
*/
public class AdtsPacketHeader {
/**
* If this is false, then the packet header is followed by a 2-byte CRC.
*/
public final boolean isProtectionAbsent;
/**
* Decoder profile (2 is AAC-LC).
*/
public final int profile;
/**
* Sample rate.
*/
public final int sampleRate;
/**
* Number of channels.
*/
public final int channels;
/**
* Packet payload length, excluding the CRC after this header.
*/
public final int payloadLength;
/**
* If this is false, then the packet header is followed by a 2-byte CRC.
*/
public final boolean isProtectionAbsent;
/**
* Decoder profile (2 is AAC-LC).
*/
public final int profile;
/**
* Sample rate.
*/
public final int sampleRate;
/**
* Number of channels.
*/
public final int channels;
/**
* Packet payload length, excluding the CRC after this header.
*/
public final int payloadLength;

/**
* @param isProtectionAbsent If this is false, then the packet header is followed by a 2-byte CRC.
* @param profile Decoder profile (2 is AAC-LC).
* @param sampleRate Sample rate.
* @param channels Number of channels.
* @param payloadLength Packet payload length, excluding the CRC after this header.
*/
public AdtsPacketHeader(boolean isProtectionAbsent, int profile, int sampleRate, int channels, int payloadLength) {
this.isProtectionAbsent = isProtectionAbsent;
this.profile = profile;
this.sampleRate = sampleRate;
this.channels = channels;
this.payloadLength = payloadLength;
}
/**
* @param isProtectionAbsent If this is false, then the packet header is followed by a 2-byte CRC.
* @param profile Decoder profile (2 is AAC-LC).
* @param sampleRate Sample rate.
* @param channels Number of channels.
* @param payloadLength Packet payload length, excluding the CRC after this header.
*/
public AdtsPacketHeader(boolean isProtectionAbsent, int profile, int sampleRate, int channels, int payloadLength) {
this.isProtectionAbsent = isProtectionAbsent;
this.profile = profile;
this.sampleRate = sampleRate;
this.channels = channels;
this.payloadLength = payloadLength;
}

/**
* @param packetHeader The packet to check against.
* @return True if the decoder does not have to be reconfigured between these two packets.
*/
public boolean canUseSameDecoder(AdtsPacketHeader packetHeader) {
return packetHeader != null &&
profile == packetHeader.profile &&
sampleRate == packetHeader.sampleRate &&
channels == packetHeader.channels;
}
/**
* @param packetHeader The packet to check against.
* @return True if the decoder does not have to be reconfigured between these two packets.
*/
public boolean canUseSameDecoder(AdtsPacketHeader packetHeader) {
return packetHeader != null &&
profile == packetHeader.profile &&
sampleRate == packetHeader.sampleRate &&
channels == packetHeader.channels;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
* of the table.
*/
public class FlacSeekPoint {
public static final int LENGTH = 18;
public static final int LENGTH = 18;

/**
* Sample number of first sample in the target frame, or 0xFFFFFFFFFFFFFFFF for a placeholder point.
*/
public final long sampleIndex;
/**
* Sample number of first sample in the target frame, or 0xFFFFFFFFFFFFFFFF for a placeholder point.
*/
public final long sampleIndex;

/**
* Offset (in bytes) from the first byte of the first frame header to the first byte of the target frame's header.
*/
public final long byteOffset;
/**
* Offset (in bytes) from the first byte of the first frame header to the first byte of the target frame's header.
*/
public final long byteOffset;

/**
* Number of samples in the target frame.
*/
public final int sampleCount;
/**
* Number of samples in the target frame.
*/
public final int sampleCount;

/**
* @param sampleIndex Index of the first sample in the frame
* @param byteOffset Offset in bytes from first frame start to target frame start
* @param sampleCount Number of samples in the frame
*/
public FlacSeekPoint(long sampleIndex, long byteOffset, int sampleCount) {
this.sampleIndex = sampleIndex;
this.byteOffset = byteOffset;
this.sampleCount = sampleCount;
}
/**
* @param sampleIndex Index of the first sample in the frame
* @param byteOffset Offset in bytes from first frame start to target frame start
* @param sampleCount Number of samples in the frame
*/
public FlacSeekPoint(long sampleIndex, long byteOffset, int sampleCount) {
this.sampleIndex = sampleIndex;
this.byteOffset = byteOffset;
this.sampleCount = sampleCount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@
* actually needed, since it is an error if they differ from the ones specified in the file metadata.
*/
public class FlacFrameInfo {
/**
* Number of samples in each subframe of this frame.
*/
public final int sampleCount;

/**
* The way stereo channel data is related. With stereo frames, one channel can contain its original data and the other
* just the difference from the first one, which allows for better compression for the other channel.
*/
public final ChannelDelta channelDelta;
/**
* Number of samples in each subframe of this frame.
*/
public final int sampleCount;

/**
* @param sampleCount Number of samples in each subframe of this frame
* @param channelDelta Channel data delta setting
*/
public FlacFrameInfo(int sampleCount, ChannelDelta channelDelta) {
this.sampleCount = sampleCount;
this.channelDelta = channelDelta;
}
/**
* The way stereo channel data is related. With stereo frames, one channel can contain its original data and the other
* just the difference from the first one, which allows for better compression for the other channel.
*/
public final ChannelDelta channelDelta;

/**
* The relationship between stereo channels.
*/
public enum ChannelDelta {
NONE(-1),
LEFT_SIDE(1),
RIGHT_SIDE(0),
MID_SIDE(1);
/**
* @param sampleCount Number of samples in each subframe of this frame
* @param channelDelta Channel data delta setting
*/
public FlacFrameInfo(int sampleCount, ChannelDelta channelDelta) {
this.sampleCount = sampleCount;
this.channelDelta = channelDelta;
}

/**
* The index of the channel containing delta values.
* The relationship between stereo channels.
*/
public final int deltaChannel;
public enum ChannelDelta {
NONE(-1),
LEFT_SIDE(1),
RIGHT_SIDE(0),
MID_SIDE(1);

/**
* The index of the channel containing delta values.
*/
public final int deltaChannel;

ChannelDelta(int deltaChannel) {
this.deltaChannel = deltaChannel;
ChannelDelta(int deltaChannel) {
this.deltaChannel = deltaChannel;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
* Matroska file cue point. Provides the offsets at a specific timecode for each track
*/
public class MatroskaCuePoint {
/**
* Timecode using the file timescale
*/
public final long timecode;
/**
* Absolute offset to the cluster
*/
public final long[] trackClusterOffsets;
/**
* Timecode using the file timescale
*/
public final long timecode;
/**
* Absolute offset to the cluster
*/
public final long[] trackClusterOffsets;

/**
* @param timecode Timecode using the file timescale
* @param trackClusterOffsets Absolute offset to the cluster
*/
public MatroskaCuePoint(long timecode, long[] trackClusterOffsets) {
this.timecode = timecode;
this.trackClusterOffsets = trackClusterOffsets;
}
/**
* @param timecode Timecode using the file timescale
* @param trackClusterOffsets Absolute offset to the cluster
*/
public MatroskaCuePoint(long timecode, long[] trackClusterOffsets) {
this.timecode = timecode;
this.trackClusterOffsets = trackClusterOffsets;
}
}
Loading

0 comments on commit 61089ff

Please sign in to comment.