comparison audacious/playback.c @ 1653:a6e6d3500c13 trunk

[svn] - revert back to r2216
author nenolod
date Thu, 07 Sep 2006 22:26:54 -0700
parents f3934d790a2e
children 600efc52c645
comparison
equal deleted inserted replaced
1652:62c5bff8a05b 1653:a6e6d3500c13
38 #include "libaudacious/util.h" 38 #include "libaudacious/util.h"
39 #include "libaudacious/configdb.h" 39 #include "libaudacious/configdb.h"
40 40
41 #include "input.h" 41 #include "input.h"
42 #include "main.h" 42 #include "main.h"
43 #include "mainwin.h"
44 #include "equalizer.h"
43 #include "output.h" 45 #include "output.h"
44 #include "playlist.h" 46 #include "playlist.h"
47 #include "ui_playlist.h"
45 #include "skinwin.h" 48 #include "skinwin.h"
46 #include "urldecode.h" 49 #include "urldecode.h"
47 #include "util.h" 50 #include "util.h"
48 51
49 52
50 #include "playback.h" 53 #include "playback.h"
51 #include "interface.h" 54
55
56 /* FIXME: yuck!! this shouldn't be here... */
57 void
58 bmp_playback_set_random_skin(void)
59 {
60 SkinNode *node;
61 guint32 randval;
62
63 /* Get a random value to select the skin to use */
64 randval = g_random_int_range(0, g_list_length(skinlist));
65 node = g_list_nth(skinlist, randval)->data;
66 bmp_active_skin_load(node->path);
67 }
52 68
53 gint 69 gint
54 bmp_playback_get_time(void) 70 bmp_playback_get_time(void)
55 { 71 {
56 if (!bmp_playback_get_playing()) 72 if (!bmp_playback_get_playing())
71 return; 87 return;
72 88
73 if (bmp_playback_get_playing()) 89 if (bmp_playback_get_playing())
74 bmp_playback_stop(); 90 bmp_playback_stop();
75 91
76 #if 0
77 vis_clear_data(mainwin_vis); 92 vis_clear_data(mainwin_vis);
78 svis_clear_data(mainwin_svis); 93 svis_clear_data(mainwin_svis);
79 mainwin_disable_seekbar(); 94 mainwin_disable_seekbar();
80 #endif
81 95
82 entry = playlist_get_entry_to_play(); 96 entry = playlist_get_entry_to_play();
83 97
84 if (!entry) 98 if (!entry)
85 return; 99 return;
86 100
87 if (!bmp_playback_play_file(entry)) 101 if (!bmp_playback_play_file(entry))
88 return; 102 return;
89 103
90 if (bmp_playback_get_time() != -1) { 104 if (bmp_playback_get_time() != -1) {
91 #if 0
92 equalizerwin_load_auto_preset(entry->filename); 105 equalizerwin_load_auto_preset(entry->filename);
93 #endif
94 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, 106 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
95 cfg.equalizer_bands); 107 cfg.equalizer_bands);
96 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, 108 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
97 cfg.equalizer_bands); 109 cfg.equalizer_bands);
98 } 110 }
110 if (!get_current_input_plugin()) 122 if (!get_current_input_plugin())
111 return; 123 return;
112 124
113 ip_data.paused = !ip_data.paused; 125 ip_data.paused = !ip_data.paused;
114 126
115 #if 0
116 if (ip_data.paused) 127 if (ip_data.paused)
117 playstatus_set_status(mainwin_playstatus, STATUS_PAUSE); 128 playstatus_set_status(mainwin_playstatus, STATUS_PAUSE);
118 else 129 else
119 playstatus_set_status(mainwin_playstatus, STATUS_PLAY); 130 playstatus_set_status(mainwin_playstatus, STATUS_PLAY);
120 #endif
121 131
122 if (get_current_input_plugin()->pause) 132 if (get_current_input_plugin()->pause)
123 get_current_input_plugin()->pause(ip_data.paused); 133 get_current_input_plugin()->pause(ip_data.paused);
124 } 134 }
125 135
144 mainwin_set_info_text(); 154 mainwin_set_info_text();
145 } 155 }
146 } 156 }
147 157
148 ip_data.buffering = FALSE; 158 ip_data.buffering = FALSE;
149 current_interface->buffering_notify(FALSE); 159 playstatus_set_status_buffering(mainwin_playstatus, FALSE);
150 ip_data.playing = FALSE; 160 ip_data.playing = FALSE;
151 } 161 }
152 162
153 void 163 void
154 bmp_playback_stop_reentrant(void) 164 bmp_playback_stop_reentrant(void)
179 const gchar *markup = 189 const gchar *markup =
180 N_("<b><big>No output plugin selected.</big></b>\n" 190 N_("<b><big>No output plugin selected.</big></b>\n"
181 "You have not selected an output plugin."); 191 "You have not selected an output plugin.");
182 192
183 GtkWidget *dialog = 193 GtkWidget *dialog =
184 gtk_message_dialog_new_with_markup(GTK_WINDOW(current_interface->parentwin), 194 gtk_message_dialog_new_with_markup(GTK_WINDOW(mainwin),
185 GTK_DIALOG_DESTROY_WITH_PARENT, 195 GTK_DIALOG_DESTROY_WITH_PARENT,
186 GTK_MESSAGE_ERROR, 196 GTK_MESSAGE_ERROR,
187 GTK_BUTTONS_OK, 197 GTK_BUTTONS_OK,
188 _(markup)); 198 _(markup));
189 gtk_dialog_run(GTK_DIALOG(dialog)); 199 gtk_dialog_run(GTK_DIALOG(dialog));