Skip to content

Commit

Permalink
Merge pull request #1064 from Be-ing/effect_short_names
Browse files Browse the repository at this point in the history
Effect & effect parameter short names
  • Loading branch information
rryan authored Dec 9, 2016
2 parents 5fe4c3f + 2255a2d commit 7e81c30
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/effects/effectmanifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class EffectManifest {
m_name = name;
}

virtual const QString& shortName() const {
return m_shortName;
}
virtual void setShortName(const QString& shortName) {
m_shortName = shortName;
}

virtual const QString& author() const {
return m_author;
}
Expand Down Expand Up @@ -114,6 +121,7 @@ class EffectManifest {

QString m_id;
QString m_name;
QString m_shortName;
QString m_author;
QString m_version;
QString m_description;
Expand Down
8 changes: 8 additions & 0 deletions src/effects/effectmanifestparameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ class EffectManifestParameter {
m_name = name;
}

virtual const QString& shortName() const {
return m_shortName;
}
virtual void setShortName(const QString& shortName) {
m_shortName = shortName;
}

virtual const QString& description() const {
return m_description;
}
Expand Down Expand Up @@ -193,6 +200,7 @@ class EffectManifestParameter {

QString m_id;
QString m_name;
QString m_shortName;
QString m_description;

ControlHint m_controlHint;
Expand Down
4 changes: 4 additions & 0 deletions src/effects/effectparameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const QString EffectParameter::name() const {
return m_parameter.name();
}

const QString EffectParameter::shortName() const {
return m_parameter.shortName();
}

const QString EffectParameter::description() const {
return m_parameter.description();
}
Expand Down
1 change: 1 addition & 0 deletions src/effects/effectparameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EffectParameter : public QObject {
const EffectManifestParameter& manifest() const;
const QString id() const;
const QString name() const;
const QString shortName() const;
const QString description() const;

///////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 7 additions & 0 deletions src/effects/effectparameterslotbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ QString EffectParameterSlotBase::name() const {
return QString();
}

QString EffectParameterSlotBase::shortName() const {
if (m_pEffectParameter) {
return m_pEffectParameter->shortName();
}
return QString();
}

QString EffectParameterSlotBase::description() const {
if (m_pEffectParameter) {
return m_pEffectParameter->description();
Expand Down
1 change: 1 addition & 0 deletions src/effects/effectparameterslotbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class EffectParameterSlotBase : public QObject {
virtual ~EffectParameterSlotBase();

QString name() const;
QString shortName() const;
QString description() const;
const EffectManifestParameter getManifest();

Expand Down
1 change: 1 addition & 0 deletions src/effects/native/autopaneffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ EffectManifest AutoPanEffect::getManifest() {
EffectManifestParameter* smoothing = manifest.addParameter();
smoothing->setId("smoothing");
smoothing->setName(QObject::tr("Smoothing"));
smoothing->setShortName(QObject::tr("Smooth"));
smoothing->setDescription(
QObject::tr("How fast the signal goes from a channel to an other"));
smoothing->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bessel4lvmixeqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EffectManifest Bessel4LVMixEQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Bessel4 LV-Mix EQ"));
manifest.setShortName(QObject::tr("Bessel4 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bessel8lvmixeqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ EffectManifest Bessel8LVMixEQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Bessel8 LV-Mix EQ"));
manifest.setShortName(QObject::tr("Bessel8 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/bitcrushereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ EffectManifest BitCrusherEffect::getManifest() {
EffectManifestParameter* frequency = manifest.addParameter();
frequency->setId("downsample");
frequency->setName(QObject::tr("Downsampling"));
frequency->setShortName(QObject::tr("Down"));
frequency->setDescription(QObject::tr("Adjusts the sample rate, to which the signal is downsampled."));
frequency->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
frequency->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
3 changes: 2 additions & 1 deletion src/effects/native/filtereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ EffectManifest FilterEffect::getManifest() {

EffectManifestParameter* q = manifest.addParameter();
q->setId("q");
q->setName(QObject::tr("Q"));
q->setName(QObject::tr("Resonance"));
q->setShortName(QObject::tr("Q"));
q->setDescription(QObject::tr("Resonance of the filters, default = Flat top"));
q->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
q->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/linkwitzriley8eqeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ EffectManifest LinkwitzRiley8EQEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("LinkwitzRiley8 EQ"));
manifest.setShortName(QObject::tr("LR8 EQ"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand Down
2 changes: 2 additions & 0 deletions src/effects/native/moogladder4filtereffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ EffectManifest MoogLadder4FilterEffect::getManifest() {
EffectManifest manifest;
manifest.setId(getId());
manifest.setName(QObject::tr("Moog Ladder 4 Filter"));
manifest.setShortName(QObject::tr("Moog Filter"));
manifest.setAuthor("The Mixxx Team");
manifest.setVersion("1.0");
manifest.setDescription(QObject::tr(
Expand All @@ -40,6 +41,7 @@ EffectManifest MoogLadder4FilterEffect::getManifest() {
EffectManifestParameter* q = manifest.addParameter();
q->setId("resonance");
q->setName(QObject::tr("Resonance"));
q->setShortName(QObject::tr("Res"));
q->setDescription(QObject::tr("Resonance of the filters. 4 = self oscillating"));
q->setControlHint(EffectManifestParameter::CONTROL_KNOB_LOGARITHMIC);
q->setSemanticHint(EffectManifestParameter::SEMANTIC_UNKNOWN);
Expand Down
1 change: 1 addition & 0 deletions src/effects/native/reverbeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ EffectManifest ReverbEffect::getManifest() {
EffectManifestParameter* time = manifest.addParameter();
time->setId("bandwidth");
time->setName(QObject::tr("Bandwidth"));
time->setShortName(QObject::tr("BW"));
time->setDescription(QObject::tr("Higher bandwidth values cause more "
"bright (high-frequency) tones to be included"));
time->setControlHint(EffectManifestParameter::CONTROL_KNOB_LINEAR);
Expand Down
10 changes: 8 additions & 2 deletions src/widget/weffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ void WEffect::effectUpdated() {
EffectPointer pEffect = m_pEffectSlot->getEffect();
if (pEffect) {
const EffectManifest& manifest = pEffect->getManifest();
name = manifest.name();
description = manifest.description();
if (!manifest.shortName().isEmpty()) {
name = manifest.shortName();
//: %1 = effect name; %2 = effect description
description = tr("%1: %2").arg(manifest.name(), manifest.description());
} else {
name = manifest.name();
description = manifest.description();
}
}
} else {
name = tr("None");
Expand Down
12 changes: 10 additions & 2 deletions src/widget/weffectparameterbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ void WEffectParameterBase::setEffectParameterSlot(

void WEffectParameterBase::parameterUpdated() {
if (m_pEffectParameterSlot) {
setText(m_pEffectParameterSlot->name());
setBaseTooltip(m_pEffectParameterSlot->description());
if (!m_pEffectParameterSlot->shortName().isEmpty()) {
setText(m_pEffectParameterSlot->shortName());
//: %1 = effect name; %2 = effect description
setBaseTooltip(tr("%1: %2").arg(
m_pEffectParameterSlot->name(),
m_pEffectParameterSlot->description()));
} else {
setText(m_pEffectParameterSlot->name());
setBaseTooltip(m_pEffectParameterSlot->description());
}
} else {
setText(tr("None"));
setBaseTooltip(tr("No effect loaded."));
Expand Down

0 comments on commit 7e81c30

Please sign in to comment.