Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ba582c232f
Fetching contributors…

Cannot retrieve contributors at this time

70 lines (58 sloc) 2.252 kb
//=============================================================================
// 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 "inspectorVolta.h"
#include "musescore.h"
#include "libmscore/volta.h"
#include "libmscore/score.h"
//---------------------------------------------------------
// InspectorVolta
//---------------------------------------------------------
InspectorVolta::InspectorVolta(QWidget* parent)
: InspectorBase(parent)
{
iElement = new InspectorElementElement(this);
layout->addWidget(iElement);
QWidget* w = new QWidget;
iVolta.setupUi(w);
layout->addWidget(w);
connect(iVolta.subtype, SIGNAL(currentIndexChanged(int)), SLOT(apply()));
}
//---------------------------------------------------------
// setElement
//---------------------------------------------------------
void InspectorVolta::setElement(Element* e)
{
VoltaSegment* voltaSegment = static_cast<VoltaSegment*>(e);
iElement->setElement(voltaSegment);
Volta* volta = voltaSegment->volta();
iVolta.subtype->blockSignals(true);
iVolta.subtype->setCurrentIndex(int(volta->subtype()));
iVolta.subtype->blockSignals(false);
}
//---------------------------------------------------------
// apply
//---------------------------------------------------------
void InspectorVolta::apply()
{
VoltaSegment* voltaSegment = static_cast<VoltaSegment*>(inspector->element());
Volta* volta = voltaSegment->volta();
Volta::VoltaType vt = volta->subtype();
Volta::VoltaType nt = Volta::VoltaType(iVolta.subtype->currentIndex());
if (vt != nt) {
Score* score = volta->score();
score->startCmd();
score->undoChangeProperty(volta, P_VOLTA_TYPE, nt);
score->endCmd();
mscore->endCmd();
}
}
Jump to Line
Something went wrong with that request. Please try again.