Commit 23e7e9c2 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

lazy initialize as much as possible

Summary:
lazy initialize the standard actions

lazy initialize all the models and the MusicListenersManager after start

Test Plan:
everything seems to work like it used to work
the interface is shown earlier but with a busy indicator

Reviewers: #elisa, astippich

Reviewed By: #elisa, astippich

Subscribers: astippich

Tags: #elisa

Maniphest Tasks: T7887

Differential Revision: https://phabricator.kde.org/D10402
parent 157c9f04
......@@ -27,10 +27,17 @@ set(managemediaplayercontrolTest_SOURCES
../src/databaseinterface.cpp
../src/musiclistenersmanager.cpp
../src/elisaapplication.cpp
../src/manageaudioplayer.cpp
../src/models/allalbumsmodel.cpp
../src/models/allartistsmodel.cpp
../src/models/alltracksmodel.cpp
../src/models/albummodel.cpp
../src/models/abstractmediaproxymodel.cpp
../src/models/allalbumsproxymodel.cpp
../src/models/allartistsproxymodel.cpp
../src/models/alltracksproxymodel.cpp
../src/models/singleartistproxymodel.cpp
../src/models/singlealbumproxymodel.cpp
../src/notificationitem.cpp
../src/trackslistener.cpp
../src/musicartist.cpp
......@@ -109,10 +116,17 @@ set(manageheaderbarTest_SOURCES
../src/databaseinterface.cpp
../src/musiclistenersmanager.cpp
../src/elisaapplication.cpp
../src/manageaudioplayer.cpp
../src/models/allalbumsmodel.cpp
../src/models/allartistsmodel.cpp
../src/models/alltracksmodel.cpp
../src/models/albummodel.cpp
../src/models/abstractmediaproxymodel.cpp
../src/models/allalbumsproxymodel.cpp
../src/models/allartistsproxymodel.cpp
../src/models/alltracksproxymodel.cpp
../src/models/singleartistproxymodel.cpp
../src/models/singlealbumproxymodel.cpp
../src/notificationitem.cpp
../src/trackslistener.cpp
../src/trackslistener.cpp
......@@ -206,6 +220,13 @@ set(mediaplaylistTest_SOURCES
../src/models/allartistsmodel.cpp
../src/models/alltracksmodel.cpp
../src/models/albummodel.cpp
../src/models/abstractmediaproxymodel.cpp
../src/models/allalbumsproxymodel.cpp
../src/models/allartistsproxymodel.cpp
../src/models/alltracksproxymodel.cpp
../src/models/singleartistproxymodel.cpp
../src/models/singlealbumproxymodel.cpp
../src/manageaudioplayer.cpp
../src/elisaapplication.cpp
../src/notificationitem.cpp
../src/musicartist.cpp
......@@ -285,10 +306,17 @@ set(trackslistenertest_SOURCES
../src/trackslistener.cpp
../src/musiclistenersmanager.cpp
../src/elisaapplication.cpp
../src/manageaudioplayer.cpp
../src/models/allalbumsmodel.cpp
../src/models/allartistsmodel.cpp
../src/models/alltracksmodel.cpp
../src/models/albummodel.cpp
../src/models/abstractmediaproxymodel.cpp
../src/models/allalbumsproxymodel.cpp
../src/models/allartistsproxymodel.cpp
../src/models/alltracksproxymodel.cpp
../src/models/singleartistproxymodel.cpp
../src/models/singlealbumproxymodel.cpp
../src/notificationitem.cpp
../src/musicartist.cpp
../src/musicalbum.cpp
......@@ -449,9 +477,51 @@ target_include_directories(localfilelistingtest PRIVATE ${CMAKE_SOURCE_DIR}/src)
if (KF5XmlGui_FOUND AND KF5KCMUtils_FOUND)
set(elisaapplicationtest_SOURCES
../src/elisaapplication.cpp
../src/musiclistenersmanager.cpp
../src/databaseinterface.cpp
../src/notificationitem.cpp
../src/trackslistener.cpp
../src/mediaplaylist.cpp
../src/musicartist.cpp
../src/musicalbum.cpp
../src/musicaudiotrack.cpp
../src/elisautils.cpp
../src/manageaudioplayer.cpp
../src/models/allalbumsmodel.cpp
../src/models/allartistsmodel.cpp
../src/models/alltracksmodel.cpp
../src/models/albummodel.cpp
../src/models/abstractmediaproxymodel.cpp
../src/models/allalbumsproxymodel.cpp
../src/models/allartistsproxymodel.cpp
../src/models/alltracksproxymodel.cpp
../src/models/singleartistproxymodel.cpp
../src/models/singlealbumproxymodel.cpp
../src/file/filelistener.cpp
../src/file/localfilelisting.cpp
../src/abstractfile/abstractfilelistener.cpp
../src/abstractfile/abstractfilelisting.cpp
elisaapplicationtest.cpp
)
if (KF5Baloo_FOUND)
if (Qt5DBus_FOUND)
qt5_add_dbus_interface(elisaapplicationtest_SOURCES
${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.fileindexer.xml
baloo/fileindexer)
qt5_add_dbus_interface(elisaapplicationtest_SOURCES
${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.scheduler.xml
baloo/scheduler)
set(elisaapplicationtest_SOURCES
${elisaapplicationtest_SOURCES}
../src/baloo/baloolistener.cpp
../src/baloo/localbaloofilelisting.cpp
)
endif()
endif()
kconfig_add_kcfg_files(elisaapplicationtest_SOURCES ../src/elisa_settings.kcfgc )
set(elisaapplicationtest_SOURCES
${elisaapplicationtest_SOURCES}
......@@ -460,7 +530,8 @@ if (KF5XmlGui_FOUND AND KF5KCMUtils_FOUND)
ecm_add_test(${elisaapplicationtest_SOURCES}
TEST_NAME "elisaapplicationtest"
LINK_LIBRARIES Qt5::Test Qt5::Core Qt5::Widgets KF5::ConfigCore KF5::ConfigGui KF5::ConfigWidgets KF5::XmlGui KF5::KCMUtils)
LINK_LIBRARIES Qt5::Test Qt5::Core Qt5::Widgets Qt5::Multimedia Qt5::Sql Qt5::Concurrent
KF5::FileMetaData KF5::I18n KF5::ConfigCore KF5::ConfigGui KF5::ConfigWidgets KF5::XmlGui KF5::KCMUtils KF5::Baloo)
target_include_directories(elisaapplicationtest PRIVATE ${CMAKE_SOURCE_DIR}/src)
endif()
......
......@@ -243,6 +243,12 @@ set(elisaImport_SOURCES
models/allalbumsmodel.cpp
models/allartistsmodel.cpp
models/alltracksmodel.cpp
models/abstractmediaproxymodel.cpp
models/allalbumsproxymodel.cpp
models/allartistsproxymodel.cpp
models/alltracksproxymodel.cpp
models/singleartistproxymodel.cpp
models/singlealbumproxymodel.cpp
databaseinterface.cpp
musiclistenersmanager.cpp
trackslistener.cpp
......
......@@ -19,6 +19,15 @@
*/
#include "elisaapplication.h"
#include "musiclistenersmanager.h"
#include "models/allalbumsproxymodel.h"
#include "models/alltracksproxymodel.h"
#include "models/allartistsproxymodel.h"
#include "models/singleartistproxymodel.h"
#include "models/singlealbumproxymodel.h"
#include "mediaplaylist.h"
#include "elisa_settings.h"
#include <KConfigCore/KAuthorized>
......@@ -51,6 +60,8 @@
#include <QDir>
#include <QDebug>
#include <memory>
class ElisaApplicationPrivate
{
public:
......@@ -63,62 +74,69 @@ public:
Q_UNUSED(parent)
}
#if defined KF5KCMUtils_FOUND && KF5KCMUtils_FOUND
KCMultiDialog mConfigurationDialog;
#endif
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
KActionCollection mCollection;
#endif
QStringList mArguments;
std::unique_ptr<MusicListenersManager> mMusicManager;
std::unique_ptr<AllAlbumsProxyModel> mAllAlbumsProxyModel;
std::unique_ptr<AllArtistsProxyModel> mAllArtistsProxyModel;
std::unique_ptr<AllTracksProxyModel> mAllTracksProxyModel;
std::unique_ptr<SingleArtistProxyModel> mSingleArtistProxyModel;
std::unique_ptr<SingleAlbumProxyModel> mSingleAlbumProxyModel;
std::unique_ptr<MediaPlayList> mMediaPlayList;
};
ElisaApplication::ElisaApplication(QObject *parent) : QObject(parent), d(std::make_unique<ElisaApplicationPrivate>(this))
{
setupActions();
#if defined KF5KCMUtils_FOUND && KF5KCMUtils_FOUND
d->mConfigurationDialog.addModule(QStringLiteral("kcm_elisa_local_file"));
#endif
}
ElisaApplication::~ElisaApplication()
= default;
void ElisaApplication::setupActions()
void ElisaApplication::setupActions(const QString &actionName)
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
auto quitAction = KStandardAction::quit(QCoreApplication::instance(), &QCoreApplication::quit, &d->mCollection);
d->mCollection.addAction(QStringLiteral("file_quit"), quitAction);
if (actionName == QStringLiteral("file_quit")) {
auto quitAction = KStandardAction::quit(QCoreApplication::instance(), &QCoreApplication::quit, &d->mCollection);
d->mCollection.addAction(actionName, quitAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("help_contents"))) {
if (actionName == QStringLiteral("help_contents") && KAuthorized::authorizeAction(actionName)) {
auto handBookAction = KStandardAction::helpContents(this, &ElisaApplication::appHelpActivated, &d->mCollection);
d->mCollection.addAction(handBookAction->objectName(), handBookAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("help_report_bug")) && !KAboutData::applicationData().bugAddress().isEmpty()) {
if (actionName == QStringLiteral("help_report_bug") && KAuthorized::authorizeAction(actionName) && !KAboutData::applicationData().bugAddress().isEmpty()) {
auto reportBugAction = KStandardAction::reportBug(this, &ElisaApplication::reportBug, &d->mCollection);
d->mCollection.addAction(reportBugAction->objectName(), reportBugAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("help_about_app"))) {
if (actionName == QStringLiteral("help_about_app") && KAuthorized::authorizeAction(actionName)) {
auto aboutAppAction = KStandardAction::aboutApp(this, &ElisaApplication::aboutApplication, this);
d->mCollection.addAction(aboutAppAction->objectName(), aboutAppAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("options_configure"))) {
if (actionName == QStringLiteral("options_configure") && KAuthorized::authorizeAction(actionName)) {
auto preferencesAction = KStandardAction::preferences(this, &ElisaApplication::configureElisa, this);
d->mCollection.addAction(preferencesAction->objectName(), preferencesAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("options_configure_keybinding"))) {
if (actionName == QStringLiteral("options_configure_keybinding") && KAuthorized::authorizeAction(actionName)) {
auto keyBindingsAction = KStandardAction::keyBindings(this, &ElisaApplication::configureShortcuts, this);
d->mCollection.addAction(keyBindingsAction->objectName(), keyBindingsAction);
}
if (KAuthorized::authorizeAction(QStringLiteral("go_back"))) {
if (actionName == QStringLiteral("go_back") && KAuthorized::authorizeAction(actionName)) {
auto goBackAction = KStandardAction::back(this, &ElisaApplication::goBack, this);
d->mCollection.addAction(goBackAction->objectName(), goBackAction);
}
......@@ -199,8 +217,11 @@ void ElisaApplication::configureShortcuts()
void ElisaApplication::configureElisa()
{
#if defined KF5KCMUtils_FOUND && KF5KCMUtils_FOUND
d->mConfigurationDialog.setModal(true);
d->mConfigurationDialog.show();
KCMultiDialog configurationDialog;
configurationDialog.addModule(QStringLiteral("kcm_elisa_local_file"));
configurationDialog.setModal(true);
configurationDialog.show();
#endif
}
......@@ -225,10 +246,52 @@ QStringList ElisaApplication::checkFileListAndMakeAbsolute(const QStringList &fi
return filesToOpen;
}
void ElisaApplication::initialize()
{
d->mMusicManager = std::make_unique<MusicListenersManager>();
Q_EMIT musicManagerChanged();
d->mAllAlbumsProxyModel = std::make_unique<AllAlbumsProxyModel>();
Q_EMIT allAlbumsProxyModelChanged();
d->mAllArtistsProxyModel = std::make_unique<AllArtistsProxyModel>();
Q_EMIT allArtistsProxyModelChanged();
d->mAllTracksProxyModel = std::make_unique<AllTracksProxyModel>();
Q_EMIT allTracksProxyModelChanged();
d->mSingleArtistProxyModel = std::make_unique<SingleArtistProxyModel>();
Q_EMIT singleArtistProxyModelChanged();
d->mSingleAlbumProxyModel = std::make_unique<SingleAlbumProxyModel>();
Q_EMIT singleAlbumProxyModelChanged();
d->mMediaPlayList = std::make_unique<MediaPlayList>();
Q_EMIT mediaPlayListChanged();
d->mMusicManager->setElisaApplication(this);
d->mMediaPlayList->setMusicListenersManager(d->mMusicManager.get());
QObject::connect(this, &ElisaApplication::enqueue, d->mMediaPlayList.get(), &MediaPlayList::enqueueAndPlay);
d->mAllAlbumsProxyModel->setSourceModel(d->mMusicManager->allAlbumsModel());
d->mAllArtistsProxyModel->setSourceModel(d->mMusicManager->allArtistsModel());
d->mAllTracksProxyModel->setSourceModel(d->mMusicManager->allTracksModel());
d->mSingleArtistProxyModel->setSourceModel(d->mMusicManager->allAlbumsModel());
d->mSingleAlbumProxyModel->setSourceModel(d->mMusicManager->albumModel());
d->mAllAlbumsProxyModel->setMediaPlayList(d->mMediaPlayList.get());
d->mAllArtistsProxyModel->setMediaPlayList(d->mMediaPlayList.get());
d->mAllTracksProxyModel->setMediaPlayList(d->mMediaPlayList.get());
d->mSingleArtistProxyModel->setMediaPlayList(d->mMediaPlayList.get());
d->mSingleAlbumProxyModel->setMediaPlayList(d->mMediaPlayList.get());
}
QAction * ElisaApplication::action(const QString& name)
{
#if defined KF5XmlGui_FOUND && KF5XmlGui_FOUND
return d->mCollection.action(name);
auto resultAction = d->mCollection.action(name);
if (!resultAction) {
setupActions(name);
resultAction = d->mCollection.action(name);
}
return resultAction;
#else
Q_UNUSED(name);
......@@ -246,5 +309,40 @@ const QStringList &ElisaApplication::arguments() const
return d->mArguments;
}
MusicListenersManager *ElisaApplication::musicManager() const
{
return d->mMusicManager.get();
}
AllAlbumsProxyModel *ElisaApplication::allAlbumsProxyModel() const
{
return d->mAllAlbumsProxyModel.get();
}
AllArtistsProxyModel *ElisaApplication::allArtistsProxyModel() const
{
return d->mAllArtistsProxyModel.get();
}
AllTracksProxyModel *ElisaApplication::allTracksProxyModel() const
{
return d->mAllTracksProxyModel.get();
}
SingleArtistProxyModel *ElisaApplication::singleArtistProxyModel() const
{
return d->mSingleArtistProxyModel.get();
}
SingleAlbumProxyModel *ElisaApplication::singleAlbumProxyModel() const
{
return d->mSingleAlbumProxyModel.get();
}
MediaPlayList *ElisaApplication::mediaPlayList() const
{
return d->mMediaPlayList.get();
}
#include "moc_elisaapplication.cpp"
......@@ -29,6 +29,13 @@
class QIcon;
class QAction;
class MusicListenersManager;
class AllAlbumsProxyModel;
class AllArtistsProxyModel;
class AllTracksProxyModel;
class SingleArtistProxyModel;
class SingleAlbumProxyModel;
class MediaPlayList;
class ElisaApplicationPrivate;
class ElisaApplication : public QObject
......@@ -41,23 +48,77 @@ class ElisaApplication : public QObject
WRITE setArguments
NOTIFY argumentsChanged)
Q_PROPERTY(MusicListenersManager *musicManager
READ musicManager
NOTIFY musicManagerChanged)
Q_PROPERTY(AllAlbumsProxyModel *allAlbumsProxyModel
READ allAlbumsProxyModel
NOTIFY allAlbumsProxyModelChanged)
Q_PROPERTY(AllArtistsProxyModel *allArtistsProxyModel
READ allArtistsProxyModel
NOTIFY allArtistsProxyModelChanged)
Q_PROPERTY(AllTracksProxyModel *allTracksProxyModel
READ allTracksProxyModel
NOTIFY allTracksProxyModelChanged)
Q_PROPERTY(SingleArtistProxyModel *singleArtistProxyModel
READ singleArtistProxyModel
NOTIFY singleArtistProxyModelChanged)
Q_PROPERTY(SingleAlbumProxyModel *singleAlbumProxyModel
READ singleAlbumProxyModel
NOTIFY singleAlbumProxyModelChanged)
Q_PROPERTY(MediaPlayList *mediaPlayList
READ mediaPlayList
NOTIFY mediaPlayListChanged)
public:
explicit ElisaApplication(QObject *parent = nullptr);
~ElisaApplication() override;
void setupActions();
Q_INVOKABLE QAction* action(const QString& name);
Q_INVOKABLE QString iconName(const QIcon& icon);
const QStringList &arguments() const;
MusicListenersManager *musicManager() const;
AllAlbumsProxyModel *allAlbumsProxyModel() const;
AllArtistsProxyModel *allArtistsProxyModel() const;
AllTracksProxyModel *allTracksProxyModel() const;
SingleArtistProxyModel *singleArtistProxyModel() const;
SingleAlbumProxyModel *singleAlbumProxyModel() const;
MediaPlayList *mediaPlayList() const;
Q_SIGNALS:
void argumentsChanged();
void musicManagerChanged();
void allAlbumsProxyModelChanged();
void allArtistsProxyModelChanged();
void allTracksProxyModelChanged();
void singleArtistProxyModelChanged();
void singleAlbumProxyModelChanged();
void mediaPlayListChanged();
void enqueue(const QStringList &files);
public Q_SLOTS:
......@@ -80,6 +141,7 @@ public Q_SLOTS:
void openRequested(const QList< QUrl > &uris);
void initialize();
private Q_SLOTS:
......@@ -87,6 +149,8 @@ private Q_SLOTS:
private:
void setupActions(const QString &actionName);
QStringList checkFileListAndMakeAbsolute(const QStringList &filesList, const QString &workingDirectory) const;
std::unique_ptr<ElisaApplicationPrivate> d;
......
......@@ -236,27 +236,6 @@ int main(int argc, char *argv[])
Elisa::ElisaConfiguration::self()->load();
Elisa::ElisaConfiguration::self()->save();
MusicListenersManager myMusicManager;
myMusicManager.setElisaApplication(&myApp);
MediaPlayList mediaPlayList;
mediaPlayList.setMusicListenersManager(&myMusicManager);
QObject::connect(&myApp, &ElisaApplication::enqueue, &mediaPlayList, &MediaPlayList::enqueueAndPlay);
AllAlbumsProxyModel allAlbumsProxyModel;
allAlbumsProxyModel.setSourceModel(myMusicManager.allAlbumsModel());
allAlbumsProxyModel.setMediaPlayList(&mediaPlayList);
AllArtistsProxyModel allArtistsProxyModel;
allArtistsProxyModel.setSourceModel(myMusicManager.allArtistsModel());
allArtistsProxyModel.setMediaPlayList(&mediaPlayList);
AllTracksProxyModel allTracksProxyModel;
allTracksProxyModel.setSourceModel(myMusicManager.allTracksModel());
allTracksProxyModel.setMediaPlayList(&mediaPlayList);
SingleArtistProxyModel singleArtistProxyModel;
singleArtistProxyModel.setSourceModel(myMusicManager.allAlbumsModel());
singleArtistProxyModel.setMediaPlayList(&mediaPlayList);
SingleAlbumProxyModel singleAlbumProxyModel;
singleAlbumProxyModel.setSourceModel(myMusicManager.albumModel());
singleAlbumProxyModel.setMediaPlayList(&mediaPlayList);
QQmlApplicationEngine engine;
engine.addImportPath(QStringLiteral("qrc:/imports"));
QQmlFileSelector selector(&engine);
......@@ -269,13 +248,6 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.rootContext()->setContextProperty(QStringLiteral("elisa"), &myApp);
engine.rootContext()->setContextProperty(QStringLiteral("allListeners"), &myMusicManager);
engine.rootContext()->setContextProperty(QStringLiteral("mediaPlayList"), &mediaPlayList);
engine.rootContext()->setContextProperty(QStringLiteral("allAlbumsProxyModel"), &allAlbumsProxyModel);
engine.rootContext()->setContextProperty(QStringLiteral("allArtistsProxyModel"), &allArtistsProxyModel);
engine.rootContext()->setContextProperty(QStringLiteral("allTracksProxyModel"), &allTracksProxyModel);
engine.rootContext()->setContextProperty(QStringLiteral("singleArtistProxyModel"), &singleArtistProxyModel);
engine.rootContext()->setContextProperty(QStringLiteral("singleAlbumProxyModel"), &singleAlbumProxyModel);
engine.rootContext()->setContextProperty(QStringLiteral("logicalDpi"), QGuiApplication::primaryScreen()->logicalDotsPerInch());
engine.load(QUrl(QStringLiteral("qrc:/qml/ElisaMainWindow.qml")));
......
......@@ -102,8 +102,8 @@ ApplicationWindow {
persistentSettings.width = mainWindow.width;
persistentSettings.height = mainWindow.height;
persistentSettings.playListState = mediaPlayList.persistentState;
persistentSettings.playListControlerState = mediaPlayList.persistentState;
persistentSettings.playListState = elisa.mediaPlayList.persistentState;
persistentSettings.playListControlerState = elisa.mediaPlayList.persistentState;
persistentSettings.audioPlayerState = manageAudioPlayer.persistentState
persistentSettings.playControlItemVolume = headerBar.playerControl.volume
......@@ -114,8 +114,8 @@ ApplicationWindow {
PlatformIntegration {
id: platformInterface
playListModel: mediaPlayList
playListControler: mediaPlayList
playListModel: elisa.mediaPlayList
playListControler: elisa.mediaPlayList
audioPlayerManager: manageAudioPlayer
headerBarManager: myHeaderBarManager
manageMediaPlayerControl: myPlayControlManager
......@@ -155,7 +155,7 @@ ApplicationWindow {
}
Connections {
target: mediaPlayList
target: elisa.mediaPlayList
onPlayListLoadFailed: {
messageNotification.showNotification(i18nc("message of passive notification when playlist load failed", "Load of playlist failed"), 3000)
}
......@@ -163,16 +163,11 @@ ApplicationWindow {
onPlayListFinished: manageAudioPlayer.playListFinished()
}
Component.onCompleted: {
mediaPlayList.persistentState = persistentSettings.playListState
mediaPlayList.enqueueAndPlay(elisa.arguments)
}
ManageHeaderBar {
id: myHeaderBarManager
playListModel: mediaPlayList
currentTrack: mediaPlayList.currentTrack
playListModel: elisa.mediaPlayList
currentTrack: elisa.mediaPlayList.currentTrack
artistRole: MediaPlayList.ArtistRole
titleRole: MediaPlayList.TitleRole
......@@ -184,8 +179,8 @@ ApplicationWindow {
ManageAudioPlayer {
id: manageAudioPlayer
currentTrack: mediaPlayList.currentTrack
playListModel: mediaPlayList
currentTrack: elisa.mediaPlayList.currentTrack
playListModel: elisa.mediaPlayList
urlRole: MediaPlayList.ResourceRole
isPlayingRole: MediaPlayList.IsPlayingRole
titleRole: MediaPlayList.TitleRole
......@@ -204,11 +199,11 @@ ApplicationWindow {
onPlayerPlay: audioPlayer.play()
onPlayerPause: audioPlayer.pause()
onPlayerStop: audioPlayer.stop()
onSkipNextTrack: mediaPlayList.skipNextTrack()
onSkipNextTrack: elisa.mediaPlayList.skipNextTrack()
onSeek: audioPlayer.seek(position)
onSourceInError:
{
mediaPlayList.trackInError(source, playerError)
elisa.mediaPlayList.trackInError(source, playerError)
allListeners.playBackError(source, playerError)
}
......@@ -218,8 +213,8 @@ ApplicationWindow {
ManageMediaPlayerControl {
id: myPlayControlManager
playListModel: mediaPlayList
currentTrack: mediaPlayList.currentTrack
playListModel: elisa.mediaPlayList
currentTrack: elisa.mediaPlayList.currentTrack
}
PassiveNotification {
......@@ -271,8 +266,8 @@ ApplicationWindow {
playerControl.onPlay: manageAudioPlayer.playPause()
playerControl.onPause: manageAudioPlayer.playPause()
playerControl.onPlayPrevious: mediaPlayList.skipPreviousTrack()
playerControl.onPlayNext: mediaPlayList.skipNextTrack()
playerControl.onPlayPrevious: elisa.mediaPlayList.skipPreviousTrack()
playerControl.onPlayNext: elisa.mediaPlayList.skipNextTrack()
ToolButton {
id: menuButton
......@@ -309,10 +304,33 @@ ApplicationWindow {
bottom: menuButton.bottom
rightMargin: elisaTheme.layoutHorizontalMargin * 3
}
}
Binding {
target: importedTracksCountNotification
property: 'musicManager'
value: elisa.musicManager
when: elisa.musicManager !== undefined
}
Loader {
sourceComponent: Binding {
target: importedTracksCountNotification
property: 'indexingRunning'
value: elisa.musicManager.indexingRunning