Exemplo n.º 1
0
    def __init__(self):
        ManagerUI.__init__(self, 3)

        self.menu = Gtk.Menu()
        self.fill_menu()
        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('listing.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        self.gui = builder

        self.box = builder.get_object("listingbox")
        self.vista = builder.get_object("vista")
        self.scroll = builder.get_object("scrolledw")
        self.vista.get_selection().set_mode(Gtk.SelectionMode.SINGLE) # could SELECTION_MULTIPLE

        old_style = context.get_conf().get_color_style()
        self.color = context.get_conf().get_palette(old_style)

        builder.connect_signals(self)
        self.dispatcher.connect_ui("action-mm-refresh-row", self.refresh_row_from_mp)
        self.dispatcher.connect_ui("operation-started", self.refresh_operation)
        self.dispatcher.connect_ui("operation-stopped", self.refresh_operation)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)

        self.populate_treeview(list(self.repository.list().values()))
        self.box.pack_start(self.strip,False,False,0)
        self.box.reorder_child(self.strip,0)
        self.box.show()
        self.pack_start(self.box,True,True,0)
Exemplo n.º 2
0
    def __init__(self):
        ManagerUI.__init__(self, 3)

        self.menu = Gtk.Menu()
        self.fill_menu()
        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('listing.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        self.gui = builder

        self.box = builder.get_object("listingbox")
        self.vista = builder.get_object("vista")
        self.scroll = builder.get_object("scrolledw")
        self.vista.get_selection().set_mode(Gtk.SelectionMode.SINGLE) # could SELECTION_MULTIPLE

        old_style = context.get_conf().get_color_style()
        self.color = context.get_conf().get_palette(old_style)

        builder.connect_signals(self)
        self.dispatcher.connect_ui("action-mm-refresh-row", self.refresh_row_from_mp)
        self.dispatcher.connect_ui("operation-started", self.refresh_operation)
        self.dispatcher.connect_ui("operation-stopped", self.refresh_operation)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)

        self.populate_treeview(self.repository.list().values())
        self.box.pack_start(self.strip,False,False,0)
        self.box.reorder_child(self.strip,0)
        self.box.show()
        self.pack_start(self.box,True,True,0)
Exemplo n.º 3
0
    def __init__(self, package=None):
        ManagerUI.__init__(self, 1)
        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('player.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        self.gui = builder

        # BUILD GUI
        self.playerui = builder.get_object("playerbox")
        self.main_area = builder.get_object("videobox")
        self.player = None

        # Seek Bar
        self.duration = 0
        self.seeking = False
        self.jump = 0  # seek value
        self.jump_id = 0  # seek signal id
        self.seek_bar = self.gui.get_object("seekbar")
        self.seek_bar.add_events(Gdk.EventMask.SCROLL_MASK)
        self.seek_bar.connect("change-value", self.on_seek)

        # VUMETER

        self.vumeterL = builder.get_object("progressbarL")
        self.vumeterR = builder.get_object("progressbarR")
        self.label_channels_player = builder.get_object(
            "label_channels_player")
        self.rangeVum = 50
        self.stereo = True

        # STATUSBAR
        self.statusbar = builder.get_object("statusbar")
        self.status = builder.get_object("status")
        self.timer = builder.get_object("timer")
        self.video = builder.get_object("video")
        self.presenter = builder.get_object("presenter")

        self.playerui.pack_start(self.strip, False, False, 0)
        self.playerui.reorder_child(self.strip, 0)
        self.pack_start(self.playerui, True, True, 0)

        self.status = INIT
        self.previous = None
        self.change_state(INIT)
        self.mediapackage = None  # The Mediapackage being reproduced

        self.thread_id = None
        builder.connect_signals(self)

        self.dispatcher.connect_ui("player-vumeter", self.set_vumeter)
        self.dispatcher.connect("player-status", self.change_state_bypass)
        self.dispatcher.connect_ui('play-list', self.play_from_list)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)
        self.dispatcher.connect_ui("quit", self.close)
