diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
new file mode 100644
index 0000000..c93b6e7
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.util
+
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import androidx.viewbinding.ViewBinding
+
+open class EasyDialogFragment : DialogFragment() {
+ lateinit var binding: T
+
+ override fun onStart() {
+ super.onStart()
+ dialog?.window?.setLayout(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
+}
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
new file mode 100644
index 0000000..c93b6e7
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.util
+
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import androidx.viewbinding.ViewBinding
+
+open class EasyDialogFragment : DialogFragment() {
+ lateinit var binding: T
+
+ override fun onStart() {
+ super.onStart()
+ dialog?.window?.setLayout(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_effects.xml b/app/src/main/res/layout/fragment_edit_effects.xml
new file mode 100644
index 0000000..46d4648
--- /dev/null
+++ b/app/src/main/res/layout/fragment_edit_effects.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
new file mode 100644
index 0000000..c93b6e7
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.util
+
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import androidx.viewbinding.ViewBinding
+
+open class EasyDialogFragment : DialogFragment() {
+ lateinit var binding: T
+
+ override fun onStart() {
+ super.onStart()
+ dialog?.window?.setLayout(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_effects.xml b/app/src/main/res/layout/fragment_edit_effects.xml
new file mode 100644
index 0000000..46d4648
--- /dev/null
+++ b/app/src/main/res/layout/fragment_edit_effects.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_instrument.xml b/app/src/main/res/layout/fragment_edit_instrument.xml
index 55e667b..eb66f19 100644
--- a/app/src/main/res/layout/fragment_edit_instrument.xml
+++ b/app/src/main/res/layout/fragment_edit_instrument.xml
@@ -14,6 +14,31 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EditInstrumentFragment">
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@+id/editEffectsButton" />
+ app:layout_constraintTop_toTopOf="@+id/editEffectsButton" />
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
new file mode 100644
index 0000000..c93b6e7
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.util
+
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import androidx.viewbinding.ViewBinding
+
+open class EasyDialogFragment : DialogFragment() {
+ lateinit var binding: T
+
+ override fun onStart() {
+ super.onStart()
+ dialog?.window?.setLayout(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_effects.xml b/app/src/main/res/layout/fragment_edit_effects.xml
new file mode 100644
index 0000000..46d4648
--- /dev/null
+++ b/app/src/main/res/layout/fragment_edit_effects.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_instrument.xml b/app/src/main/res/layout/fragment_edit_instrument.xml
index 55e667b..eb66f19 100644
--- a/app/src/main/res/layout/fragment_edit_instrument.xml
+++ b/app/src/main/res/layout/fragment_edit_instrument.xml
@@ -14,6 +14,31 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EditInstrumentFragment">
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@+id/editEffectsButton" />
+ app:layout_constraintTop_toTopOf="@+id/editEffectsButton" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_effect.xml b/app/src/main/res/layout/fragment_effect.xml
new file mode 100644
index 0000000..ff90aa8
--- /dev/null
+++ b/app/src/main/res/layout/fragment_effect.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 66c49ef..bf86c48 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -11,9 +11,11 @@
+
+
diff --git a/app/src/main/java/com/lukas/music/instruments/Instrument.kt b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
index 3013335..53ec4ad 100644
--- a/app/src/main/java/com/lukas/music/instruments/Instrument.kt
+++ b/app/src/main/java/com/lukas/music/instruments/Instrument.kt
@@ -10,6 +10,8 @@
package com.lukas.music.instruments
+import com.lukas.music.instruments.effect.Effect
+import com.lukas.music.instruments.effect.EffectType
import com.lukas.music.song.note.Note
import com.lukas.music.song.voice.BassVoice
import com.lukas.music.song.voice.Voice
@@ -17,6 +19,10 @@
abstract class Instrument(var name: String) {
var voice: Voice = BassVoice(this)
var envelope = Envelope(this)
+ val effects = Array(EffectType.VALUES.size) {
+ Effect(EffectType.VALUES[it])
+ }
+
abstract var waveform: Waveform
abstract var volume: Float
abstract var muted: Boolean
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
new file mode 100644
index 0000000..ebc64d1
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/Effect.kt
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+class Effect(val type: EffectType)
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
new file mode 100644
index 0000000..8b7767b
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/instruments/effect/EffectType.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.instruments.effect
+
+enum class EffectType(val description: String, val parameter1Name: String) {
+ LowPass("low pass filter", "cutoff frequency"),
+ ;
+
+ companion object {
+ val VALUES = values()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
new file mode 100644
index 0000000..6e359e4
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEffectsFragment.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.lukas.music.databinding.FragmentEditEffectsBinding
+import com.lukas.music.instruments.Instrument
+import com.lukas.music.util.EasyDialogFragment
+
+class EditEffectsFragment(private val instrument: Instrument) :
+ EasyDialogFragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEditEffectsBinding.inflate(inflater)
+ for (effect in instrument.effects) {
+ val effectEditor = EffectFragment(effect)
+ childFragmentManager.beginTransaction().add(binding.effectsDisplay.id, effectEditor)
+ .commit()
+ }
+ binding.closeButton.setOnClickListener {
+ dismiss()
+ }
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
index ea6a855..605c9e5 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditEnvelopeFragment.kt
@@ -14,14 +14,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditEnvelopeBinding
import com.lukas.music.instruments.Envelope
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.smartSetup
-class EditEnvelopeFragment(private val envelope: Envelope) : DialogFragment() {
- lateinit var binding: FragmentEditEnvelopeBinding
-
+class EditEnvelopeFragment(private val envelope: Envelope) :
+ EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -44,12 +43,4 @@
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
index 45d84b9..bedabeb 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditInstrumentFragment.kt
@@ -16,21 +16,19 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.DialogFragment
import com.lukas.music.databinding.FragmentEditInstrumentBinding
import com.lukas.music.instruments.Instrument
import com.lukas.music.instruments.Waveform
import com.lukas.music.song.voice.Voice
import com.lukas.music.ui.adapters.InstrumentViewHolder
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setup
import com.lukas.music.util.smartSetup
class EditInstrumentFragment(
private val instrument: Instrument,
private val viewHolder: InstrumentViewHolder
-) : DialogFragment() {
- lateinit var binding: FragmentEditInstrumentBinding
-
+) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -67,17 +65,12 @@
binding.editEnvelopeButton.setOnClickListener {
EditEnvelopeFragment(instrument.envelope).showNow(childFragmentManager, "")
}
+ binding.editEffectsButton.setOnClickListener {
+ EditEffectsFragment(instrument).showNow(childFragmentManager, "")
+ }
binding.closeButton.setOnClickListener {
dismiss()
}
return binding.root
}
-
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
index 58a856f..0033b59 100644
--- a/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EditVoiceFragment.kt
@@ -16,18 +16,16 @@
import android.view.ViewGroup
import android.widget.TableRow
import androidx.core.view.setMargins
-import androidx.fragment.app.DialogFragment
import com.google.android.material.button.MaterialButton
import com.lukas.music.R
import com.lukas.music.databinding.FragmentEditVoiceBinding
import com.lukas.music.song.Song
import com.lukas.music.song.voice.Voice
import com.lukas.music.util.ArrayProperty
+import com.lukas.music.util.EasyDialogFragment
import com.lukas.music.util.setupToggle
-class EditVoiceFragment(private val voice: Voice) : DialogFragment() {
- private lateinit var binding: FragmentEditVoiceBinding
-
+class EditVoiceFragment(private val voice: Voice) : EasyDialogFragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
@@ -54,14 +52,6 @@
return binding.root
}
- override fun onStart() {
- super.onStart()
- dialog?.window?.setLayout(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT
- )
- }
-
companion object {
val buttonLayout = TableRow.LayoutParams(0, TableRow.LayoutParams.WRAP_CONTENT)
diff --git a/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
new file mode 100644
index 0000000..b040f9d
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/ui/fragments/EffectFragment.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.ui.fragments
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import com.lukas.music.databinding.FragmentEffectBinding
+import com.lukas.music.instruments.effect.Effect
+
+class EffectFragment(private val effect: Effect) : Fragment() {
+ lateinit var binding: FragmentEffectBinding
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ binding = FragmentEffectBinding.inflate(inflater)
+ binding.effectName.text = effect.type.description
+ return binding.root
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
new file mode 100644
index 0000000..c93b6e7
--- /dev/null
+++ b/app/src/main/java/com/lukas/music/util/EasyDialogFragment.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2022 Lukas Eisenhauer
+ *
+ * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with this program. If not, see .
+ */
+
+package com.lukas.music.util
+
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import androidx.viewbinding.ViewBinding
+
+open class EasyDialogFragment : DialogFragment() {
+ lateinit var binding: T
+
+ override fun onStart() {
+ super.onStart()
+ dialog?.window?.setLayout(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_effects.xml b/app/src/main/res/layout/fragment_edit_effects.xml
new file mode 100644
index 0000000..46d4648
--- /dev/null
+++ b/app/src/main/res/layout/fragment_edit_effects.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_edit_instrument.xml b/app/src/main/res/layout/fragment_edit_instrument.xml
index 55e667b..eb66f19 100644
--- a/app/src/main/res/layout/fragment_edit_instrument.xml
+++ b/app/src/main/res/layout/fragment_edit_instrument.xml
@@ -14,6 +14,31 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EditInstrumentFragment">
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@+id/editEffectsButton" />
+ app:layout_constraintTop_toTopOf="@+id/editEffectsButton" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_effect.xml b/app/src/main/res/layout/fragment_effect.xml
new file mode 100644
index 0000000..ff90aa8
--- /dev/null
+++ b/app/src/main/res/layout/fragment_effect.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 55d1bcd..0b341db 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -43,4 +43,5 @@
Delete this instrument
Edit voice
Edit envelope
+ Edit effects
\ No newline at end of file