Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<entry name="customColorEnable" type="string">
<default>true</default>
</entry>
<entry name="showLabels" type="string">
<default>true</default>
</entry>
<entry name="sixBarMode" type="string">
<default>false</default>
</entry>
<entry name="customColorCodeRGB" type="string">
<default>#ffffff</default>
</entry>
Expand Down
7 changes: 7 additions & 0 deletions contents/ui/AudioAnalizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ Item {
property int eight: generatorFrecu(6)
property int nine: generatorFrecu(8)

property int six_one: generatorFrecu(5)
property int six_two: generatorFrecu(1)
property int six_three: generatorFrecu(2)
property int six_four: generatorFrecu(4)
property int six_five: generatorFrecu(7)
property int six_six: generatorFrecu(8)

Plasma5Support.DataSource {
id: executable2
engine: "executable"
Expand Down
36 changes: 31 additions & 5 deletions contents/ui/GeneralConfig.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Item {
property alias cfg_frecuencyUpdates: frecuencyUpdate.value
property alias cfg_customColorEnable: sistemColorCkeck.checked
property alias cfg_customColorCodeRGB: customColorRGB.text
property alias cfg_sixBarMode: sixBarMode.checked
property var cfg_colorize: sistemColorCkeck.checked ? cfg_customColorCodeRGB : Kirigami.Theme.TextColor
property alias cfg_showLabels: showTextLabels.checked

ColumnLayout {
id:mainColumn
Expand All @@ -32,27 +34,34 @@ Item {
Row {
Layout.minimumWidth: root.width/2
height: refrestitle.implicitHeight
Label {
/*Label {
height: parent.height
width: 30
text: "10"
font.bold: true
verticalAlignment: Text.AlignVBottom
}
}*/
Slider {
id: frecuencyUpdate
width: parent.width*.3
width: parent.width*.5
from: 10 // Valor mínimo del slider
to: 150 // Valor máximo del slider
stepSize: 10 // Incremento de paso del slider

}
Label {
/*Label {
height: parent.height
width: 30
text: "150"
font.bold: true
verticalAlignment: Text.AlignVBottom
}*/
Label {
height: parent.height
width: 30
text: cfg_frecuencyUpdates
font.bold: false
verticalAlignment: Text.AlignVBottom
}

}
Expand All @@ -65,7 +74,6 @@ Item {
text: i18n("Custom color:")
horizontalAlignment: Label.AlignRight
}

CheckBox{
id: sistemColorCkeck
text: i18n("")
Expand All @@ -80,6 +88,24 @@ Item {
width: 250
enabled: sistemColorCkeck.checked
}
Label {
Layout.minimumWidth: root.width/2
text: i18n("Show Text Labels")
horizontalAlignment: Label.AlignRight
}
CheckBox{
id: showTextLabels
text: i18n("")
}
Label {
Layout.minimumWidth: root.width/2
text: i18n("6 Bars")
horizontalAlignment: Label.AlignRight
}
CheckBox{
id: sixBarMode
text: i18n("")
}

}
}
Expand Down
45 changes: 26 additions & 19 deletions contents/ui/main.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import QtQuick 2.15
import QtMultimedia 5.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid
Expand All @@ -16,11 +17,12 @@ PlasmoidItem {
property string artist: mpris2Model.currentPlayer?.artist ?? ""
property string track: mpris2Model.currentPlayer?.track
property string generalColor: Plasmoid.configuration.customColorEnable ? Plasmoid.configuration.customColorCodeRGB : Kirigami.ThemeTextColor
property string showLabels: Plasmoid.configuration.showLabels
property string sixBarMode: Plasmoid.configuration.sixBarMode

readonly property int playbackStatus: mpris2Model.currentPlayer?.playbackStatus ?? 0
readonly property bool isPlaying: root.playbackStatus === Mpris.PlaybackStatus.Playing


AudioAnalizer {
id: audioAnalizer

Expand All @@ -33,7 +35,7 @@ PlasmoidItem {
id: wrapper
width: parent.width
height: parent.height
Layout.minimumWidth: 290
Layout.minimumWidth: showLabels == "true" ? 290 : 170
Layout.minimumHeight: 170
Column {
width: parent.width
Expand All @@ -42,70 +44,73 @@ PlasmoidItem {
Row {
id: barras
width: height
height: trackMusic.height/infotrack.height < .70 ? (parent.height*.65) > parent.width ? parent.width : parent.height*.65 : (parent.height*.55) > parent.width ? parent.width : parent.height*.55
spacing: (width-((width/16)*9))/8
height: showLabels == "true" ? (trackMusic.height/infotrack.height < .70 ? (parent.height*.65) > parent.width ? parent.width : parent.height*.65 : (parent.height*.55) > parent.width ? parent.width : parent.height*.55) : parent.height
spacing: sixBarMode == "true" ? (width-((width/16)*6))/8 : (width-((width/16)*9))/8
anchors.horizontalCenter: parent.horizontalCenter
//visible: trackMusic.length > 0 ? true : false
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.one : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_one : audioAnalizer.one) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.two : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_two : audioAnalizer.two) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.three : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_three : audioAnalizer.three) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.four : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_four : audioAnalizer.four) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.five : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_five : audioAnalizer.five) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
height: isPlaying ? audioAnalizer.six : width
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? (sixBarMode == "true" ? audioAnalizer.six_six : audioAnalizer.six) : width
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? audioAnalizer.seven : width
visible: sixBarMode == "true" ? false : true
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? audioAnalizer.eight : width
visible: sixBarMode == "true" ? false : true
radius: width/2
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
color: generalColor
width: barras.width/16
width: sixBarMode == "true" ? barras.width/10 : barras.width/16
height: isPlaying ? audioAnalizer.nine : width
visible: sixBarMode == "true" ? false : true
radius: width/2
anchors.verticalCenter: parent.verticalCenter

Expand All @@ -126,6 +131,7 @@ PlasmoidItem {
width: wrapper.width
font.pixelSize: parent.height*.6
text: track
visible: showLabels == "true" ? true : false
color: generalColor
font.bold: true
lineHeight: 0.8
Expand All @@ -144,6 +150,7 @@ PlasmoidItem {
height: parent.height*.35
font.pixelSize: height*.8
text: artist
visible: showLabels == "true" ? true : false
color: generalColor
opacity: .80
horizontalAlignment: Text.AlignHCenter
Expand Down
1 change: 1 addition & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"KPlugin": {
"Authors": [
{
"Email": "[email protected]",
"Name": "zayronxio"
}
],
Expand Down