Exemplo n.º 4
0
    def __init__(self,package=None):
        ManagerUI.__init__(self,1)
        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('player.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        self.gui=builder

        # BUILD GUI
        self.playerui = builder.get_object("playerbox")
        self.main_area = builder.get_object("videobox")
        self.player = None

        # Seek Bar
        self.duration = 0
        self.seeking = False
        self.jump=0 # seek value
        self.jump_id=0 # seek signal id
        self.seek_bar=self.gui.get_object("seekbar")
        self.seek_bar.add_events(Gdk.EventMask.SCROLL_MASK)
        self.seek_bar.connect("change-value", self.on_seek)

        # VUMETER

        self.vumeterL = builder.get_object("progressbarL")
        self.vumeterR = builder.get_object("progressbarR")
        self.label_channels_player = builder.get_object("label_channels_player")
        self.rangeVum = 50
        self.stereo = True

        # STATUSBAR
        self.statusbar = builder.get_object("statusbar")
        self.status=builder.get_object("status")
        self.timer=builder.get_object("timer")
        self.video=builder.get_object("video")
        self.presenter=builder.get_object("presenter")

        self.playerui.pack_start(self.strip,False,False,0)
        self.playerui.reorder_child(self.strip,0)
        self.pack_start(self.playerui,True,True,0)

        self.status=INIT
        self.previous=None
        self.change_state(INIT)
        self.mediapackage=None # The Mediapackage being reproduced

        self.thread_id=None
        builder.connect_signals(self)

        self.dispatcher.connect_ui("player-vumeter", self.set_vumeter)
        self.dispatcher.connect("player-status", self.change_state_bypass)
        self.dispatcher.connect_ui('play-list', self.play_from_list)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)
        self.dispatcher.connect_ui("quit", self.close)
Exemplo n.º 5
0
    def __init__(self):
        Gtk.Box.__init__(self)
        dbuilder= Gtk.Builder()
        dbuilder.add_from_file(get_ui_path('distrib.glade'))
        self.builder = dbuilder
        self.gui = dbuilder
        dbox = dbuilder.get_object("distbox")
        release = dbuilder.get_object("release_label")
        release.set_label(get_footer())

        recorder = dbuilder.get_object("button1")
        manager = dbuilder.get_object("button2")
        quit_button =  dbuilder.get_object("button3")
        shutdown_button =  dbuilder.get_object("button4")

        profile_button = dbuilder.get_object("profile_button")
        self.selected = dbuilder.get_object("selected_profile")
        self.update_selected_profile()

        strip = StripUI(None)
        strip.resize()
        strip.set_logo()
        dbox.pack_start(strip,False,False,0)
        dbox.reorder_child(strip,0)

        #Connect signals
        dispatcher = context.get_dispatcher()
        dispatcher.connect_ui("action-reload-profile", self.update_selected_profile)
        recorder.connect("clicked", self.emit_signal, "action-view-change", 0)
        manager.connect("clicked", self.emit_signal, "action-view-change", 1)
        quit_button.connect("clicked", self.emit_signal, "action-quit")
        shutdown_button.connect("clicked", self.emit_signal, "action-shutdown")
        profile_button.connect("clicked", self.on_profile_button)

        conf = context.get_conf()
        quit_button.set_visible(conf.get_boolean("basic", "quit"))
        shutdown_button.set_visible(conf.get_boolean("basic", "shutdown"))
        self.pack_start(dbox, True, True, 0)
Exemplo n.º 6
0
 def test_get_footer(self):
     self.assertEqual(
         miscellaneous.get_footer(),
         "Galicaster " + __version__ + "  -  " + self.conf.get_hostname())
Exemplo n.º 7
0
    def __init__(self, package=None):
        logger.info("Creating Recording Area")
        Gtk.Box.__init__(self)

        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('recorder.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        # TEST
        self.repo = context.get_repository()
        self.dispatcher = context.get_dispatcher()
        self.worker = context.get_worker()
        self.conf = context.get_conf()
        self.recorder = context.get_recorder()
        self.recorder.set_create_drawing_areas_func(self.create_drawing_areas)
        self.start_recording = False
        self.font = None
        self.scheduled_recording = False
        self.focus_is_active = False
        self.net_activity = None
        self.error_dialog = None
        self.close_before_response_action = False

        # BUILD
        self.recorderui = builder.get_object("recorderbox")
        self.main_area = builder.get_object("videobox")
        self.vubox = builder.get_object("vubox")
        self.gui = builder

        # VUMETER
        self.rangeVum = 50
        self.thresholdVum = self.conf.get_float('audio', 'min')
        self.mute = False
        self.stereo = True
        self.vumeterL = builder.get_object("progressbarL")
        self.vumeterR = builder.get_object("progressbarR")
        self.label_channels = builder.get_object("label_channels")

        # SWAP
        if not self.conf.get_boolean('basic', 'swapvideos'):
            self.gui.get_object("swapbutton").destroy()
        self.swap = False

        # STATUS
        self.view = self.set_status_view()
        hbox1 = self.gui.get_object('hbox1')
        hbox1.add(self.view)
        self.dispatcher.connect_ui("init", self.check_status_area)
        self.dispatcher.connect_ui("init", self.check_net, None)
        self.dispatcher.connect_ui("opencast-status", self.check_net)

        # UI
        self.pack_start(self.recorderui, True, True, 0)
        self.pause_dialog = None

        # Event Manager
        self.dispatcher.connect_ui("recorder-vumeter", self.set_vumeter)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)
        self.dispatcher.connect_ui("recorder-status", self.handle_status)
        self.dispatcher.connect_ui("recorder-ready", self.reset_mute)

        # STATES
        self.previous = None

        # PERMISSIONS
        self.allow_pause = self.conf.get_permission("pause")
        self.allow_start = self.conf.get_permission("start")
        self.allow_stop = self.conf.get_permission("stop")
        self.allow_manual = self.conf.get_permission("manual")
        self.allow_overlap = self.conf.get_permission("overlap")

        self.help_main_str = self.conf.get('help', 'main')
        self.help_text_str = self.conf.get('help', 'text')

        # OTHER
        builder.connect_signals(self)
        self.net_activity = self.conf.get_boolean('ingest', 'active')

        self.proportion = 1

        #TIMEOUTS
        deps = self.update_scheduler_deps()
        GObject.timeout_add(500, self.update_scheduler_timeout, *deps)
        self.update_clock_timeout(self.gui.get_object("local_clock"))
        GObject.timeout_add(10000, self.update_clock_timeout,
                            self.gui.get_object("local_clock"))
