File tree Expand file tree Collapse file tree
apps/fxlab/app/src/main/kotlin/com/mobileer/androidfxlab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ class MainActivity : AppCompatActivity() {
121121 == PackageManager .PERMISSION_GRANTED
122122 ) {
123123 NativeInterface .createAudioEngine()
124+ if (EffectsAdapter .effectList.isEmpty()) {
125+ addDefaultEffects()
126+ }
124127 NativeInterface .enable(isAudioEnabled)
125128 }
126129 }
@@ -150,6 +153,18 @@ class MainActivity : AppCompatActivity() {
150153 }
151154 }
152155
156+ private fun addDefaultEffects () {
157+ val defaultEffects = listOf (" Gain" , " Echo" , " Tremolo" )
158+ for (effectName in defaultEffects) {
159+ NativeInterface .effectDescriptionMap[effectName]?.let {
160+ val toAdd = Effect (it)
161+ EffectsAdapter .effectList.add(toAdd)
162+ NativeInterface .addEffect(toAdd)
163+ }
164+ }
165+ EffectsAdapter .notifyDataSetChanged()
166+ }
167+
153168 @RequiresApi(Build .VERSION_CODES .M )
154169 private fun handleMidiDevices () {
155170
You can’t perform that action at this time.
0 commit comments