Skip to content

Commit

Permalink
Messy changes:
Browse files Browse the repository at this point in the history
- a huge amount of small changes, lost track of them, but nothing super important
AND
- visually refactored Knob, now size is fully dynamic!
- covers are disabled in sample Local Data Provider
- as usual, have updated some dependencies
  • Loading branch information
arutemu committed Oct 14, 2024
1 parent 9f80e5c commit fdfbda9
Show file tree
Hide file tree
Showing 17 changed files with 1,619 additions and 250 deletions.
10 changes: 7 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ android {
}

dependencies {
def nav_version = "2.8.1"
def nav_version = "2.8.2"
def lifecycle_version = "2.8.6"
def accompanist = '0.36.0'

Expand Down Expand Up @@ -98,7 +98,7 @@ dependencies {
// palette
implementation 'androidx.palette:palette-ktx:1.0.0'

implementation platform('androidx.compose:compose-bom:2024.09.02')
implementation platform('androidx.compose:compose-bom:2024.09.03')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
Expand All @@ -111,7 +111,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation platform('androidx.compose:compose-bom:2024.09.02')
androidTestImplementation platform('androidx.compose:compose-bom:2024.09.03')
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
Expand All @@ -125,4 +125,8 @@ dependencies {

// LazyList scrollbar
implementation 'com.github.nanihadesuka:LazyColumnScrollbar:2.2.0'

// Android Wear libs for rounded/radial text
//implementation "androidx.wear.compose:compose-material:1.4.0"
//implementation "androidx.wear.compose:compose-foundation:1.4.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data class Slider(
override val name: String,
val startValue: Float,
val endValue: Float,
val value: Float,
//val value: Float,
val measure: String
) : PluginElement(id, name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.mukuro.pedalboard.data.Knob
import com.mukuro.pedalboard.data.PluginElement
import com.mukuro.pedalboard.data.Plugin
import com.mukuro.pedalboard.data.PluginType
import com.mukuro.pedalboard.data.Slider

/**
* A static data store of [Plugin]s.
Expand All @@ -21,15 +22,15 @@ object LocalPluginsDataProvider {
name = "test Nayuta plugin",
aspectRatio = 0.6f,
elements = TestKnob.knobSet1,
coverDrawable = R.drawable.nayuta
//coverDrawable = R.drawable.nayuta
),
Plugin(
id = 2L,
type = PluginType.CHORUS,
name = "test chorus plugin",
aspectRatio = 0.6f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.power
//coverDrawable = R.drawable.power
),
Plugin(
id = 3L,
Expand All @@ -47,7 +48,7 @@ object LocalPluginsDataProvider {
name = "Amptweaker Small Form",
aspectRatio = 0.581f,
elements = TestKnob.knobSet1,
coverDrawable = R.drawable.anime_girl_3,
//coverDrawable = R.drawable.anime_girl_3,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -57,7 +58,7 @@ object LocalPluginsDataProvider {
name = "Boss single switch",
aspectRatio = 0.574f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.illustration_1,
//coverDrawable = R.drawable.illustration_1,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -67,7 +68,7 @@ object LocalPluginsDataProvider {
name = "Boss double switch",
aspectRatio = 1.088f,
elements = TestKnob.knobSet3,
coverDrawable = R.drawable.makima,
//coverDrawable = R.drawable.makima,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -77,7 +78,7 @@ object LocalPluginsDataProvider {
name = "DigiTech Whammy",
aspectRatio = 0.839f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.frieren_1,
//coverDrawable = R.drawable.frieren_1,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -87,7 +88,7 @@ object LocalPluginsDataProvider {
name = "EHX Big Muff",
aspectRatio = 0.809f,
elements = TestKnob.knobSet1,
coverDrawable = R.drawable.nayuta,
//coverDrawable = R.drawable.nayuta,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -97,7 +98,7 @@ object LocalPluginsDataProvider {
name = "EHX Small Clone",
aspectRatio = 0.647f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.madoka_2,
//coverDrawable = R.drawable.madoka_2,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -107,7 +108,7 @@ object LocalPluginsDataProvider {
name = "Ibanez Tube Screamer Classic super duper long name",
aspectRatio = 0.542f,
elements = TestKnob.knobSet3,
coverDrawable = R.drawable.anime_girl_4,
//coverDrawable = R.drawable.anime_girl_4,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -117,7 +118,7 @@ object LocalPluginsDataProvider {
name = "Line 6 Modeler Pedals",
aspectRatio = 1.667f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.makima_6,
//coverDrawable = R.drawable.makima_6,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -127,7 +128,7 @@ object LocalPluginsDataProvider {
name = "Small MXR Pedals",
aspectRatio = 0.535f,
elements = TestKnob.knobSet1,
coverDrawable = R.drawable.nayuta_1,
//coverDrawable = R.drawable.nayuta_1,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -137,15 +138,15 @@ object LocalPluginsDataProvider {
name = "Morley Wah Pedals",
aspectRatio = 1.553f,
elements = TestKnob.knobSet3,
coverDrawable = R.drawable.madoka_1
//coverDrawable = R.drawable.madoka_1
),
Plugin(
id = 11L,
type = PluginType.CHORUS,
name = "ProCo Rat Two",
aspectRatio = 0.875f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.makima_7,
//coverDrawable = R.drawable.makima_7,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -155,23 +156,23 @@ object LocalPluginsDataProvider {
name = "Strymon Small Form",
aspectRatio = 0.889f,
elements = TestKnob.knobSet1,
coverDrawable = R.drawable.illustration_3
//coverDrawable = R.drawable.illustration_3
),
Plugin(
id = 13L,
type = PluginType.CHORUS,
name = "Strymon Large Form",
aspectRatio = 1.324f,
elements = TestKnob.knobSet3,
coverDrawable = R.drawable.illustration_2
//coverDrawable = R.drawable.illustration_2
),
Plugin(
id = 14L,
type = PluginType.CHORUS,
name = "TC Electronic Mini",
aspectRatio = 0.514f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.bocchi_1,
//coverDrawable = R.drawable.bocchi_1,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -181,7 +182,7 @@ object LocalPluginsDataProvider {
name = "TC Electronic Single Stomp",
aspectRatio = 0.583f,
elements = TestKnob.knobSet3,
coverDrawable = R.drawable.bocchi_2,
//coverDrawable = R.drawable.bocchi_2,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -191,7 +192,7 @@ object LocalPluginsDataProvider {
name = "Way Huge",
aspectRatio = 0.798f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.hutao_1,
//coverDrawable = R.drawable.hutao_1,
horizontal = Arrangement.Center,
vertical = Arrangement.Bottom
),
Expand All @@ -201,7 +202,7 @@ object LocalPluginsDataProvider {
name = "Walrus Audio Large Form",
aspectRatio = 1.217f,
elements = TestKnob.knobSet2,
coverDrawable = R.drawable.crymachina_1
//coverDrawable = R.drawable.crymachina_1
)
)

Expand Down Expand Up @@ -258,7 +259,28 @@ object LocalPluginsDataProvider {
startPoint = 0f,
endPoint = 100f,
measure = "db"
)
),
Slider(
id = 5,
name = "Drive",
startValue = 0f,
endValue = 100f,
measure = "db"
),
Slider(
id = 6,
name = "Drive",
startValue = 0f,
endValue = 100f,
measure = "db"
),
Knob(
id = 7,
name = "Overdrive",
startPoint = 0f,
endPoint = 100f,
measure = "db"
),

)
val knobSet3 = listOf(
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/java/com/mukuro/pedalboard/ui/PedalboardApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ private fun PedalboardNavigationWrapper(
mainTitle = "Drums";
subTitle = "Backing tracks"
}
PedalboardRoute.TEST -> {
mainTitle = "Test page";
subTitle = "Experimental central"
}
}

Column(modifier = Modifier){
Expand Down Expand Up @@ -434,7 +438,6 @@ private fun PedalboardNavHost(
)
}
composable(PedalboardRoute.EFFECTS) {
//EmptyComingSoon()
PedalboardEffectsScreen(
contentType = contentType,
pedalboardHomeUIState = pedalboardHomeUIState,
Expand All @@ -454,5 +457,8 @@ private fun PedalboardNavHost(
composable(PedalboardRoute.DRUMS) {
EmptyComingSoon()
}
composable(PedalboardRoute.TEST) {
EmptyComingSoon()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ class PedalboardHomeViewModel(private val pluginsRepository: PluginsRepository =
openedPreset = preset,
)
}*/
fun closeQuickMenu() {
_uiState.value = _uiState
.value.copy(
isDetailOnlyOpen = false,
//openedPlugin = _uiState.value.plugins.first()
)
}

// TODO - implement adding plugin to the board
fun addPlugin(pluginId: Long) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.mukuro.pedalboard.ui

import android.net.Uri
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -250,7 +251,7 @@ fun PedalboardPluginsList(
// changed from COLUMN to ROW, let's check it
Column(
modifier = modifier
//.padding(horizontal = 12.dp)
//.padding(horizontal = 12.dp) // TODO - need to make the clip modifier to be used only on tablets
.clip(shape = RoundedCornerShape(36.dp, 0.dp, 0.dp, 0.dp))
.background(MaterialTheme.colorScheme.surfaceDim)
) {
Expand Down Expand Up @@ -294,19 +295,15 @@ fun PedalboardPluginsList(
items(items = plugins, key = { it.id }) { plugin ->
PedalboardPluginCard(
plugin = plugin,
navigateToDetail = { pluginId ->
navigateToDetail(pluginId, PedalboardContentType.SINGLE_PANE)
},
toggleSelection = togglePluginSelection,
isOpened = openedPlugin?.id == plugin.id,
isSelected = selectedPluginIds.contains(plugin.id)
)
}
}
InternalLazyRowScrollbar(
modifier = Modifier
//.fillMaxHeight()
.padding(horizontal = 24.dp),
.fillMaxHeight(),
//.padding(horizontal = 24.dp),
state = pluginLazyListState,
settings = ScrollbarSettings(
selectionMode = ScrollbarSelectionMode.Full,
Expand All @@ -315,7 +312,9 @@ fun PedalboardPluginsList(
//scrollbarPadding = 12.dp,
//thumbThickness = 36.dp,
thumbMinLength = 0.3f
)
),
// TODO - implement custom indicatorContent for custom scrollbar design :3
//indicatorContent = Scrollbar()
)
}

Expand Down Expand Up @@ -361,10 +360,6 @@ fun PedalboardAllPluginsList(
items(items = plugins, key = { it.id }) { plugin ->
PedalboardPluginCard(
plugin = plugin,
navigateToDetail = { pluginId ->
navigateToDetail(pluginId, PedalboardContentType.SINGLE_PANE)
},
toggleSelection = togglePluginSelection,
isOpened = openedPlugin?.id == plugin.id,
isSelected = selectedPluginIds.contains(plugin.id)
)
Expand Down Expand Up @@ -410,13 +405,14 @@ fun ImageLoader(plugin: Plugin) {
)
}

// OLD STUFF, DOES NOT WORK, IS NOT USED, REMOVE IT!
@Composable
fun Scrollbar() {
Card(
modifier = Modifier
.height(16.dp)
.width(120.dp)
.padding(vertical = 20.dp)
.padding(vertical = 8.dp)
.clip(CardDefaults.shape),
colors = CardDefaults.cardColors(),
elevation = CardDefaults.cardElevation(),
Expand Down
Loading

0 comments on commit fdfbda9

Please sign in to comment.