def setUp(self):
     self.order = -1
     self.volume = 0
     self.replaygain_profiles = [None, None, None]
     quodlibet.plugins.init()
     quodlibet.config.init()
     self.win = PlayOrder(self, self)
     self.win.set_active(0)
Exemplo n.º 2
0
    def setUp(self):
        quodlibet.plugins.init()
        quodlibet.config.init()

        self.order = None
        self.volume = 0
        self.replaygain_profiles = [None, None, None]
        self.po = PlayOrder(self, self)
Exemplo n.º 3
0
 def setUp(self):
     self.order = -1
     self.volume = 0
     self.replaygain_profiles = [None, None, None]
     quodlibet.plugins.init()
     quodlibet.config.init()
     self.win = PlayOrder(self, self)
     self.win.set_active(0)
Exemplo n.º 4
0
    def __init__(self, model, player):
        super(StatusBarBox, self).__init__(spacing=6)

        self.order = order = PlayOrder(model, player)
        self.pack_start(order, False, True, 0)

        self.repeat = repeat = ReapeatButton()
        self.pack_start(repeat, False, True, 0)
        repeat.connect('toggled', self.__repeat, model)
        model.repeat = repeat.get_active()

        self.statusbar = StatusBar(TaskController.default_instance)
        self.pack_start(self.statusbar, True, True, 0)
Exemplo n.º 5
0
    def __init__(self, model, player):
        super(StatusBarBox, self).__init__(spacing=12)

        self.order = order = PlayOrder(model, player)

        hb = Gtk.HBox(spacing=6)
        label = Gtk.Label(label=_("_Order:"))
        label.set_mnemonic_widget(order)
        label.set_use_underline(True)
        hb.pack_start(label, True, True, 0)
        hb.pack_start(order, True, True, 0)
        self.pack_start(hb, False, True, 0)

        self.repeat = repeat = qltk.ccb.ConfigCheckButton(
            _("_Repeat"), "settings", "repeat")
        repeat.set_tooltip_text(_("Restart the playlist when finished"))
        self.pack_start(repeat, False, True, 0)

        repeat.connect('toggled', self.__repeat, model)
        repeat.set_active(config.getboolean('settings', 'repeat'))

        self.statusbar = StatusBar(TaskController.default_instance)
        self.pack_start(self.statusbar, True, True, 0)
Exemplo n.º 6
0
class TPlayOrder(TestCase):
    def setUp(self):
        self.order = -1
        self.volume = 0
        self.replaygain_profiles = [None, None, None]
        quodlibet.plugins.init()
        quodlibet.config.init()
        self.win = PlayOrder(self, self)
        self.win.set_active(0)

    def test_initial(self):
        self.failUnlessEqual(self.win.get_active(), 0)
        self.failUnless(self.replaygain_profiles[2], ["album", "track"])

    def test_set_name(self):
        self.win.set_active("weighted")
        self.failUnlessEqual(2, self.win.get_active())
        self.failUnless(self.replaygain_profiles[2], ["track"])

    def test_set_int(self):
        self.win.set_active(3)
        self.failUnlessEqual(3, self.win.get_active())
        self.failUnless(self.replaygain_profiles[2], ["track"])

    def test_get_name(self):
        for i, name in enumerate(["inorder","shuffle","weighted","onesong"]):
            self.win.set_active(name)
            self.failUnlessEqual(
                self.win.get_active_name().lower(), name.lower())

    def tearDown(self):
        self.win.destroy()
        quodlibet.plugins.quit()
        quodlibet.config.quit()
Exemplo n.º 7
0
class TPlayOrder(TestCase):
    def setUp(self):
        quodlibet.plugins.init()
        quodlibet.config.init()

        self.order = None
        self.volume = 0
        self.replaygain_profiles = [None, None, None]
        self.reset_replaygain = lambda: None
        self.po = PlayOrder(self, self)

    def tearDown(self):
        self.po.destroy()
        quodlibet.plugins.quit()
        quodlibet.config.quit()

    def test_initial(self):
        self.failUnlessEqual(self.po.get_active_name(), "inorder")
        self.failUnless(self.replaygain_profiles[2], ["album", "track"])

    def test_unknown_name(self):
        self.assertRaises(ValueError, self.po.set_active_by_name, "foobar")

    def test_unknown_index(self):
        self.assertRaises(IndexError, self.po.set_active_by_index, 999)

    def test_set_name(self):
        self.po.set_active_by_name("weighted")
        self.failUnlessEqual(self.po.get_active_name(), "weighted")

    def test_replay_gain(self):
        self.po.set_active_by_name("weighted")
        self.failUnlessEqual(self.replaygain_profiles[2], ["track"])
        self.po.set_active_by_name("inorder")
        self.failUnlessEqual(self.replaygain_profiles[2], ["album", "track"])

    def test_set_int(self):
        old = self.po.get_active_name()
        self.po.set_active_by_index(3)
        self.failIfEqual(self.po.get_active_name(), old)

    def test_get_name(self):
        orders = ["inorder", "shuffle", "weighted", "onesong"]
        for i, name in enumerate(orders):
            self.po.set_active_by_name(name)
            self.failUnlessEqual(self.po.get_active_name(), name)

    def test_shuffle(self):
        self.assertEqual(self.po.get_active_name(), "inorder")
        self.po.set_shuffle(True)
        self.assertTrue(self.po.get_shuffle())
        self.assertEqual(self.po.get_active_name(), "shuffle")

    def test_shuffle_weighted(self):
        self.po.set_active_by_name("weighted")
        self.assertTrue(self.po.get_shuffle())
        self.po.set_shuffle(False)
        self.assertEqual(self.po.get_active_name(), "inorder")
        self.po.set_shuffle(True)
        self.assertTrue(self.po.get_shuffle())
        self.assertEqual(self.po.get_active_name(), "weighted")
class TPlayOrder(TestCase):
    def setUp(self):
        self.order = -1
        self.volume = 0
        self.replaygain_profiles = [None, None, None]
        quodlibet.plugins.init()
        quodlibet.config.init()
        self.win = PlayOrder(self, self)
        self.win.set_active(0)

    def test_initial(self):
        self.failUnlessEqual(self.win.get_active(), 0)
        self.failUnless(self.replaygain_profiles[2], ["album", "track"])

    def test_set_name(self):
        self.win.set_active("weighted")
        self.failUnlessEqual(2, self.win.get_active())
        self.failUnless(self.replaygain_profiles[2], ["track"])

    def test_set_int(self):
        self.win.set_active(3)
        self.failUnlessEqual(3, self.win.get_active())
        self.failUnless(self.replaygain_profiles[2], ["track"])

    def test_get_name(self):
        orders = ["inorder", "shuffle", "weighted", "onesong"]
        for i, name in enumerate(orders):
            self.win.set_active(name)
            self.failUnlessEqual(self.win.get_active_name().lower(),
                                 name.lower())

    def tearDown(self):
        self.win.destroy()
        quodlibet.plugins.quit()
        quodlibet.config.quit()