home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gst-python / 0.10 / examples / mixer.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.1 KB  |  33 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import sys
  5. import gst
  6. import gst.interfaces as gst
  7. pipeline = 'alsasrc'
  8. if sys.argv[1:]:
  9.     pipeline = ' '.join(sys.argv[1:])
  10.  
  11. a = gst.element_factory_make(pipeline)
  12. print dir(a)
  13. res = a.set_state(gst.STATE_PAUSED)
  14. if res != gst.STATE_CHANGE_SUCCESS:
  15.     print 'Could not set pipeline %s to PAUSED' % pipeline
  16.  
  17. print 'Inputs:'
  18. for t in a.list_tracks():
  19.     if t.flags & gst.interfaces.MIXER_TRACK_INPUT:
  20.         sys.stdout.write(t.label)
  21.     
  22.     sys.stdout.write(': %d - %d' % (t.min_volume, t.max_volume))
  23.     volumes = a.get_volume(t)
  24.     sys.stdout.write(': %r' % (volumes,))
  25.     if t.props.num_channels > 0:
  26.         a.set_volume(t, volumes = volumes)
  27.     
  28.     if t.flags & gst.interfaces.MIXER_TRACK_RECORD:
  29.         sys.stdout.write(' (selected)')
  30.     
  31.     sys.stdout.write('\n')
  32.  
  33.