Skip to content

Commit

Permalink
Removed internal visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWoitaschek committed Jul 19, 2017
1 parent ae99b0f commit 53988d0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ fun readChaptersFromMatroska(file: File): SparseArray<String> {
return emptySparseArray()
}

internal fun List<MatroskaChapter>.flattenToSparseArray(
fun List<MatroskaChapter>.flattenToSparseArray(
vararg preferredLanguages: String): SparseArray<String> {
val res = SparseArray<String>()

fun addChapter(chapters: List<MatroskaChapter>, depth: Int) {
chapters.forEachIndexed { i, chapter ->
res.put(
// Simple hack with adding depth is needed because chapter
// and it's first subchapter have usually the same starting time.
// and it's first sub-chapter have usually the same starting time.
(chapter.startTime / 1000000).toInt() + if (i == 0) depth else 0,
"+ ".repeat(depth) + (chapter.getName(*preferredLanguages) ?: "Chapter ${i + 1}"))
addChapter(chapter.children, depth + 1)
Expand All @@ -49,7 +49,7 @@ internal fun List<MatroskaChapter>.flattenToSparseArray(
return res
}

internal fun readMatroskaChapters(file: File): List<MatroskaChapter> {
fun readMatroskaChapters(file: File): List<MatroskaChapter> {
// Reference MatroskaDocTypes to force static init of its members which
// register in static map used when identifying EBML Element types.
MatroskaDocTypes.Void.level
Expand Down Expand Up @@ -198,9 +198,9 @@ class MatroskaParseException(message: String) : RuntimeException(message)

private infix fun <T : Element> Element?.isType(t: ProtoType<T>) = this != null && isType(t.type)

internal data class MatroskaChapterName(val name: String, val languages: Set<String>)
data class MatroskaChapterName(val name: String, val languages: Set<String>)

internal data class MatroskaChapter(
data class MatroskaChapter(
val startTime: Long,
val names: List<MatroskaChapterName>,
val children: List<MatroskaChapter>) {
Expand Down

0 comments on commit 53988d0

Please sign in to comment.