Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 199620
Collapse All | Expand All

(-)../gkrellmms/gkrellmms.c (-42 / +48 lines)
Lines 82-87 Link Here
82
static gint style_id;
82
static gint style_id;
83
static GkrellmTicks *pGK;
83
static GkrellmTicks *pGK;
84
84
85
DBusGProxy* proxy = NULL;
86
85
/* drag and drop support */
87
/* drag and drop support */
86
88
87
enum {
89
enum {
Lines 103-127 Link Here
103
  if (!xmms_running) return ;
105
  if (!xmms_running) return ;
104
106
105
  switch (i) {
107
  switch (i) {
106
    case gkrellmms_prev: xmms_remote_playlist_prev(xmms_session); break;
108
    case gkrellmms_prev: audacious_remote_playlist_prev(proxy); break;
107
    case gkrellmms_play:
109
    case gkrellmms_play:
108
      if (xmms_remote_is_playing(xmms_session) && 
110
      if (audacious_remote_is_playing(proxy) && 
109
          !xmms_remote_is_paused(xmms_session)) 
111
          !audacious_remote_is_paused(proxy)) 
110
        xmms_remote_pause(xmms_session);
112
        audacious_remote_pause(proxy);
111
      else
113
      else
112
        xmms_remote_play(xmms_session);
114
        audacious_remote_play(proxy);
113
      break;
115
      break;
114
    case gkrellmms_paus: xmms_remote_pause(xmms_session); break;
116
    case gkrellmms_paus: audacious_remote_pause(proxy); break;
115
    case gkrellmms_stop:
117
    case gkrellmms_stop:
116
      xmms_remote_stop(xmms_session);
118
      audacious_remote_stop(proxy);
117
// FIXME      time_krell->previous = t = 0;
119
// FIXME      time_krell->previous = t = 0;
118
      break;
120
      break;
119
    case gkrellmms_next: xmms_remote_playlist_next(xmms_session); break;
121
    case gkrellmms_next: audacious_remote_playlist_next(proxy); break;
120
    case gkrellmms_eject:
122
    case gkrellmms_eject:
121
      if (eject_opens_playlist)
123
      if (eject_opens_playlist)
122
        pl_show_playlist();
124
        pl_show_playlist();
123
      else
125
      else
124
        xmms_remote_eject(xmms_session);
126
        audacious_remote_eject(proxy);
125
      break;
127
      break;
126
  }
128
  }
127
}
129
}
Lines 211-223 Link Here
211
213
212
  playlist_changed = update_playlist();
214
  playlist_changed = update_playlist();
