Skip to content

Commit 7fccda1

Browse files
committed
Fixed build
1 parent 1871665 commit 7fccda1

File tree

20 files changed

+67
-20
lines changed

20 files changed

+67
-20
lines changed

core/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ android {
1414
}
1515

1616
kotlin {
17+
jvmToolchain(17)
18+
1719
androidTarget().apply {
1820
publishAllLibraryVariants()
1921
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package pl.lemanski.mikroSoundFont.generator
2+
3+
actual fun getGenerator(): Generator {
4+
TODO("Not yet implemented")
5+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package pl.lemanski.mikroSoundFont.io.wav
2+
3+
import java.nio.ByteBuffer
4+
import java.nio.ByteOrder
5+
6+
actual fun WavFileHeader.toByteArray(): ByteArray {
7+
val byteArray = ByteArray(44) // The size is based on the structure
8+
val buffer = ByteBuffer.wrap(byteArray).order(ByteOrder.LITTLE_ENDIAN)
9+
buffer.put(chunkID.toByteArray(Charsets.UTF_8), 0, 4)
10+
11+
buffer.putInt(4, chunkSize.toInt())
12+
13+
buffer.position(8)
14+
buffer.put(format.toByteArray(Charsets.UTF_8), 0, 4)
15+
16+
buffer.position(12)
17+
buffer.put(subchunk1ID.toByteArray(Charsets.UTF_8), 0, 4)
18+
19+
buffer.putInt(16, subchunk1Size.toInt())
20+
21+
buffer.putShort(20, audioFormat.toShort())
22+
23+
buffer.putShort(22, numChannels.toShort())
24+
25+
buffer.putInt(24, sampleRate.toInt())
26+
27+
buffer.putInt(28, byteRate.toInt())
28+
29+
buffer.putShort(32, blockAlign.toShort())
30+
31+
buffer.putShort(34, bitsPerSample.toShort())
32+
33+
buffer.position(36)
34+
buffer.put(subchunk2ID.toByteArray(Charsets.UTF_8), 0, 4)
35+
36+
buffer.putInt(40, subchunk2Size.toInt())
37+
38+
return byteArray
39+
}

core/src/androidMain/kotlin/pl/lemanski/pandamidi/io/wav/WavFileHeader.android.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/Chord.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/Chord.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
22

33
sealed interface Chord {
44
fun notes(): List<Note>

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/ChordBuilder.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/ChordBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
22

33
import kotlin.collections.distinct
44
import kotlin.collections.sorted

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/ChordBuilderExt.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/ChordBuilderExt.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
22

33
// Triads
44

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/Interval.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/Interval.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
22

33
data class Interval(private val semitones: Int) {
44

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/Note.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/Note.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
2+
3+
import kotlin.jvm.JvmInline
24

35
//+------+----+----+----+----+----+----+----+----+----+----+----+
46
//| Note | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
@@ -21,6 +23,7 @@ package pl.lemanski.pandamidi.core
2123
* This class represents a MIDI note.
2224
*/
2325

26+
@JvmInline
2427
value class Note(val value: Int) : Comparable<Note> {
2528
init {
2629
require(value in 0..127) {

core/src/commonMain/kotlin/pl/lemanski/pandamidi/core/TimeSignature.kt renamed to core/src/commonMain/kotlin/pl/lemanski/mikroSoundFont/core/TimeSignature.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package pl.lemanski.pandamidi.core
1+
package pl.lemanski.mikroSoundFont.core
22

33
data class TimeSignature(
44
val numerator: Int,

0 commit comments

Comments
 (0)