Mercurial > audlegacy
changeset 2420:b23f52fe132f trunk
[svn] Removed util.* from libaudacious
Removed my C++ comments from ui_fileopener.c
Cleanups
author | mf0102 |
---|---|
date | Sat, 27 Jan 2007 04:07:46 -0800 |
parents | 884a00d035d2 |
children | 74ec16ef847b |
files | ChangeLog src/audacious/genevent.c src/audacious/input.c src/audacious/main.c src/audacious/playback.c src/audacious/ui_fileopener.c src/libaudacious/Makefile src/libaudacious/util.c src/libaudacious/util.h |
diffstat | 9 files changed, 47 insertions(+), 197 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Jan 26 18:11:50 2007 -0800 +++ b/ChangeLog Sat Jan 27 04:07:46 2007 -0800 @@ -1,3 +1,11 @@ +2007-01-27 02:11:50 +0000 William Pitcock <nenolod@sacredspiral.co.uk> + revision [3848] + - audacious.desktop is already installed, no need to do so here + + trunk/Makefile | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + + 2007-01-27 02:10:18 +0000 William Pitcock <nenolod@sacredspiral.co.uk> revision [3846] - fix: W:playlist_list.c(162) [get_transparency_pixmap]: possible type-punned pointer dereference
--- a/src/audacious/genevent.c Fri Jan 26 18:11:50 2007 -0800 +++ b/src/audacious/genevent.c Sat Jan 27 04:07:46 2007 -0800 @@ -45,8 +45,6 @@ #include "libaudacious/configdb.h" #include "libaudacious/beepctrl.h" -#include "libaudacious/util.h" -#include "vfs.h" #include "controlsocket.h" #include "dnd.h" @@ -55,14 +53,15 @@ #include "hints.h" #include "input.h" #include "logger.h" -#include "ui_main.h" #include "output.h" #include "playback.h" #include "playlist.h" +#include "pluginenum.h" +#include "ui_main.h" #include "ui_playlist.h" -#include "pluginenum.h" #include "util.h" #include "visualization.h" +#include "vfs.h" gboolean ev_waiting = FALSE;
--- a/src/audacious/input.c Fri Jan 26 18:11:50 2007 -0800 +++ b/src/audacious/input.c Sat Jan 27 04:07:46 2007 -0800 @@ -33,16 +33,15 @@ #include "fft.h" #include "input.h" #include "main.h" -#include "ui_main.h" #include "output.h" -#include "strings.h" -#include "visualization.h" #include "playback.h" -#include "widgets/widgetcore.h" #include "pluginenum.h" +#include "strings.h" #include "titlestring.h" - -#include "libaudacious/util.h" +#include "ui_main.h" +#include "util.h" +#include "visualization.h" +#include "widgets/widgetcore.h" #include "vfs.h" #include "vfs_buffer.h"
--- a/src/audacious/main.c Fri Jan 26 18:11:50 2007 -0800 +++ b/src/audacious/main.c Sat Jan 27 04:07:46 2007 -0800 @@ -47,7 +47,6 @@ #include "libaudacious/configdb.h" #include "libaudacious/beepctrl.h" -#include "libaudacious/util.h" #include "vfs.h" #include "controlsocket.h"
--- a/src/audacious/playback.c Fri Jan 26 18:11:50 2007 -0800 +++ b/src/audacious/playback.c Sat Jan 27 04:07:46 2007 -0800 @@ -37,15 +37,15 @@ #include <sys/stat.h> #include <dirent.h> -#include "libaudacious/util.h" #include "libaudacious/configdb.h" +#include "hook.h" #include "input.h" #include "main.h" -#include "ui_main.h" #include "ui_equalizer.h" #include "output.h" #include "playlist.h" +#include "ui_main.h" #include "ui_playlist.h" #include "ui_skinselector.h" #include "urldecode.h" @@ -53,7 +53,6 @@ #include "playback.h" -#include "hook.h" /* FIXME: yuck!! this shouldn't be here... */ void @@ -71,11 +70,8 @@ gint playback_get_time(void) { - if (!playback_get_playing()) - return -1; - - if (!get_current_input_plugin()) - return -1; + g_return_val_if_fail(playback_get_playing(), -1); + g_return_val_if_fail(get_current_input_plugin(), -1); return get_current_input_plugin()->get_time(); } @@ -87,8 +83,7 @@ Playlist *playlist = playlist_get_active(); gint penalty = 0; - if (playlist_get_length(playlist) == 0) - return; + g_return_if_fail(playlist_get_length(playlist) != 0); if (playback_get_playing()) playback_stop(); @@ -98,9 +93,7 @@ mainwin_disable_seekbar(); entry = playlist_get_entry_to_play(playlist); - - if (entry == NULL) - return; + g_return_if_fail(entry != NULL); /* * If the playlist entry cannot be played, try to pick another one. @@ -108,26 +101,25 @@ * * - nenolod */ - for ( penalty=0 ; penalty <= 15 && entry != NULL && !playback_play_file(entry) ; penalty++ ) + for (penalty = 0; penalty <= 15 && entry != NULL && !playback_play_file(entry); penalty++) { playlist_next(playlist); entry = playlist_get_entry_to_play(playlist); - /* XXX ew. workaround for a stupid bug where audacious will keep - * trying to play a file with no valid decoder. - */ - if (entry == NULL) - return; + /* XXX ew. workaround for a stupid bug where audacious will keep + * trying to play a file with no valid decoder. + */ + g_return_if_fail(entry != NULL); - if (entry->decoder == NULL ) - entry->decoder = input_check_file(entry->filename, FALSE); + if (entry->decoder == NULL ) + entry->decoder = input_check_file(entry->filename, FALSE); - /* if we hit 15 entries in a row with no valid decoder, just + /* if we hit 15 entries in a row with no valid decoder, just * bail due to confusion - */ - if (penalty == 15) - return; + */ + if (penalty == 15) + return; } if (playback_get_time() != -1) { @@ -235,7 +227,7 @@ * - nenolod */ if (!entry->decoder && - (((entry->decoder = input_check_file(entry->filename, FALSE)) == NULL) || + (((entry->decoder = input_check_file(entry->filename, FALSE)) == NULL) || !input_is_enabled(entry->decoder->filename))) { input_file_not_playable(entry->filename); @@ -273,31 +265,28 @@ gboolean restore_pause = FALSE; gint l=0, r=0; - if (!ip_data.playing) - return; - - if (!get_current_input_plugin()) - return; + g_return_if_fail(ip_data.playing); + g_return_if_fail(get_current_input_plugin()); /* FIXME WORKAROUND...that should work with all plugins * mute the volume, start playback again, do the seek, then pause again * -Patrick Sudowe */ - if(ip_data.paused) + if (ip_data.paused) { - restore_pause = TRUE; - output_get_volume(&l, &r); - output_set_volume(0,0); - playback_pause(); + restore_pause = TRUE; + output_get_volume(&l, &r); + output_set_volume(0,0); + playback_pause(); } free_vis_data(); get_current_input_plugin()->seek(time); - if(restore_pause) + if (restore_pause) { - playback_pause(); - output_set_volume(l, r); + playback_pause(); + output_set_volume(l, r); } }
--- a/src/audacious/ui_fileopener.c Fri Jan 26 18:11:50 2007 -0800 +++ b/src/audacious/ui_fileopener.c Sat Jan 27 04:07:46 2007 -0800 @@ -149,8 +149,9 @@ gtk_container_add(GTK_CONTAINER(bbox), close_button); gtk_container_add(GTK_CONTAINER(bbox), action_button); - // this storage object holds several other objects which are used in the - // callback functions + /* this storage object holds several other objects which are used in the + * callback functions + */ gpointer storage = g_object_new(G_TYPE_OBJECT, NULL); g_object_set_data(storage, "window", window); g_object_set_data(storage, "chooser", chooser);
--- a/src/libaudacious/Makefile Fri Jan 26 18:11:50 2007 -0800 +++ b/src/libaudacious/Makefile Sat Jan 27 04:07:46 2007 -0800 @@ -25,7 +25,6 @@ $(CONF_SRC) \ rcfile.c \ beepctrl.c \ - util.c \ formatter.c \ titlestring.c \ xconvert.c
--- a/src/libaudacious/util.c Fri Jan 26 18:11:50 2007 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* Audacious - * Copyright (C) 2005-2007 Audacious team - * - * XMMS - Cross-platform multimedia player - * Copyright (C) 1998-2003 Peter Alm, Mikael Alm, Olle Hallnas, - * Thomas Nilsson and 4Front Technologies - * Copyright (C) 1999-2003 Haavard Kvaalen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <stdlib.h> -#include <glib.h> -#include <gtk/gtk.h> - -/** - * xmms_show_message: - * @title: The title of the message to show. - * @text: The text of the message to show. - * @button_text: The text of the button which will close the messagebox. - * @modal: Whether or not the messagebox should be modal. - * @button_action: Code to execute on when the messagebox is closed, or %NULL. - * @action_data: Optional opaque data to pass to @button_action. - * - * Displays a message box. - * - * Return value: A GTK widget handle for the message box. - **/ -GtkWidget * -xmms_show_message(const gchar * title, const gchar * text, - const gchar * button_text, gboolean modal, - GtkSignalFunc button_action, gpointer action_data) -{ - GtkWidget *dialog; - GtkWidget *dialog_vbox, *dialog_hbox, *dialog_bbox; - GtkWidget *dialog_bbox_b1; - GtkWidget *dialog_textlabel; - GtkWidget *dialog_icon; - - dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_type_hint( GTK_WINDOW(dialog) , GDK_WINDOW_TYPE_HINT_DIALOG ); - gtk_window_set_modal( GTK_WINDOW(dialog) , modal ); - gtk_window_set_title( GTK_WINDOW(dialog) , title ); - gtk_container_set_border_width( GTK_CONTAINER(dialog) , 10 ); - - dialog_vbox = gtk_vbox_new( FALSE , 0 ); - dialog_hbox = gtk_hbox_new( FALSE , 0 ); - - /* icon */ - dialog_icon = gtk_image_new_from_stock( GTK_STOCK_DIALOG_INFO , GTK_ICON_SIZE_DIALOG ); - gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_icon , FALSE , FALSE , 2 ); - - /* label */ - dialog_textlabel = gtk_label_new( text ); - /* gtk_label_set_selectable( GTK_LABEL(dialog_textlabel) , TRUE ); */ - gtk_box_pack_start( GTK_BOX(dialog_hbox) , dialog_textlabel , TRUE , TRUE , 2 ); - - gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_hbox , FALSE , FALSE , 2 ); - gtk_box_pack_start( GTK_BOX(dialog_vbox) , gtk_hseparator_new() , FALSE , FALSE , 4 ); - - dialog_bbox = gtk_hbutton_box_new(); - gtk_button_box_set_layout( GTK_BUTTON_BOX(dialog_bbox) , GTK_BUTTONBOX_END ); - dialog_bbox_b1 = gtk_button_new_with_label( button_text ); - g_signal_connect_swapped( G_OBJECT(dialog_bbox_b1) , "clicked" , - G_CALLBACK(gtk_widget_destroy) , dialog ); - if ( button_action ) - g_signal_connect( G_OBJECT(dialog_bbox_b1) , "clicked" , - button_action , action_data ); - GTK_WIDGET_SET_FLAGS( dialog_bbox_b1 , GTK_CAN_DEFAULT); - gtk_widget_grab_default( dialog_bbox_b1 ); - - gtk_container_add( GTK_CONTAINER(dialog_bbox) , dialog_bbox_b1 ); - gtk_box_pack_start( GTK_BOX(dialog_vbox) , dialog_bbox , FALSE , FALSE , 0 ); - - gtk_container_add( GTK_CONTAINER(dialog) , dialog_vbox ); - gtk_widget_show_all(dialog); - - return dialog; -} - - -/** - * audacious_get_localdir: - * - * Returns a string with the full path of Audacious local datadir (where config files are placed). - * It's useful in order to put in the right place custom config files for audacious plugins. - * - * Return value: a string with full path of Audacious local datadir (should be freed after use) - **/ -gchar* -audacious_get_localdir(void) -{ - gchar *datadir; - gchar *tmp; - - if ( (tmp = getenv("XDG_CONFIG_HOME")) == NULL ) - datadir = g_build_filename( g_get_home_dir() , ".config" , "audacious" , NULL ); - else - datadir = g_build_filename( tmp , "audacious" , NULL ); - - return datadir; -} - - -/** - * xmms_check_realtime_priority: - * - * Legacy function included for compatibility with XMMS. - * - * Return value: FALSE - **/ -gboolean -xmms_check_realtime_priority(void) -{ - return FALSE; -} - -/** - * xmms_usleep: - * @usec: The amount of microseconds to sleep. - * - * Legacy function included for compatibility with XMMS. - **/ -void -xmms_usleep(gint usec) -{ - g_usleep(usec); -}