Skip to content

Commit

Permalink
Fix dataremotes not set in correct format
Browse files Browse the repository at this point in the history
This hopefully resolves the issue with the sliders not updating
correctly.
  • Loading branch information
freaktechnik committed Oct 31, 2014
1 parent a1143ab commit b58a36b
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -503,13 +503,17 @@ sbBaseMediacoreMultibandEqualizer::SetCurrentPresetName(const nsAString& aCurren
// This should possibly be done in front-end code for the separation.
LOG(("Applying new GAIN value to the band slider"));
char* gainString;
rv = gain->ToString(&gainString);
SB_ConvertFloatEqGainToJSStringValue(gainValue, &gainString);
nsCOMPtr<nsISupportsString> supportsGainString(do_CreateInstance("@mozilla.org/supports-string;1"));
nsEmbedString sgsData(gainString);
rv = supportsGainString->SetData(sgsData, 64);
NS_ENSURE_SUCCESS(rv, rv);

nsEmbedCString bandPrefName(NS_LITERAL_CSTRING("songbird.eq.band."));
bandPrefName.AppendInt(index);

LOG(("Band: %i, Gain: %s", index, gainString));
rv = mPrefs->SetCharPref(bandPrefName.get(), gainString);
rv = mPrefs->SetComplexValue(bandPrefName.get(), NS_GET_IID(nsISupportsString), supportsGainString);
NS_ENSURE_SUCCESS(rv, rv);
}
}
Expand Down

0 comments on commit b58a36b

Please sign in to comment.