Exemplo n.º 1
0
 def open_device(self):
     # the app will crash if I rmmod awe_awe
     solfege_c_midi.cvar.seqfd = os.open(self.m_device, os.O_WRONLY, 0)
     if not solfege_c_midi.sndctl_seq_reset():
         # we cannot use self.close() because that function will try
         # to call sndctl_seq_reset()
         os.close(solfege_c_midi.cvar.seqfd)
         solfege_c_midi.cvar.seqfd = -1
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SEQ_RESET) failed"
             % self.m_device, solfege_c_midi.cvar.errno)
     i = solfege_c_midi.sndctl_seq_nrsynths()
     if i == -1:
         self.close()
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SEQ_NRSYNTHS, &n) failed"
             % self.m_device, solfege_c_midi.cvar.errno)
     if self.m_devnum >= i:
         if i == 0:
             self.close()
             raise SeqNoSynthsException(self.m_device)
         else:
             self.m_devnum = i - 1
     self.m_num_voices = solfege_c_midi.get_synth_nr_voices(self.m_devnum)
     if self.m_num_voices == -1:
         self.close()
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SYNTH_INFO, &si) failed"
             % self.m_device, solfege_c_midi.cvar.errno)
Exemplo n.º 2
0
 def open_device(self):
     # the app will crash if I rmmod awe_awe
     solfege_c_midi.cvar.seqfd = os.open(self.m_device, os.O_WRONLY, 0)
     if not solfege_c_midi.sndctl_seq_reset():
         # we cannot use self.close() because that function will try
         # to call sndctl_seq_reset()
         os.close(solfege_c_midi.cvar.seqfd)
         solfege_c_midi.cvar.seqfd = -1
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SEQ_RESET) failed" % self.m_device,
             solfege_c_midi.cvar.errno,
         )
     i = solfege_c_midi.sndctl_seq_nrsynths()
     if i == -1:
         self.close()
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SEQ_NRSYNTHS, &n) failed" % self.m_device,
             solfege_c_midi.cvar.errno,
         )
     if self.m_devnum >= i:
         if i == 0:
             self.close()
             raise SeqNoSynthsException(self.m_device)
         else:
             self.m_devnum = i - 1
     self.m_num_voices = solfege_c_midi.get_synth_nr_voices(self.m_devnum)
     if self.m_num_voices == -1:
         self.close()
         raise SyscallException(
             "While trying to open the device %s\nioctl(seqfd, SNDCTL_SYNTH_INFO, &si) failed" % self.m_device,
             solfege_c_midi.cvar.errno,
         )
Exemplo n.º 3
0
 def print_soundcard_info(self):
     print "Devicefile:", self.m_device
     print "The following sound devices has been found:"
     assert solfege_c_midi.cvar.seqfd
     nrsynths = solfege_c_midi.sndctl_seq_nrsynths()
     for x in range(nrsynths):
         print "%i: %s" % (x, solfege_c_midi.get_synth_name(x))
     print "--- using %s ---" % solfege_c_midi.get_synth_name(self.m_devnum)
Exemplo n.º 4
0
 def print_soundcard_info(self):
     print("Devicefile:", self.m_device)
     print("The following sound devices has been found:")
     assert solfege_c_midi.cvar.seqfd
     nrsynths = solfege_c_midi.sndctl_seq_nrsynths()
     for x in range(nrsynths):
         print("%i: %s" % (x, solfege_c_midi.get_synth_name(x)))
     print("--- using %s ---" % solfege_c_midi.get_synth_name(self.m_devnum))