2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011 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 LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#include "score.h"
|
|
|
|
#include "iname.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InstrumentName
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InstrumentName::InstrumentName(Score* s)
|
|
|
|
: Text(s)
|
|
|
|
{
|
2014-05-21 17:57:56 +02:00
|
|
|
setInstrumentNameType(InstrumentNameType::SHORT);
|
2012-05-26 14:26:10 +02:00
|
|
|
_layoutPos = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2013-03-05 20:23:59 +01:00
|
|
|
// instrumentNameTypeName
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
QString InstrumentName::instrumentNameTypeName() const
|
2012-05-26 14:26:10 +02:00
|
|
|
{
|
2014-05-21 17:57:56 +02:00
|
|
|
if (instrumentNameType() == InstrumentNameType::SHORT)
|
2012-05-26 14:26:10 +02:00
|
|
|
return QString("short");
|
|
|
|
return QString("long");
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2013-03-05 20:23:59 +01:00
|
|
|
// setInstrumentNameType
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
void InstrumentName::setInstrumentNameType(const QString& s)
|
2012-05-26 14:26:10 +02:00
|
|
|
{
|
|
|
|
if (s == "short")
|
2014-05-21 17:57:56 +02:00
|
|
|
setInstrumentNameType(InstrumentNameType::SHORT);
|
2012-05-26 14:26:10 +02:00
|
|
|
if (s == "long")
|
2014-05-21 17:57:56 +02:00
|
|
|
setInstrumentNameType(InstrumentNameType::LONG);
|
2012-05-26 14:26:10 +02:00
|
|
|
else
|
|
|
|
qDebug("InstrumentName::setSubtype: unknown <%s>", qPrintable(s));
|
|
|
|
}
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
void InstrumentName::setInstrumentNameType(InstrumentNameType st)
|
2012-09-21 14:29:34 +02:00
|
|
|
{
|
2013-03-05 20:23:59 +01:00
|
|
|
_instrumentNameType = st;
|
2014-05-21 17:57:56 +02:00
|
|
|
if (st == InstrumentNameType::SHORT)
|
2014-05-30 10:13:29 +02:00
|
|
|
setTextStyleType(TextStyleType::INSTRUMENT_SHORT);
|
2012-09-21 14:29:34 +02:00
|
|
|
else
|
2014-05-30 10:13:29 +02:00
|
|
|
setTextStyleType(TextStyleType::INSTRUMENT_LONG);
|
2012-09-21 14:29:34 +02:00
|
|
|
}
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
}
|
|
|
|
|