mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
mixer simple basic abstraction - added python binding
reasons: - rapid development - class-like code structure - more readable code features: - hcontrol binding is managed from python (opportunity to create virtual mixer without driver or join multiple cards to behave as one)
This commit is contained in:
parent
582cc1f098
commit
e0d7bfcea6
9 changed files with 1436 additions and 33 deletions
24
modules/mixer/simple/python/main.py
Normal file
24
modules/mixer/simple/python/main.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- Python -*-
|
||||
|
||||
from os.path import dirname
|
||||
from pyalsa.alsacontrol import Control
|
||||
from sys import path
|
||||
path.insert(0, dirname(__file__))
|
||||
|
||||
def alsacode(module):
|
||||
execfile(dirname(__file__)+'/'+module+'.py', globals())
|
||||
|
||||
ctl = Control(device)
|
||||
info = ctl.cardInfo()
|
||||
#mixername = info['mixername']
|
||||
components = info['components']
|
||||
del ctl
|
||||
|
||||
if components.find('HDA:') >= 0:
|
||||
module = 'hda'
|
||||
else:
|
||||
raise ValueError, "Mixer for this hardware is not implemented in python"
|
||||
|
||||
alsacode(module)
|
||||
Loading…
Add table
Add a link
Reference in a new issue