Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maui
Vvave
Commits
57dd52ff
Commit
57dd52ff
authored
Jul 06, 2019
by
camilo higuita
Browse files
style ux ui migration
parent
dfbc997b
Changes
13
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
57dd52ff
...
...
@@ -35,22 +35,22 @@ add_executable(vvave
services/local/taginfo.cpp
services/local/player.cpp
services/local/youtubedl.cpp
services/local/linking.cpp
#
services/local/linking.cpp
services/local/socket.cpp
services/web/babeit.cpp
#
services/web/babeit.cpp
services/web/youtube.cpp
services/web/Spotify/spotify.cpp
#
services/web/Spotify/spotify.cpp
db/collectionDB.cpp
# settings/BabeSettings.cpp
# settings/fileloader.cpp
# utils/brain.cpp
utils/babeconsole.cpp
#
utils/babeconsole.cpp
models/tracks/tracksmodel.cpp
models/basemodel.cpp
models/baselist.cpp
models/playlists/playlistsmodel.cpp
models/albums/albumsmodel.cpp
models/cloud/cloud.cpp
#
models/cloud/cloud.cpp
)
if
(
ANDROID
)
...
...
main.qml
View file @
57dd52ff
...
...
@@ -313,24 +313,24 @@ Layout.fillWidth: true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
leftContent
:
Maui.
ToolButton
leftContent
:
ToolButton
{
icon
N
ame
:
"
headphones
"
icon
.n
ame
:
"
headphones
"
visible
:
_drawer
.
modal
icon
C
olor
:
_drawer
.
visible
?
babeColor
:
textColor
icon
.c
olor
:
_drawer
.
visible
?
babeColor
:
textColor
onClicked
:
_drawer
.
visible
=
!
_drawer
.
visible
colorSc
heme.highlightColor
:
babeColor
Kirigami.T
heme.highlightColor
:
babeColor
// text: qsTr("Now")
}
middleContent
:
[
Maui.
ToolButton
ToolButton
{
id
:
babeBtnIcon
icon
N
ame
:
"
love
"
icon
C
olor
:
currentBabe
?
babeColor
:
textColor
icon
.n
ame
:
"
love
"
enabled
:
currentTrackIndex
>=
0
icon
.c
olor
:
currentBabe
?
babeColor
:
textColor
onClicked
:
if
(
!
mainlistEmpty
)
{
mainPlaylist
.
list
.
fav
(
currentTrackIndex
,
!
(
mainPlaylist
.
list
.
get
(
currentTrackIndex
).
fav
==
"
1
"
))
...
...
@@ -338,36 +338,37 @@ Layout.fillWidth: true
}
},
Maui.
ToolButton
ToolButton
{
icon
N
ame
:
"
media-skip-backward
"
icon
C
olor
:
textColor
icon
.n
ame
:
"
media-skip-backward
"
icon
.c
olor
:
textColor
onClicked
:
Player
.
previousTrack
()
onPressAndHold
:
Player
.
playAt
(
prevTrackIndex
)
},
Maui.
ToolButton
ToolButton
{
id
:
playIcon
iconColor
:
textColor
iconName
:
isPlaying
?
"
media-playback-pause
"
:
"
media-playback-start
"
enabled
:
currentTrackIndex
>=
0
icon.color
:
textColor
icon.name
:
isPlaying
?
"
media-playback-pause
"
:
"
media-playback-start
"
onClicked
:
player
.
playing
=
!
player
.
playing
},
Maui.
ToolButton
ToolButton
{
id
:
nextBtn
icon
C
olor
:
textColor
icon
N
ame
:
"
media-skip-forward
"
icon
.c
olor
:
textColor
icon
.n
ame
:
"
media-skip-forward
"
onClicked
:
Player
.
nextTrack
()
onPressAndHold
:
Player
.
playAt
(
Player
.
shuffle
())
},
Maui.
ToolButton
ToolButton
{
id
:
shuffleBtn
icon
C
olor
:
babeColor
icon
N
ame
:
isShuffle
?
"
media-playlist-shuffle
"
:
"
media-playlist-normal
"
icon
.c
olor
:
babeColor
icon
.n
ame
:
isShuffle
?
"
media-playlist-shuffle
"
:
"
media-playlist-normal
"
onClicked
:
{
isShuffle
=
!
isShuffle
...
...
models/albums/albumsmodel.cpp
View file @
57dd52ff
...
...
@@ -3,9 +3,9 @@
#include
"utils/brain.h"
#include
<QtConcurrent>
AlbumsModel
::
AlbumsModel
(
QObject
*
parent
)
:
BaseList
(
parent
)
AlbumsModel
::
AlbumsModel
(
QObject
*
parent
)
:
BaseList
(
parent
),
db
(
CollectionDB
::
getInstance
())
{
this
->
db
=
CollectionDB
::
getInstance
();
connect
(
this
,
&
AlbumsModel
::
queryChanged
,
this
,
&
AlbumsModel
::
setList
);
}
...
...
models/playlists/playlistsmodel.cpp
View file @
57dd52ff
#include
"playlistsmodel.h"
#include
"db/collectionDB.h"
PlaylistsModel
::
PlaylistsModel
(
QObject
*
parent
)
:
BaseList
(
parent
)
PlaylistsModel
::
PlaylistsModel
(
QObject
*
parent
)
:
BaseList
(
parent
),
db
(
CollectionDB
::
getInstance
())
{
this
->
db
=
CollectionDB
::
getInstance
();
this
->
setList
();
}
...
...
models/tracks/tracksmodel.cpp
View file @
57dd52ff
...
...
@@ -2,9 +2,9 @@
#include
"db/collectionDB.h"
TracksModel
::
TracksModel
(
QObject
*
parent
)
:
BaseList
(
parent
)
TracksModel
::
TracksModel
(
QObject
*
parent
)
:
BaseList
(
parent
),
db
(
CollectionDB
::
getInstance
())
{
this
->
db
=
CollectionDB
::
getInstance
();
connect
(
this
,
&
TracksModel
::
queryChanged
,
this
,
&
TracksModel
::
setList
);
}
...
...
services/local/player.cpp
View file @
57dd52ff
...
...
@@ -2,23 +2,22 @@
#include
"../../utils/bae.h"
Player
::
Player
(
QObject
*
parent
)
:
QObject
(
parent
)
Player
::
Player
(
QObject
*
parent
)
:
QObject
(
parent
),
player
(
new
QMediaPlayer
(
this
)),
updater
(
new
QTimer
(
this
))
{
this
->
player
=
new
QMediaPlayer
(
this
);
this
->
buffer
=
new
QBuffer
(
this
->
player
);
connect
(
this
->
player
,
&
QMediaPlayer
::
durationChanged
,
this
,
[
&
](
qint64
dur
)
{
emit
this
->
durationChanged
(
/*BAE::transformTime(dur/1000)*/
);
});
//
connect(this->player, &QMediaPlayer::durationChanged, this, [&](qint64 dur)
//
{
//
emit this->durationChanged(/*BAE::transformTime(dur/1000)*/);
//
});
this
->
player
->
setVolume
(
this
->
volume
);
this
->
updater
=
new
QTimer
(
this
);
connect
(
this
->
updater
,
&
QTimer
::
timeout
,
this
,
&
Player
::
update
);
}
bool
Player
::
play
()
bool
Player
::
play
()
const
{
if
(
this
->
url
.
isEmpty
())
return
false
;
...
...
@@ -30,7 +29,7 @@ bool Player::play()
return
true
;
}
void
Player
::
pause
()
void
Player
::
pause
()
const
{
if
(
this
->
player
->
isAvailable
())
this
->
player
->
pause
();
...
...
@@ -73,9 +72,9 @@ void Player::emitState()
QString
Player
::
transformTime
(
const
int
&
pos
)
{
auto
time
=
BAE
::
transformTime
(
pos
);
return
time
;
return
BAE
::
transformTime
(
pos
);
}
void
Player
::
appendBuffe
(
QByteArray
&
array
)
{
qDebug
()
<<
"APENDING TO BUFFER"
<<
array
<<
this
->
array
;
...
...
@@ -105,7 +104,7 @@ void Player::setUrl(const QString &value)
this
->
pos
=
0
;
emit
this
->
posChanged
();
auto
media
=
QMediaContent
(
QUrl
::
fromLocalFile
(
this
->
url
));
const
auto
media
=
QMediaContent
(
QUrl
::
fromLocalFile
(
this
->
url
));
this
->
player
->
setMedia
(
media
);
this
->
emitState
();
}
...
...
@@ -166,7 +165,7 @@ bool Player::getFinished()
void
Player
::
setPos
(
const
int
&
value
)
{
this
->
pos
=
value
;
this
->
player
->
setPosition
(
this
->
player
->
duration
()
/
1000
*
this
->
pos
);
this
->
player
->
setPosition
(
this
->
player
->
duration
()
/
1000
*
this
->
pos
);
this
->
emitState
();
this
->
posChanged
();
}
...
...
services/local/player.h
View file @
57dd52ff
...
...
@@ -63,8 +63,8 @@ private:
bool
playing
=
false
;
bool
finished
=
false
;
bool
play
();
void
pause
();
bool
play
()
const
;
void
pause
()
const
;
void
emitState
();
...
...
@@ -82,7 +82,7 @@ signals:
void
posChanged
();
public
slots
:
QString
transformTime
(
const
int
&
pos
);
static
QString
transformTime
(
const
int
&
pos
);
void
playRemote
(
const
QString
&
url
);
void
stop
();
...
...
view_models/BabeTable/BabeTable.qml
View file @
57dd52ff
...
...
@@ -35,7 +35,7 @@ BabeList
property
bool
group
:
false
property
alias
contextMenu
:
contextMenu
property
alias
contextMenuItems
:
contextMenu
.
content
property
alias
contextMenuItems
:
contextMenu
.
content
Data
property
alias
playAllBtn
:
playAllBtn
property
alias
appendBtn
:
appendBtn
...
...
@@ -207,14 +207,14 @@ BabeList
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Go to Artist
"
)
onTriggered
:
goToArtist
()
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Go to Album
"
)
onTriggered
:
goToAlbum
()
...
...
view_models/BabeTable/TableMenu.qml
View file @
57dd52ff
...
...
@@ -7,8 +7,9 @@ import ".."
import
"
../../utils/Help.js
"
as
H
import
org
.
kde
.
mauikit
1.0
as
Maui
import
org
.
kde
.
kirigami
2.6
as
Kirigami
Maui.
Menu
Menu
{
id
:
control
width
:
unit
*
200
...
...
@@ -32,9 +33,9 @@ Maui.Menu
signal
infoClicked
()
signal
copyToClicked
()
property
alias
menuItem
:
control
.
content
property
alias
menuItem
:
control
.
content
Data
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Select...
"
)
onTriggered
:
...
...
@@ -46,7 +47,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
!
fav
?
qsTr
(
"
Fav it
"
):
qsTr
(
"
UnFav it
"
)
onTriggered
:
...
...
@@ -56,7 +57,7 @@ Maui.Menu
}
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Queue
"
)
onTriggered
:
...
...
@@ -66,7 +67,7 @@ Maui.Menu
}
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Add to...
"
)
onTriggered
:
...
...
@@ -78,7 +79,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Share...
"
)
onTriggered
:
...
...
@@ -89,7 +90,7 @@ Maui.Menu
}
Maui.
MenuItem
MenuItem
{
visible
:
root
.
showAccounts
text
:
qsTr
(
"
Copy to cloud
"
)
...
...
@@ -100,7 +101,7 @@ Maui.Menu
}
}
Maui.
MenuItem
MenuItem
{
text
:
isAndroid
?
qsTr
(
"
Open with...
"
)
:
qsTr
(
"
Show in folder...
"
)
...
...
@@ -113,7 +114,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
visible
:
false
text
:
qsTr
(
"
Edit...
"
)
...
...
@@ -135,10 +136,10 @@ Maui.Menu
// }
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Remove
"
)
colorSc
heme.textColor
:
dangerColor
Kirigami.T
heme.textColor
:
dangerColor
onTriggered
:
{
removeClicked
()
...
...
@@ -149,7 +150,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
id
:
starsRow
width
:
parent
.
width
...
...
@@ -237,7 +238,7 @@ Maui.Menu
}
Maui.
MenuItem
MenuItem
{
id
:
colorsRow
width
:
parent
.
width
...
...
vvave.cpp
View file @
57dd52ff
...
...
@@ -25,9 +25,10 @@
* */
vvave
::
vvave
(
QObject
*
parent
)
:
QObject
(
parent
)
vvave
::
vvave
(
QObject
*
parent
)
:
QObject
(
parent
),
notify
(
new
Notify
(
this
)),
db
(
CollectionDB
::
getInstance
())
{
this
->
db
=
CollectionDB
::
getInstance
();
for
(
const
auto
&
path
:
{
BAE
::
CachePath
,
BAE
::
YoutubeCachePath
})
{
QDir
dirPath
(
path
);
...
...
@@ -39,7 +40,6 @@ vvave::vvave(QObject *parent) : QObject(parent)
if
(
!
FMH
::
fileExists
(
BAE
::
NotifyDir
+
"/vvave.notifyrc"
))
QFile
::
copy
(
":/assets/vvave.notifyrc"
,
BAE
::
NotifyDir
+
"/vvave.notifyrc"
);
this
->
notify
=
new
Notify
(
this
);
connect
(
this
->
notify
,
&
Notify
::
babeSong
,
[
this
]()
{
// emit this->babeIt();
...
...
widgets/MainPlaylist/PlaylistMenu.qml
View file @
57dd52ff
...
...
@@ -2,32 +2,32 @@ import QtQuick 2.9
import
QtQuick
.
Controls
2.2
import
org
.
kde
.
mauikit
1.0
as
Maui
Maui.
Menu
Menu
{
signal
clearOut
()
signal
clean
()
signal
callibrate
()
signal
hideCover
()
signal
saveToClicked
()
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Clear out...
"
)
onTriggered
:
clearOut
()
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Clean...
"
)
onTriggered
:
clean
()
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Save list to...
"
)
onTriggered
:
saveToClicked
()
}
Maui.
MenuItem
MenuItem
{
enabled
:
syncPlaylist
.
length
>
0
text
:
syncPlaylist
.
length
>
0
&&
sync
?
qsTr
(
"
Pause syncing
"
)
:
qsTr
(
"
Continue syncing
"
)
...
...
widgets/PlaylistsView/PlaylistsView.qml
View file @
57dd52ff
...
...
@@ -110,7 +110,7 @@ ColumnLayout
holder.emojiSize
:
iconSizes
.
huge
contextMenuItems
:
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Remove from playlist
"
)
}
...
...
widgets/SelectionBarMenu.qml
View file @
57dd52ff
...
...
@@ -8,10 +8,10 @@ import "../utils/Help.js" as H
import
"
../utils/Player.js
"
as
Player
import
"
../view_models
"
import
org
.
kde
.
kirigami
2.6
as
Kirigami
import
org
.
kde
.
mauikit
1.0
as
Maui
Maui.
Menu
Menu
{
id
:
control
width
:
unit
*
200
...
...
@@ -24,7 +24,7 @@ Maui.Menu
signal
rateClicked
(
int
rate
)
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Play...
"
)
onTriggered
:
...
...
@@ -39,13 +39,13 @@ Maui.Menu
}
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Append...
"
)
onTriggered
:
Player
.
appendAll
(
_selectionBarModelList
.
getAll
())
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Queue
"
)
onTriggered
:
...
...
@@ -58,7 +58,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Fav/UnFav them
"
)
onTriggered
:
...
...
@@ -70,7 +70,7 @@ Maui.Menu
}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Add to...
"
)
onTriggered
:
...
...
@@ -83,7 +83,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Share...
"
)
onTriggered
:
...
...
@@ -96,10 +96,10 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
text
:
qsTr
(
"
Remove
"
)
colorSc
heme.textColor
:
dangerColor
Kirigami.T
heme.textColor
:
dangerColor
onTriggered
:
{
close
()
...
...
@@ -108,7 +108,7 @@ Maui.Menu
MenuSeparator
{}
Maui.
MenuItem
MenuItem
{
id
:
starsRow
width
:
parent
.
width
...
...
@@ -194,7 +194,7 @@ Maui.Menu
}
Maui.
MenuItem
MenuItem
{
id
:
colorsRow
width
:
parent
.
width
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment