Bug #712

addAttributeProperty doesn't work in FilterLib

Added by Nils Peters over 8 years ago. Updated almost 8 years ago.

Status:ClosedStart date:2011-02-24
Priority:NormalDue date:
Assignee:Nils Peters% Done:

100%

Category:-Spent time:1.50 hour
Target version:-
Branch:master OS:

Description

In the FilterLib, the frequency attribute is being clipped to avoid too low or too high cutoff frequencies:

addAttributeWithSetter(Frequency,    kTypeFloat64);
addAttributeProperty(Frequency,        range,    TTValue(2.0, sr*0.475));
addAttributeProperty(Frequency,        rangeChecking,    TT("clip"));

Unfortunately, this clipping doesn't seem to work at all.

History

#1 Updated by Tim Place over 8 years ago

Maybe its because this has a custom setter method.

It seems appropriate that if you define a custom setter method that your method should perform the clipping. But perhaps there are some other design issues to think about or make clearer with all this stuff?

#2 Updated by Tim Place over 8 years ago

Is there a way in redmine to tag things? For example, this issue should be tagged 'documentation'.

#3 Updated by Nils Peters over 8 years ago

rangeChecking using addAttributeProperty also doesn't work in other extensions - just tried to use it in the SoundfileLib extension.

addAttributeWithSetter(Length,            kTypeFloat64);
  addAttributeProperty(Length,            range,        TTValue(0, 60000));
  addAttributeProperty(Length,            rangeChecking,    TT("clip"));

#4 Updated by Nils Peters almost 8 years ago

addAttributeProperty actually works: the attribute name must not be capitalized though: *l*ength instead of *L*ength.

addAttributeWithSetter(Length,            kTypeFloat64);
  addAttributeProperty(length,            range,        TTValue(0, 60000));
  addAttributeProperty(length,            rangeChecking,    TT("clip"));

IMO, this should be improved.

#5 Updated by Nils Peters almost 8 years ago

  • Status changed from New to Closed
  • Assignee changed from Tim Place to Nils Peters
  • % Done changed from 0 to 100
  • Branch set to master

Also available in: Atom PDF