[tuxdroid-svn] r890 - in software/gadgets/xmms_player/trunk/xmms_player: . Scripts Scripts/Python
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2008-01-28 07:43:35
|
Author: jerome Date: 2008-01-28 08:43:32 +0100 (Mon, 28 Jan 2008) New Revision: 890 Added: software/gadgets/xmms_player/trunk/xmms_player/Pictures/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.glade software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.pyp software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.glade software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.pyp software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/init.pyp software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/main.pyp software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/notify.pyp software/gadgets/xmms_player/trunk/xmms_player/Strings/ software/gadgets/xmms_player/trunk/xmms_player/Strings/fr_ALL.xml software/gadgets/xmms_player/trunk/xmms_player/about.xml software/gadgets/xmms_player/trunk/xmms_player/parts.xml software/gadgets/xmms_player/trunk/xmms_player/settings.xml software/gadgets/xmms_player/trunk/xmms_player/strings.xml Log: Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.glade 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,468 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="width_request">355</property> + <property name="height_request">212</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Parameters</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFixed" id="fixed9"> + <property name="height_request">212</property> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_cancel_clicked"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">156</property> + <property name="y">175</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_accept_clicked"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-apply</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">256</property> + <property name="y">175</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="width_request">356</property> + <property name="height_request">64</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed8"> + <property name="height_request">1</property> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label_remote"> + <property name="width_request">334</property> + <property name="height_request">33</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current : None</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button_remote"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_remote_clicked"/> + </widget> + <packing> + <property name="x">264</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame5"> + <property name="border_width">5</property> + <property name="width_request">356</property> + <property name="height_request">118</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed6"> + <property name="border_width">1</property> + <property name="height_request">66</property> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="spinTimer"> + <property name="width_request">56</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 120 1 10 10</property> + </widget> + <packing> + <property name="x">150</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="play_location_cb"> + <property name="width_request">148</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Play location</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="filechooserbutton1"> + <property name="width_request">175</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="title" translatable="yes">/my_music_file</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">150</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="cbTimer"> + <property name="width_request">154</property> + <property name="height_request">23</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Close in (mins)</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="auto_play_cb"> + <property name="width_request">264</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Auto play</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">Audio player</property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">56</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/conf/other.pyp 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,106 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + def updates_commons(self): + """ + Updates common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # Remote Frame + txt = _me.string('gui_conf_remote_title') + self.get_widget("label11").set_text(txt) + + txt = "%s : None" % _me.string('gui_conf_current_bind_lb') + self.get_widget("label_remote").set_text(txt) + + txt = _me.string('gui_conf_remote_set_bt') + self.get_widget("button_remote").set_label(txt) + + + # Bottom buttons + txt = _me.string('gui_conf_cancel_bt') + self.get_widget("label6").set_text(txt) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + #set the defaul directory to open. + directory = _me.get_param("current_directory") + self.get_widget("filechooserbutton1").set_current_folder(directory) + + # auto - play and play location + txt = _me.string('gui_conf_auto_play') + self.get_widget('auto_play_cb').set_label(txt) + + txt = _me.string('gui_conf_play_location_label') + self.get_widget('play_location_cb').set_label(txt) + + self.get_widget('auto_play_cb').set_active(_me.get_param('auto_play')) + self.get_widget('play_location_cb').set_active(_me.get_param('play_location')) + + self.get_widget('spinTimer').set_value(_me.get_param('spin_timer')) + self.get_widget('cbTimer').set_active(_me.get_param('flag_timer')) + + + def updates_specifics(self): + """ + Updates specific widgets + """ + pass + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + thread.start_new_thread(remote_set_caption, ()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + current_directory = self.get_widget("filechooserbutton1").get_current_folder() + current_directory = current_directory.replace('%20', ' ') + _me.set_param("current_directory", current_directory) + + _me.set_param('auto_play', self.get_widget('auto_play_cb').get_active()) + _me.set_param('play_location', self.get_widget('play_location_cb').get_active()) + + _me.set_param('flag_timer', self.get_widget('cbTimer').get_active()) + _me.set_param('spin_timer', self.get_widget('spinTimer').get_value()) + + + self.get_widget("window1").destroy() + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + #On cancel clicked, no action implemented + self.get_widget("window1").destroy() Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.glade 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,101 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b></b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.pyp (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/GUI/widget/other.pyp 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,16 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/widget/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + thread.start_new_thread(self.update, ()) + + def update(self): + _me.update_informations() Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/init.pyp =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/init.pyp (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/init.pyp 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1 @@ +_me.set_param('timer_var', 0) Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/main.pyp =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/main.pyp (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/main.pyp 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,185 @@ +import threading +import time + + +def update_informations(): + pass + + +def _xmms_command(command): + """ + launch a shell command + """ + tux.cmd.sound_play(10) + tux.sys.shell_free("xmms '%s'" % command) + + +def error_dialog(message): + """ + Create an error Dialog Box with an error occured + """ + + def on_click_okcancel(obj): + dialogue.destroy() + + dialogue = gtk.Dialog("Music player widget error", None, gtk.DIALOG_MODAL, ()) + bt_alone = dialogue.add_button("Ok/Cancel", gtk.RESPONSE_APPLY) + bt_alone.connect("clicked", on_click_okcancel) + box = gtk.HBox(spacing = 5) + box.set_border_width(5) + box.show() + dialogue.vbox.pack_start(box) + identified_error = gtk.Label(message) + identified_error.show() + box.pack_start(identified_error) + dialogue.run() + + +# procedure witch initialize the audio player # +def _init_player(): + _xmms_command("") + +# function to check mp3 and ogg files into current directory # +def check_file(directory): + try: + dir_files = os.listdir(directory) + except OSError: + return False + sound_list = [] + for m_file in dir_files: + if m_file.lower().find('.mp3') != -1: + sound_list.append(m_file) + if m_file.lower().find('.ogg') != -1: + sound_list.append(m_file) + if m_file.lower().find('.wav') != -1: + sound_list.append(m_file) + if len(sound_list) > 0: + return True + else: + return False + + +# function to verify if xmms is present to this computer # +def check_xmms(directory): + return os.path.exists('/usr/bin/xmms') + +# Attached event's remote control # +def on_standby(): + _me.exit_main_loop() + +def play_pressed(): + _xmms_command("-t") + + +def stop_pressed(): + #_xmms_command("-s") + _xmms_command("--quit") + +def previous_pressed(): + _xmms_command("-r") + +def next_pressed(): + _xmms_command("-f") + +def menu_pressed(): + correct_playlist = check_file(current_directory) + if correct_playlist: + current_dir = "'%s'" % _me.get_param("current_directory") + _xmms_command(current_dir) + else: + gtk.gdk.threads_enter() + error_dialog(_me.string("err_no_file_to_read")) + gtk.gdk.threads_leave() + + + +def volume_mute(): + """ + Set the current value of the volume to mute or unmute. + """ + mute = _me.get_param('muted') + if mute: + mute = False + tux.sys.shell('amixer sset PCM unmute') + else: + mute = True + tux.sys.shell('amixer sset PCM mute') + _me.set_param('muted', mute) + +def volume_plus(): + """ + Set the current value of the volume up to 5% + """ + tux.sys.shell('amixer sset PCM 5%+') + +def volume_minus(): + """ + Set the current value of the volume down to 5% + """ + tux.sys.shell('amixer sset PCM 5%-') + + +tux.event.on_remote_bt[K_STANDBY] = on_standby +tux.event.on_remote_bt[K_PLAYPAUSE] = play_pressed +tux.event.on_remote_bt[K_STOP] = stop_pressed +tux.event.on_remote_bt[K_PREVIOUS] = previous_pressed +tux.event.on_remote_bt[K_NEXT] = next_pressed +tux.event.on_remote_bt[K_UP] = previous_pressed +tux.event.on_remote_bt[K_DOWN] = next_pressed +tux.event.on_remote_bt[K_OK] = play_pressed +tux.event.on_remote_bt[K_MENU] = menu_pressed +tux.event.on_remote_bt[K_MUTE] = volume_mute +tux.event.on_remote_bt[K_VOLUMEPLUS] = volume_plus +tux.event.on_remote_bt[K_VOLUMEMINUS] = volume_minus + +# initialisation of xmms player, auto-play and wait for an exit signal # +current_directory = _me.get_param("current_directory") + +#flag wich allow the main loop to run +allow_main_loop = True + +# check that the remote can working +if not tux.daemon.connected or not tux.status.rf_state(): + gtk.gdk.threads_enter() + error_dialog(_me.string("err_remote_not_work")) + gtk.gdk.threads_leave() + allow_main_loop = False + +# check xmms presence on the system +can_launch = check_xmms(current_directory) +if not can_launch: + gtk.gdk.threads_enter() + error_dialog(_me.string("err_no_xmms_found")) + gtk.gdk.threads_leave() + allow_main_loop = False + +# Look for auto_play enable. +def auto_play_asked(): + if not _me.get_param('auto_play'): + return False + _xmms_command("-p") + +def play_location_asked(): + if not _me.get_param('play_location'): + return False + menu_pressed() + + +def TimerFunct(): + """ + Will be launch to exit xmms player. + """ + stop_pressed() + on_standby() + + +# run the main loop +if allow_main_loop: + #If the timer is activated. + if _me.get_param('flag_timer'): + t = threading.Timer(float(_me.get_param('spin_timer') * 60.0), TimerFunct) + t.start() + + play_location_asked() + auto_play_asked() + _me.run_main_loop() Added: software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/notify.pyp (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Scripts/Python/notify.pyp 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,5 @@ +def notify_checker(): + return False + +def notify_actuator(): + pass Added: software/gadgets/xmms_player/trunk/xmms_player/Strings/fr_ALL.xml =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/Strings/fr_ALL.xml (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/Strings/fr_ALL.xml 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,50 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <at_gui_conf_auto_play_cb type='str'>Lancement automatique</at_gui_conf_auto_play_cb> + <at_gui_conf_button_remote type='str'>Set</at_gui_conf_button_remote> + <at_gui_conf_cbTimer type='str'>Fermer dans (mins)</at_gui_conf_cbTimer> + <at_gui_conf_label11 type='str'>Telecommande</at_gui_conf_label11> + <at_gui_conf_label13 type='str'>Lecteur de musique</at_gui_conf_label13> + <at_gui_conf_label5 type='str'>Accepter</at_gui_conf_label5> + <at_gui_conf_label6 type='str'>Quitter</at_gui_conf_label6> + <at_gui_conf_label_remote type='str'>Current : None</at_gui_conf_label_remote> + <at_gui_conf_play_location_cb type='str'>Lire emplacement</at_gui_conf_play_location_cb> + <err_no_file_to_read type='str'>Désolé, je ne peux trouver de fichiers a lire ici. Vérifiez votre configuration</err_no_file_to_read> + <err_no_xmms_found type='str'>Désolé, je ne peux ouvrir xmms</err_no_xmms_found> + <err_remote_not_work type='str'>Vous devez connecter le dongle pour utiliser ce gadget</err_remote_not_work> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <gui_conf_auto_play type='str'>Lancement automatique</gui_conf_auto_play> + <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_play_location_label type='str'>Lire le dossier</gui_conf_play_location_label> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <help_text type='str'>Ce gadget controle xmms player avec la télécommande. +Dans la fenêtre de configuration vous pouvez sélectionner le chemin des fichiers musicaux +que vous voulez lire. Additionnellement, vous pouvez égelement activer l'option 'auto-play'. +Celà va automatiquement lancer la play-list du média player +de la session précédente ou lancer la lecture du chemin sélectionné. L'option +fermer quittera le média player après un nombre de minutes spécifié +Remote control: +=> OK/play-pause : play ou pause. +=> Menu : lance le répertoire sélectionné. +=> Next/arrow down : fichier suivant. +=> Previous/ arrow up: fichier précédent. +=> Stop: quitter le player. +=> Standby: retour à manager. + +Les touches suiventes ne fonctionnent pas quand tux est le périphérique audio +Seuelement quand votre PC est le périphérique audio. +=> Mute : coupe ou restaure le volume +=> Vol+ : augmente le volume +=> Vol- : diminue volume</help_text> + <name_to_read type='str'>lecteur xmms</name_to_read> + <speaker_name type='str'>Bruno8k</speaker_name> +</strings> Added: software/gadgets/xmms_player/trunk/xmms_player/about.xml =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/about.xml (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/about.xml 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='UTF-8'?> +<about> + <gadget_author type='str'>jer...@ky...</gadget_author> + <gadget_description type='str'>A little controller for XMMS player.</gadget_description> + <gadget_name type='str'>xmms_player</gadget_name> + <gadget_version type='str'>0.0.4</gadget_version> +</about> Added: software/gadgets/xmms_player/trunk/xmms_player/parts.xml =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/parts.xml (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/parts.xml 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,6 @@ +<?xml version='1.0' encoding='UTF-8'?> +<parts> + <notifications type='bool'>True</notifications> + <parameters_GUI type='bool'>True</parameters_GUI> + <widget_GUI type='bool'>True</widget_GUI> +</parts> Added: software/gadgets/xmms_player/trunk/xmms_player/settings.xml =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/settings.xml (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/settings.xml 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,34 @@ +<?xml version='1.0' encoding='UTF-8'?> +<settings> + <general> + <framework_version type='str'>0.0.0</framework_version> + <gui_state> + <conf> + <visible type='bool'>False</visible> + </conf> + <widget> + <visible type='bool'>False</visible> + </widget> + </gui_state> + <have_main_part type='bool'>True</have_main_part> + <have_settings_part type='bool'>True</have_settings_part> + <have_widget_part type='bool'>False</have_widget_part> + <language type='str'>fr_ALL</language> + <main_priority type='int'>4</main_priority> + <menu_active type='bool'>True</menu_active> + <notified type='bool'>True</notified> + <notify_delay type='int'>60</notify_delay> + <notify_priority type='int'>4</notify_priority> + <pitch type='int'>100</pitch> + <speaker type='int'>2</speaker> + </general> + <parameters> + <auto_play type='bool'>True</auto_play> + <current_directory type='str'>/home</current_directory> + <flag_player type='bool'>False</flag_player> + <flag_timer type='bool'>False</flag_timer> + <muted type='bool'>False</muted> + <play_location type='bool'>True</play_location> + <spin_timer type='int'>60</spin_timer> + </parameters> +</settings> Added: software/gadgets/xmms_player/trunk/xmms_player/strings.xml =================================================================== --- software/gadgets/xmms_player/trunk/xmms_player/strings.xml (rev 0) +++ software/gadgets/xmms_player/trunk/xmms_player/strings.xml 2008-01-28 07:43:32 UTC (rev 890) @@ -0,0 +1,51 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <at_gui_conf_auto_play_cb type='str'>Auto play</at_gui_conf_auto_play_cb> + <at_gui_conf_button_remote type='str'>Set</at_gui_conf_button_remote> + <at_gui_conf_cbTimer type='str'>Close in (mins)</at_gui_conf_cbTimer> + <at_gui_conf_label11 type='str'>Remote</at_gui_conf_label11> + <at_gui_conf_label13 type='str'>Audio player</at_gui_conf_label13> + <at_gui_conf_label5 type='str'>Accept</at_gui_conf_label5> + <at_gui_conf_label6 type='str'>Cancel</at_gui_conf_label6> + <at_gui_conf_label_remote type='str'>Current : None</at_gui_conf_label_remote> + <at_gui_conf_play_location_cb type='str'>Play location</at_gui_conf_play_location_cb> + <err_no_file_to_read type='str'>Sorry, I can't find any music file to play here. Better check your configuration</err_no_file_to_read> + <err_no_xmms_found type='str'>Sorry, I can't start xmms player</err_no_xmms_found> + <err_remote_not_work type='str'>You need to connect the dongle to use this gadget</err_remote_not_work> + <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <gui_conf_auto_play type='str'>Auto play</gui_conf_auto_play> + <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_play_location_label type='str'>Play location</gui_conf_play_location_label> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <help_text type='str'>This gadget controls xmms player with the remote control. +In the settings window you can select the path of the music files you +want to play. Additionally, you can also enable the auto play option. +This will automatically start the play list from the media player's +previous session or start the playback of the selected path. The close +option will exit the media application after the specified number of +minutes. +Remote control buttons: +=> OK/play-pause : play or pause song +=> Menu : refresh selected directory +=> Next/arrow down : Next song +=> Previous/ arrow up: Previous song +=> Stop: stop song +=> Standby: back to manager + +The ones below do not work when Tux is set as audio device. +Only when using the audio device in your computer. +=> Mute : mute or unmute volume +=> Vol+ : increase volume +=> Vol- : decrease volume</help_text> + <name_to_read type='str'>xmms player</name_to_read> + <speaker_name type='str'>Ryan8k</speaker_name> +</strings> |