def pack_rdbs(box, callback): D = {} D['harmonic'] = b = gu.RadioButton(None, _("Harmonic"), callback) b.set_data('idir', 'harmonic') box.pack_start(b, False) D['melodic'] = b = gu.RadioButton(b, _("Melodic"), callback) b.set_data('idir', 'melodic') box.pack_start(b, False) return D
def pack_rdbs(box, callback): D = {} D['harmonic'] = b = gu.RadioButton(None, _("Harmonic"), callback) b.m_idir = 'harmonic' box.pack_start(b, False, False, 0) D['melodic'] = b = gu.RadioButton(b, _("Melodic"), callback) b.m_idir = 'melodic' box.pack_start(b, False, False, 0) return D
def create_win32_sound_page(self): it, page_vbox = self.new_page_box(None, _("Sound Setup")) ############# # midi setup ############# txt = Gtk.Label( _("""Solfege has two ways to play MIDI files. It is recommended to use Windows multimedia output. An external MIDI player can be useful if your soundcard lacks a hardware synth, in which case you have to use a program like timidity to play the music.""" )) txt.set_line_wrap(1) txt.set_justify(Gtk.Justification.FILL) txt.set_alignment(0.0, 0.0) page_vbox.pack_start(txt, False, False, 0) self.g_fakesynth_radio = gu.RadioButton(None, _("_No sound"), None) page_vbox.pack_start(self.g_fakesynth_radio, False, False, 0) hbox = gu.bHBox(page_vbox, False) self.g_device_radio = gu.RadioButton(self.g_fakesynth_radio, _("_Windows multimedia output:"), None) self.g_synth = Gtk.ComboBoxText() if winmidi: for devname in winmidi.output_devices(): #FIXME workaround of the bug # http://code.google.com/p/solfege/issues/detail?id=12 if devname is None: self.g_synth.append_text("FIXME bug #12") else: self.g_synth.append_text(devname) self.g_synth.set_active(self.get_int('sound/synth_number') + 1) hbox.pack_start(self.g_device_radio, False, False, 0) hbox.pack_start(self.g_synth, False, False, 0) hbox = gu.bHBox(page_vbox, False) self.g_midiplayer_radio = gu.RadioButton( self.g_fakesynth_radio, _("Use _external MIDI player"), None) hbox.pack_start(self.g_midiplayer_radio, False, False, 0) if self.get_string("sound/type") == "external-midiplayer": self.g_midiplayer_radio.set_active(True) elif self.get_string("sound/type") == "winsynth": self.g_device_radio.set_active(True) else: self.g_fakesynth_radio.set_active(True) gu.bButton(page_vbox, _("_Test"), self.on_apply_and_play_test_sound, False)
def create_linux_sound_page(self): it, page_vbox = self.new_page_box(None, _("Sound Setup")) ############# # midi setup ############# self.g_fakesynth_radio = gu.RadioButton(None, _("_No sound"), None) page_vbox.pack_start(self.g_fakesynth_radio, False, False, 0) ### ALSA self.m_gui_client_port = False hbox = gu.bHBox(page_vbox, False) self.g_alsa_radio = gu.RadioButton(self.g_fakesynth_radio, _("Use ALSA _device"), None) hbox.pack_start(self.g_alsa_radio, False, False, 0) self.g_alsa_device = Gtk.Button() self.g_alsa_device.connect('clicked', self.popup_alsa_connection_list) hbox.pack_start(self.g_alsa_device, False, False, 0) if solfege.soundcard.alsa_sequencer: connections = solfege.soundcard.alsa_sequencer.get_connection_list( ) for v in connections: if v[0:2] == self.get_list("sound/alsa-client-port"): self.g_alsa_device.set_label(v[-1]) self.m_gui_client_port = v[0:2] break else: if connections: self.m_gui_client_port = connections[-1][0:2] self.g_alsa_device.set_label(connections[-1][-1]) else: self.g_alsa_device.set_label("") else: self.g_alsa_device.set_sensitive(False) self.g_alsa_radio.set_sensitive(False) label = Gtk.Label( label="Disabled because the pyalsa Python module was not found." ) label.show() hbox.pack_start(label, False, False, 0) ### OSS hbox = gu.bHBox(page_vbox, False) self.g_device_radio = gu.RadioButton(self.g_fakesynth_radio, _("Use OSS _device"), None) hbox.pack_start(self.g_device_radio, False, False, 0) self.g_device_file = gu.sComboBox( 'sound', 'device_file', ['/dev/sequencer', '/dev/sequencer2', '/dev/music']) self.g_synth_num = Gtk.SpinButton() self.g_synth_num.set_adjustment(Gtk.Adjustment(0, 0, 100, 1, 1)) self.g_synth_num.set_value(self.get_int('sound/synth_number')) hbox.pack_start(self.g_device_file, False, False, 0) hbox.pack_start(self.g_synth_num, False, False, 0) ### hbox = gu.bHBox(page_vbox, False) self.g_midiplayer_radio = gu.RadioButton( self.g_fakesynth_radio, _("Use _external MIDI player"), None) hbox.pack_start(self.g_midiplayer_radio, False, False, 0) if self.get_string("sound/type") == "external-midiplayer": self.g_midiplayer_radio.set_active(True) elif self.get_string("sound/type") == "sequencer-device": self.g_device_radio.set_active(True) elif self.get_string("sound/type") == "alsa-sequencer": self.g_alsa_radio.set_active(True) else: self.g_fakesynth_radio.set_active(True) gu.bButton(page_vbox, _("_Test"), self.on_apply_and_play_test_sound, False)