Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effect & effect parameter short names #1064

Merged
merged 7 commits into from
Dec 9, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -74,6 +74,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 @@ -179,6 +186,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 @@ -69,6 +69,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 @@ -38,6 +38,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 @@ -37,7 +37,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 @@ -39,6 +40,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->setName(QObject::tr("Band"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of "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
9 changes: 7 additions & 2 deletions src/widget/weffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ 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();
description = manifest.name() + ": " + manifest.description();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the ": " be translatable? @sblaisot, that should be " : " in French, correct?

Copy link
Member

@sblaisot sblaisot Dec 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, the english ": " translates in french to " : " (in fact, the first space, before the colon, is a non-breaking space).
But I'm afraid this will be hard in transifex to translate that as the space after the colon will not be visible in the interface and it need some hints to be properly translated :(
@esbrandt what do you think ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

French typography rule is simple (this is the only simple thing in french): if the punctuation mark is made of a single part (like dot, comma, ...), there is no space before and one space after. If it is made of two parts (like colon, semicolon, ...), there is a non-breaking space before and a space after.
with the exception of parenthesis, brackets, ... which have a space outside and no space inside.

} else {
name = manifest.name();
description = manifest.description();
}
}
} else {
name = tr("None");
Expand Down
11 changes: 9 additions & 2 deletions src/widget/weffectparameterbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ 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());
setBaseTooltip(m_pEffectParameterSlot->name()
+ QString(": ") +
m_pEffectParameterSlot->description());
} else {
setText(m_pEffectParameterSlot->name());
setBaseTooltip(m_pEffectParameterSlot->description());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be nice to setBaseTooltip as something like <name>: <description> so it's easy to learn the full name. (same in WEffect)

} else {
setText(tr("None"));
setBaseTooltip(tr("No effect loaded."));
Expand Down