Should PositionableAudioSource have virtual setLooping()?

PositionableAudioSource has a virtual bool isLooping() const = 0; - should it have a virtual setLooping?

In all implementations of it that I have, both Juce’s and mine, all instances of PositionableAudioSource do in fact have a setLooping method - but a non-virtual one. Since I use looping quite a bit, I have to have code like:[code]// Source is a class that implements PositionableAudioSource
// and has a method void setLooping(bool looping);
class MyPositionableAudioSource : public PositionableAudioSource {
MyPositionableAudioSource(Source* source) : source_(source) {}

void setLooping(bool looping) {
source_->setLooping(looping); // Whole class must be generic for just this one line.

It doesn’t really make sense to have a getter but no setter for looping - particularly when everything else about PositionableAudioSource is settable! If PositionableAudioSource added a single linevirtual void setLooping(bool looping) {}then it’s almost certain that no existing code would be broken and this asymmetry would be fixed.

Seems like a very reasonable request!

Just a reminder here, hoping to see this tiny, itsy, barely noticeable change get in as part of something more important…

(It’s causing me some slight code agita - I end up with three layers of templating which would all go away… nothing I can’t handle, it’s just… ugly!)

Already done, just not checked in yet, as I’m in the middle of messing about with some other classes… Will be doing a check-in asap!

Damn, you’re fast! :smiley: I shouldn’t have bugged yaz.

This looks like a good week… I’m realizing that I can move my project forward to gcc 4.5 and VC 10 - and finally, finally use all those great C++0x features

I’m jealous! I imagine it’ll be a long time before I can drop support for older compilers and start using those 0x features in Juce…

:frowning: Yes, I was going to make some teasing comment about that but realized it’d be too close to the bone for you.

Well, you have the advantage of being master of your demesne, so it works out.

It’ll be… strange. The auto keyword will be great. I need lambdas - are these the lambdas I’m looking for?

Delegating constructors and in-class member initialisers are my most wanted features, I think.

No delegating constructors in gcc 4.5. :frowning: