commonMain.objects.music._allMusic.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of emoji-kt-jvm Show documentation
Show all versions of emoji-kt-jvm Show documentation
Emoji support for Kotlin/Multiplatform
The newest version!
package org.kodein.emoji.objects.music
import org.kodein.emoji.Emoji
import org.kodein.emoji.EmojiFinder
import org.kodein.emoji.addSt1Variations
import org.kodein.emoji.addSt2Variations
internal fun EmojiFinder.addAllMusic() {
add(intArrayOf(0x1f3bc), _MusicalScore)
add(intArrayOf(0x1f3b5), _MusicalNote)
add(intArrayOf(0x1f3b6), _MusicalNotes)
add(intArrayOf(0x1f399, 0xfe0f), _StudioMicrophone)
add(intArrayOf(0x1f399), _StudioMicrophone)
add(intArrayOf(0x1f39a, 0xfe0f), _LevelSlider)
add(intArrayOf(0x1f39a), _LevelSlider)
add(intArrayOf(0x1f39b, 0xfe0f), _ControlKnobs)
add(intArrayOf(0x1f39b), _ControlKnobs)
add(intArrayOf(0x1f3a4), _Microphone)
add(intArrayOf(0x1f3a7), _Headphone)
add(intArrayOf(0x1f4fb), _Radio)
}
internal suspend fun SequenceScope.yieldAllMusic() {
yield(_MusicalScore)
yield(_MusicalNote)
yield(_MusicalNotes)
yield(_StudioMicrophone)
yield(_LevelSlider)
yield(_ControlKnobs)
yield(_Microphone)
yield(_Headphone)
yield(_Radio)
}
internal val countMusic = 9
/**
* All Emoji of the Objects: music subgroup.
*/
public fun Emoji.Companion.sequenceMusic(): Sequence =
sequence { yieldAllMusic() }
/**
* All Emoji of the Objects: music subgroup.
*
* WARNING: This can be quite heavy to construct.
* This method should be called in background and its result should be cached.
*/
public fun Emoji.Companion.listMusic(): List =
ArrayList(countMusic).also { list -> sequenceMusic().forEach { list.add(it) } }
@Deprecated("Renamed listMusic.", replaceWith = ReplaceWith("listMusic()"), level = DeprecationLevel.WARNING)
public fun Emoji.Companion.allMusic(): List =
listMusic()
© 2015 - 2025 Weber Informatics LLC | Privacy Policy