Skip to content

Commit

Permalink
Fixed applying presets from the eq-preset-list
Browse files Browse the repository at this point in the history
  • Loading branch information
freaktechnik committed Jun 7, 2014
1 parent 814f619 commit 0b1fb0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 15 additions & 1 deletion app/content/bindings/eqPresetList.xml
Expand Up @@ -55,7 +55,13 @@
<implementation>
<field name="_observer">null</field>
<field name="_presetList">document.getAnonymousElementByAttribute(this, "anonid", "eq-preset-list")</field>
<field name="_preset">this._presetList.getAttribute("value")</field>
<property name="_preset">
<getter>
<![CDATA[
return this._presetList.inputField.value
]]>
</getter>
</property>
<property name="preset">
<getter>
<![CDATA[
Expand Down Expand Up @@ -116,15 +122,19 @@
this._presetList.label = this._mm.equalizer.currentPresetName;
this._commandListener = function(e) {
Components.utils.reportError("onCommand");
that.onCommand(e);
};
this._saveListener = function(e) {
Components.utils.reportError("onSave");
that.onSave(e);
};
this._deleteListener = function(e) {
Components.utils.reportError("onDelete");
that.onDelete(e);
};
this._textFieldListener = function(e) {
Components.utils.reportError("keys!");
that.onFieldChange(e);
}
this._presetList.addEventListener("command", this._commandListener, false);
Expand All @@ -135,6 +145,7 @@
document.getAnonymousElementByAttribute(this, "anonid", "eq-preset-reset")
.addEventListener("command", this._deleteListener, false);
this._presetList.inputField.addEventListener("input", this._textFieldListener, false);
Components.utils.reportError("construction done");
]]>
</constructor>
<destructor>
Expand Down Expand Up @@ -177,6 +188,7 @@
<parameter name="updateBackend" />
<body>
<![CDATA[
Components.utils.reportError("onPresetChange");
this._presetList.select(preset);
var deleteButton = document.getAnonymousElementByAttribute(this, "anonid", "eq-preset-delete");
Expand All @@ -202,6 +214,7 @@
}
if(updateBackend) {
Components.utils.reportError("Telling EQ to change to "+preset);
this._mm.equalizer.currentPresetName = preset;
}
]]>
Expand All @@ -211,6 +224,7 @@
<parameter name="event" />
<body>
<![CDATA[
Components.utils.reportError("Changing preset");
this.onPresetChange(this._preset, true);
]]>
</body>
Expand Down
Expand Up @@ -89,10 +89,10 @@ interface ngIMainEqualizerPresetProvider : ngIEqualizerPresetProvider
* \note Observers of the topic "equalizer-preset-saved" are notified after
* the preset has been saved with the service as subject and the name
* as data.
* \note This should not be used to add presets to the list, rather create
* an ngIEqualizerPresetProvider to add presets.
* \note This should not be used to add presets to the list unless importing,
* rather create an ngIEqualizerPresetProvider to add presets.
* \throw NS_ERROR_ILLEGAL_VALUE if the supplied array does not have the
* same length as teh equalizer has bands.
* same length as the equalizer has bands.
*/
void savePreset(in AString aName, in nsIArray aValues);
};
Expand Down

0 comments on commit 0b1fb0f

Please sign in to comment.