1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// 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 "inspector.h"
#include "inspectorTextLine.h"
#include "inspectorHairpin.h"
#include "musescore.h"
#include "libmscore/hairpin.h"
#include "libmscore/score.h"
// #include "icons.h"
namespace Ms {
//---------------------------------------------------------
// InspectorHairpin
//---------------------------------------------------------
InspectorHairpin::InspectorHairpin(QWidget* parent)
// : InspectorElementBase(parent)
: InspectorTextLineBase(parent)
{
h.setupUi(addWidget());
h.hairpinType->clear();
h.hairpinType->addItem(tr("Crescendo Hairpin"), int(HairpinType::CRESC_HAIRPIN));
h.hairpinType->addItem(tr("Decrescendo Hairpin"), int(HairpinType::DECRESC_HAIRPIN));
h.hairpinType->addItem(tr("Crescendo Line"), int(HairpinType::CRESC_LINE));
h.hairpinType->addItem(tr("Decrescendo Line"), int(HairpinType::DECRESC_LINE));
h.veloChangeMethod->clear();
h.veloChangeMethod->addItem(tr("Default (linear)"), int(VeloChangeMethod::NORMAL));
h.veloChangeMethod->addItem(tr("Ease-in and out"), int(VeloChangeMethod::EASE_IN_OUT));
h.veloChangeMethod->addItem(tr("Ease-in"), int(VeloChangeMethod::EASE_IN));
h.veloChangeMethod->addItem(tr("Ease-out"), int(VeloChangeMethod::EASE_OUT));
h.veloChangeMethod->addItem(tr("Exponential"), int(VeloChangeMethod::EXPONENTIAL));
const std::vector<InspectorItem> il = {
{ Pid::HAIRPIN_CIRCLEDTIP, 0, h.hairpinCircledTip, h.resetHairpinCircledTip },
{ Pid::HAIRPIN_TYPE, 0, h.hairpinType, 0 },
{ Pid::PLACEMENT, 0, h.placement, h.resetPlacement },
{ Pid::DYNAMIC_RANGE, 0, h.dynRange, h.resetDynRange },
{ Pid::VELO_CHANGE, 0, h.veloChange, h.resetVeloChange },
{ Pid::HAIRPIN_HEIGHT, 0, h.hairpinHeight, h.resetHairpinHeight },
{ Pid::HAIRPIN_CONT_HEIGHT, 0, h.hairpinContHeight, h.resetHairpinContHeight },
{ Pid::SINGLE_NOTE_DYNAMICS, 0, h.singleNoteDynamics, h.resetSingleNoteDynamics},
{ Pid::VELO_CHANGE_METHOD, 0, h.veloChangeMethod, h.resetVeloChangeMethod },
};
const std::vector<InspectorPanel> ppList = {
{ h.title, h.panel }
};
mapSignals(il, ppList);
}
//---------------------------------------------------------
// updateLineType
//---------------------------------------------------------
void InspectorHairpin::updateLineType()
{
HairpinSegment* hs = toHairpinSegment(inspector->element());
Hairpin* hp = hs->hairpin();
bool userDash = hp->lineStyle() == Qt::CustomDashLine;
l.dashLineLength->setVisible(userDash);
l.dashGapLength->setVisible(userDash);
l.resetDashLineLength->setVisible(userDash);
l.resetDashGapLength->setVisible(userDash);
l.dashLineLengthLabel->setVisible(userDash);
l.dashGapLengthLabel->setVisible(userDash);
}
//---------------------------------------------------------
// valueChanged
//---------------------------------------------------------
void InspectorHairpin::valueChanged(int idx)
{
InspectorTextLineBase::valueChanged(idx);
if (iList[idx].t == Pid::LINE_STYLE)
updateLineType();
}
//---------------------------------------------------------
// setElement
//---------------------------------------------------------
void InspectorHairpin::setElement()
{
InspectorTextLineBase::setElement();
updateLineType();
}
//---------------------------------------------------------
// postInit
//---------------------------------------------------------
void InspectorHairpin::postInit()
{
bool useTextLine = h.hairpinType->currentIndex() == int(HairpinType::CRESC_LINE)
|| h.hairpinType->currentIndex() == int(HairpinType::DECRESC_LINE);
l.lineVisible->setEnabled(useTextLine);
h.gridWidget->setHidden(useTextLine);
}
}
|