2 # -*- coding: utf-8 -*-
4 # This file is part of jack_mixer
6 # Copyright (C) 2006-2009 Nedko Arnaudov <nedko@arnaudov.name>
7 # Copyright (C) 2009 Frederic Peters <fpeters@0d.be>
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 from optparse import OptionParser
25 gi.require_version('Gtk', '3.0')
26 from gi.repository import Gtk
27 from gi.repository import GObject
28 from gi.repository import GLib
33 # temporary change Python modules lookup path to look into installation
34 # directory ($prefix/share/jack_mixer/)
36 sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..', 'share', 'jack_mixer'))
45 from preferences import PreferencesDialog
47 from serialization_xml import XmlSerialization
48 from serialization import SerializedObject, Serializator
50 from nsmclient import NSMClient
52 # restore Python modules lookup path
55 class JackMixer(SerializedObject):
57 # scales suitable as meter scales
58 meter_scales = [scale.IEC268(), scale.Linear70dB(), scale.IEC268Minimalistic()]
60 # scales suitable as volume slider scales
61 slider_scales = [scale.Linear30dB(), scale.Linear70dB()]
63 # name of settngs file that is currently open
64 current_filename = None
66 _init_solo_channels = None
70 self.nsm_client = None
71 if os.environ.get('NSM_URL'):
72 self.nsm_client = NSMClient(prettyName = "jack_mixer",
73 saveCallback = self.nsm_save_cb,
74 openOrNewCallback = self.nsm_open_cb,
75 supportsSaveStatus = False,
76 hideGUICallback = self.nsm_hide_cb,
77 showGUICallback = self.nsm_show_cb,
78 exitProgramCallback = self.nsm_exit_cb,
79 loggingLevel = "error",
81 self.nsm_client.announceGuiVisibility(self.visible)
84 self.create_mixer('jack_mixer', with_nsm = False)
87 def create_mixer(self, client_name, with_nsm = True):
88 self.create_ui(with_nsm)
89 self.mixer = jack_mixer_c.Mixer(client_name)
92 self.window.set_title(client_name)
94 self.monitor_channel = self.mixer.add_output_channel("Monitor", True, True)
97 GLib.timeout_add(80, self.read_meters)
99 GLib.timeout_add(200, self.nsm_react)
100 GLib.timeout_add(50, self.midi_events_check)
102 def create_ui(self, with_nsm):
104 self.output_channels = []
105 self.window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL)
106 self.window.set_icon_name('jack_mixer')
107 self.gui_factory = gui.Factory(self.window, self.meter_scales, self.slider_scales)
109 self.vbox_top = Gtk.VBox()
110 self.window.add(self.vbox_top)
112 self.menubar = Gtk.MenuBar()
113 self.vbox_top.pack_start(self.menubar, False, True, 0)
115 mixer_menu_item = Gtk.MenuItem.new_with_mnemonic("_Mixer")
116 self.menubar.append(mixer_menu_item)
117 edit_menu_item = Gtk.MenuItem.new_with_mnemonic('_Edit')
118 self.menubar.append(edit_menu_item)
119 help_menu_item = Gtk.MenuItem.new_with_mnemonic('_Help')
120 self.menubar.append(help_menu_item)
122 self.window.set_default_size(120, 300)
124 self.mixer_menu = Gtk.Menu()
125 mixer_menu_item.set_submenu(self.mixer_menu)
127 add_input_channel = Gtk.MenuItem.new_with_mnemonic('New _Input Channel')
128 self.mixer_menu.append(add_input_channel)
129 add_input_channel.connect("activate", self.on_add_input_channel)
131 add_output_channel = Gtk.MenuItem.new_with_mnemonic('New _Output Channel')
132 self.mixer_menu.append(add_output_channel)
133 add_output_channel.connect("activate", self.on_add_output_channel)
135 self.mixer_menu.append(Gtk.SeparatorMenuItem())
137 open = Gtk.MenuItem.new_with_mnemonic('_Open')
138 self.mixer_menu.append(open)
139 open.connect('activate', self.on_open_cb)
140 save = Gtk.MenuItem.new_with_mnemonic('_Save')
141 self.mixer_menu.append(save)
142 save.connect('activate', self.on_save_cb)
144 save_as = Gtk.MenuItem.new_with_mnemonic('Save_As')
145 self.mixer_menu.append(save_as)
146 save_as.connect('activate', self.on_save_as_cb)
148 self.mixer_menu.append(Gtk.SeparatorMenuItem())
150 quit = Gtk.MenuItem.new_with_mnemonic('_Quit')
151 self.mixer_menu.append(quit)
152 quit.connect('activate', self.on_quit_cb)
154 edit_menu = Gtk.Menu()
155 edit_menu_item.set_submenu(edit_menu)
157 self.channel_edit_input_menu_item = Gtk.MenuItem.new_with_mnemonic('_Edit Input Channel')
158 edit_menu.append(self.channel_edit_input_menu_item)
159 self.channel_edit_input_menu = Gtk.Menu()
160 self.channel_edit_input_menu_item.set_submenu(self.channel_edit_input_menu)
162 self.channel_edit_output_menu_item = Gtk.MenuItem.new_with_mnemonic('Edit _Output Channel')
163 edit_menu.append(self.channel_edit_output_menu_item)
164 self.channel_edit_output_menu = Gtk.Menu()
165 self.channel_edit_output_menu_item.set_submenu(self.channel_edit_output_menu)
167 self.channel_remove_input_menu_item = Gtk.MenuItem.new_with_mnemonic('Remove _Input Channel')
168 edit_menu.append(self.channel_remove_input_menu_item)
169 self.channel_remove_input_menu = Gtk.Menu()
170 self.channel_remove_input_menu_item.set_submenu(self.channel_remove_input_menu)
172 self.channel_remove_output_menu_item = Gtk.MenuItem.new_with_mnemonic('_Remove Output Channel')
173 edit_menu.append(self.channel_remove_output_menu_item)
174 self.channel_remove_output_menu = Gtk.Menu()
175 self.channel_remove_output_menu_item.set_submenu(self.channel_remove_output_menu)
177 channel_remove_all_menu_item = Gtk.MenuItem.new_with_mnemonic('Clear')
178 edit_menu.append(channel_remove_all_menu_item)
179 channel_remove_all_menu_item.connect("activate", self.on_channels_clear)
181 edit_menu.append(Gtk.SeparatorMenuItem())
183 preferences = Gtk.MenuItem.new_with_mnemonic('_Preferences')
184 preferences.connect('activate', self.on_preferences_cb)
185 edit_menu.append(preferences)
187 help_menu = Gtk.Menu()
188 help_menu_item.set_submenu(help_menu)
190 about = Gtk.MenuItem.new_with_mnemonic('_About')
191 help_menu.append(about)
192 about.connect("activate", self.on_about)
194 self.hbox_top = Gtk.HBox()
195 self.vbox_top.pack_start(self.hbox_top, True, True, 0)
197 self.scrolled_window = Gtk.ScrolledWindow()
198 self.hbox_top.pack_start(self.scrolled_window, True, True, 0)
200 self.hbox_inputs = Gtk.HBox()
201 self.hbox_inputs.set_spacing(0)
202 self.hbox_inputs.set_border_width(0)
203 self.hbox_top.set_spacing(0)
204 self.hbox_top.set_border_width(0)
206 self.scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
207 self.scrolled_window.add(self.hbox_inputs)
209 self.hbox_outputs = Gtk.HBox()
210 self.hbox_outputs.set_spacing(0)
211 self.hbox_outputs.set_border_width(0)
213 self.hbox_outputs.pack_start(frame, False, True, 0)
214 self.hbox_top.pack_start(self.hbox_outputs, False, True, 0)
216 self.window.connect("destroy", Gtk.main_quit)
218 self.window.connect('delete-event', self.on_delete_event)
221 self.nsm_client.reactToMessage()
224 def nsm_hide_cb(self):
227 self.nsm_client.announceGuiVisibility(False)
229 def nsm_show_cb(self):
230 self.window.show_all()
232 self.nsm_client.announceGuiVisibility(True)
234 def nsm_open_cb(self, path, session_name, client_name):
235 self.create_mixer(client_name, with_nsm = True)
237 if os.path.isfile(path):
239 self.load_from_xml(f)
244 self.current_filename = path
246 def nsm_save_cb(self, path, session_name, client_name):
251 def nsm_exit_cb(self, path, session_name, client_name):
254 def on_delete_event(self, widget, event):
257 def sighandler(self, signum, frame):
258 #print "Signal %d received" % signum
259 if signum == signal.SIGUSR1:
261 elif signum == signal.SIGTERM:
263 elif signum == signal.SIGINT:
266 print("Unknown signal %d received" % signum)
269 print("Cleaning jack_mixer")
273 for channel in self.channels:
278 def on_open_cb(self, *args):
279 dlg = Gtk.FileChooserDialog(title='Open', parent=self.window,
280 action=Gtk.FileChooserAction.OPEN,
281 buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
282 Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
283 dlg.set_default_response(Gtk.ResponseType.OK)
284 if dlg.run() == Gtk.ResponseType.OK:
285 filename = dlg.get_filename()
287 f = open(filename, 'r')
288 self.load_from_xml(f)
290 err = Gtk.MessageDialog(self.window,
291 Gtk.DialogFlags.MODAL,
292 Gtk.MessageType.ERROR,
294 "Failed loading settings.")
298 self.current_filename = filename
303 def on_save_cb(self, *args):
304 if not self.current_filename:
305 return self.on_save_as_cb()
306 f = open(self.current_filename, 'w')
310 def on_save_as_cb(self, *args):
311 dlg = Gtk.FileChooserDialog(title='Save', parent=self.window,
312 action=Gtk.FileChooserAction.SAVE,
313 buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
314 Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
315 dlg.set_default_response(Gtk.ResponseType.OK)
316 if dlg.run() == Gtk.ResponseType.OK:
317 self.current_filename = dlg.get_filename()
321 def on_quit_cb(self, *args):
324 preferences_dialog = None
325 def on_preferences_cb(self, widget):
326 if not self.preferences_dialog:
327 self.preferences_dialog = PreferencesDialog(self)
328 self.preferences_dialog.show()
329 self.preferences_dialog.present()
331 def on_add_input_channel(self, widget):
332 dialog = NewChannelDialog(app=self)
333 dialog.set_transient_for(self.window)
338 if ret == Gtk.ResponseType.OK:
339 result = dialog.get_result()
340 channel = self.add_channel(**result)
342 self.window.show_all()
344 def on_add_output_channel(self, widget):
345 dialog = NewOutputChannelDialog(app=self)
346 dialog.set_transient_for(self.window)
351 if ret == Gtk.ResponseType.OK:
352 result = dialog.get_result()
353 channel = self.add_output_channel(**result)
355 self.window.show_all()
357 def on_edit_input_channel(self, widget, channel):
358 print('Editing channel "%s"' % channel.channel_name)
359 channel.on_channel_properties()
361 def remove_channel_edit_input_menuitem_by_label(self, widget, label):
362 if (widget.get_label() == label):
363 self.channel_edit_input_menu.remove(widget)
365 def on_remove_input_channel(self, widget, channel):
366 print('Removing channel "%s"' % channel.channel_name)
367 self.channel_remove_input_menu.remove(widget)
368 self.channel_edit_input_menu.foreach(
369 self.remove_channel_edit_input_menuitem_by_label,
370 channel.channel_name);
371 if self.monitored_channel is channel:
372 channel.monitor_button.set_active(False)
373 for i in range(len(self.channels)):
374 if self.channels[i] is channel:
377 self.hbox_inputs.remove(channel.get_parent())
379 if len(self.channels) == 0:
380 self.channel_remove_input_menu_item.set_sensitive(False)
382 def on_edit_output_channel(self, widget, channel):
383 print('Editing channel "%s"' % channel.channel_name)
384 channel.on_channel_properties()
386 def remove_channel_edit_output_menuitem_by_label(self, widget, label):
387 if (widget.get_label() == label):
388 self.channel_edit_output_menu.remove(widget)
390 def on_remove_output_channel(self, widget, channel):
391 print('Removing channel "%s"' % channel.channel_name)
392 self.channel_remove_output_menu.remove(widget)
393 self.channel_edit_output_menu.foreach(
394 self.remove_channel_edit_output_menuitem_by_label,
395 channel.channel_name);
396 if self.monitored_channel is channel:
397 channel.monitor_button.set_active(False)
398 for i in range(len(self.channels)):
399 if self.output_channels[i] is channel:
401 del self.output_channels[i]
402 self.hbox_outputs.remove(channel.get_parent())
404 if len(self.output_channels) == 0:
405 self.channel_remove_output_menu_item.set_sensitive(False)
407 def rename_channels(self, container, parameters):
408 if (container.get_label() == parameters['oldname']):
409 container.set_label(parameters['newname'])
411 def on_channel_rename(self, oldname, newname):
412 rename_parameters = { 'oldname' : oldname, 'newname' : newname }
413 self.channel_edit_input_menu.foreach(self.rename_channels,
415 self.channel_edit_output_menu.foreach(self.rename_channels,
417 self.channel_remove_input_menu.foreach(self.rename_channels,
419 self.channel_remove_output_menu.foreach(self.rename_channels,
421 print("Renaming channel from %s to %s\n" % (oldname, newname))
424 def on_channels_clear(self, widget):
425 for channel in self.output_channels:
427 self.hbox_outputs.remove(channel.get_parent())
428 for channel in self.channels:
430 self.hbox_inputs.remove(channel.get_parent())
432 self.output_channels = []
433 self.channel_edit_input_menu = Gtk.Menu()
434 self.channel_edit_input_menu_item.set_submenu(self.channel_edit_input_menu)
435 self.channel_edit_input_menu_item.set_sensitive(False)
436 self.channel_remove_input_menu = Gtk.Menu()
437 self.channel_remove_input_menu_item.set_submenu(self.channel_remove_input_menu)
438 self.channel_remove_input_menu_item.set_sensitive(False)
439 self.channel_edit_output_menu = Gtk.Menu()
440 self.channel_edit_output_menu_item.set_submenu(self.channel_edit_output_menu)
441 self.channel_edit_output_menu_item.set_sensitive(False)
442 self.channel_remove_output_menu = Gtk.Menu()
443 self.channel_remove_output_menu_item.set_submenu(self.channel_remove_output_menu)
444 self.channel_remove_output_menu_item.set_sensitive(False)
446 def add_channel(self, name, stereo, volume_cc, balance_cc, mute_cc, solo_cc):
448 channel = InputChannel(self, name, stereo)
449 self.add_channel_precreated(channel)
451 e = sys.exc_info()[0]
452 err = Gtk.MessageDialog(self.window,
453 Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
454 Gtk.MessageType.ERROR,
456 "Channel creation failed")
461 channel.channel.volume_midi_cc = volume_cc
463 channel.channel.autoset_volume_midi_cc()
465 channel.channel.balance_midi_cc = balance_cc
467 channel.channel.autoset_balance_midi_cc()
469 channel.channel.mute_midi_cc = mute_cc
471 channel.channel.autoset_mute_midi_cc()
473 channel.channel.solo_midi_cc = solo_cc
475 channel.channel.autoset_solo_midi_cc()
478 def add_channel_precreated(self, channel):
481 self.hbox_inputs.pack_start(frame, False, True, 0)
484 channel_edit_menu_item = Gtk.MenuItem(label=channel.channel_name)
485 self.channel_edit_input_menu.append(channel_edit_menu_item)
486 channel_edit_menu_item.connect("activate", self.on_edit_input_channel, channel)
487 self.channel_edit_input_menu_item.set_sensitive(True)
489 channel_remove_menu_item = Gtk.MenuItem(label=channel.channel_name)
490 self.channel_remove_input_menu.append(channel_remove_menu_item)
491 channel_remove_menu_item.connect("activate", self.on_remove_input_channel, channel)
492 self.channel_remove_input_menu_item.set_sensitive(True)
494 self.channels.append(channel)
496 for outputchannel in self.output_channels:
497 channel.add_control_group(outputchannel)
499 # create post fader output channel matching the input channel
500 channel.post_fader_output_channel = self.mixer.add_output_channel(
501 channel.channel.name + ' Out', channel.channel.is_stereo, True)
502 channel.post_fader_output_channel.volume = 0
503 channel.post_fader_output_channel.set_solo(channel.channel, True)
505 def read_meters(self):
506 for channel in self.channels:
508 for channel in self.output_channels:
512 def midi_events_check(self):
513 for channel in self.channels + self.output_channels:
514 channel.midi_events_check()
517 def add_output_channel(self, name, stereo, volume_cc, balance_cc, mute_cc,
518 display_solo_buttons, color):
520 channel = OutputChannel(self, name, stereo)
521 channel.display_solo_buttons = display_solo_buttons
522 channel.color = color
523 self.add_output_channel_precreated(channel)
525 err = Gtk.MessageDialog(self.window,
526 Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
527 Gtk.MessageType.ERROR,
529 "Channel creation failed")
535 channel.channel.volume_midi_cc = volume_cc
537 channel.channel.autoset_volume_midi_cc()
539 channel.channel.balance_midi_cc = balance_cc
541 channel.channel.autoset_balance_midi_cc()
543 channel.channel.mute_midi_cc = mute_cc
545 channel.channel.autoset_mute_midi_cc()
549 def add_output_channel_precreated(self, channel):
552 self.hbox_outputs.pack_start(frame, False, True, 0)
555 channel_edit_menu_item = Gtk.MenuItem(label=channel.channel_name)
556 self.channel_edit_output_menu.append(channel_edit_menu_item)
557 channel_edit_menu_item.connect("activate", self.on_edit_output_channel, channel)
558 self.channel_edit_output_menu_item.set_sensitive(True)
560 channel_remove_menu_item = Gtk.MenuItem(label=channel.channel_name)
561 self.channel_remove_output_menu.append(channel_remove_menu_item)
562 channel_remove_menu_item.connect("activate", self.on_remove_output_channel, channel)
563 self.channel_remove_output_menu_item.set_sensitive(True)
565 self.output_channels.append(channel)
567 _monitored_channel = None
568 def get_monitored_channel(self):
569 return self._monitored_channel
571 def set_monitored_channel(self, channel):
572 if self._monitored_channel:
573 if channel.channel.name == self._monitored_channel.channel.name:
575 self._monitored_channel = channel
576 if type(channel) is InputChannel:
577 # reset all solo/mute settings
578 for in_channel in self.channels:
579 self.monitor_channel.set_solo(in_channel.channel, False)
580 self.monitor_channel.set_muted(in_channel.channel, False)
581 self.monitor_channel.set_solo(channel.channel, True)
582 self.monitor_channel.prefader = True
584 self.monitor_channel.prefader = False
585 self.update_monitor(channel)
586 monitored_channel = property(get_monitored_channel, set_monitored_channel)
588 def update_monitor(self, channel):
589 if self.monitored_channel is not channel:
591 self.monitor_channel.volume = channel.channel.volume
592 self.monitor_channel.balance = channel.channel.balance
593 self.monitor_channel.out_mute = channel.channel.out_mute
594 if type(self.monitored_channel) is OutputChannel:
595 # sync solo/muted channels
596 for input_channel in self.channels:
597 self.monitor_channel.set_solo(input_channel.channel,
598 channel.channel.is_solo(input_channel.channel))
599 self.monitor_channel.set_muted(input_channel.channel,
600 channel.channel.is_muted(input_channel.channel))
602 def get_input_channel_by_name(self, name):
603 for input_channel in self.channels:
604 if input_channel.channel.name == name:
608 def on_about(self, *args):
609 about = Gtk.AboutDialog()
610 about.set_name('jack_mixer')
611 about.set_copyright('Copyright © 2006-2020\nNedko Arnaudov, Frederic Peters, Arnout Engelen, Daniel Sheeler')
612 about.set_license('''\
613 jack_mixer is free software; you can redistribute it and/or modify it
614 under the terms of the GNU General Public License as published by the
615 Free Software Foundation; either version 2 of the License, or (at your
616 option) any later version.
618 jack_mixer is distributed in the hope that it will be useful, but
619 WITHOUT ANY WARRANTY; without even the implied warranty of
620 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
621 General Public License for more details.
623 You should have received a copy of the GNU General Public License along
624 with jack_mixer; if not, write to the Free Software Foundation, Inc., 51
625 Franklin Street, Fifth Floor, Boston, MA 02110-130159 USA''')
626 about.set_authors(['Nedko Arnaudov <nedko@arnaudov.name>',
627 'Frederic Peters <fpeters@0d.be>',
628 'Daniel Sheeler <dsheeler@pobox.com>'])
629 about.set_logo_icon_name('jack_mixer')
630 about.set_website('https://rdio.space/jackmixer/')
635 def save_to_xml(self, file):
636 #print "Saving to XML..."
637 b = XmlSerialization()
642 def load_from_xml(self, file, silence_errors=False):
643 #print "Loading from XML..."
644 self.on_channels_clear(None)
645 self.unserialized_channels = []
646 b = XmlSerialization()
654 s.unserialize(self, b)
655 for channel in self.unserialized_channels:
656 if isinstance(channel, InputChannel):
657 if self._init_solo_channels and channel.channel_name in self._init_solo_channels:
659 self.add_channel_precreated(channel)
660 self._init_solo_channels = None
661 for channel in self.unserialized_channels:
662 if isinstance(channel, OutputChannel):
663 self.add_output_channel_precreated(channel)
664 del self.unserialized_channels
666 self.window.show_all()
668 def serialize(self, object_backend):
669 width, height = self.window.get_size()
670 object_backend.add_property('geometry',
671 '%sx%s' % (width, height))
673 for input_channel in self.channels:
674 if input_channel.channel.solo:
675 solo_channels.append(input_channel)
677 object_backend.add_property('solo_channels', '|'.join([x.channel.name for x in solo_channels]))
678 object_backend.add_property('visible', '%s' % str(self.visible))
680 def unserialize_property(self, name, value):
681 if name == 'geometry':
682 width, height = value.split('x')
683 self.window.resize(int(width), int(height))
685 if name == 'solo_channels':
686 self._init_solo_channels = value.split('|')
688 if name == 'visible':
689 self.visible = value == 'True'
692 def unserialize_child(self, name):
693 if name == InputChannel.serialization_name():
694 channel = InputChannel(self, "", True)
695 self.unserialized_channels.append(channel)
698 if name == OutputChannel.serialization_name():
699 channel = OutputChannel(self, "", True)
700 self.unserialized_channels.append(channel)
703 def serialization_get_childs(self):
704 '''Get child objects tha required and support serialization'''
705 childs = self.channels[:] + self.output_channels[:]
708 def serialization_name(self):
716 self.window.show_all()
718 signal.signal(signal.SIGUSR1, self.sighandler)
719 signal.signal(signal.SIGTERM, self.sighandler)
720 signal.signal(signal.SIGINT, self.sighandler)
721 signal.signal(signal.SIGHUP, signal.SIG_IGN)
725 #f = file("/dev/stdout", "w")
730 print("Usage: %s [mixer_name]" % sys.argv[0])
733 parser = OptionParser(usage='usage: %prog [options] [jack_client_name]')
734 parser.add_option('-c', '--config', dest='config',
735 help='use a non default configuration file')
737 options, args = parser.parse_args()
748 except Exception as e:
749 err = Gtk.MessageDialog(None,
750 Gtk.DialogFlags.MODAL,
751 Gtk.MessageType.ERROR,
753 "Mixer creation failed (%s)" % str(e))
758 if not mixer.nsm_client and options.config:
759 f = open(options.config)
760 mixer.current_filename = options.config
762 mixer.load_from_xml(f)
764 err = Gtk.MessageDialog(mixer.window,
765 Gtk.DialogFlags.MODAL,
766 Gtk.MessageType.ERROR,
768 "Failed loading settings.")
771 mixer.window.set_default_size(60*(1+len(mixer.channels)+len(mixer.output_channels)), 300)
778 if __name__ == "__main__":