213
215
214
	if ((xmms_running = xmms_remote_is_running(xmms_session))) {
216
	if ((xmms_running = audacious_remote_is_running(proxy))) {
215
    /* position is changed in the playlist when the playlist is changed too !
217
    /* position is changed in the playlist when the playlist is changed too !
216
     */
218
     */
217
    position_changed = 
219
    position_changed = 
218
      pl_get_current_position() != prev_position || playlist_changed;
220
      pl_get_current_position() != prev_position || playlist_changed;
219
    prev_position = pl_get_current_position();
221
    prev_position = pl_get_current_position();
220
		xmms_playing = xmms_remote_is_playing(xmms_session);
222
		xmms_playing = audacious_remote_is_playing(proxy);
221
223
222
		if (scroll_panel) {
224
		if (scroll_panel) {
223
			/* Scrollbar */
225
			/* Scrollbar */
Lines 228-234 Link Here
228
				scrolling_title_text = get_scrolling_title_text(&len, FALSE);
230
				scrolling_title_text = get_scrolling_title_text(&len, FALSE);
229
				time = pl_get_current_time();
231
				time = pl_get_current_time();
230
				if (scrolling_tooltip != NULL) {
232
				if (scrolling_tooltip != NULL) {
231
					xmms_remote_get_info(xmms_session, &rate, &freq, &nch);
233
					audacious_remote_get_info(proxy, &rate, &freq, &nch);
232
					prev_scrolling_tooltip_text = scrolling_tooltip_text;
234
					prev_scrolling_tooltip_text = scrolling_tooltip_text;
233
          scrolling_tooltip_text = g_strdup_printf("%s\n%d%s - %dHz - %s",
235
          scrolling_tooltip_text = g_strdup_printf("%s\n%d%s - %dHz - %s",
234
				  scrolling_title_text, rate / 1000,
236
				  scrolling_title_text, rate / 1000,
Lines 297-303 Link Here
297
	if (slider_in_motion == NULL) {
299
	if (slider_in_motion == NULL) {
298
		xmms_decal->x_off = 1;
300
		xmms_decal->x_off = 1;
299
		if(xmms_running && (xmms_playing || position_changed) && draw_time){ 
301
		if(xmms_running && (xmms_playing || position_changed) && draw_time){ 
300
		  output_time = xmms_remote_get_output_time(xmms_session);
302
		  output_time = audacious_remote_get_output_time(proxy);
301
      /* calculate slider position */
303
      /* calculate slider position */
302
  	  slider_position = pl_get_current_time() ? 
304
  	  slider_position = pl_get_current_time() ? 
303
                             ((output_time * 100) / pl_get_current_time()) : 0;
305
                             ((output_time * 100) / pl_get_current_time()) : 0;
Lines 334-340 Link Here
334
		if (!xmms_running)  {
336
		if (!xmms_running)  {
335
      on_index = led_playing_index;
337
      on_index = led_playing_index;
336
      off_index = led_off_index;
338
      off_index = led_off_index;
337
    } else if (xmms_remote_is_paused(xmms_session)) {
339
    } else if (audacious_remote_is_paused(proxy)) {
338
			on_index = led_off_index;	/* invert the duty cycle */
340
			on_index = led_off_index;	/* invert the duty cycle */
339
			off_index = led_paused_index;
341
			off_index = led_paused_index;
340
		} else if (!xmms_playing) {
342
		} else if (!xmms_playing) {
Lines 397-405 Link Here
397
drag_data_received(GtkWidget *window,GdkDragContext *context, gint x, gint y,
399
drag_data_received(GtkWidget *window,GdkDragContext *context, gint x, gint y,
398
                   GtkSelectionData *data,guint info,guint time,gpointer date) {
400
                   GtkSelectionData *data,guint info,guint time,gpointer date) {
399
  if (data->data) {
401
  if (data->data) {
400
    xmms_remote_playlist_clear(xmms_session);
402
    audacious_remote_playlist_clear(proxy);
401
    xmms_remote_playlist_add_url_string(xmms_session,(gchar *)data->data);
403
    audacious_remote_playlist_add_url_string(proxy,(gchar *)data->data);
402
    xmms_remote_play(xmms_session);
404
    audacious_remote_play(proxy);
403
    update_playlist();
405
    update_playlist();
404
  }
406
  }
405
}
407
}
Lines 437-465 Link Here
437
     | P200 I really notice some bugs without it.
439
     | P200 I really notice some bugs without it.
438
     */
440
     */
439
    if (!xmms_playing)
441
    if (!xmms_playing)
440
      xmms_remote_play(xmms_session);
442
      audacious_remote_play(proxy);
441
    timer = time(&lt);
443
    timer = time(&lt);
442
444
443
    /* Do nothing, wait until xmms really plays;
445
    /* Do nothing, wait until xmms really plays;
444
     | stop waiting after 10 seconds.
446
     | stop waiting after 10 seconds.
445
     */
447
     */
446
    /* FIXME ugly evil code */
448
    /* FIXME ugly evil code */
447
    while (!xmms_remote_is_playing(xmms_session) && ((time(&lt) - timer) < 10))
449
    while (!audacious_remote_is_playing(proxy) && ((time(&lt) - timer) < 10))
448
    {
450
    {
449
      usleep(0);
451
      usleep(0);
450
    }
452
    }
451
453
452
    xmms_remote_jump_to_time(xmms_session, where_to_jump);
454
    audacious_remote_jump_to_time(proxy, where_to_jump);
453
455
454
    timer = localtime(&lt)->tm_sec;
456
    timer = localtime(&lt)->tm_sec;
455
457
456
    /* Wait till really jumped before we continue. */
458
    /* Wait till really jumped before we continue. */
457
    while ((xmms_remote_get_output_time(xmms_session) / 1000) 
459
    while ((audacious_remote_get_output_time(proxy) / 1000) 
458
        != (where_to_jump / 1000) && ((time(&lt) - timer) < 10))
460
        != (where_to_jump / 1000) && ((time(&lt) - timer) < 10))
459
      usleep(0);
461
      usleep(0);
460
  }
462
  }
461
  else if((slider_in_motion != NULL) && !xmms_playing)
463
  else if((slider_in_motion != NULL) && !xmms_playing)
462
    xmms_remote_play(xmms_session);
464
    audacious_remote_play(proxy);
463
465
464
  slider_in_motion = NULL;
466
  slider_in_motion = NULL;
465
  got_motion = FALSE;
467
  got_motion = FALSE;
Lines 482-496 Link Here
482
        xmms_start_func();
484
        xmms_start_func();
483
      break;
485
      break;
484
    case 2:
486
    case 2:
485
      if (xmms_running && xmms_remote_is_playing(xmms_session))
487
      if (xmms_running && audacious_remote_is_playing(proxy))
486
      {
488
      {
487
        if (krell_mmb_pause)
489
        if (krell_mmb_pause)
488
          xmms_remote_pause(xmms_session);
490
          audacious_remote_pause(proxy);
489
        else
491
        else
490
          xmms_remote_stop(xmms_session);
492
          audacious_remote_stop(proxy);
491
      }
493
      }
492
      else if (xmms_running)
494
      else if (xmms_running)
493
        xmms_remote_play(xmms_session);
495
        audacious_remote_play(proxy);
494
      else
496
      else
495
        xmms_start_func();
497
        xmms_start_func();
496
      break;
498
      break;
Lines 811-826 Link Here
811
	static GkrellmPiximage *bg_scroll_image;
813
	static GkrellmPiximage *bg_scroll_image;
812
814
813
	if (first_create) {
815
	if (first_create) {
814
		xmms_running = xmms_remote_is_running(xmms_session);
816
		xmms_running = audacious_remote_is_running(proxy);
815
		if (auto_main_close && xmms_running)
817
		if (auto_main_close && xmms_running)
816
      xmms_remote_main_win_toggle(xmms_session, FALSE);
818
			audacious_remote_main_win_toggle(proxy, FALSE);
817
		if (xmms_autostart && !xmms_running)  xmms_start_func();
819
		if (xmms_autostart && !xmms_running)  xmms_start_func();
818
     
820
    		pl_init();
819
    pl_init();
820
		control_panel = gkrellm_panel_new0();
821
		control_panel = gkrellm_panel_new0();
821
	} else {
822
	} else {
822
    update_playlist();
823
		update_playlist();
823
  }
824
	}
824
825
825
	style = gkrellm_meter_style(DEFAULT_STYLE);
826
	style = gkrellm_meter_style(DEFAULT_STYLE);
826
	if (scroll_style) g_free(scroll_style);
827
	if (scroll_style) g_free(scroll_style);
Lines 860-866 Link Here
860
861
861
    if (scrolling_tooltip == NULL) {
862
    if (scrolling_tooltip == NULL) {
862
		scrolling_tooltip = gtk_tooltips_new();
863
		scrolling_tooltip = gtk_tooltips_new();
863
		scrolling_tooltip_text = g_strdup("xmms");
864
		scrolling_tooltip_text = g_strdup("audacious");
864
		gtk_tooltips_set_tip(scrolling_tooltip, scroll_panel->drawing_area,
865
		gtk_tooltips_set_tip(scrolling_tooltip, scroll_panel->drawing_area,
865
					scrolling_tooltip_text, NULL);
866
					scrolling_tooltip_text, NULL);
866
		gtk_tooltips_set_delay(scrolling_tooltip, 750);
867
		gtk_tooltips_set_delay(scrolling_tooltip, 750);
Lines 874-880 Link Here
874
	gkrellm_set_krell_full_scale(time_krell, 100, 1);
875
	gkrellm_set_krell_full_scale(time_krell, 100, 1);
875
876
876
	m = gkrellm_get_style_margins(style);
877
	m = gkrellm_get_style_margins(style);
877
	w = gkrellm_gdk_string_width(ts->font, "-000:00");
878
	w = gkrellm_gdk_string_width(ts->font, "-000:00xxx");
878
	xmms_decal = gkrellm_create_decal_text(control_panel, (gchar *) "A0", ts,
879
	xmms_decal = gkrellm_create_decal_text(control_panel, (gchar *) "A0", ts,
879
				style, -1, -1, w);
880
				style, -1, -1, w);
880
	xmms_decal->x += m->left;
881
	xmms_decal->x += m->left;
Lines 973-979 Link Here
973
void mainwin_back_func()
974
void mainwin_back_func()
974
{
975
{
975
  if (auto_main_close && xmms_running)
976
  if (auto_main_close && xmms_running)
976
    xmms_remote_main_win_toggle(xmms_session, TRUE);
977
    audacious_remote_main_win_toggle(proxy, TRUE);
977
}
978
}
978
979
979
static GkrellmMonitor  plugin_mon  =
980
static GkrellmMonitor  plugin_mon  =
Lines 1007-1012 Link Here
1007
GkrellmMonitor *
1008
GkrellmMonitor *
1008
gkrellm_init_plugin(void) {
1009
gkrellm_init_plugin(void) {
1009
  gchar *tmp;
1010
  gchar *tmp;
1011
  GError *error = NULL;
1012
  static DBusGConnection *connection = NULL;
1010
1013
1011
#ifdef ENABLE_NLS
1014
#ifdef ENABLE_NLS
1012
   bind_textdomain_codeset(PACKAGE, "UTF-8");
1015
   bind_textdomain_codeset(PACKAGE, "UTF-8");
Lines 1016-1021 Link Here
1016
	running_factory = options_menu_factory(1);
1019
	running_factory = options_menu_factory(1);
1017
	not_running_factory = options_menu_factory(0);
1020
	not_running_factory = options_menu_factory(0);
1018
1021
1022
1023
1024
  connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
1025
1026
  proxy = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE,
1027
                                    AUDACIOUS_DBUS_PATH,
1028
                                    AUDACIOUS_DBUS_INTERFACE);
1029
1019
  /* Default settings */
1030
  /* Default settings */
1020
  control_panel = NULL;
1031
  control_panel = NULL;
1021
  xmms_running = FALSE;
1032
  xmms_running = FALSE;
Lines 1033-1048 Link Here
1033
1044
1034
  playlist_dir = g_strdup(gkrellm_homedir());
1045
  playlist_dir = g_strdup(gkrellm_homedir());
1035
  files_directory = g_strdup("/");
1046
  files_directory = g_strdup("/");
1036
  gkrellmms_label = g_strdup("xmms");
1047
  gkrellmms_label = g_strdup("audacious");
1037
  xmms_session = 0;
1038
  scroll_enable = TRUE;
1048
  scroll_enable = TRUE;
1039
  scroll_separator = g_strdup(SCROLL_SEPARATOR);
1049
  scroll_separator = g_strdup(SCROLL_SEPARATOR);
1040
  draw_time = 1;
1050
  draw_time = 1;
1041
#ifdef USE_BMP
1051
  xmms_exec_command = g_strdup("audacious");
1042
  xmms_exec_command = g_strdup("beep-media-player");
1043
#else
1044
  xmms_exec_command = g_strdup("xmms");
1045
#endif
1046
  xmms_autostart = 0;
1052
  xmms_autostart = 0;
1047
  auto_main_close = 0;
1053
  auto_main_close = 0;
1048
  auto_hide_all = 0;
1054
  auto_hide_all = 0;
(-)../gkrellmms/gkrellmms.h (-6 / +5 lines)
Lines 25-35 Link Here
25
#include <time.h>
25
#include <time.h>
26
#include <gkrellm2/gkrellm.h>
26
#include <gkrellm2/gkrellm.h>
27
27
28
#ifdef USE_BMP
28
#include <audacious/audctrl.h>
29
#include <bmp/beepctrl.h>
29
#include <audacious/dbus.h>
30
#else
30
31
#include <xmms/xmmsctrl.h>
32
#endif
33
31
34
#include "playlist.h"
32
#include "playlist.h"
35
/* You can change these ones, but at your own risk.
33
/* You can change these ones, but at your own risk.
Lines 105-110 Link Here
105
103
106
104
107
/* Very global vars */
105
/* Very global vars */
106
extern DBusGProxy* proxy;
107
108
GtkItemFactory *running_factory;
108
GtkItemFactory *running_factory;
109
GtkItemFactory *not_running_factory;
109
GtkItemFactory *not_running_factory;
110
110
Lines 120-126 Link Here
120
gchar *scroll_separator;
120
gchar *scroll_separator;
121
gint scroll_enable;
121
gint scroll_enable;
122
gint enable_buttonbar;
122
gint enable_buttonbar;
123
gint xmms_session;
124
gint xmms_autostart;
123
gint xmms_autostart;
125
gint auto_main_close;
124
gint auto_main_close;
126
gint auto_hide_all;
125
gint auto_hide_all;
(-)../gkrellmms/Makefile (-13 / +7 lines)
Lines 8-31 Link Here
8
IMLIB_INCLUDE ?= 
8
IMLIB_INCLUDE ?= 
9
IMLIB_LIB ?= 
9
IMLIB_LIB ?= 
10
10
11
ifdef USE_BMP
11
XMMS_INCLUDE ?= `pkg-config audacious --cflags`
12
   XMMS_INCLUDE ?= `pkg-config bmp --cflags`
12
XMMS_LIB ?= `pkg-config audacious --libs`
13
   XMMS_LIB ?= `pkg-config bmp --libs`
13
14
else
14
DBUS_INCLUDE ?= `pkg-config dbus-1 --cflags`
15
   XMMS_INCLUDE ?= `xmms-config --cflags`
15
DBUS_LIB ?= `pkg-config dbus-1 --libs`
16
   XMMS_LIB ?= `xmms-config --libs`
17
endif
18
16
19
PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins
17
PLUGIN_DIR ?= /usr/local/lib/gkrellm2/plugins
20
18
21
FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) $(IMLIB_INCLUDE) $(XMMS_INCLUDE)
19
FLAGS = -O2 -Wall -fPIC $(GTK_INCLUDE) $(IMLIB_INCLUDE) $(DBUS_INCLUDE) $(XMMS_INCLUDE)
22
LIBS = $(GTK_LIB) $(IMLIB_LIB) $(XMMS_LIB)
20
LIBS = $(GTK_LIB) $(IMLIB_LIB) $(DBUS_LIB) $(XMMS_LIB)
23
LFLAGS = -shared -lpthread
21
LFLAGS = -shared -lpthread
24
22
25
ifdef USE_BMP
26
   FLAGS += -DUSE_BMP
27
endif
28
29
LOCALEDIR ?= /usr/share/locale
23
LOCALEDIR ?= /usr/share/locale
30
ifeq ($(enable_nls),1)
24
ifeq ($(enable_nls),1)
31
   FLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
25
   FLAGS += -DENABLE_NLS -DLOCALEDIR=\"$(LOCALEDIR)\"
(-)../gkrellmms/options.c (-98 / +71 lines)
Lines 26-32 Link Here
26
                 *playlist_dir_entry,
26
                 *playlist_dir_entry,
27
                 *label_entry,
27
                 *label_entry,
28
                 *separator_entry,
28
                 *separator_entry,
29
                 *session_entry,
30
                 *xmms_start_entry,
29
                 *xmms_start_entry,
31
                 *scroll_enable_entry,
30
                 *scroll_enable_entry,
32
                 *main_close_entry,
31
                 *main_close_entry,
Lines 52-79 Link Here
52
  switch (type)
51
  switch (type)
53
  {
52
  {
54
    case gkrellmms_mainwin:
53
    case gkrellmms_mainwin:
55
      xmms_remote_main_win_toggle(xmms_session,
54
      audacious_remote_main_win_toggle(proxy,
56
        !xmms_remote_is_main_win(xmms_session));
55
        !audacious_remote_is_main_win(proxy));
57
      break;
56
      break;
58
    case gkrellmms_playlist:
57
    case gkrellmms_playlist:
59
      xmms_remote_pl_win_toggle(xmms_session,
58
      audacious_remote_pl_win_toggle(proxy,
60
        !xmms_remote_is_pl_win(xmms_session));
59
        !audacious_remote_is_pl_win(proxy));
61
      break;
60
      break;
62
    case gkrellmms_eq:
61
    case gkrellmms_eq:
63
      xmms_remote_eq_win_toggle(xmms_session,
62
      audacious_remote_eq_win_toggle(proxy,
64
        !xmms_remote_is_eq_win(xmms_session));
63
        !audacious_remote_is_eq_win(proxy));
65
      break;
64
      break;
66
    case gkrellmms_repeat:
65
    case gkrellmms_repeat:
67
      xmms_remote_toggle_repeat(xmms_session);
66
      audacious_remote_toggle_repeat(proxy);
68
      break;
67
      break;
69
    case gkrellmms_shuffle:
68
    case gkrellmms_shuffle:
70
      xmms_remote_toggle_shuffle(xmms_session);
69
      audacious_remote_toggle_shuffle(proxy);
71
      break;
70
      break;
72
    case gkrellmms_eject:
71
    case gkrellmms_eject:
73
      xmms_remote_eject(xmms_session);
72
      audacious_remote_eject(proxy);
74
      break;
73
      break;
75
    case gkrellmms_prefs:
74
    case gkrellmms_prefs:
76
      xmms_remote_show_prefs_box(xmms_session);
75
      audacious_remote_show_prefs_box(proxy);
77
      break;
76
      break;
78
    default:
77
    default:
79
      do_xmms_command(type);
78
      do_xmms_command(type);
Lines 83-89 Link Here
83
82
84
void aot_func(GtkWidget *w, gpointer data)
83
void aot_func(GtkWidget *w, gpointer data)
85
{
84
{
86
  xmms_remote_toggle_aot(xmms_session, GPOINTER_TO_INT(data));
85
  audacious_remote_toggle_aot(proxy, GPOINTER_TO_INT(data));
87
}
86
}
88
87
89
void save_time(gint);
88
void save_time(gint);
Lines 118-132 Link Here
118
	 */
117
	 */
119
  /* FIXME supposed ugly evil code */
118
  /* FIXME supposed ugly evil code */
120
  timer = time(&lt);
119
  timer = time(&lt);
121
  while (!xmms_remote_is_running(xmms_session) && ((time(&lt) - timer) < 10))
120
  while (!audacious_remote_is_running(proxy) && ((time(&lt) - timer) < 10))
122
				usleep(0);
121
				usleep(0);
123
122
124
	xmms_running = xmms_remote_is_running(xmms_session);
123
	xmms_running = audacious_remote_is_running(proxy);
125
124
126
	if (auto_hide_all && xmms_running) {
125
	if (auto_hide_all && xmms_running) {
127
    xmms_remote_main_win_toggle(xmms_session, FALSE);
126
    audacious_remote_main_win_toggle(proxy, FALSE);
128
    xmms_remote_pl_win_toggle(xmms_session, FALSE);
127
    audacious_remote_pl_win_toggle(proxy, FALSE);
129
    xmms_remote_eq_win_toggle(xmms_session, FALSE);
128
    audacious_remote_eq_win_toggle(proxy, FALSE);
130
	}
129
	}
131
}
130
}
132
131
Lines 143-150 Link Here
143
  time(&lt);
142
  time(&lt);
144
  timer = lt;
143
  timer = lt;
145
144
146
  xmms_remote_quit(xmms_session);
145
  audacious_remote_quit(proxy);
147
  while (xmms_remote_is_running(xmms_session)
146
  while (audacious_remote_is_running(proxy)
148
         && ((time(&lt) - timer) < 10)) {
147
         && ((time(&lt) - timer) < 10)) {
149
    /* Do nothing; wait until xmms really quits, but not longer than 10sec! */
148
    /* Do nothing; wait until xmms really quits, but not longer than 10sec! */
150
    usleep(0);
149
    usleep(0);
Lines 167-206 Link Here
167
166
168
static GtkItemFactoryEntry gkrellmms_factory[] =
167
static GtkItemFactoryEntry gkrellmms_factory[] =
169
{
168
{
170
  {"/-",                            NULL, NULL,          0,        "<Separator>"},
169
  {N_("/Toggles"),                   NULL, NULL,          0,        "<Branch>"},
171
  {N_("/Toggles..."),                   NULL, NULL,          0,        "<Branch>"},
170
  {N_("/Toggles/Main Window"),       NULL, toggles_func,  gkrellmms_mainwin,  "<Item>"},
172
  {N_("/Toggles.../Main Window"),       NULL, toggles_func,  gkrellmms_mainwin,  "<Item>"},
171
  {N_("/Toggles/Playlist"),          NULL, toggles_func,  gkrellmms_playlist, "<Item>"},
173
  {N_("/Toggles.../Playlist"),          NULL, toggles_func,  gkrellmms_playlist, "<Item>"},
172
  {N_("/Toggles/EQ"),                NULL, toggles_func,  gkrellmms_eq,       "<Item>"},
174
  {N_("/Toggles.../EQ"),                NULL, toggles_func,  gkrellmms_eq,       "<Item>"},
173
  {N_("/Toggles/Repeat"),            NULL, toggles_func,  gkrellmms_repeat,   "<Item>"},
175
  {N_("/Toggles.../Repeat"),            NULL, toggles_func,  gkrellmms_repeat,   "<Item>"},
174
  {N_("/Toggles/Shuffle"),           NULL, toggles_func,  gkrellmms_shuffle,  "<Item>"},
176
  {N_("/Toggles.../Shuffle"),           NULL, toggles_func,  gkrellmms_shuffle,  "<Item>"},
175
  {N_("/Toggles/-"),                 NULL, NULL,          0,        "<Separator>"},
177
  {N_("/Toggles.../-"),                 NULL, NULL,          0,        "<Separator>"},
176
  {N_("/Toggles/Always on top on"),  NULL, aot_func,      ON,       "<Item>"},
178
  {N_("/Toggles.../Always on top on"),  NULL, aot_func,      ON,       "<Item>"},
177
  {N_("/Toggles/Always on top off"), NULL, aot_func,      OFF,      "<Item>"},
179
  {N_("/Toggles.../Always on top off"), NULL, aot_func,      OFF,      "<Item>"},
180
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
178
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
181
  {"/Xmms...",                          NULL, NULL,          0,        "<Branch>"},
179
  {"/Audacious",                          NULL, NULL,          0,        "<Branch>"},
182
  {N_("/Xmms.../Previous"),             NULL, toggles_func,  gkrellmms_prev,     "<Item>"},
180
  {N_("/Audacious/Previous"),             NULL, toggles_func,  gkrellmms_prev,     "<Item>"},
183
  {N_("/Xmms.../Play"),                 NULL, toggles_func,  gkrellmms_play,     "<Item>"},
181
  {N_("/Audacious/Play"),                 NULL, toggles_func,  gkrellmms_play,     "<Item>"},
184
  {N_("/Xmms.../Pause"),                NULL, toggles_func,  gkrellmms_paus,     "<Item>"},
182
  {N_("/Audacious/Pause"),                NULL, toggles_func,  gkrellmms_paus,     "<Item>"},
185
  {N_("/Xmms.../Stop"),                 NULL, toggles_func,  gkrellmms_stop,     "<Item>"},
183
  {N_("/Audacious/Stop"),                 NULL, toggles_func,  gkrellmms_stop,     "<Item>"},
186
  {N_("/Xmms.../Next"),                 NULL, toggles_func,  gkrellmms_next,     "<Item>"},
184
  {N_("/Audacious/Next"),                 NULL, toggles_func,  gkrellmms_next,     "<Item>"},
187
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
185
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
188
  {N_("/Playlist Editor"),              NULL, open_playlist_cb, 0,        "<Item>"},
186
  {N_("/Playlist Editor"),              NULL, open_playlist_cb, 0,        "<Item>"},
189
  {N_("/GKrellMMS Options"),            NULL, open_options_cb, 0,        "<Item>"},
187
  {N_("/GKrellMMS Options"),            NULL, open_options_cb, 0,        "<Item>"},
190
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
188
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
191
  {N_("/Open file(s)"),                 NULL, toggles_func,  gkrellmms_eject,    "<Item>"},
189
  {N_("/Open file(s)"),                 NULL, toggles_func,  gkrellmms_eject,    "<Item>"},
192
  {N_("/Open Playlist"),                NULL, load_playlist_cb,  0,        "<Item>"},
190
  {N_("/Open Playlist"),                NULL, load_playlist_cb,  0,        "<Item>"},
193
  {N_("/XMMS Prefs"),                   NULL, toggles_func,  gkrellmms_prefs,    "<Item>"},
191
  {N_("/Audacious Preferences"),                   NULL, toggles_func,  gkrellmms_prefs,    "<Item>"},
194
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
195
  {N_("/Quit XMMS"),                    NULL, quit_func,     0,        "<Item>"},
196
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
192
  {"/-",                                NULL, NULL,          0,        "<Separator>"},
193
  {N_("/Quit Audacious"),                    NULL, quit_func,     0,        "<Item>"},
197
};
194
};
198
195
199
static GtkItemFactoryEntry gkrellmms_factory_norun[] =
196
static GtkItemFactoryEntry gkrellmms_factory_norun[] =
200
{
197
{
201
  {"/-",                           NULL, NULL,          0,    "<Separator>"},
198
  {N_("/Launch Audacious"),                 NULL, start_func,    0,    "<Item>"},
202
  {N_("/Launch XMMS"),                 NULL, start_func,    0,    "<Item>"},
203
  {"/-",                           NULL, NULL,          0,    "<Separator>"},
204
};
199
};
205
200
206
GtkItemFactory *options_menu_factory(gint run_menu)
201
GtkItemFactory *options_menu_factory(gint run_menu)
Lines 261-269 Link Here
261
  scroll_separator = g_strdup(gtk_entry_get_text(GTK_ENTRY(separator_entry)));
256
  scroll_separator = g_strdup(gtk_entry_get_text(GTK_ENTRY(separator_entry)));
262
	gkrellmms_set_scroll_separator_len();
257
	gkrellmms_set_scroll_separator_len();
263
258
264
  xmms_session = gtk_spin_button_get_value_as_int(
265
                                                GTK_SPIN_BUTTON(session_entry));
266
267
  /* Toggles */
259
  /* Toggles */
268
  prev_scroll_enable = scroll_enable;
260
  prev_scroll_enable = scroll_enable;
269
  scroll_enable = GTK_TOGGLE_BUTTON(scroll_enable_entry)->active;
261
  scroll_enable = GTK_TOGGLE_BUTTON(scroll_enable_entry)->active;
Lines 284-290 Link Here
284
void save_gkrellmms_config(FILE *f)
276
void save_gkrellmms_config(FILE *f)
285
{
277
{
286
  fprintf(f, "%s scroll_enable %d\n", CONFIG_KEYWORD, scroll_enable);
278
  fprintf(f, "%s scroll_enable %d\n", CONFIG_KEYWORD, scroll_enable);
287
  fprintf(f, "%s xmms_session %d\n", CONFIG_KEYWORD, xmms_session);
288
  fprintf(f, "%s draw_time %d\n", CONFIG_KEYWORD, draw_time);
279
  fprintf(f, "%s draw_time %d\n", CONFIG_KEYWORD, draw_time);
289
  fprintf(f, "%s xmms_autostart %d\n", CONFIG_KEYWORD, xmms_autostart);
280
  fprintf(f, "%s xmms_autostart %d\n", CONFIG_KEYWORD, xmms_autostart);
290
  fprintf(f, "%s auto_main_close %d\n", CONFIG_KEYWORD, auto_main_close);
281
  fprintf(f, "%s auto_main_close %d\n", CONFIG_KEYWORD, auto_main_close);
Lines 311-318 Link Here
311
  {
302
  {
312
    if (strcmp(config, "scroll_enable") == 0)
303
    if (strcmp(config, "scroll_enable") == 0)
313
      sscanf(item, "%d\n", &scroll_enable);
304
      sscanf(item, "%d\n", &scroll_enable);
314
    else if (strcmp(config, "xmms_session") == 0)
315
      sscanf(item, "%d\n", &xmms_session);
316
    else if (strcmp(config, "xmms_autostart") == 0)
305
    else if (strcmp(config, "xmms_autostart") == 0)
317
      sscanf(item, "%d\n", &xmms_autostart);
306
      sscanf(item, "%d\n", &xmms_autostart);
318
    else if (strcmp(config, "auto_main_close") == 0)
307
    else if (strcmp(config, "auto_main_close") == 0)
Lines 413-419 Link Here
413
            *time_draw_entry,
402
            *time_draw_entry,
414
            *pause_entry,
403
            *pause_entry,
415
            *time_fmt_entry;
404
            *time_fmt_entry;
416
  GtkAdjustment *adjust;
417
  GSList *eject_group = NULL,
405
  GSList *eject_group = NULL,
418
         *time_draw_group = NULL,
406
         *time_draw_group = NULL,
419
         *pause_group = NULL,
407
         *pause_group = NULL,
Lines 423-441 Link Here
423
  gint i;
411
  gint i;
424
  static gchar *gkrellmms_help_text[] =
412
  static gchar *gkrellmms_help_text[] =
425
  {
413
  {
426
    N_("GKrellMMS is a GKrellM XMMS-plugin which allows you to control \n" \
414
    N_("GKrellMMS is a GKrellM Audacious-plugin which allows you to control \n" \
427
    "XMMS from within GKrellM. It features some cool things, such as: \n" \
415
    "Audacious from within GKrellM. It features some cool things, such as: \n" \
428
    "\n" \
416
    "\n" \
429
    "- A scrolling title. \n" \
417
    "- A scrolling title. \n" \
430
    "- A Krell which indicates where you are in a song. \n" \
418
    "- A Krell which indicates where you are in a song. \n" \
431
    "- Themeable buttons for controlling XMMS. \n" \
419
    "- Themeable buttons for controlling Audacious. \n" \
432
    "- A playlist editor. \n" \
420
    "- A playlist editor. \n" \
433
    "- A gtk-popup-menu with misc. XMMS-functions. \n" \
421
    "- A gtk-popup-menu with misc. Audacious-functions. \n" \
434
    "\n"),
422
    "\n"),
435
423
436
    N_("<b>How to use GKrellMMS: \n"),
424
    N_("<b>How to use GKrellMMS: \n"),
437
    N_("\n" \
425
    N_("\n" \
438
    "You can do some cool stuff with the XMMS-Krell, by using your mouse. \n" \
426
    "You can do some cool stuff with the Audacious-Krell, by using your mouse. \n" \
439
    "\n"),
427
    "\n"),
440
428
441
    N_("<b>Mouse actions: \n" \
429
    N_("<b>Mouse actions: \n" \
Lines 443-450 Link Here
443
    N_("Jump through song. \n"),
431
    N_("Jump through song. \n"),
444
432
445
    N_("<b>\tMiddle mouse-button: "),
433
    N_("<b>\tMiddle mouse-button: "),
446
    N_("Pause/stop/play XMMS (configurable), \n" \
434
    N_("Pause/stop/play Audacious (configurable), \n" \
447
    "\t  or launch XMMS if it's not running. \n"),
435
    "\t  or launch Audacious if it's not running. \n"),
448
436
449
    N_("<b>\tRight mouse-button: "),
437
    N_("<b>\tRight mouse-button: "),
450
    N_("Popup-menu. \n" \
438
    N_("Popup-menu. \n" \
Lines 453-468 Link Here
453
    "\n"),
441
    "\n"),
454
442
455
    N_("<b>\tConstant red: "),
443
    N_("<b>\tConstant red: "),
456
    N_("XMMS is turned off. \n"),
444
    N_("Audacious is turned off. \n"),
457
445
458
    N_("<b>\tConstant green: "),
446
    N_("<b>\tConstant green: "),
459
    N_("XMMS is playing. \n"),
447
    N_("Audacious is playing. \n"),
460
448
461
    N_("<b>\tRed, blinking green: "),
449
    N_("<b>\tRed, blinking green: "),
462
    N_("XMMS is stopped. \n"),
450
    N_("Audacious is stopped. \n"),
463
451
464
    N_("<b>\tGreen, blinking red: "),
452
    N_("<b>\tGreen, blinking red: "),
465
    N_("XMMS is paused. \n" \
453
    N_("Audacious is paused. \n" \
466
    "\n"),
454
    "\n"),
467
455
468
    N_("<b>Configurabilities:\n"),
456
    N_("<b>Configurabilities:\n"),
Lines 473-487 Link Here
473
461
474
    N_("<b>Configs tab: \n" \
462
    N_("<b>Configs tab: \n" \
475
    "\n" \
463
    "\n" \
476
    "\tXMMS Executable: \n"),
464
    "\tAudacious Executable: \n"),
477
465
478
    N_("\tHow the XMMS-executable (+ eventually path) \n" \
466
    N_("\tHow the Audacious-executable (+ eventually path) \n" \
479
    "\tis called on your computer. Default is xmms\n" \
467
    "\tis called on your computer. Default is audacious\n" \
480
    "\n"),
468
    "\n"),
481
469
482
    N_("<b>\tFiles Directory: \n"),
470
    N_("<b>\tFiles Directory: \n"),
483
    N_("\tThe directory where your mp3's/xm's/whatever \n" \
471
    N_("\tThe directory where your mp3's/xm's/whatever \n" \
484
    "\tare stored in. When starting XMMS from GKrellM, it will go to this \n" \
472
    "\tare stored in. When starting Audacious from GKrellM, it will go to this \n" \
485
    "\tdirectory when ejecting. \n" \
473
    "\tdirectory when ejecting. \n" \
486
    "\n"),
474
    "\n"),
487
  
475
  
Lines 490-496 Link Here
490
    "\n"),
478
    "\n"),
491
479
492
    N_("<b>\tKrell label: \n"),
480
    N_("<b>\tKrell label: \n"),
493
    N_("\tThe text-label you want in the krell when xmms isn't running/playing. \n" \
481
    N_("\tThe text-label you want in the krell when Audacious isn't running/playing. \n" \
494
    "\n"),
482
    "\n"),
495
  
483
  
496
    N_("<b>\tScroll separator: \n"),
484
    N_("<b>\tScroll separator: \n"),
Lines 498-508 Link Here
498
    "\tIt defaults to '   ***   ' (that's 3 spaces, 3 *'s and 3 spaces). \n" \
486
    "\tIt defaults to '   ***   ' (that's 3 spaces, 3 *'s and 3 spaces). \n" \
499
    "\n"),
487
    "\n"),
500
488
501
    N_("<b>\tXMMS Session to use: \n"),
502
    N_("\tThe XMMS-session you want to use with GKrellMMS. \n" \
503
    "\tUse 0 if you only have 1 XMMS running. \n" \
504
    "\n"),
505
  
506
    N_("<b>Toggles tab: \n" \
489
    N_("<b>Toggles tab: \n" \
507
    "\n" \
490
    "\n" \
508
    "\tDraw minus (-) with remaining time: \n"),
491
    "\tDraw minus (-) with remaining time: \n"),
Lines 510-532 Link Here
510
    N_("\tDraw a minus (-) before the remaining time, when you have \n" \
493
    N_("\tDraw a minus (-) before the remaining time, when you have \n" \
511
    "\tthe output-time displaying remaining time. \n\n"),
494
    "\tthe output-time displaying remaining time. \n\n"),
512
495
513
    N_("<b>\tXMMS Auto Launch: \n"),
496
    N_("<b>\tAudacious Auto Launch: \n"),
514
    N_("\tAuto launch XMMS when starting GKrellMMS. \n" \
497
    N_("\tAuto launch Audacious when starting GKrellMMS. \n" \
515
    "\n"),
498
    "\n"),
516
  
499
  
517
    N_("<b>\tAuto Mainwindow Close: \n"),
500
    N_("<b>\tAuto Mainwindow Close: \n"),
518
    N_("\tAutomatically close the XMMS-mainwindow \n" \
501
    N_("\tAutomatically close the Audacious-mainwindow \n" \
519
    "\twhen GKrellMMS starts, and XMMS is already running, or when \n" \
502
    "\twhen GKrellMMS starts, and Audacious is already running, or when \n" \
520
    "\tlaunching XMMS while GKrellMMS runs. This option also enables the \n" \
503
    "\tlaunching Audacious while GKrellMMS runs. This option also enables the \n" \
521
    "\tmainwindow back when you quit gkrellm (some people really do). \n" \
504
    "\tmainwindow back when you quit gkrellm (some people really do). \n" \
522
    "\n"),
505
    "\n"),
523
506
524
    N_("<b>\tAuto hide all XMMS windows: \n"),
507
    N_("<b>\tAuto hide all Audacious windows: \n"),
525
    N_("\tAutomatically hide all XMMS windows when GKrellMMS starts. \n" \
508
    N_("\tAutomatically hide all Audacious windows when GKrellMMS starts. \n" \
526
     "\n"),
509
     "\n"),
527
510
528
    N_("<b>\tAuto start playing: \n"),
511
    N_("<b>\tAuto start playing: \n"),
529
    N_("\tAutomatically start playing when launching XMMS. \n\n"),
512
    N_("\tAutomatically start playing when launching Audacious. \n\n"),
530
513
531
    N_("<b>\tEnable scrolling title: \n"),
514
    N_("<b>\tEnable scrolling title: \n"),
532
    N_("\tEnable/disable the scrolling title-panel. \n" \
515
    N_("\tEnable/disable the scrolling title-panel. \n" \
Lines 537-549 Link Here
537
    "\tEject opens: \n"),
520
    "\tEject opens: \n"),
538
521
539
    N_("\tCheck whether the eject-button on the button-bar opens a \n" \
522
    N_("\tCheck whether the eject-button on the button-bar opens a \n" \
540
    "\tplaylist or an other XMMS-file. \n" \
523
    "\tplaylist or an other Audacious-file. \n" \
541
    "\n"),
524
    "\n"),
542
  
525
  
543
    N_("<b>\tMMB on krell click: \n"),
526
    N_("<b>\tMMB on krell click: \n"),
544
    N_("\tCheck whether GKrellMMS should pause/continue or \n" \
527
    N_("\tCheck whether GKrellMMS should pause/continue or \n" \
545
    "\tstop/play the current song on a MMB-click on the krell. MMB Click will \n" \
528
    "\tstop/play the current song on a MMB-click on the krell. MMB Click will \n" \
546
    "\talways start playing the song if XMMS isn't playing. \n" \
529
    "\talways start playing the song if Audacious isn't playing. \n" \
547
    "\n"),
530
    "\n"),
548
531
549
    N_("<b>\tLoad file-info: \n"),
532
    N_("<b>\tLoad file-info: \n"),
Lines 553-559 Link Here
553
    "\tplaylist editor, or are playing on a slow network/cdrom. \n\n"),
536
    "\tplaylist editor, or are playing on a slow network/cdrom. \n\n"),
554
537
555
    N_("<b>\tDraw in time bar: \n"),
538
    N_("<b>\tDraw in time bar: \n"),
556
    N_("\tCheck whether to draw the output time or 'xmms' in \n" \
539
    N_("\tCheck whether to draw the output time or 'audacious' in \n" \
557
    "\tthe time-krell panel. \n" \
540
    "\tthe time-krell panel. \n" \
558
    "\n"),
541
    "\n"),
559
542
Lines 577-583 Link Here
577
  hbox = gtk_hbox_new(FALSE, 5);
560
  hbox = gtk_hbox_new(FALSE, 5);
578
561
579
  zbox = gtk_vbox_new(FALSE, 0);
562
  zbox = gtk_vbox_new(FALSE, 0);
580
  label = gtk_label_new(_("XMMS Executable:"));
563
  label = gtk_label_new(_("Audacious Executable:"));
581
  gtk_box_pack_start(GTK_BOX(zbox), label, TRUE, FALSE, 0);
564
  gtk_box_pack_start(GTK_BOX(zbox), label, TRUE, FALSE, 0);
582
  label = gtk_label_new(_("Files Directory:"));
565
  label = gtk_label_new(_("Files Directory:"));
583
  gtk_box_pack_start(GTK_BOX(zbox), label, TRUE, FALSE, 0);
566
  gtk_box_pack_start(GTK_BOX(zbox), label, TRUE, FALSE, 0);
Lines 618-634 Link Here
618
  gtk_box_pack_start(GTK_BOX(hbox), zbox, FALSE, FALSE, 0);
601
  gtk_box_pack_start(GTK_BOX(hbox), zbox, FALSE, FALSE, 0);
619
  gtk_container_add(GTK_CONTAINER(vbox), hbox);
602
  gtk_container_add(GTK_CONTAINER(vbox), hbox);
620
603
621
  hbox = gtk_hbox_new(FALSE, 5);
622
  adjust = (GtkAdjustment *) gtk_adjustment_new((gfloat) xmms_session, 0.0,
623
                             100.0, 1.0, 5.0, 0.0);
624
  session_entry = gtk_spin_button_new(adjust, 1.0, 1);
625
  gtk_spin_button_set_digits(GTK_SPIN_BUTTON(session_entry), (guint) 0);
626
  gtk_spin_button_set_value(GTK_SPIN_BUTTON(session_entry), xmms_session);
627
  gtk_box_pack_start(GTK_BOX(hbox), session_entry, FALSE, FALSE, 0);
628
  label = gtk_label_new(_("XMMS Session to use"));
629
  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
630
  gtk_container_add(GTK_CONTAINER(vbox), hbox);
631
632
  label = gtk_label_new(_("Configs"));
604
  label = gtk_label_new(_("Configs"));
633
  gtk_container_add(GTK_CONTAINER(frame), vbox);
605
  gtk_container_add(GTK_CONTAINER(frame), vbox);
634
  gtk_notebook_append_page(GTK_NOTEBOOK(laptop), frame, label);
606
  gtk_notebook_append_page(GTK_NOTEBOOK(laptop), frame, label);
Lines 644-662 Link Here
644
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(draw_minus_entry), draw_minus);  
616
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(draw_minus_entry), draw_minus);  
645
  gtk_container_add(GTK_CONTAINER(vbox), draw_minus_entry);
617
  gtk_container_add(GTK_CONTAINER(vbox), draw_minus_entry);
646
618
647
  xmms_start_entry = gtk_check_button_new_with_label(_("Auto launch XMMS on GKrellMMS startup"));
619
  xmms_start_entry = gtk_check_button_new_with_label(_("Auto launch Audacious on GKrellMMS startup"));
648
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(xmms_start_entry), xmms_autostart);
620
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(xmms_start_entry), xmms_autostart);
649
  gtk_container_add(GTK_CONTAINER(vbox), xmms_start_entry);
621
  gtk_container_add(GTK_CONTAINER(vbox), xmms_start_entry);
650
622
651
  main_close_entry = gtk_check_button_new_with_label(_("Auto close (and open) XMMS Mainwin"));
623
  main_close_entry = gtk_check_button_new_with_label(_("Auto close (and open) Audacious Mainwin"));
652
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(main_close_entry), auto_main_close);
624
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(main_close_entry), auto_main_close);
653
  gtk_container_add(GTK_CONTAINER(vbox), main_close_entry);
625
  gtk_container_add(GTK_CONTAINER(vbox), main_close_entry);
654
626
655
  hide_all_entry = gtk_check_button_new_with_label(_("Auto hide all XMMS windows on XMMS startup"));
627
  hide_all_entry = gtk_check_button_new_with_label(_("Auto hide all Audacious windows on Audacious startup"));
656
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hide_all_entry), auto_hide_all);
628
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hide_all_entry), auto_hide_all);
657
  gtk_container_add(GTK_CONTAINER(vbox), hide_all_entry);
629
  gtk_container_add(GTK_CONTAINER(vbox), hide_all_entry);
658
630
659
  auto_play_entry = gtk_check_button_new_with_label(_("Auto start playing on XMMS launch"));
631
  auto_play_entry = gtk_check_button_new_with_label(_("Auto start playing on Audaciou launch"));
660
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(auto_play_entry), auto_play_start);
632
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(auto_play_entry), auto_play_start);
661
  gtk_container_add(GTK_CONTAINER(vbox), auto_play_entry);
633
  gtk_container_add(GTK_CONTAINER(vbox), auto_play_entry);
662
634
Lines 720-726 Link Here
720
  gtk_signal_connect(GTK_OBJECT(time_draw_entry), "pressed",
692
  gtk_signal_connect(GTK_OBJECT(time_draw_entry), "pressed",
721
                     (GtkSignalFunc) time_type_set, GINT_TO_POINTER(1));
693
                     (GtkSignalFunc) time_type_set, GINT_TO_POINTER(1));
722
694
723
  time_draw_entry = gtk_radio_button_new_with_label(time_draw_group, _("XMMS-text"));
695
  time_draw_entry = gtk_radio_button_new_with_label(time_draw_group, _("Audacious-text"));
724
  gtk_box_pack_start(GTK_BOX(zbox), time_draw_entry, FALSE, FALSE, 0);
696
  gtk_box_pack_start(GTK_BOX(zbox), time_draw_entry, FALSE, FALSE, 0);
725
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(time_draw_entry), !draw_time);
697
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(time_draw_entry), !draw_time);
726
  gtk_signal_connect(GTK_OBJECT(time_draw_entry), "pressed",
698
  gtk_signal_connect(GTK_OBJECT(time_draw_entry), "pressed",
Lines 840-847 Link Here
840
  /* About */
812
  /* About */
841
  gkrellmms_info_text = g_strdup_printf(
813
  gkrellmms_info_text = g_strdup_printf(
842
    _("GKrellMMS %d.%d.%d\n" \
814
    _("GKrellMMS %d.%d.%d\n" \
843
    "GKrellM XMMS Plugin\n" \
815
    "GKrellM Audacious Plugin\n" \
844
    "\n" \
816
    "\n" \
817
    "Copyright (C) 2008      Sascha Hlusiak <contact@saschahlusiak.de>\n"\
845
    "Copyright (C) 2000-2002 Sander Klein Lebbink <sander@cerberus.demon.nl>\n"\
818
    "Copyright (C) 2000-2002 Sander Klein Lebbink <sander@cerberus.demon.nl>\n"\
846
    "Current Maintainer: Sjoerd Simons <sjoerd@luon.net>\n" \
819
    "Current Maintainer: Sjoerd Simons <sjoerd@luon.net>\n" \
847
    "http://gkrellm.luon.net/\n" \
820
    "http://gkrellm.luon.net/\n" \
(-)../gkrellmms/playlist.c (-17 / +18 lines)
Lines 107-122 Link Here
107
void update_playlist_position(void) {
107
void update_playlist_position(void) {
108
  GtkTreeIter iter;
108
  GtkTreeIter iter;
109
109
110
  current_position = xmms_remote_get_playlist_pos(xmms_session) + 1;
110
  current_position = audacious_remote_get_playlist_pos(proxy) + 1;
111
  g_free(current_title);
111
  g_free(current_title);
112
  g_free(current_file);
112
  g_free(current_file);
113
  if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(playlist),
113
  if (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(playlist),
114
                                &iter, NULL, current_position -1))  {
114
                                &iter, NULL, current_position -1))  {
115
    current_file = xmms_remote_get_playlist_file(xmms_session,
115
    current_file = audacious_remote_get_playlist_file(proxy,
116
                                                     current_position -1);
116
                                                     current_position -1);
117
    current_title = xmms_remote_get_playlist_title(xmms_session,
117
    current_title = audacious_remote_get_playlist_title(proxy,
118
                                                     current_position -1);
118
                                                     current_position -1);
119
    current_time =  xmms_remote_get_playlist_time(xmms_session,
119
    current_time =  audacious_remote_get_playlist_time(proxy,
120
                                                     current_position -1);
120
                                                     current_position -1);
121
121
122
    current_file = string_to_utf8(current_file, TRUE);
122
    current_file = string_to_utf8(current_file, TRUE);
Lines 154-166 Link Here
154
154
155
  total_plist_time = 0;
155
  total_plist_time = 0;
156
156
157
  if (!xmms_remote_is_running(xmms_session)) return;
157
  if (!audacious_remote_is_running(proxy)) return;
158
158
159
  len = xmms_remote_get_playlist_length(xmms_session);
159
  len = audacious_remote_get_playlist_length(proxy);
160
  playlist_length = len;
160
  playlist_length = len;
161
161
162
  for (i = 0 ; i < len ; i ++) {
162
  for (i = 0 ; i < len ; i ++) {
163
    filename =  xmms_remote_get_playlist_file(xmms_session, i);
163
    filename =  audacious_remote_get_playlist_file(proxy, i);
164
    if (filename == NULL) {
164
    if (filename == NULL) {
165
      /* error occurred empty playlist and try again */
165
      /* error occurred empty playlist and try again */
166
      empty_playlist();
166
      empty_playlist();
Lines 173-183 Link Here
173
173
174
    gtk_list_store_append(playlist,&iter);
174
    gtk_list_store_append(playlist,&iter);
175
    if (always_load_info) {
175
    if (always_load_info) {
176
      title = xmms_remote_get_playlist_title(xmms_session, i);
176
      title = audacious_remote_get_playlist_title(proxy, i);
177
      if (title != NULL) { 
177
      if (title != NULL) { 
178
        title = string_to_utf8(title, FALSE);
178
        title = string_to_utf8(title, FALSE);
179
      } 
179
      } 
180
      time = xmms_remote_get_playlist_time(xmms_session, i);
180
      time = audacious_remote_get_playlist_time(proxy, i);
181
      gtk_list_store_set(playlist,&iter,
181
      gtk_list_store_set(playlist,&iter,
182
                         PLAYLIST_POSITION,i+ 1,
182
                         PLAYLIST_POSITION,i+ 1,
183
                         PLAYLIST_TITLE,title == NULL ? "" : title,
183
                         PLAYLIST_TITLE,title == NULL ? "" : title,
Lines 206-218 Link Here
206
  char *filename = NULL;
206
  char *filename = NULL;
207
207
208
  /* playlist lenght changed, reload */
208
  /* playlist lenght changed, reload */
209
  if (playlist_length != xmms_remote_get_playlist_length(xmms_session)) {
209
  if (playlist_length != audacious_remote_get_playlist_length(proxy)) {
210
    empty_playlist();
210
    empty_playlist();
211
    playlist_length = -1;
211
    load_playlist();
212
    load_playlist();
212
    return TRUE;
213
    return TRUE;
213
  }
214
  }
214
  filename = string_to_utf8(
215
  filename = string_to_utf8(
215
               xmms_remote_get_playlist_file(xmms_session,current_position-1),
216
               audacious_remote_get_playlist_file(proxy,current_position-1),
216
               TRUE
217
               TRUE
217
             );
218
             );
218
  
219
  
Lines 224-230 Link Here
224
  }
225
  }
225
  g_free(filename);
226
  g_free(filename);
226
227
227
  if (xmms_remote_get_playlist_pos(xmms_session) != current_position + 1) {
228
  if (audacious_remote_get_playlist_pos(proxy) != current_position + 1) {
228
    update_playlist_position();
229
    update_playlist_position();
229
  }
230
  }
230
  return TRUE;
231
  return TRUE;
Lines 273-281 Link Here
273
    }
274
    }
274
    list = g_list_append(list,path);
275
    list = g_list_append(list,path);
275
  }
276
  }
276
  if (xmms_remote_is_running(xmms_session)) {
277
  if (audacious_remote_is_running(proxy)) {
277
    xmms_remote_playlist_clear(xmms_session);
278
    audacious_remote_playlist_clear(proxy);
278
    xmms_remote_playlist_add(xmms_session, list);
279
    audacious_remote_playlist_add(proxy, list);
279
  }
280
  }
280
281
281
  for (tlist = list; tlist != NULL; tlist = g_list_next(tlist)) {
282
  for (tlist = list; tlist != NULL; tlist = g_list_next(tlist)) {
Lines 386-393 Link Here
386
  gtk_tree_model_get(GTK_TREE_MODEL(playlist),&iter,
387
  gtk_tree_model_get(GTK_TREE_MODEL(playlist),&iter,
387
                     PLAYLIST_POSITION,&position,
388
                     PLAYLIST_POSITION,&position,
388
                     -1);
389
                     -1);
389
  xmms_remote_set_playlist_pos(xmms_session,position - 1);
390
  audacious_remote_set_playlist_pos(proxy,position - 1);
390
  xmms_remote_play(xmms_session);
391
  audacious_remote_play(proxy);
391
  return TRUE;
392
  return TRUE;
392
}
393
}
393
394
(-)../gkrellmms/playlist.h (-5 / +1 lines)
Lines 24-34 Link Here
24
#include <stdio.h>
24
#include <stdio.h>
25
#include <time.h>
25
#include <time.h>
26
26
27
#ifdef USE_BMP
27
#include <audacious/auddrct.h>
28
#include <bmp/beepctrl.h>
29
#else
30
#include <xmms/xmmsctrl.h>
31
#endif
32
28
33
#include "gkrellmms.h"
29
#include "gkrellmms.h"
34
30

Return to bug 199620