MuseScore  3.4
Music composition and notation
debugger.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2016 Werner Schweer and others
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 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __DEBUGGER_H__
21 #define __DEBUGGER_H__
22 
23 #include "ui_debugger.h"
24 #include "ui_element.h"
25 #include "ui_note.h"
26 #include "ui_page.h"
27 #include "ui_text.h"
28 #include "ui_measure.h"
29 #include "ui_segment.h"
30 #include "ui_chord.h"
31 #include "ui_chordrest.h"
32 #include "ui_hairpin.h"
33 #include "ui_barline.h"
34 #include "ui_dynamic.h"
35 #include "ui_tuplet.h"
36 #include "ui_slurtie.h"
37 #include "ui_tie.h"
38 #include "ui_line.h"
39 #include "ui_textline.h"
40 #include "ui_linesegment.h"
41 #include "ui_lyrics.h"
42 #include "ui_beam.h"
43 #include "ui_tremolo.h"
44 #include "ui_spanner.h"
45 #include "ui_slursegment.h"
46 #include "ui_tiesegment.h"
47 #include "ui_accidental.h"
48 #include "ui_clef.h"
49 #include "ui_articulationbase.h"
50 #include "ui_keysig.h"
51 #include "ui_rest.h"
52 #include "ui_stem.h"
53 #include "ui_box.h"
54 #include "ui_harmony.h"
55 #include "ui_spanner.h"
56 #include "ui_system.h"
57 #include "ui_timesig.h"
58 #include "ui_bracket.h"
59 
60 #include "globals.h"
61 #include "libmscore/element.h"
62 #include "libmscore/mscore.h"
63 #include "abstractdialog.h"
64 
65 namespace Ms {
66 
67 class ShowElementBase;
68 class Element;
69 class Page;
70 class DoubleLabel;
71 class Score;
72 class BSymbol;
73 class ElementItem;
74 
75 class ShowNoteWidget;
76 
77 //---------------------------------------------------------
78 // Debugger
79 //---------------------------------------------------------
80 
81 class Debugger : public AbstractDialog, public Ui::DebuggerBase {
82  Q_OBJECT
83 
84  QStack<Element*>backStack;
85  QStack<Element*>forwardStack;
86 
88 
89  bool searchElement(QTreeWidgetItem* pi, Element* el);
90  void updateElement(Element*);
91  virtual void showEvent(QShowEvent*);
92  void addMeasure(ElementItem* mi, Measure* measure);
93  void readSettings();
94 
95  protected:
98  virtual void retranslate() { retranslateUi(this); }
99 
100  private slots:
101  void itemClicked(QTreeWidgetItem*, int);
102  void itemExpanded(QTreeWidgetItem*);
103  void layoutScore();
104  void backClicked();
105  void forwardClicked();
106  void selectElement();
107  void resetElement();
108  void layout();
109 
110  public slots:
111  void setElement(Element*);
112  void reloadClicked();
113 
114  public:
115  Debugger(QWidget* parent = 0);
116  void writeSettings();
117  void updateList(Score*);
118  };
119 
120 //---------------------------------------------------------
121 // MeasureListEditor
122 //---------------------------------------------------------
123 
124 class MeasureListEditor : public QWidget {
125  Q_OBJECT
126 
127  private slots:
128  // void itemChanged(QListViewItem*);
129 
130  public:
132  };
133 
134 //---------------------------------------------------------
135 // ShowElementBase
136 //---------------------------------------------------------
137 
138 class ShowElementBase : public QWidget {
139  Q_OBJECT
140 
141  Ui::ElementBase eb;
143 
144  private slots:
145  void parentClicked();
146  void linkClicked();
147  void link2Clicked();
148  void link3Clicked();
149  void offsetxChanged(double);
150  void offsetyChanged(double);
151  void selectedClicked(bool);
152  void visibleClicked(bool);
153 
154  public slots:
155  void gotoElement(QListWidgetItem*);
156  void gotoElement(QTreeWidgetItem*);
157 
158  protected:
159  QVBoxLayout* layout;
160 
161  signals:
162  void elementChanged(Element*);
163 
164  public:
165  ShowElementBase();
166  virtual void setElement(Element*);
167  Element* element() const { return el; }
168  QWidget* addWidget();
169  };
170 
171 //---------------------------------------------------------
172 // ShowPageWidget
173 //---------------------------------------------------------
174 
176  Q_OBJECT
177 
178  Ui::PageBase pb;
179 
180  private slots:
181  void itemClicked(QListWidgetItem*);
182 
183  public:
184  ShowPageWidget();
185  virtual void setElement(Element*);
186  };
187 
188 //---------------------------------------------------------
189 // MeasureView
190 //---------------------------------------------------------
191 
192 class MeasureView : public ShowElementBase {
193  Q_OBJECT
194 
195  Ui::MeasureBase mb;
196 
197  private slots:
198  void elementClicked(QTreeWidgetItem* item);
199  void nextClicked();
200  void prevClicked();
201  void mmRestClicked();
202 
203  public:
204  MeasureView();
205  virtual void setElement(Element*);
206  };
207 
208 //---------------------------------------------------------
209 // ChordDebug
210 //---------------------------------------------------------
211 
212 class ChordDebug : public ShowElementBase {
213  Q_OBJECT
214  Ui::ChordRestBase crb;
215  Ui::ChordBase cb;
216 
217  private slots:
218  void hookClicked();
219  void stemClicked();
220  void directionChanged(int);
221  void beamClicked();
222  void tupletClicked();
223  void upChanged(bool);
224  void beamModeChanged(int);
225  void stemSlashClicked();
226  void arpeggioClicked();
227  void tremoloClicked();
228 // void glissandoClicked();
229 
230  public:
231  ChordDebug();
232  virtual void setElement(Element*);
233  };
234 
235 //---------------------------------------------------------
236 // SegmentView
237 //---------------------------------------------------------
238 
239 class SegmentView : public ShowElementBase {
240  Q_OBJECT
241  Ui::SegmentBase sb;
242 
243  public:
244  SegmentView();
245  virtual void setElement(Element*);
246  };
247 
248 //---------------------------------------------------------
249 // ShowNoteWidget
250 //---------------------------------------------------------
251 
253  Q_OBJECT
254 
255  Ui::NoteBase nb;
256 
257  private slots:
258  void tieForClicked();
259  void tieBackClicked();
260  void accidentalClicked();
261  void dot1Clicked();
262  void dot2Clicked();
263  void dot3Clicked();
264  void dot4Clicked();
265 
266  signals:
267  void scoreChanged();
268 
269  public:
270  ShowNoteWidget();
271  virtual void setElement(Element*);
272  };
273 
274 //---------------------------------------------------------
275 // RestView
276 //---------------------------------------------------------
277 
278 class RestView : public ShowElementBase {
279  Q_OBJECT
280 
281  Ui::ChordRestBase crb;
282  Ui::Rest rb;
283 
284  private slots:
285  void dot1Clicked();
286  void dot2Clicked();
287  void dot3Clicked();
288  void dot4Clicked();
289  void tupletClicked();
290  void beamClicked();
291 
292  public:
293  RestView();
294  virtual void setElement(Element*);
295  };
296 
297 //---------------------------------------------------------
298 // TextView
299 //---------------------------------------------------------
300 
301 class TextView : public ShowElementBase {
302  Q_OBJECT
303 
304  Ui::TextBase tb;
305 
306  private slots:
307  void textChanged();
308 
309  signals:
310  void scoreChanged();
311 
312  public:
313  TextView();
314  virtual void setElement(Element*);
315  };
316 
317 //---------------------------------------------------------
318 // HarmonyView
319 //---------------------------------------------------------
320 
321 class HarmonyView : public ShowElementBase {
322  Q_OBJECT
323 
324  Ui::TextBase tb;
325  Ui::HarmonyBase hb;
326 
327  public:
328  HarmonyView();
329  virtual void setElement(Element*);
330  private slots:
331  void on_leftParen_clicked(bool checked);
332  void on_rightParen_clicked(bool checked);
333  };
334 
335 //---------------------------------------------------------
336 // SpannerView
337 //---------------------------------------------------------
338 
339 class SpannerView : public ShowElementBase {
340  Q_OBJECT
341 
342  Ui::SpannerBase sp;
343 
344  private slots:
345  void startClicked();
346  void endClicked();
347 
348  public:
349  SpannerView();
350  virtual void setElement(Element*);
351  };
352 
353 //---------------------------------------------------------
354 // HairpinView
355 //---------------------------------------------------------
356 
357 class HairpinView : public SpannerView {
358  Q_OBJECT
359 
360  Ui::HairpinBase hp;
361  Ui::SLineBase sl;
362 
363  public:
364  HairpinView();
365  virtual void setElement(Element*);
366  };
367 
368 
369 
370 //---------------------------------------------------------
371 // ElementView
372 //---------------------------------------------------------
373 
374 class ElementView : public ShowElementBase {
375  Q_OBJECT
376 
377  public:
378  ElementView();
379  };
380 
381 //---------------------------------------------------------
382 // BarLineView
383 //---------------------------------------------------------
384 
385 class BarLineView : public ShowElementBase {
386  Q_OBJECT
387 
388  Ui::BarLineBase bl;
389 
390  public:
391  BarLineView();
392  virtual void setElement(Element*);
393  };
394 
395 //---------------------------------------------------------
396 // DynamicView
397 //---------------------------------------------------------
398 
399 class DynamicView : public ShowElementBase {
400  Q_OBJECT
401 
402  Ui::TextBase tb;
403  Ui::DynamicBase bl;
404 
405  public:
406  DynamicView();
407  virtual void setElement(Element*);
408  };
409 
410 //---------------------------------------------------------
411 // TupletView
412 //---------------------------------------------------------
413 
414 class TupletView : public ShowElementBase {
415  Q_OBJECT
416 
417  Ui::TupletBase tb;
418 
419  signals:
420  void itemClicked(Element*);
421  void scoreChanged();
422 
423  private slots:
424  void numberClicked();
425  void tupletClicked();
426  void elementClicked(QTreeWidgetItem*);
427 
428  public:
429  TupletView();
430  virtual void setElement(Element*);
431  };
432 
433 //---------------------------------------------------------
434 // DoubleLabel
435 //---------------------------------------------------------
436 
437 class DoubleLabel : public QLabel {
438  Q_OBJECT
439 
440  public:
441  DoubleLabel(QWidget* parent);
442  void setValue(double);
443  virtual QSize sizeHint() const;
444  };
445 
446 //---------------------------------------------------------
447 // SlurTieView
448 //---------------------------------------------------------
449 
450 class SlurTieView : public SpannerView {
451  Q_OBJECT
452 
453  Ui::SlurTieBase st;
454 
455  private slots:
456  void segmentClicked(QTreeWidgetItem* item);
457 
458  public:
459  SlurTieView();
460  virtual void setElement(Element*);
461  };
462 
463 //---------------------------------------------------------
464 // TieView
465 //---------------------------------------------------------
466 
467 class TieView : public SlurTieView {
468  Q_OBJECT
469 
470  Ui::TieBase tb;
471 
472  private slots:
473  void startClicked();
474  void endClicked();
475 
476  public:
477  TieView();
478  virtual void setElement(Element*);
479  };
480 
481 //---------------------------------------------------------
482 // VoltaView
483 //---------------------------------------------------------
484 
485 class VoltaView : public ShowElementBase {
486  Q_OBJECT
487 
488  Ui::TextLineBase tlb;
489  Ui::SLineBase lb;
490  Ui::SpannerBase sp;
491 
492  private slots:
493  void segmentClicked(QTreeWidgetItem* item);
494  void beginTextClicked();
495  void continueTextClicked();
496  void endTextClicked();
497  void startClicked();
498  void endClicked();
499 
500  public:
501  VoltaView();
502  virtual void setElement(Element*);
503  };
504 
505 //---------------------------------------------------------
506 // VoltaSegmentView
507 //---------------------------------------------------------
508 
510  Q_OBJECT
511 
512  Ui::LineSegmentBase lb;
513 
514  private slots:
515  void lineClicked();
516 
517  public:
519  virtual void setElement(Element*);
520  };
521 
522 //---------------------------------------------------------
523 // TextLineView
524 //---------------------------------------------------------
525 
526 class TextLineView : public SpannerView {
527  Q_OBJECT
528 
529  Ui::TextLineBase tlb;
530  Ui::SLineBase lb;
531 
532  private slots:
533  void beginTextClicked();
534  void continueTextClicked();
535  void endTextClicked();
536 
537  public:
538  TextLineView();
539  virtual void setElement(Element*);
540  };
541 
542 //---------------------------------------------------------
543 // TextLineSegmentView
544 //---------------------------------------------------------
545 
547  Q_OBJECT
548 
549  Ui::LineSegmentBase lb;
550 
551  private slots:
552  void lineClicked();
553 
554  public:
556  virtual void setElement(Element*);
557  };
558 
559 //---------------------------------------------------------
560 // LineSegmentView
561 //---------------------------------------------------------
562 
564  Q_OBJECT
565 
566  Ui::LineSegmentBase lb;
567 
568  private slots:
569  void lineClicked();
570 
571  public:
572  LineSegmentView();
573  virtual void setElement(Element*);
574  };
575 
576 //---------------------------------------------------------
577 // VoltaSegmentView
578 //---------------------------------------------------------
579 
580 class LyricsView : public ShowElementBase {
581  Q_OBJECT
582 
583  Ui::LyricsBase lb;
584 
585  public:
586  LyricsView();
587  virtual void setElement(Element*);
588  };
589 
590 //---------------------------------------------------------
591 // BeamView
592 //---------------------------------------------------------
593 
594 class BeamView : public ShowElementBase {
595  Q_OBJECT
596 
597  Ui::BeamBase bb;
598 
599  private slots:
600  void elementClicked(QTreeWidgetItem*);
601 
602  public:
603  BeamView();
604  virtual void setElement(Element*);
605  };
606 
607 //---------------------------------------------------------
608 // TremoloView
609 //---------------------------------------------------------
610 
611 class TremoloView : public ShowElementBase {
612  Q_OBJECT
613 
614  Ui::TremoloBase tb;
615 
616  private slots:
617  void chord1Clicked();
618  void chord2Clicked();
619 
620  public:
621  TremoloView();
622  virtual void setElement(Element*);
623  };
624 
625 //---------------------------------------------------------
626 // OttavaView
627 //---------------------------------------------------------
628 
629 class OttavaView : public TextLineView {
630  Q_OBJECT
631 
632 // Ui::OttavaBase ob;
633 
634  private slots:
635 
636  public:
637  OttavaView();
638  virtual void setElement(Element*);
639  };
640 
641 //---------------------------------------------------------
642 // SlurSegmentView
643 //---------------------------------------------------------
644 
646  Q_OBJECT
647 
648  Ui::SlurSegment ss;
649 
650  private slots:
651  void slurTieClicked();
652 
653  public:
654  SlurSegmentView();
655  virtual void setElement(Element*);
656  };
657 
658 //---------------------------------------------------------
659 // TieSegmentView
660 //---------------------------------------------------------
661 
663  Q_OBJECT
664 
665  Ui::TieSegment ss;
666 
667  private slots:
668  void slurTieClicked();
669 
670  public:
671  TieSegmentView();
672  virtual void setElement(Element*);
673  };
674 
675 //---------------------------------------------------------
676 // AccidentalView
677 //---------------------------------------------------------
678 
680  Q_OBJECT
681 
682  Ui::Accidental acc;
683 
684  public:
685  AccidentalView();
686  virtual void setElement(Element*);
687  };
688 
689 //---------------------------------------------------------
690 // ClefView
691 //---------------------------------------------------------
692 
693 class ClefView : public ShowElementBase {
694  Q_OBJECT
695 
697 
698  public:
699  ClefView();
700  virtual void setElement(Element*);
701  };
702 
703 //---------------------------------------------------------
704 // ArticulationView
705 //---------------------------------------------------------
706 
708  Q_OBJECT
709 
710  Ui::ArticulationBase articulation;
711 
712  public:
714  virtual void setElement(Element*);
715  };
716 
717 //---------------------------------------------------------
718 // KeySigView
719 //---------------------------------------------------------
720 
721 class KeySigView : public ShowElementBase {
722  Q_OBJECT
723 
725 
726  public:
727  KeySigView();
728  virtual void setElement(Element*);
729  };
730 
731 //---------------------------------------------------------
732 // StemView
733 //---------------------------------------------------------
734 
735 class StemView : public ShowElementBase {
736  Q_OBJECT
737 
738  Ui::StemBase stem;
739 
740  public:
741  StemView();
742  virtual void setElement(Element*);
743  };
744 
745 //---------------------------------------------------------
746 // BoxView
747 //---------------------------------------------------------
748 
749 class BoxView : public ShowElementBase {
750  Q_OBJECT
751 
752  Ui::BoxBase box;
753 
754  public:
755  BoxView();
756  virtual void setElement(Element*);
757  };
758 
759 //---------------------------------------------------------
760 // SystemView
761 //---------------------------------------------------------
762 
763 class SystemView : public ShowElementBase {
764  Q_OBJECT
765 
766  Ui::SystemBase mb;
767 
768  private slots:
769  void elementClicked(QTreeWidgetItem*);
770  void measureClicked(QListWidgetItem*);
771 
772  public:
773  SystemView();
774  virtual void setElement(Element*);
775  };
776 
777 //---------------------------------------------------------
778 // TimeSigView
779 //---------------------------------------------------------
780 
781 class TimeSigView : public ShowElementBase {
782  Q_OBJECT
783 
785 
786  public:
787  TimeSigView();
788  virtual void setElement(Element*);
789  };
790 
791 //---------------------------------------------------------
792 // BracketView
793 //---------------------------------------------------------
794 
795 class BracketView : public ShowElementBase {
796  Q_OBJECT
797 
798  Ui::Bracket br;
799 
800  public:
801  BracketView();
802  virtual void setElement(Element*);
803  };
804 
805 
806 } // namespace Ms
807 #endif
808 
Definition: debugger.h:546
Ui::HarmonyBase hb
Definition: debugger.h:325
Ui::PageBase pb
Definition: debugger.h:178
Ui::SlurTieBase st
Definition: debugger.h:453
Definition: debugger.h:385
Definition: debugger.h:301
Definition: debugger.h:437
Ui::MeasureBase mb
Definition: debugger.h:195
virtual void showEvent(QShowEvent *)
Definition: debugger.cpp:282
Ui::BeamBase bb
Definition: debugger.h:597
void resetElement()
Definition: debugger.cpp:190
Definition: debugger.h:357
Definition: debugger.h:467
Definition: debugger.h:594
Definition: debugger.h:124
Ui::SegmentBase sb
Definition: debugger.h:241
Definition: debugger.h:374
Definition: debugger.h:526
Definition: debugger.h:721
one measure in a system
Definition: measure.h:65
Definition: debugger.h:781
void addMeasure(ElementItem *mi, Measure *measure)
Definition: debugger.cpp:379
Ui::TextLineBase tlb
Definition: debugger.h:529
Ui::ArticulationBase articulation
Definition: debugger.h:710
void selectElement()
Definition: debugger.cpp:179
Definition: debugger.cpp:81
Base class of score layout elements.
Definition: element.h:158
Ui::SpannerBase sp
Definition: debugger.h:342
void forwardClicked()
Definition: debugger.cpp:2281
Debugger(QWidget *parent=0)
Definition: debugger.cpp:142
Ui::LineSegmentBase lb
Definition: debugger.h:549
Definition: debugger.h:662
void itemExpanded(QTreeWidgetItem *)
Definition: debugger.cpp:568
Ui::DynamicBase bl
Definition: debugger.h:403
QVBoxLayout * layout
Definition: debugger.h:159
Definition: score.h:391
Definition: debugger.h:645
Definition: debugger.h:749
Definition: abstractdialog.h:29
void setElement(Element *)
Definition: debugger.cpp:553
Definition: debugger.h:763
Ui::TimeSig tb
Definition: debugger.h:784
Ui::HairpinBase hp
Definition: debugger.h:360
void updateList(Score *)
Definition: debugger.cpp:438
bool searchElement(QTreeWidgetItem *pi, Element *el)
Definition: debugger.cpp:527
Element * element() const
Definition: debugger.h:167
Definition: debugger.h:192
void backClicked()
Definition: debugger.cpp:2267
Ui::StemBase stem
Definition: debugger.h:738
Definition: debugger.h:414
Definition: debugger.h:580
Definition: debugger.h:81
virtual void retranslate()
Definition: debugger.h:98
Definition: debugger.h:138
Ui::Bracket br
Definition: debugger.h:798
Definition: debugger.h:693
Definition: debugger.h:707
Ui::SystemBase mb
Definition: debugger.h:766
Ui::LineSegmentBase lb
Definition: debugger.h:512
Ui::ElementBase eb
Definition: debugger.h:141
Definition: debugger.h:509
Definition: debugger.h:339
Element * el
Definition: debugger.h:142
Ui::TextLineBase tlb
Definition: debugger.h:488
Ui::ChordRestBase crb
Definition: debugger.h:214
Definition: debugger.h:485
Ui::SLineBase sl
Definition: debugger.h:361
Definition: aeolus.cpp:26
void itemClicked(QTreeWidgetItem *, int)
Definition: debugger.cpp:577
ShowElementBase * elementViews[int(ElementType::MAXTYPE)]
Definition: debugger.h:87
Ui::TieSegment ss
Definition: debugger.h:665
Ui::LyricsBase lb
Definition: debugger.h:583
Definition: debugger.h:450
void updateElement(Element *)
Definition: debugger.cpp:597
Score * cs
Definition: debugger.h:96
Ui::BoxBase box
Definition: debugger.h:752
Ui::Accidental acc
Definition: debugger.h:682
QStack< Element * > forwardStack
Definition: debugger.h:85
Ui::NoteBase nb
Definition: debugger.h:255
Definition: debugger.h:252
Ui::TupletBase tb
Definition: debugger.h:417
Definition: debugger.h:679
Ui::ChordBase cb
Definition: debugger.h:215
Definition: debugger.h:563
Ui::LineSegmentBase lb
Definition: debugger.h:566
Definition: debugger.h:278
Definition: debugger.h:212
Definition: debugger.h:735
Ui::KeySig keysig
Definition: debugger.h:724
Ui::SlurSegment ss
Definition: debugger.h:648
Definition: debugger.h:239
Ui::SLineBase lb
Definition: debugger.h:489
Definition: debugger.h:399
void reloadClicked()
Definition: debugger.cpp:2295
Ui::ChordRestBase crb
Definition: debugger.h:281
Ui::BarLineBase bl
Definition: debugger.h:388
void layoutScore()
Definition: debugger.cpp:245
Ui::TremoloBase tb
Definition: debugger.h:614
Ui::TextBase tb
Definition: debugger.h:402
Ui::TextBase tb
Definition: debugger.h:304
Definition: debugger.h:321
Ui::TieBase tb
Definition: debugger.h:470
Definition: debugger.h:611
Ui::SpannerBase sp
Definition: debugger.h:490
Definition: debugger.h:795
Ui::SLineBase lb
Definition: debugger.h:530
Ui::TextBase tb
Definition: debugger.h:324
Definition: debugger.h:629
void layout()
Definition: debugger.cpp:202
Ui::Clef clef
Definition: debugger.h:696
void readSettings()
Definition: debugger.cpp:229
QStack< Element * > backStack
Definition: debugger.h:84
void writeSettings()
Definition: debugger.cpp:215
Definition: debugger.h:175
Ui::Rest rb
Definition: debugger.h:282
Element * curElement
Definition: debugger.h:97