Exemplo n.º 8
0
    def __init__(self, package=None):
        logger.info("Creating Recording Area")
        Gtk.Box.__init__(self)

        builder = Gtk.Builder()
        builder.add_from_file(get_ui_path('recorder.glade'))
        release = builder.get_object("release_label")
        release.set_label(get_footer())

        # TEST
        self.repo = context.get_repository()
        self.dispatcher = context.get_dispatcher()
        self.worker = context.get_worker()
        self.conf = context.get_conf()
        self.recorder = context.get_recorder()
        self.recorder.set_create_drawing_areas_func(self.create_drawing_areas)
        self.start_recording = False
        self.font = None
        self.scheduled_recording = False
        self.focus_is_active = False
        self.net_activity = None
        self.error_dialog = None
        self.close_before_response_action = False

        # BUILD
        self.recorderui = builder.get_object("recorderbox")
        self.main_area = builder.get_object("videobox")
        self.vubox = builder.get_object("vubox")
        self.gui = builder

        # VUMETER
        self.rangeVum = 50
        self.thresholdVum = self.conf.get_float('audio','min')
        self.mute = False
        self.stereo = True
        self.vumeterL = builder.get_object("progressbarL")
        self.vumeterR = builder.get_object("progressbarR")
        self.label_channels= builder.get_object("label_channels")
        self.low_audio = False
        self.lowaudio_threshold = self.conf.get_float('lowaudio','lowaudio_threshold')

        # SWAP
        if not self.conf.get_boolean('basic', 'swapvideos'):
            self.gui.get_object("swapbutton").destroy()
        self.swap = False

        # STATUS
        self.view = self.set_status_view()
        hbox1 = self.gui.get_object('hbox1')
        hbox1.add(self.view)
        self.dispatcher.connect_ui("init", self.check_status_area)
        self.dispatcher.connect_ui("init", self.check_net, None)
        self.dispatcher.connect_ui("opencast-status", self.check_net)
        self.dispatcher.connect_ui("operation-started", self.check_operations)
        self.dispatcher.connect_ui("operation-stopped", self.check_operations)

        # UI
        self.pack_start(self.recorderui,True,True,0)
        self.pause_dialog = None

        # Event Manager
        self.dispatcher.connect_ui("recorder-vumeter", self.set_vumeter)
        self.dispatcher.connect_ui("view-changed", self.event_change_mode)
        self.dispatcher.connect_ui("recorder-status", self.handle_status)
        self.dispatcher.connect_ui("recorder-ready", self.reset_mute)

        # STATES
        self.previous = None

        # PERMISSIONS
        self.allow_pause = self.conf.get_permission("pause")
        self.allow_start = self.conf.get_permission("start")
        self.allow_stop = self.conf.get_permission("stop")
        self.allow_manual = self.conf.get_permission("manual")
        self.allow_overlap = self.conf.get_permission("overlap")

        self.help_main_str = self.conf.get('help', 'main')
        self.help_text_str = self.conf.get('help', 'text')

        # OTHER
        builder.connect_signals(self)
        self.net_activity = self.conf.get_boolean('ingest', 'active')
        self.pausedialog_size = self.conf.get_int('basic', 'pausedialog_size',
                                                  default=15)
        if self.pausedialog_size < 5:
            self.pausedialog_size = 5
        elif self.pausedialog_size > 100:
            self.pausedialog_size = 100

        self.proportion = 1

        #TIMEOUTS
        deps = self.update_scheduler_deps()
        GObject.timeout_add(500, self.update_scheduler_timeout, *deps)
        self.update_clock_timeout(self.gui.get_object("local_clock"))
        GObject.timeout_add(10000, self.update_clock_timeout, self.gui.get_object("local_clock"))