mixer: added flag "open"
Remember if a mixer object is open or closed. Don't call open() again if it is already open. This guarantees that the mixer plugin is always called in a consistent state, and we will be able to remove lots of checks from the implementations. To support mixers which are automatically opened even if the audio output is still closed (to set the volume before playback starts), this patch also adds the "global" flag to the mixer_plugin struct. Both ALSA and OSS set this flag, while PULSE does not.
This commit is contained in:
@@ -68,6 +68,13 @@ struct mixer_plugin {
|
||||
* @return true on success
|
||||
*/
|
||||
bool (*set_volume)(struct mixer *mixer, unsigned volume);
|
||||
|
||||
/**
|
||||
* If true, then the mixer is automatically opened, even if
|
||||
* its audio output is not open. If false, then the mixer is
|
||||
* disabled as long as its audio output is closed.
|
||||
*/
|
||||
bool global;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user