Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Vvave
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maui
Vvave
Commits
72f660ab
Commit
72f660ab
authored
Jan 17, 2018
by
Camilo Higuita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
105501ee
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
125 additions
and
85 deletions
+125
-85
db/collectionDB.cpp
db/collectionDB.cpp
+11
-0
db/collectionDB.h
db/collectionDB.h
+2
-0
db/script.sql
db/script.sql
+2
-1
main.qml
main.qml
+9
-25
settings/fileloader.h
settings/fileloader.h
+1
-0
settings/settings.cpp
settings/settings.cpp
+5
-5
settings/settings.h
settings/settings.h
+1
-1
utils/bae.h
utils/bae.h
+3
-1
utils/brain.cpp
utils/brain.cpp
+6
-1
utils/brain.h
utils/brain.h
+1
-1
view_models/BabeGrid.qml
view_models/BabeGrid.qml
+0
-1
view_models/BabeHolder.qml
view_models/BabeHolder.qml
+2
-3
widgets/AlbumsView.qml
widgets/AlbumsView.qml
+5
-1
widgets/ArtistsView.qml
widgets/ArtistsView.qml
+5
-0
widgets/BabeBar.qml
widgets/BabeBar.qml
+2
-2
widgets/MainPlaylist.qml
widgets/MainPlaylist.qml
+61
-33
widgets/SettingsView.qml
widgets/SettingsView.qml
+9
-10
No files found.
db/collectionDB.cpp
View file @
72f660ab
...
...
@@ -511,6 +511,17 @@ bool CollectionDB::trackPlaylist(const QString &url, const QString &playlist)
return
false
;
}
bool
CollectionDB
::
addFolder
(
const
QString
&
url
)
{
QVariantMap
map
{{
KEYMAP
[
KEY
::
URL
],
url
},
{
KEYMAP
[
KEY
::
ADD_DATE
],
QDate
::
currentDate
()}};
if
(
insert
(
TABLEMAP
[
TABLE
::
FOLDERS
],
map
))
return
true
;
return
false
;
}
DB_LIST
CollectionDB
::
getDBData
(
const
QStringList
&
urls
)
{
...
...
db/collectionDB.h
View file @
72f660ab
...
...
@@ -66,6 +66,8 @@ public:
bool
addPlaylist
(
const
QString
&
title
);
bool
trackPlaylist
(
const
QString
&
url
,
const
QString
&
playlist
);
bool
addFolder
(
const
QString
&
url
);
BAE
::
DB_LIST
getDBData
(
const
QStringList
&
urls
);
BAE
::
DB_LIST
getDBData
(
const
QString
&
queryTxt
);
QVariantList
getDBDataQML
(
const
QString
&
queryTxt
);
...
...
db/script.sql
View file @
72f660ab
...
...
@@ -44,7 +44,8 @@ name TEXT NOT NULL
CREATE
TABLE
FOLDERS
(
url
TEXT
PRIMARY
KEY
url
TEXT
PRIMARY
KEY
,
addDate
DATE
NOT
NULL
)
;
CREATE
TABLE
SOURCES
...
...
main.qml
View file @
72f660ab
...
...
@@ -55,7 +55,7 @@ ApplicationWindow
searchView
.
populate
(
res
)
// albumsView.filter(res)
currentView
=
6
currentView
=
5
}
}
...
...
@@ -103,21 +103,7 @@ ApplicationWindow
onAlbumsViewClicked
:
currentView
=
2
onArtistsViewClicked
:
currentView
=
3
onPlaylistsViewClicked
:
currentView
=
4
onSettingsViewClicked
:
{
if
(
settingsDrawer
.
visible
)
{
settingsDrawer
.
close
()
settingsIcon
.
color
=
textColor
}
else
{
settingsDrawer
.
open
()
settingsIcon
.
color
=
accentColor
}
}
onSettingsViewClicked
:
settingsDrawer
.
visible
?
settingsDrawer
.
close
()
:
settingsDrawer
.
open
()
}
footer
:
Rectangle
...
...
@@ -179,13 +165,11 @@ ApplicationWindow
z
:
-
999
}
SettingsView
{
id
:
settingsDrawer
onIconSizeChanged
:
iconSize
=
size
}
SettingsView
{
id
:
settingsDrawer
onIconSizeChanged
:
iconSize
=
size
}
Page
...
...
@@ -196,8 +180,8 @@ ApplicationWindow
clip
:
true
transform
:
Translate
{
x
:
(
settingsDrawer
.
position
*
views
.
width
*
0.33
)
*-
1
}
x
:
(
settingsDrawer
.
position
*
views
.
width
*
0.33
)
*-
1
}
Column
{
...
...
settings/fileloader.h
View file @
72f660ab
...
...
@@ -60,6 +60,7 @@ public slots:
{
if
(
QFileInfo
(
path
).
isDir
())
{
this
->
con
->
addFolder
(
path
);
QDirIterator
it
(
path
,
BAE
::
formats
,
QDir
::
Files
,
QDirIterator
::
Subdirectories
);
while
(
it
.
hasNext
())
urls
<<
it
.
next
();
...
...
settings/settings.cpp
View file @
72f660ab
...
...
@@ -99,13 +99,13 @@ settings::settings(QObject *parent) : QObject(parent)
{
BAE
::
TABLEMAP
[
TABLE
::
PLAYLISTS
],
true
}});
this
->
startBrainz
(
1
0
00
);
this
->
startBrainz
(
1
5
00
);
}
else
{
this
->
dirs
.
clear
();
this
->
collectionWatcher
();
this
->
watcher
->
removePaths
(
watcher
->
directories
());
this
->
startBrainz
(
2
000
);
this
->
startBrainz
(
3
000
);
}
...
...
@@ -192,7 +192,7 @@ void settings::handleDirectoryChanged(const QString &dir)
auto
wait
=
new
QTimer
(
this
);
wait
->
setSingleShot
(
true
);
wait
->
setInterval
(
1
0
00
);
wait
->
setInterval
(
1
5
00
);
connect
(
wait
,
&
QTimer
::
timeout
,[
=
]()
{
...
...
@@ -209,10 +209,10 @@ void settings::checkCollection()
// this->refreshCollectionPaths();
// this->collectionWatcher();
this
->
brainzOn
=
true
;
this
->
startBrainz
(
2
000
);
this
->
startBrainz
(
3
000
);
}
void
settings
::
startBrainz
(
const
int
&
speed
)
void
settings
::
startBrainz
(
const
u
int
&
speed
)
{
if
(
this
->
brainzOn
)
{
...
...
settings/settings.h
View file @
72f660ab
...
...
@@ -39,7 +39,7 @@ private slots:
void
on_remove_clicked
();
public
slots
:
void
startBrainz
(
const
int
&
speed
);
void
startBrainz
(
const
u
int
&
speed
);
void
populateDB
(
const
QStringList
&
paths
);
private:
...
...
utils/bae.h
View file @
72f660ab
...
...
@@ -75,6 +75,7 @@ namespace BAE
ARTISTS_TAGS
,
TRACKS_TAGS
,
LOGS
,
FOLDERS
,
ALL
,
NONE
};
...
...
@@ -94,7 +95,8 @@ namespace BAE
{
TABLE
::
ALBUMS_TAGS
,
"albums_tags"
},
{
TABLE
::
ARTISTS_TAGS
,
"artists_tags"
},
{
TABLE
::
TRACKS_TAGS
,
"tracks_tags"
},
{
TABLE
::
LOGS
,
"logs"
}
{
TABLE
::
LOGS
,
"logs"
},
{
TABLE
::
FOLDERS
,
"folders"
}
};
...
...
utils/brain.cpp
View file @
72f660ab
...
...
@@ -57,11 +57,13 @@ void Brain::setInfo(DB_LIST dataList, ONTOLOGY ontology, QList<SERVICES> service
for
(
auto
data
:
dataList
)
{
if
(
!
go
)
return
;
if
(
cb
!=
nullptr
)
cb
(
data
);
this
->
pulpo
.
feed
(
data
,
recursive
);
this
->
t
.
msleep
(
this
->
interval
);
if
(
!
go
)
return
;
}
}
...
...
@@ -81,6 +83,7 @@ void Brain::synapse()
void
Brain
::
connectionParser
(
DB
track
,
RESPONSE
response
)
{
for
(
auto
res
:
response
.
keys
())
{
switch
(
res
)
{
case
ONTOLOGY
::
ALBUM
:
this
->
parseAlbumInfo
(
track
,
response
[
res
]);
break
;
...
...
@@ -88,6 +91,8 @@ void Brain::connectionParser(DB track, RESPONSE response)
case
ONTOLOGY
::
TRACK
:
this
->
parseTrackInfo
(
track
,
response
[
res
]);
break
;
default:
return
;
}
this
->
t
.
msleep
(
this
->
interval
);
}
}
void
Brain
::
parseAlbumInfo
(
DB
&
track
,
const
INFO_K
&
response
)
...
...
utils/brain.h
View file @
72f660ab
...
...
@@ -43,7 +43,7 @@ private:
QThread
t
;
CollectionDB
*
con
;
Pulpo
pulpo
;
uint
interval
=
500
;
uint
interval
=
1
500
;
bool
go
=
false
;
signals:
...
...
view_models/BabeGrid.qml
View file @
72f660ab
...
...
@@ -17,7 +17,6 @@ Pane
height
:
400
background
:
Rectangle
{
anchors.fill
:
parent
...
...
view_models/BabeHolder.qml
View file @
72f660ab
...
...
@@ -3,14 +3,13 @@ import QtQuick.Controls 2.2
import
QtQuick
.
Layouts
1.3
import
QtGraphicalEffects
1.0
Rectangle
Item
{
property
string
emoji
property
string
message
clip
:
true
anchors.fill
:
parent
color
:
"
transparent
"
GridLayout
{
...
...
@@ -27,7 +26,7 @@ Rectangle
width
:
parent
.
width
height
:
parent
.
height
Layout.row
:
1
color
:
bae
.
backgroundColor
()
color
:
"
transparent
"
Image
{
...
...
widgets/AlbumsView.qml
View file @
72f660ab
...
...
@@ -11,7 +11,7 @@ BabeGrid
{
id
:
albumsViewGrid
visible
:
true
albumSize
:
Math
.
sqrt
(
root
.
width
*
root
.
height
)
*
0.25
albumSize
:
Math
.
sqrt
(
root
.
width
*
root
.
height
)
*
0.25
borderRadius
:
20
signal
rowClicked
(
var
track
)
...
...
@@ -20,6 +20,10 @@ BabeGrid
signal
queueTrack
(
var
track
)
signal
appendAlbum
(
var
tracks
)
transform
:
Translate
{
y
:
(
drawer
.
position
*
albumsViewGrid
.
height
*
0.33
)
*-
1
}
Drawer
{
...
...
widgets/ArtistsView.qml
View file @
72f660ab
...
...
@@ -20,6 +20,11 @@ BabeGrid
signal
queueTrack
(
var
track
)
signal
appendAlbum
(
var
tracks
)
transform
:
Translate
{
y
:
(
drawer
.
position
*
artistsViewGrid
.
height
*
0.33
)
*-
1
}
Drawer
{
id
:
drawer
...
...
widgets/BabeBar.qml
View file @
72f660ab
...
...
@@ -29,7 +29,7 @@ ToolBar
Rectangle
{
anchors.fill
:
parent
color
:
backgroundColor
color
:
backgroundColor
}
RowLayout
...
...
@@ -163,7 +163,7 @@ ToolBar
{
id
:
settingsIcon
text
:
MdiFont
.
Icon
.
settings
color
:
textColor
color
:
settingsDrawer
.
visible
?
accentColor
:
textColor
iconSize
:
size
}
...
...
widgets/MainPlaylist.qml
View file @
72f660ab
...
...
@@ -14,6 +14,7 @@ import "../widgets"
Item
{
id
:
mainPlaylistRoot
property
var
currentTrack
property
string
currentArtwork
property
bool
shuffle
:
false
...
...
@@ -40,33 +41,45 @@ Item
z
:
-
999
}
Column
Layout
Grid
Layout
{
id
:
playlistLayout
anchors.fill
:
parent
rowSpacing
:
0
rows
:
4
columns
:
1
Rectangle
Item
{
id
:
cover
Layout.preferredHeight
:
columnWidth
Layout.minimumHeight
:
columnWidth
Layout.maximumHeight
:
columnWidth
Layout.row
:
1
Layout.column
:
1
Layout.fillWidth
:
true
color
:
bae
.
altColor
()
Layout.preferredHeight
:
columnWidth
Layout.maximumHeight
:
250
visible
:
list
.
count
>
0
Rectangle
{
anchors.fill
:
parent
color
:
bae
.
midColor
()
z
:
-
999
}
FastBlur
{
anchors.fill
:
cover
width
:
mainPlaylistRoot
.
width
height
:
mainPlaylist
.
y
source
:
artwork
radius
:
100
transparentBorder
:
true
cached
:
true
}
Image
{
id
:
artwork
width
:
parent
.
width
<
columnWidth
?
parent
.
width
:
columnWidth
width
:
parent
.
height
<
250
?
parent
.
height
:
250
height
:
parent
.
height
anchors.centerIn
:
parent
source
:
currentArtwork
?
"
file://
"
+
encodeURIComponent
(
currentArtwork
)
:
"
qrc:/assets/cover.png
"
...
...
@@ -109,30 +122,36 @@ Item
}
Rectangle
Item
{
id
:
playbackControls
Layout.row
:
2
Layout.column
:
1
Layout.fillWidth
:
true
Layout.preferredHeight
:
48
Layout.minimumHeight
:
48
Layout.maximumHeight
:
48
height
:
48
visible
:
list
.
count
>
0
color
:
bae
.
midColor
()
onYChanged
:
Rectangle
{
if
(
playbackControls
.
y
<
columnWidth
/
4
)
{
cover
.
visible
=
false
playbackControls
.
y
=
0
}
else
{
cover
.
visible
=
true
playbackControls
.
y
=
columnWidth
}
anchors.fill
:
parent
color
:
bae
.
midColor
()
opacity
:
0.8
z
:
-
999
}
// onYChanged:
// {
// if(playbackControls.y<columnWidth/4)
// {
// cover.visible = false
// playbackControls.y = 0
// }else
// {
// cover.visible = true
// playbackControls.y = columnWidth
// }
// }
PlaylistMenu
{
...
...
@@ -255,17 +274,25 @@ Item
}
}
Rectangle
Item
{
id
:
slideBar
Layout.row
:
3
Layout.column
:
1
Layout.fillWidth
:
true
Layout.preferredHeight
:
22
Layout.minimumHeight
:
22
Layout.maximumHeight
:
22
color
:
"
transparent
"
height
:
48
Rectangle
{
anchors.fill
:
parent
color
:
bae
.
midColor
()
opacity
:
0.8
z
:
-
999
}
Slider
{
id
:
progressBar
anchors.fill
:
parent
width
:
parent
.
width
height
:
parent
.
height
from
:
0
to
:
1000
value
:
0
...
...
@@ -307,12 +334,13 @@ Item
}
Rectangle
Item
{
id
:
mainPlaylist
Layout.row
:
4
Layout.column
:
1
Layout.fillWidth
:
true
Layout.fillHeight
:
true
color
:
bae
.
altColor
()
StackView
{
...
...
widgets/SettingsView.qml
View file @
72f660ab
...
...
@@ -11,7 +11,7 @@ Drawer
id
:
settingsView
y
:
header
.
height
height
:
parent
.
height
-
header
.
height
width
:
parent
.
width
*
0.5
width
:
bae
.
isMobile
()
?
parent
.
width
*
0.7
:
parent
.
width
*
0.5
edge
:
Qt
.
RightEdge
interactive
:
true
focus
:
true
...
...
@@ -48,8 +48,10 @@ Drawer
folder
:
bae
.
homeDir
()
onAccepted
:
{
listModel
.
append
({
url
:
folder
.
toString
()})
scanDir
(
folder
.
toString
())
var
path
=
folder
.
toString
().
replace
(
"
file://
"
,
""
)
listModel
.
append
({
url
:
path
})
scanDir
(
path
)
}
}
FolderPicker
...
...
@@ -59,10 +61,8 @@ Drawer
Connections
{
target
:
folderPicker
onPathClicked
:
{
load
(
path
)
}
onPathClicked
:
load
(
path
)
onAccepted
:
{
listModel
.
append
({
url
:
path
})
...
...
@@ -129,11 +129,10 @@ Drawer
Component.onCompleted
:
{
var
map
=
bae
.
get
(
"
select url from
sources
"
)
var
map
=
bae
.
get
(
"
select url from
folders order by addDate desc
"
)
for
(
var
i
in
map
)
{
model
.
append
(
map
[
i
])
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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