예제 #1
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError, e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."),)
             raise
         devnum = 0
         logging.error("WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0", devnum)
         self.__driver = winmidi.Winmidi(devnum)
예제 #2
0
    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)
예제 #3
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError as e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."),)
             raise
         devnum = 0
         logging.error("WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0", devnum)
         self.__driver = winmidi.Winmidi(devnum)
     self.m_type_major = "win32"  # FIXME
     self.m_devnum = devnum
     if verbose_init:
         logging.debug("Solfege will use Windows multimedia output.")
예제 #4
0
    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)
예제 #5
0
 def __init__(self, devnum, verbose_init):
     SynthCommon.__init__(self)
     try:
         self.__driver = winmidi.Winmidi(devnum)
     except RuntimeError as e:
         if not winmidi.output_devices():
             e.args = e.args + (_("No MIDI output devices available."), )
             raise
         devnum = 0
         logging.error(
             "WinSynth.__init__: No MIDI output devices available on %i. Retrying with devNum 0",
             devnum)
         self.__driver = winmidi.Winmidi(devnum)
     self.m_type_major = "win32"  # FIXME
     self.m_devnum = devnum
     if verbose_init:
         logging.debug("Solfege will use Windows multimedia output.")