forked from auracaster/pyalsaaudio
Whitespace fixes
- strip trailing whitespace in several files - fix some indentation (tabs vs. spaces)
This commit is contained in:
committed by
Oswald Buddenhagen
parent
f25c8243dc
commit
c5153db0ac
@@ -196,8 +196,8 @@ get_pcmtype(PyObject *obj)
|
||||
static bool is_value_volume_unit(long unit)
|
||||
{
|
||||
if (unit == VOLUME_UNITS_PERCENTAGE ||
|
||||
unit == VOLUME_UNITS_RAW ||
|
||||
unit == VOLUME_UNITS_DB) {
|
||||
unit == VOLUME_UNITS_RAW ||
|
||||
unit == VOLUME_UNITS_DB) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -73,7 +73,7 @@ def show_mixer(name, kwargs):
|
||||
volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB)
|
||||
for i in range(len(volumes)):
|
||||
print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
|
||||
|
||||
|
||||
try:
|
||||
mutes = mixer.getmute()
|
||||
for i in range(len(mutes)):
|
||||
@@ -113,7 +113,7 @@ def set_mixer(name, args, kwargs):
|
||||
mixer.setmute(1, channel)
|
||||
else:
|
||||
mixer.setmute(0, channel)
|
||||
|
||||
|
||||
elif args in ['rec','unrec']:
|
||||
# Enable/disable recording
|
||||
if args == 'rec':
|
||||
|
||||
4
setup.py
4
setup.py
@@ -29,12 +29,12 @@ if __name__ == '__main__':
|
||||
'License :: OSI Approved :: Python Software Foundation License',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Topic :: Multimedia :: Sound/Audio',
|
||||
'Topic :: Multimedia :: Sound/Audio :: Mixers',
|
||||
'Topic :: Multimedia :: Sound/Audio :: Players',
|
||||
'Topic :: Multimedia :: Sound/Audio :: Capture/Recording',
|
||||
],
|
||||
ext_modules=[Extension('alsaaudio',['alsaaudio.c'],
|
||||
ext_modules=[Extension('alsaaudio',['alsaaudio.c'],
|
||||
libraries=['asound'])]
|
||||
)
|
||||
|
||||
10
test.py
10
test.py
@@ -20,7 +20,7 @@ PCMMethods = [
|
||||
]
|
||||
|
||||
PCMDeprecatedMethods = [
|
||||
('setchannels', (2,)),
|
||||
('setchannels', (2,)),
|
||||
('setrate', (44100,)),
|
||||
('setformat', (alsaaudio.PCM_FORMAT_S8,)),
|
||||
('setperiodsize', (320,))
|
||||
@@ -49,10 +49,10 @@ class MixerTest(unittest.TestCase):
|
||||
|
||||
def testMixer(self):
|
||||
"""Open the default Mixers and the Mixers on every card"""
|
||||
|
||||
|
||||
for c in alsaaudio.card_indexes():
|
||||
mixers = alsaaudio.mixers(cardindex=c)
|
||||
|
||||
|
||||
for m in mixers:
|
||||
mixer = alsaaudio.Mixer(m, cardindex=c)
|
||||
mixer.close()
|
||||
@@ -73,7 +73,7 @@ class MixerTest(unittest.TestCase):
|
||||
mixer.close()
|
||||
|
||||
def testMixerClose(self):
|
||||
"""Run common Mixer methods on a closed object and verify it raises an
|
||||
"""Run common Mixer methods on a closed object and verify it raises an
|
||||
error"""
|
||||
|
||||
mixers = alsaaudio.mixers()
|
||||
@@ -133,7 +133,7 @@ class PCMTest(unittest.TestCase):
|
||||
pcm = alsaaudio.PCM(card='default')
|
||||
except alsaaudio.ALSAAudioError:
|
||||
pass
|
||||
|
||||
|
||||
# Verify we got a DepreciationWarning
|
||||
self.assertEqual(len(w), 1, "PCM(card='default') expected a warning" )
|
||||
self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "PCM(card='default') expected a DeprecationWarning")
|
||||
|
||||
Reference in New Issue
Block a user