MuseScore  3.4
Music composition and notation
scorecmp.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2018 Werner Schweer
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __SCORECMP_H__
14 #define __SCORECMP_H__
15 
16 namespace Ui {
17  class ScoreComparisonTool;
18  }
19 
20 namespace Ms {
21 
22 class Score;
23 class ScoreElement;
24 class ScoreDiff;
25 class RawScoreDiffModel;
26 class ScoreDiffModel;
27 class ScoreListModel;
28 struct ScoreVersion;
29 class ScoreVersionListModel;
30 
31 //---------------------------------------------------------
32 // ScoreComparisonTool
33 //---------------------------------------------------------
34 
35 class ScoreComparisonTool : public QDockWidget {
36  Q_OBJECT
37 
38  public:
39  enum class Mode { RAW, INTELLIGENT };
40 
41  private:
42  Ui::ScoreComparisonTool* _ui;
44 
45  ScoreListModel* _scoreListModel = nullptr;
46  ScoreVersionListModel* _scoreVersionsModel1 = nullptr;
47  ScoreVersionListModel* _scoreVersionsModel2 = nullptr;
48 
49  ScoreDiff* _diff = nullptr;
50  RawScoreDiffModel* _rawModel = nullptr;
51  ScoreDiffModel* _intelligentModel = nullptr;
52 
53  void updateDiffView(Mode mode);
54  void updateDiffTitle();
55  void resetVersion1ComboBox();
56  void resetVersion2ComboBox();
57  Score* openScoreVersion(const ScoreVersion& ver);
58  void showElement(const ScoreElement* se, bool select);
59 
60  private slots:
61  void on_compareButton_clicked();
62  void on_browseFileButton_clicked();
63  void on_score1ComboBox_currentIndexChanged(int);
64  void on_score2ComboBox_currentIndexChanged(int);
65  void on_rawModeRadioButton_toggled(bool);
66  void on_intelligentModeRadioButton_toggled(bool);
67  void on_intelligentDiffView_activated(const QModelIndex&);
68  void selectedVersionsChanged();
69 
70  protected:
71  void changeEvent(QEvent* e) override;
72  void showEvent(QShowEvent* e) override;
73 
74  signals:
75  void diffAboutToBeUpdated();
76  void diffUpdated();
77 
78  public:
79  explicit ScoreComparisonTool(QWidget* parent = nullptr);
81 
82  void setMode(Mode mode);
83  Mode mode() const { return _mode; }
84 
85  void compare(Score* s1, Score* s2);
86 
87  public slots:
88  void slotWindowSplit(bool);
89  void invalidateDiff();
90  void updateDiff();
91  void updateScoreVersions(const Score*);
92  };
93 
94 } // namespace Ms
95 #endif
Definition: scorediff.h:135
Mode
Definition: scorecmp.h:39
Definition: crashreporter.h:27
Definition: scoreElement.h:173
Definition: scorelistmodel.h:54
Definition: score.h:391
Definition: scorelistmodel.h:75
Mode _mode
Definition: scorecmp.h:43
Mode mode() const
Definition: scorecmp.h:83
Definition: scorediffmodel.h:47
Definition: scorelistmodel.h:26
Definition: aeolus.cpp:26
Ui::ScoreComparisonTool * _ui
Definition: scorecmp.h:42
Definition: scorediffmodel.h:26
Definition: scorecmp.h:35