Skip to content

Commit

Permalink
fix mtest; start implementing master effect section
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Mar 28, 2013
1 parent c63def0 commit 2f265da
Show file tree
Hide file tree
Showing 12 changed files with 540 additions and 642 deletions.
2 changes: 1 addition & 1 deletion libmscore/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ void Beam::write(Xml& xml) const
// this info is used for regression testing
// l1/l2 is the beam position of the layout engine
//
if (score()->testMode()) {
if (MScore::testMode) {
qreal _spatium4 = spatium() * .25;
foreach(BeamFragment* f, fragments) {
xml.tag("l1", int(lrint(f->py1[idx] / _spatium4)));
Expand Down
2 changes: 1 addition & 1 deletion libmscore/chordrest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void ChordRest::writeProperties(Xml& xml) const
qDebug("ChordRest: spannerBack->id == -1");
}
#ifndef NDEBUG
if (_beam && (score()->testMode() || !_beam->generated()))
if (_beam && (MScore::testMode || !_beam->generated()))
xml.tag("Beam", _beam->id());
#else
if (!xml.clipboardmode && _beam && !_beam->generated())
Expand Down
4 changes: 3 additions & 1 deletion libmscore/instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "tablature.h"
#include "instrtemplate.h"
#include "msynthesizer.h"
#include "mscore.h"

Instrument InstrumentList::defaultInstrument;
extern MasterSynthesizer* synti;
Expand Down Expand Up @@ -377,7 +378,8 @@ void Channel::write(Xml& xml) const

e.write(xml);
}
xml.tag("synti", ::synti->name(synti));
if (!MScore::testMode)
xml.tag("synti", ::synti->name(synti));
if (mute)
xml.tag("mute", mute);
if (solo)
Expand Down
1 change: 1 addition & 0 deletions libmscore/mscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ qreal MScore::PDPI = 1200;
qreal MScore::DPI = 1200;
qreal MScore::DPMM;
bool MScore::debugMode;
bool MScore::testMode = false;

MStyle* MScore::_defaultStyle;
MStyle* MScore::_baseStyle;
Expand Down
1 change: 1 addition & 0 deletions libmscore/mscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ class MScore : public QObject {
static qreal DPI;
static qreal DPMM;
static bool debugMode;
static bool testMode;
};

Q_DECLARE_METATYPE(MScore::ValueType)
Expand Down
11 changes: 0 additions & 11 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ void MeasureBaseList::change(MeasureBase* ob, MeasureBase* nb)
void Score::init()
{
_linkId = 0;
_testMode = false;
_parentScore = 0;
_currentLayer = 0;
_playMode = PLAYMODE_SYNTHESIZER;
Expand Down Expand Up @@ -3320,16 +3319,6 @@ void Score::linkId(int val)
s->_linkId = val + 1; // update unused link id
}

//---------------------------------------------------------
// setTestMode
//---------------------------------------------------------

void Score::setTestMode(bool val)
{
foreach(Score* score, scoreList())
score->_testMode = val;
}

//---------------------------------------------------------
// scoreList
// return a list of scores containing the root score
Expand Down
4 changes: 0 additions & 4 deletions libmscore/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ class Score : public QObject {
Measure* startLayout; ///< start a relayout at this measure
LayoutFlags layoutFlags;

bool _testMode; // prepare for regression tests

bool _updateAll;
bool _layoutAll; ///< do a complete relayout

Expand Down Expand Up @@ -903,8 +901,6 @@ class Score : public QObject {
void transposeSemitone(int semitone);
MeasureBase* insertMeasure(Element::ElementType type, MeasureBase*,
bool createEmptyMeasures = false);
bool testMode() const { return _testMode; }
void setTestMode(bool val);
Audio* audio() const { return _audio; }
void setAudio(Audio* a) { _audio = a; }
PlayMode playMode() const { return _playMode; }
Expand Down
12 changes: 6 additions & 6 deletions libmscore/scorefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void Score::write(Xml& xml, bool selectionOnly)
}
xml.tag("currentLayer", _currentLayer);

if (!_testMode)
if (!MScore::testMode)
_syntiState.write(xml);

if (pageNumberOffset())
Expand All @@ -104,7 +104,7 @@ void Score::write(Xml& xml, bool selectionOnly)
QMapIterator<QString, QString> i(_metaTags);
while (i.hasNext()) {
i.next();
if (!_testMode || (i.key() != "platform" && i.key() != "creationDate"))
if (!MScore::testMode || (i.key() != "platform" && i.key() != "creationDate"))
xml.tag(QString("metaTag name=\"%1\"").arg(i.key()), i.value());
}

Expand Down Expand Up @@ -534,13 +534,13 @@ extern bool enableTestMode;

void Score::saveFile(QIODevice* f, bool msczFormat, bool onlySelection)
{
if(!testMode())
setTestMode(enableTestMode);
if(!MScore::testMode)
MScore::testMode = enableTestMode;
Xml xml(f);
xml.writeOmr = msczFormat;
xml.header();
xml.stag("museScore version=\"" MSC_VERSION "\"");
if (!_testMode) {
if (!MScore::testMode) {
xml.tag("programVersion", VERSION);
xml.tag("programRevision", revision);
}
Expand Down Expand Up @@ -1304,7 +1304,7 @@ void Score::writeSegments(Xml& xml, const Measure* m, int strack, int etrack,
ChordRest* cr = static_cast<ChordRest*>(e);
Beam* beam = cr->beam();
#ifndef NDEBUG
if (beam && beam->elements().front() == cr && (testMode() || !beam->generated())) {
if (beam && beam->elements().front() == cr && (MScore::testMode || !beam->generated())) {
beam->setId(xml.beamId++);
beam->write(xml);
}
Expand Down
2 changes: 2 additions & 0 deletions mscore/musescore.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Sym;
class MasterPalette;
class PluginCreator;
class PluginManager;
class MasterSynthesizer;

struct PluginDescription;

Expand Down Expand Up @@ -643,6 +644,7 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
extern MuseScore* mscore;
extern MuseScoreCore* mscoreCore;
extern QString dataPath;
extern MasterSynthesizer* synti;

extern QAction* getAction(const char*);
extern Shortcut* midiActionMap[128];
Expand Down
Loading

0 comments on commit 2f265da

Please sign in to comment.