cvs: pear /XMMS gtkxmms php_xmms.h xmms.c xmms.glade
| From: | Rasmus Lerdorf | Date: | Fri, 10 Aug 2001 00:36:51 +0000 |
| Subject: | cvs: pear /XMMS gtkxmms php_xmms.h xmms.c xmms.glade | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-451@lists.php.net to get a copy of this message | ||
rasmus Thu Aug 9 20:36:51 2001 EDT
Modified files:
/pear/XMMS gtkxmms php_xmms.h xmms.c xmms.glade
Log:
Add code to allow you to turn the main xmms window, playlist and equalizer
windows on and off. Add checkboxes in gtkxmms to test.
Index: pear/XMMS/gtkxmms
diff -u pear/XMMS/gtkxmms:1.1 pear/XMMS/gtkxmms:1.2
--- pear/XMMS/gtkxmms:1.1 Thu Aug 9 19:55:08 2001
+++ pear/XMMS/gtkxmms Thu Aug 9 20:36:50 2001
@@ -48,6 +48,21 @@
xmms_repeat();
}
+function on_win_toggled($widget) {
+ $state = $widget->get_active();
+ xmms_main_win($state);
+}
+
+function on_pl_toggled($widget) {
+ $state = $widget->get_active();
+ xmms_pl_win($state);
+}
+
+function on_eq_toggled($widget) {
+ $state = $widget->get_active();
+ xmms_eq_win($state);
+}
+
function time_bar() {
global $bar, $adjust;
@@ -70,7 +85,11 @@
}
}
+
xmms_start();
+xmms_main_win(false);
+xmms_pl_win(false);
+xmms_eq_win(false);
$glade = &new GladeXML('./xmms.glade');
$current = xmms_current();
/* If already playing - change to stop button */
Index: pear/XMMS/php_xmms.h
diff -u pear/XMMS/php_xmms.h:1.1 pear/XMMS/php_xmms.h:1.2
--- pear/XMMS/php_xmms.h:1.1 Thu Aug 9 19:55:08 2001
+++ pear/XMMS/php_xmms.h Thu Aug 9 20:36:50 2001
@@ -61,6 +61,9 @@
PHP_FUNCTION(xmms_url);
PHP_FUNCTION(xmms_skin);
PHP_FUNCTION(xmms_time);
+PHP_FUNCTION(xmms_main_win);
+PHP_FUNCTION(xmms_pl_win);
+PHP_FUNCTION(xmms_eq_win);
ZEND_BEGIN_MODULE_GLOBALS(xmms)
int session;
Index: pear/XMMS/xmms.c
diff -u pear/XMMS/xmms.c:1.1 pear/XMMS/xmms.c:1.2
--- pear/XMMS/xmms.c:1.1 Thu Aug 9 19:55:08 2001
+++ pear/XMMS/xmms.c Thu Aug 9 20:36:50 2001
@@ -57,6 +57,9 @@
PHP_FE(xmms_url, NULL)
PHP_FE(xmms_skin, NULL)
PHP_FE(xmms_time, NULL)
+ PHP_FE(xmms_main_win, NULL)
+ PHP_FE(xmms_pl_win, NULL)
+ PHP_FE(xmms_eq_win, NULL)
{NULL, NULL, NULL} /* Must be the last line in xmms_functions[] */
};
/* }}} */
@@ -596,7 +599,7 @@
time_pos = Z_DVAL_PP(time_pos_arg);
xmms_remote_jump_to_time(XG(session), (int)(time_pos*1000));
RETVAL_DOUBLE(time_pos);
- /* Fall-through. */
+ break;
case 0:
RETVAL_DOUBLE((double)(xmms_remote_get_output_time(XG(session))/1000.0));
break;
@@ -604,6 +607,59 @@
}
/* }}} */
+/* {{{ proto void xmms_main_win([bool setting])
+ Hide/Unhide main xmms window */
+PHP_FUNCTION(xmms_main_win)
+{
+ zval **setting_arg;
+ int setting;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &setting_arg) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ convert_to_long_ex(setting_arg);
+ setting = Z_LVAL_PP(setting_arg);
+
+ xmms_remote_main_win_toggle(XG(session),setting?TRUE:FALSE);
+}
+/* }}} */
+
+/* {{{ proto void xmms_pl_win([bool setting])
+ Hide/Unhide playlist xmms window */
+PHP_FUNCTION(xmms_pl_win)
+{
+ zval **setting_arg;
+ int setting;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &setting_arg) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ convert_to_long_ex(setting_arg);
+ setting = Z_LVAL_PP(setting_arg);
+
+ xmms_remote_pl_win_toggle(XG(session),setting?TRUE:FALSE);
+}
+/* }}} */
+
+/* {{{ proto void xmms_eq_win([bool setting])
+ Hide/Unhide equalizer xmms window */
+PHP_FUNCTION(xmms_eq_win)
+{
+ zval **setting_arg;
+ int setting;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &setting_arg) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ convert_to_long_ex(setting_arg);
+ setting = Z_LVAL_PP(setting_arg);
+
+ xmms_remote_eq_win_toggle(XG(session),setting?TRUE:FALSE);
+}
+/* }}} */
/*
* Local variables:
Index: pear/XMMS/xmms.glade
diff -u pear/XMMS/xmms.glade:1.1 pear/XMMS/xmms.glade:1.2
--- pear/XMMS/xmms.glade:1.1 Thu Aug 9 19:55:08 2001
+++ pear/XMMS/xmms.glade Thu Aug 9 20:36:50 2001
@@ -53,7 +53,7 @@
<class>GtkTable</class>
<name>table1</name>
<rows>3</rows>
- <columns>4</columns>
+ <columns>5</columns>
<homogeneous>False</homogeneous>
<row_spacing>0</row_spacing>
<column_spacing>0</column_spacing>
@@ -272,6 +272,90 @@
<right_attach>4</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>win</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>toggled</name>
+ <handler>on_win_toggled</handler>
+ <last_modification_time>Fri, 10 Aug 2001 00:28:07 GMT</last_modification_time>
+ </signal>
+ <label>win</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>4</left_attach>
+ <right_attach>5</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>pl</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>toggled</name>
+ <handler>on_pl_toggled</handler>
+ <last_modification_time>Fri, 10 Aug 2001 00:27:38 GMT</last_modification_time>
+ </signal>
+ <label>pl</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>4</left_attach>
+ <right_attach>5</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>eq</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>toggled</name>
+ <handler>on_eq_toggled</handler>
+ <last_modification_time>Fri, 10 Aug 2001 00:27:28 GMT</last_modification_time>
+ </signal>
+ <label>eq</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <child>
+ <left_attach>4</left_attach>
+ <right_attach>5</right_attach>
+ <top_attach>2</top_attach>
+ <bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>