MuseScore
3.4
Music composition and notation
omr
omrview.h
Go to the documentation of this file.
1
//=============================================================================
2
// MusE Reader
3
// Linux Music Score Reader
4
//
5
// Copyright (C) 2010 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
//
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 __SCAN_VIEW_H__
21
#define __SCAN_VIEW_H__
22
23
namespace
Ms
{
24
25
class
Omr;
26
class
Page;
27
class
ScoreView;
28
class
OmrPage;
29
30
//---------------------------------------------------------
31
// Tile
32
//---------------------------------------------------------
33
34
struct
Tile
{
35
int
no
;
36
QRect
r
;
37
QPixmap
pm
;
38
OmrPage
*
page
;
39
int
pageNo
;
40
41
Tile
();
42
};
43
44
static
const
int
TILE_H = 512;
45
static
const
int
TILE_W = 512;
46
47
//---------------------------------------------------------
48
// OmrView
49
//---------------------------------------------------------
50
51
class
OmrView
:
public
QWidget {
52
Q_OBJECT
53
Omr
*
_omr
;
54
ScoreView
*
_scoreView
;
55
int
maxTiles
;
56
57
QList<Tile*>
usedTiles
;
58
QStack<Tile*>
freeTiles
;
59
QPoint
startDrag
;
60
61
QTransform
_matrix
;
62
int
xoff,
yoff
;
63
int
pageWidth
;
64
65
bool
_fotoMode
;
66
QRectF
_foto
;
67
68
bool
_showLines
;
69
bool
_showBarlines
;
70
bool
_showSlices
;
71
bool
_showStaves
;
72
73
void
zoom(
int
step,
const
QPoint& pos);
74
75
virtual
void
mousePressEvent(QMouseEvent*);
76
virtual
void
mouseMoveEvent(QMouseEvent*);
77
virtual
void
wheelEvent(QWheelEvent*);
78
virtual
void
paintEvent(QPaintEvent*);
79
virtual
void
contextMenuEvent(QContextMenuEvent*);
80
81
qreal
mag
()
const
{
return
_matrix.m11(); }
82
void
setMag(
double
mag);
83
void
initTile(
Tile
* t);
84
85
public
slots:
86
void
setScale(
double
);
87
void
setOffset(
double
,
double
);
88
89
signals:
90
void
pageNumberChanged(
int
);
91
void
xPosChanged(
int
);
92
void
yPosChanged(
int
);
93
94
public
:
95
OmrView
(
ScoreView
*, QWidget* parent = 0);
96
void
setOmr(
Omr
*);
97
Omr
*
omr
()
const
{
return
_omr; }
98
bool
fotoMode
()
const
{
return
_fotoMode; }
99
void
setFotoMode
(
bool
val) { _fotoMode = val; }
100
101
void
setShowLines
(
bool
val) { _showLines = val; }
102
bool
showLines
()
const
{
return
_showLines; }
103
bool
showBarlines
()
const
{
return
_showBarlines; }
104
bool
showSlices
()
const
{
return
_showSlices; }
105
bool
showStaves
()
const
{
return
_showStaves; }
106
void
setShowBarlines(
bool
val);
107
void
setShowSlices(
bool
val);
108
void
setShowStaves(
bool
val);
109
};
110
111
}
112
113
#endif
114
Ms::OmrView::showSlices
bool showSlices() const
Definition:
omrview.h:104
Ms::Omr
Definition:
omr.h:124
Ms::Tile::pm
QPixmap pm
Definition:
omrview.h:37
Ms::ScoreView
Definition:
scoreview.h:90
Ms::OmrView::usedTiles
QList< Tile * > usedTiles
Definition:
omrview.h:57
Ms::OmrView::_showLines
bool _showLines
Definition:
omrview.h:68
Ms::Tile
Definition:
omrview.h:34
Ms::OmrView::mag
qreal mag() const
Definition:
omrview.h:81
Ms::OmrView::showLines
bool showLines() const
Definition:
omrview.h:102
Ms::OmrView::maxTiles
int maxTiles
Definition:
omrview.h:55
Ms::OmrView::setShowLines
void setShowLines(bool val)
Definition:
omrview.h:101
Ms::OmrView::startDrag
QPoint startDrag
Definition:
omrview.h:59
Ms::OmrView::pageWidth
int pageWidth
Definition:
omrview.h:63
Ms::Tile::r
QRect r
Definition:
omrview.h:36
Ms::OmrView::_matrix
QTransform _matrix
Definition:
omrview.h:61
Ms::OmrView::showStaves
bool showStaves() const
Definition:
omrview.h:105
Ms
Definition:
aeolus.cpp:26
Ms::OmrView::_omr
Omr * _omr
Definition:
omrview.h:53
Ms::Tile::pageNo
int pageNo
Definition:
omrview.h:39
Ms::OmrView
Definition:
omrview.h:51
Ms::OmrView::yoff
int yoff
Definition:
omrview.h:62
Ms::Tile::Tile
Tile()
Definition:
omrview.cpp:107
Ms::Tile::page
OmrPage * page
Definition:
omrview.h:38
Ms::OmrView::setFotoMode
void setFotoMode(bool val)
Definition:
omrview.h:99
Ms::OmrView::fotoMode
bool fotoMode() const
Definition:
omrview.h:98
Ms::Tile::no
int no
Definition:
omrview.h:35
Ms::OmrView::_scoreView
ScoreView * _scoreView
Definition:
omrview.h:54
Ms::OmrView::freeTiles
QStack< Tile * > freeTiles
Definition:
omrview.h:58
Ms::OmrView::_foto
QRectF _foto
Definition:
omrview.h:66
Ms::OmrView::_fotoMode
bool _fotoMode
Definition:
omrview.h:65
Ms::OmrView::_showStaves
bool _showStaves
Definition:
omrview.h:71
Ms::OmrView::omr
Omr * omr() const
Definition:
omrview.h:97
Ms::OmrView::showBarlines
bool showBarlines() const
Definition:
omrview.h:103
Ms::OmrView::_showSlices
bool _showSlices
Definition:
omrview.h:70
Ms::OmrPage
Definition:
omrpage.h:187
Ms::OmrView::_showBarlines
bool _showBarlines
Definition:
omrview.h:69
Generated by
1.8.13