package mg.dot.feufaro.solfa

class POneVoiceNote {
    val oneVoiceNote: MutableList<PNotes> = mutableListOf()
    companion object {
        var nextMarkers: MutableList<String> = mutableListOf()
    }
    private var nextNote: String = ""
    fun addNextMarker(marker: Char) {
        nextMarkers.add(marker.toString())
    }
    fun appendLastNote(note: Char) {
        oneVoiceNote.lastOrNull()?.appendNote(note)
    }
    fun appendLastMarker(marker: Char) {
        oneVoiceNote.lastOrNull()?.addMarker(marker.toString())
    }
    fun addItem(noteString: String = "") {
        val newNote: PNotes = PNotes(noteString, nextMarkers)
        oneVoiceNote.add(newNote)
        nextNote = ""
        nextMarkers = mutableListOf()
    }
}