forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspector for Marker/Jump properties
- Loading branch information
Showing
16 changed files
with
445 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// $Id:$ | ||
// | ||
// Copyright (C) 2012 Werner Schweer | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2 | ||
// as published by the Free Software Foundation and appearing in | ||
// the file LICENSE.GPL | ||
//============================================================================= | ||
|
||
#include "inspectorJump.h" | ||
#include "musescore.h" | ||
#include "libmscore/jump.h" | ||
#include "libmscore/score.h" | ||
|
||
//--------------------------------------------------------- | ||
// InspectorJump | ||
//--------------------------------------------------------- | ||
|
||
InspectorJump::InspectorJump(QWidget* parent) | ||
: InspectorBase(parent) | ||
{ | ||
iElement = new InspectorElementElement(this); | ||
layout->addWidget(iElement); | ||
QWidget* w = new QWidget; | ||
iJump.setupUi(w); | ||
layout->addWidget(w); | ||
connect(iJump.jumpTo, SIGNAL(textChanged(const QString&)), SLOT(apply())); | ||
connect(iJump.playUntil, SIGNAL(textChanged(const QString&)), SLOT(apply())); | ||
connect(iJump.continueAt, SIGNAL(textChanged(const QString&)), SLOT(apply())); | ||
} | ||
|
||
//--------------------------------------------------------- | ||
// setElement | ||
//--------------------------------------------------------- | ||
|
||
void InspectorJump::setElement(Element* e) | ||
{ | ||
Jump* jump = static_cast<Jump*>(e); | ||
iElement->setElement(jump); | ||
|
||
iJump.jumpTo->blockSignals(true); | ||
iJump.playUntil->blockSignals(true); | ||
iJump.continueAt->blockSignals(true); | ||
|
||
iJump.jumpTo->setText(jump->jumpTo()); | ||
iJump.playUntil->setText(jump->playUntil()); | ||
iJump.continueAt->setText(jump->continueAt()); | ||
|
||
iJump.jumpTo->blockSignals(false); | ||
iJump.playUntil->blockSignals(false); | ||
iJump.continueAt->blockSignals(false); | ||
} | ||
|
||
//--------------------------------------------------------- | ||
// apply | ||
//--------------------------------------------------------- | ||
|
||
void InspectorJump::apply() | ||
{ | ||
Jump* jump = static_cast<Jump*>(inspector->element()); | ||
|
||
if (iJump.jumpTo->text() != jump->jumpTo() | ||
|| iJump.playUntil->text() != jump->playUntil() | ||
|| iJump.continueAt->text() != jump->continueAt()) { | ||
Score* score = jump->score(); | ||
score->startCmd(); | ||
|
||
if (iJump.jumpTo->text() != jump->jumpTo()) | ||
score->undoChangeProperty(jump, P_JUMP_TO, iJump.jumpTo->text()); | ||
if (iJump.playUntil->text() != jump->playUntil()) | ||
score->undoChangeProperty(jump, P_PLAY_UNTIL, iJump.playUntil->text()); | ||
if (iJump.continueAt->text() != jump->continueAt()) | ||
score->undoChangeProperty(jump, P_CONTINUE_AT, iJump.continueAt->text()); | ||
|
||
score->endCmd(); | ||
mscore->endCmd(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// $Id:$ | ||
// | ||
// Copyright (C) 2012 Werner Schweer and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2 | ||
// as published by the Free Software Foundation and appearing in | ||
// the file LICENSE.GPL | ||
//============================================================================= | ||
|
||
#ifndef __INSPECTOR_JUMP_H__ | ||
#define __INSPECTOR_JUMP_H__ | ||
|
||
#include "inspector.h" | ||
#include "ui_inspector_jump.h" | ||
#include "libmscore/property.h" | ||
|
||
//--------------------------------------------------------- | ||
// InspectorJump | ||
//--------------------------------------------------------- | ||
|
||
class InspectorJump : public InspectorBase { | ||
Q_OBJECT | ||
|
||
InspectorElementElement* iElement; | ||
Ui::InspectorJump iJump; | ||
|
||
public slots: | ||
virtual void apply(); | ||
|
||
public: | ||
InspectorJump(QWidget* parent); | ||
virtual void setElement(Element*); | ||
bool dirty() const; | ||
}; | ||
|
||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// $Id:$ | ||
// | ||
// Copyright (C) 2012 Werner Schweer | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2 | ||
// as published by the Free Software Foundation and appearing in | ||
// the file LICENSE.GPL | ||
//============================================================================= | ||
|
||
#include "inspectorMarker.h" | ||
#include "musescore.h" | ||
#include "libmscore/marker.h" | ||
#include "libmscore/score.h" | ||
|
||
//--------------------------------------------------------- | ||
// inspectorMarker | ||
//--------------------------------------------------------- | ||
|
||
InspectorMarker::InspectorMarker(QWidget* parent) | ||
: InspectorBase(parent) | ||
{ | ||
iElement = new InspectorElementElement(this); | ||
layout->addWidget(iElement); | ||
QWidget* w = new QWidget; | ||
iMarker.setupUi(w); | ||
layout->addWidget(w); | ||
connect(iMarker.subtype, SIGNAL(currentIndexChanged(int)), SLOT(apply())); | ||
connect(iMarker.jumpLabel, SIGNAL(textChanged(const QString&)), SLOT(apply())); | ||
} | ||
|
||
//--------------------------------------------------------- | ||
// setElement | ||
//--------------------------------------------------------- | ||
|
||
void InspectorMarker::setElement(Element* e) | ||
{ | ||
Marker* marker = static_cast<Marker*>(e); | ||
iElement->setElement(marker); | ||
|
||
iMarker.subtype->blockSignals(true); | ||
iMarker.jumpLabel->blockSignals(true); | ||
|
||
iMarker.subtype->setCurrentIndex(int(marker->markerType())); | ||
iMarker.jumpLabel->setText(marker->label()); | ||
|
||
iMarker.subtype->blockSignals(false); | ||
iMarker.jumpLabel->blockSignals(false); | ||
} | ||
|
||
//--------------------------------------------------------- | ||
// apply | ||
//--------------------------------------------------------- | ||
|
||
void InspectorMarker::apply() | ||
{ | ||
Marker* marker = static_cast<Marker*>(inspector->element()); | ||
|
||
if (iMarker.subtype->currentIndex() != int(marker->markerType()) | ||
|| iMarker.jumpLabel->text() != marker->label()) { | ||
Score* score = marker->score(); | ||
score->startCmd(); | ||
score->undoChangeProperty(marker, P_MARKER_TYPE, iMarker.subtype->currentIndex()); | ||
score->undoChangeProperty(marker, P_LABEL, iMarker.jumpLabel->text()); | ||
score->endCmd(); | ||
mscore->endCmd(); | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// $Id:$ | ||
// | ||
// Copyright (C) 2013 Werner Schweer and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2 | ||
// as published by the Free Software Foundation and appearing in | ||
// the file LICENSE.GPL | ||
//============================================================================= | ||
|
||
#ifndef __INSPECTOR_MARKER_H__ | ||
#define __INSPECTOR_MARKER_H__ | ||
|
||
#include "inspector.h" | ||
#include "ui_inspector_marker.h" | ||
#include "libmscore/property.h" | ||
|
||
//--------------------------------------------------------- | ||
// InspectorMarker | ||
//--------------------------------------------------------- | ||
|
||
class InspectorMarker : public InspectorBase { | ||
Q_OBJECT | ||
|
||
InspectorElementElement* iElement; | ||
Ui::InspectorMarker iMarker; | ||
|
||
public slots: | ||
virtual void apply(); | ||
|
||
public: | ||
InspectorMarker(QWidget* parent); | ||
virtual void setElement(Element*); | ||
bool dirty() const; | ||
}; | ||
|
||
#endif | ||
|
||
|
Oops, something went wrong.