[mythtv] [PATCH] volume control for OSS and ALSA

Ed Wildgoose lists at wildgooses.com
Thu Oct 28 06:57:29 UTC 2004


Isaac Richards wrote:

>On Wednesday 27 October 2004 06:02 pm, Ed Wildgoose wrote:
>  
>
>>This sounds nearly perfect, except....
>>
>>...since AudioOutputBase is only an optional feature, you can't really
>>include base code there, like the generic volume control...  Consider
>>for example the DirectX class which doesn't inherit from
>>AudioOutputBase, or some new class which is someday written and uses
>>something else.
>>
>>Instead, I suggest that we create a new class, (say VolumeControl),
>>which contains everything you added to AudioOutputBase, but make the
>>very base class "AudioOutput" inherit from the VolumeControl class.  In
>>this way, EVERY class will get the code (makes sense?).  It's not a big
>>change, just a copy and paste operation.  The code which uses the class
>>will not even tell that we have done this.
>>    
>>
>
>That doesn't really make any sense.  Every audio output class is going to have 
>to deal with volume somehow, so it makes sense for the common methods to be 
>in the base class that all audio output classes inherit from.  If they don't 
>inherit from it, they're broken.
>  
>


Agreed.  That's what I just proposed...

However, the base class in this case is AudioOutput.  AudioOutputBase is 
just our convenient first stab at a generic concrete implementation.  I 
should think that we really want to move the volume stuff, since it's 
really, really concrete into the AudioOutput class itself.  And the 
easiest way to do this without breaking AudioOutput being a pure 
interface, would be to make AudioOutput inherit from some class that 
already contains the implementation...

However, I agree the way it has been done is probably also just as good 
in practice...  I suspect DirectX output might be broken though, someone 
with a win32 machine perhaps can report?  (Is there someone I can send a 
message to just to say we broke it..?)

Would you be happy to commit this patch as is?  I think it looks fine 
from here

Thanks again Jermiah!

Ed W


More information about the mythtv-dev mailing list