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
V
VVave
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
marcin mikołajczak
VVave
Commits
afcbe1c3
Commit
afcbe1c3
authored
Mar 29, 2020
by
Camilo Higuita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add credits
parent
17445948
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
70 deletions
+74
-70
main.cpp
main.cpp
+74
-70
No files found.
main.cpp
View file @
afcbe1c3
...
...
@@ -12,8 +12,10 @@
#ifdef STATIC_MAUIKIT
#include "3rdparty/mauikit/src/mauikit.h"
#include "fmstatic.h"
#include "mauiapp.h"
#else
#include <MauiKit/fmstatic.h>
#include <MauiKit/mauiapp.h>
#endif
#if defined Q_OS_ANDROID || defined Q_OS_IOS
...
...
@@ -50,95 +52,97 @@ Q_DECL_EXPORT
int
main
(
int
argc
,
char
*
argv
[])
{
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
#ifdef Q_OS_WIN32
qputenv
(
"QT_MULTIMEDIA_PREFERRED_PLUGINS"
,
"w"
);
#endif
qputenv
(
"QT_MULTIMEDIA_PREFERRED_PLUGINS"
,
"w"
);
#endif
#if defined Q_OS_ANDROID | defined Q_OS_IOS
QGuiApplication
app
(
argc
,
argv
);
QGuiApplication
app
(
argc
,
argv
);
#else
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
#endif
#ifdef Q_OS_ANDROID
if
(
!
MAUIAndroid
::
checkRunTimePermissions
({
"android.permission.WRITE_EXTERNAL_STORAGE"
}))
return
-
1
;
if
(
!
MAUIAndroid
::
checkRunTimePermissions
({
"android.permission.WRITE_EXTERNAL_STORAGE"
}))
return
-
1
;
#endif
app
.
setApplicationName
(
BAE
::
appName
);
app
.
setApplicationVersion
(
BAE
::
version
);
app
.
setApplicationDisplayName
(
BAE
::
displayName
);
app
.
setOrganizationName
(
BAE
::
orgName
);
app
.
setOrganizationDomain
(
BAE
::
orgDomain
);
app
.
setWindowIcon
(
QIcon
(
"qrc:/assets/vvave.png"
));
QCommandLineParser
parser
;
parser
.
setApplicationDescription
(
BAE
::
description
);
const
QCommandLineOption
versionOption
=
parser
.
addVersionOption
();
parser
.
process
(
app
);
const
QStringList
args
=
parser
.
positionalArguments
();
static
auto
babe
=
new
vvave
;
static
auto
youtube
=
new
YouTube
;
// Spotify spotify;
QFontDatabase
::
addApplicationFont
(
":/assets/materialdesignicons-webfont.ttf"
);
QQmlApplicationEngine
engine
;
const
QUrl
url
(
QStringLiteral
(
"qrc:/main.qml"
));
QObject
::
connect
(
&
engine
,
&
QQmlApplicationEngine
::
objectCreated
,
&
app
,
[
url
,
args
](
QObject
*
obj
,
const
QUrl
&
objUrl
)
{
if
(
!
obj
&&
url
==
objUrl
)
QCoreApplication
::
exit
(
-
1
);
if
(
FMStatic
::
loadSettings
(
"Settings"
,
"ScanCollectionOnStartUp"
,
true
).
toBool
())
{
const
auto
currentSources
=
vvave
::
getSourceFolders
();
babe
->
scanDir
(
currentSources
.
isEmpty
()
?
BAE
::
defaultSources
:
currentSources
);
}
if
(
!
args
.
isEmpty
())
babe
->
openUrls
(
args
);
},
Qt
::
QueuedConnection
);
qmlRegisterSingletonType
<
vvave
>
(
"org.maui.vvave"
,
1
,
0
,
"Vvave"
,
[](
QQmlEngine
*
engine
,
QJSEngine
*
scriptEngine
)
->
QObject
*
{
Q_UNUSED
(
engine
)
Q_UNUSED
(
scriptEngine
)
return
babe
;
});
qmlRegisterSingletonType
<
vvave
>
(
"org.maui.vvave"
,
1
,
0
,
"YouTube"
,
[](
QQmlEngine
*
engine
,
QJSEngine
*
scriptEngine
)
->
QObject
*
{
Q_UNUSED
(
engine
)
Q_UNUSED
(
scriptEngine
)
return
youtube
;
});
qmlRegisterType
<
TracksModel
>
(
"TracksList"
,
1
,
0
,
"Tracks"
);
qmlRegisterType
<
PlaylistsModel
>
(
"PlaylistsList"
,
1
,
0
,
"Playlists"
);
qmlRegisterType
<
AlbumsModel
>
(
"AlbumsList"
,
1
,
0
,
"Albums"
);
qmlRegisterType
<
Cloud
>
(
"CloudList"
,
1
,
0
,
"Cloud"
);
qmlRegisterType
<
Player
>
(
"Player"
,
1
,
0
,
"Player"
);
app
.
setApplicationName
(
BAE
::
appName
);
app
.
setApplicationVersion
(
BAE
::
version
);
app
.
setApplicationDisplayName
(
BAE
::
displayName
);
app
.
setOrganizationName
(
BAE
::
orgName
);
app
.
setOrganizationDomain
(
BAE
::
orgDomain
);
app
.
setWindowIcon
(
QIcon
(
"qrc:/assets/vvave.png"
));
MauiApp
::
instance
()
->
setCredits
({
QVariantMap
({{
"name"
,
"Camilo Higuita"
},
{
"email"
,
"milo.h@aol.com"
},
{
"year"
,
"2019-2020"
}})});
QCommandLineParser
parser
;
parser
.
setApplicationDescription
(
BAE
::
description
);
const
QCommandLineOption
versionOption
=
parser
.
addVersionOption
();
parser
.
process
(
app
);
const
QStringList
args
=
parser
.
positionalArguments
();
static
auto
babe
=
new
vvave
;
static
auto
youtube
=
new
YouTube
;
// Spotify spotify;
QFontDatabase
::
addApplicationFont
(
":/assets/materialdesignicons-webfont.ttf"
);
QQmlApplicationEngine
engine
;
const
QUrl
url
(
QStringLiteral
(
"qrc:/main.qml"
));
QObject
::
connect
(
&
engine
,
&
QQmlApplicationEngine
::
objectCreated
,
&
app
,
[
url
,
args
](
QObject
*
obj
,
const
QUrl
&
objUrl
)
{
if
(
!
obj
&&
url
==
objUrl
)
QCoreApplication
::
exit
(
-
1
);
if
(
FMStatic
::
loadSettings
(
"Settings"
,
"ScanCollectionOnStartUp"
,
true
).
toBool
())
{
const
auto
currentSources
=
vvave
::
getSourceFolders
();
babe
->
scanDir
(
currentSources
.
isEmpty
()
?
BAE
::
defaultSources
:
currentSources
);
}
if
(
!
args
.
isEmpty
())
babe
->
openUrls
(
args
);
},
Qt
::
QueuedConnection
);
qmlRegisterSingletonType
<
vvave
>
(
"org.maui.vvave"
,
1
,
0
,
"Vvave"
,
[](
QQmlEngine
*
engine
,
QJSEngine
*
scriptEngine
)
->
QObject
*
{
Q_UNUSED
(
engine
)
Q_UNUSED
(
scriptEngine
)
return
babe
;
});
qmlRegisterSingletonType
<
vvave
>
(
"org.maui.vvave"
,
1
,
0
,
"YouTube"
,
[](
QQmlEngine
*
engine
,
QJSEngine
*
scriptEngine
)
->
QObject
*
{
Q_UNUSED
(
engine
)
Q_UNUSED
(
scriptEngine
)
return
youtube
;
});
qmlRegisterType
<
TracksModel
>
(
"TracksList"
,
1
,
0
,
"Tracks"
);
qmlRegisterType
<
PlaylistsModel
>
(
"PlaylistsList"
,
1
,
0
,
"Playlists"
);
qmlRegisterType
<
AlbumsModel
>
(
"AlbumsList"
,
1
,
0
,
"Albums"
);
qmlRegisterType
<
Cloud
>
(
"CloudList"
,
1
,
0
,
"Cloud"
);
qmlRegisterType
<
Player
>
(
"Player"
,
1
,
0
,
"Player"
);
#ifdef STATIC_KIRIGAMI
KirigamiPlugin
::
getInstance
().
registerTypes
();
KirigamiPlugin
::
getInstance
().
registerTypes
();
#endif
#ifdef STATIC_MAUIKIT
MauiKit
::
getInstance
().
registerTypes
();
MauiKit
::
getInstance
().
registerTypes
();
#endif
QtWebView
::
initialize
();
engine
.
load
(
url
);
QtWebView
::
initialize
();
engine
.
load
(
url
);
#ifdef Q_OS_MACOS
MAUIMacOS
::
removeTitlebarFromWindow
();
MAUIMacOS
::
removeTitlebarFromWindow
();
#endif
return
app
.
exec
();
return
app
.
exec
();
}
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