def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of video_modes. ''' if PROPixx is None: raise ImportError('Cannot open PROPixx library') self.video_mode = mode dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of :attr:`ViewControllerBase.video_modes`. ''' if PROPixx is None: if ignore_vpixx_import_error: return raise ImportError('Cannot open PROPixx library') dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of :attr:`ViewControllerBase.video_modes`. ''' if self.vpixx_remote: App.get_running_app().remote_viewer.send_vpixx_command( 'video_mode', (mode, )) return if PROPixx is None: raise ImportError('Cannot open PROPixx library') dev = PROPixx() dev.setDlpSequencerProgram(mode) dev.updateRegisterCache() dev.close()
def set_video_mode(self, mode): '''Sets the projector's video mode. ``mode`` can be one of video_modes. ''' if PROPixx is None: raise ImportError('Cannot open PROPixx library') modes = { 'RGB': 'RGB 120Hz', 'QUAD4X': 'RGB Quad 480Hz', 'QUAD12X': 'GREY Quad 1440Hz' } self.video_mode = mode dev = PROPixx() dev.setDlpSequencerProgram(modes[mode]) dev.updateRegisterCache() dev.close()
my_device_controller.audio.initializeCodec() # Configures initial CODEC state. my_device_controller.audio.setLeftRightMode( 'mono') # Set which mode the audio will be output. my_device_controller.audio.setAudioBuffer( 0, 64) # Set the audio to start at address 0, and size 64. # Now we must create the audio stimulus. # This is done by simply filling a list with a sound wave. audio_stim = [] import math for i in range(32): audio_stim.append(int(32767 * math.sin(2.0 * math.pi * i / 32.0))) my_device_controller.writeRam( 0, audio_stim) # Write the audio stimulus in the ram. my_device_controller.audio.setVolume(0.25) my_device_controller.updateRegisterCache() # Send everything to the device. # We must at this point create the audio schedule # The first parameter is the schedule onset, which we set to 0, # meaning that the first schedule tick will occur immediately once the schedule starts. # The second and third parameters indicate that the audio samples will be played at 40 kHz. # The forth parameter is a schedule counter, indicating the number of ticks # that the schedule should run before stopping. # We'll run it for 16000 samples, which will take 16000/40000 = 400 ms. my_device_controller.audio.setAudioSchedule(0, 40000, 'hz', 16000) my_device_controller.audio.startScheduleLeft() my_device_controller.updateRegisterCache() # Close the devices my_device.close() my_device_controller.close()