Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2021 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 :
23 : #include "learnpagemodel.h"
24 :
25 : #include "translation.h"
26 :
27 : using namespace muse::learn;
28 :
29 0 : LearnPageModel::LearnPageModel(QObject* parent)
30 : : QObject(parent),
31 0 : m_gettingStartedModel(new PlaylistModel(this)),
32 0 : m_advancedModel(new PlaylistModel(this))
33 : {
34 0 : }
35 :
36 0 : PlaylistModel* LearnPageModel::startedPlaylist() const
37 : {
38 0 : return m_gettingStartedModel;
39 : }
40 :
41 0 : PlaylistModel* LearnPageModel::advancedPlaylist() const
42 : {
43 0 : return m_advancedModel;
44 : }
45 :
46 0 : void LearnPageModel::load()
47 : {
48 0 : learnService()->refreshPlaylists();
49 :
50 0 : m_gettingStartedModel->setPlaylist(learnService()->startedPlaylist());
51 0 : learnService()->startedPlaylistChanged().onReceive(this, [this] (const Playlist& playlist) {
52 0 : m_gettingStartedModel->setPlaylist(playlist);
53 0 : });
54 :
55 0 : m_advancedModel->setPlaylist(learnService()->advancedPlaylist());
56 0 : learnService()->advancedPlaylistChanged().onReceive(this, [this] (const Playlist& playlist) {
57 0 : m_advancedModel->setPlaylist(playlist);
58 0 : });
59 0 : }
60 :
61 0 : QVariantMap LearnPageModel::classesAuthor() const
62 : {
63 0 : QVariantMap author;
64 0 : author["name"] = muse::qtrc("learn", "Marc Sabatella");
65 0 : author["role"] = muse::qtrc("learn", "Instructor");
66 :
67 : // Rename to "MuseScore Studio" in this description?
68 0 : author["position"] = muse::qtrc("learn", "Creator, Mastering MuseScore");
69 0 : author["description"] = muse::qtrc("learn", "Welcome to Mastering MuseScore – the most comprehensive resource "
70 : "for learning the world’s most popular music notation software! "
71 : "My name is Marc Sabatella, and I have been helping develop, support, "
72 : "and promote MuseScore since its initial release over ten years ago.\n\n"
73 : "Whether you are just getting started with music notation software, "
74 : "or are a power user eager to explore advanced engraving and playback techniques, "
75 : "my flagship online course Mastering MuseScore "
76 : "covers everything you need to know to get the most out of MuseScore.\n\n"
77 : "In addition, Mastering MuseScore features a supportive community of musicians, "
78 : "with discussion spaces, live streams, "
79 : "and other related courses and services to help you create your best music. "
80 : "Take advantage of this opportunity to learn MuseScore from one of its most recognized experts!\n\n"
81 0 : "(Note: Mastering MuseScore is available in English only)");
82 0 : author["avatarUrl"] = "qrc:/qt/qml/Muse/Learn/resources/marc_sabatella.jpg";
83 0 : author["organizationName"] = muse::qtrc("learn", "Mastering MuseScore");
84 0 : author["organizationUrl"] = "https://www.masteringmusescore.com/musescore4";
85 :
86 0 : return author;
87 0 : }
88 :
89 0 : bool LearnPageModel::classesEnabled()
90 : {
91 0 : return learnConfiguration()->classesEnabled();
92 : }
|