24 #include <dbus/dbus-glib.h>
45 g_return_if_fail(list !=
NULL);
46 g_return_if_fail(num > 0);
53 glist = g_list_append(glist, (gpointer)data);
75 g_clear_error(&
error);
77 return (
string ?
string :
NULL);
88 const gchar *
filenames[g_list_length (list) + 1];
91 for (count = 0; list !=
NULL; count ++, list = list->next)
92 filenames[count] = list->data;
94 filenames[count] =
NULL;
97 g_clear_error (&
error);
108 const gchar *
filenames[g_list_length (list) + 1];
111 for (count = 0; list !=
NULL; count ++, list = list->next)
112 filenames[count] = list->data;
114 filenames[count] =
NULL;
117 g_clear_error (&
error);
130 const gchar *
filenames[g_list_length (list) + 1];
133 for (count = 0; list !=
NULL; count ++, list = list->next)
134 filenames[count] = list->data;
136 filenames[count] =
NULL;
139 g_clear_error (&
error);
150 g_clear_error(&
error);
160 g_clear_error(&
error);
170 g_clear_error(&
error);
180 g_clear_error(&
error);
190 gboolean is_playing =
FALSE;
192 g_clear_error(&
error);
205 gboolean is_paused =
FALSE;
207 g_clear_error(&
error);
222 g_clear_error(&
error);
235 g_clear_error(&
error);
249 g_clear_error(&
error);
261 g_clear_error(&
error);
275 g_clear_error(&
error);
288 g_clear_error(&
error);
300 g_clear_error(&
error);
314 return (vl > vr) ? vl : vr;
326 g_clear_error(&
error);
339 g_clear_error(&
error);
350 gint
b = 50, vl = 0, vr = 0;
356 vr = (v * (100 - abs(b))) / 100;
358 vl = (v * (100 -
b)) / 100;
372 gint v = 0, vl = 0, vr = 0;
383 vr = (v * (100 - abs(b))) / 100;
385 vl = (v * (100 -
b)) / 100;
402 g_clear_error(&
error);
416 g_clear_error(&
error);
430 g_clear_error(&
error);
445 g_clear_error(&
error);
456 g_clear_error(&
error);
466 gboolean visible =
TRUE;
468 g_clear_error(&
error);
489 g_clear_error(&
error);
509 g_clear_error(&
error);
520 g_clear_error(&
error);
530 g_clear_error(&
error);
541 g_clear_error(&
error);
551 g_clear_error(&
error);
563 g_clear_error(&
error);
575 g_clear_error(&
error);
591 g_clear_error(&
error);
601 g_clear_error(&
error);
607 g_clear_error (&
error);
619 g_clear_error(&
error);
632 g_clear_error(&
error);
638 gboolean is_stop_after;
640 g_clear_error (&
error);
641 return is_stop_after;
653 g_clear_error(&
error);
663 gdouble preamp = 0.0;
666 g_clear_error(&
error);
682 g_clear_error(&
error);
696 g_clear_error(&
error);
707 g_clear_error(&
error);
719 g_clear_error(&
error);
729 g_clear_error(&
error);
749 gchar *
string, guint pos) {
751 g_clear_error(&
error);
762 g_clear_error(&
error);
773 g_clear_error(&
error);
787 g_clear_error(&
error);
798 g_clear_error(&
error);
810 gboolean is_advance =
FALSE;
812 g_clear_error(&
error);
833 g_clear_error(&
error);
844 g_clear_error(&
error);
855 g_clear_error(&
error);
868 g_clear_error(&
error);
882 g_clear_error(&
error);
897 g_clear_error(&
error);
910 g_clear_error(&
error);
928 g_clear_error(&
error);
930 if (G_IS_VALUE(&value) ==
FALSE)
938 if (G_VALUE_HOLDS_STRING(&value))
940 s = g_strdup(g_value_get_string(&value));
941 else if (g_value_type_transformable(G_VALUE_TYPE(&value), G_TYPE_STRING))
943 GValue tmp_value = { 0, };
945 g_value_init(&tmp_value, G_TYPE_STRING);
946 g_value_transform(&value, &tmp_value);
949 s = g_strdup(g_value_get_string(&tmp_value));
951 g_value_unset(&tmp_value);
954 s = g_strdup(
"<unknown type>");
956 g_value_unset(&value);
968 g_clear_error(&
error);
980 g_clear_error(&
error);
990 g_clear_error(&
error);
992 return (
string ?
string :
NULL);
static gboolean org_atheme_audacious_add_list(DBusGProxy *proxy, const char **IN_filenames, GError **error)
EXPORT void audacious_remote_eq_activate(DBusGProxy *proxy, gboolean active)
Toggles the equalizer.
static gboolean org_atheme_audacious_playlist_ins_url_string(DBusGProxy *proxy, const char *IN_url, const gint IN_pos, GError **error)
EXPORT void audacious_remote_stop(DBusGProxy *proxy)
Tells audacious to stop.
EXPORT void audacious_remote_playlist_next(DBusGProxy *proxy)
Tells audacious to move forward in the playlist.
static gboolean org_atheme_audacious_get_eq_band(DBusGProxy *proxy, const gint IN_band, gdouble *OUT_value, GError **error)
EXPORT gboolean audacious_remote_is_advance(DBusGProxy *proxy)
audacious_remote_is_advance:
EXPORT void audacious_remote_show_about_box(DBusGProxy *proxy)
Tells audacious to show the about box.
static gboolean org_atheme_audacious_pause(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_set_eq_band(DBusGProxy *proxy, const gint IN_band, const gdouble IN_value, GError **error)
EXPORT void audacious_remote_playlist_delete(DBusGProxy *proxy, guint pos)
Deletes a playlist entry from current playlist in given position.
EXPORT void audacious_remote_playlist_open_list(DBusGProxy *proxy, GList *list)
Sends a list of URIs for Audacious to open.
EXPORT gchar * audacious_remote_get_playlist_file(DBusGProxy *proxy, guint pos)
Queries Audacious about a playlist entry's file.
static gboolean org_atheme_audacious_toggle_auto_advance(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_playing(DBusGProxy *proxy, gboolean *OUT_is_playing, GError **error)
static gboolean org_atheme_audacious_queue_get_queue_pos(DBusGProxy *proxy, const guint IN_pos, guint *OUT_qpos, GError **error)
static gboolean org_atheme_audacious_seek(DBusGProxy *proxy, const guint IN_pos, GError **error)
static gboolean org_atheme_audacious_playlist_enqueue_to_temp(DBusGProxy *proxy, const char *IN_url, GError **error)
EXPORT void audacious_remote_playlist_open_list_to_temp(DBusGProxy *proxy, GList *list)
Sends a list of URIs for Audacious to open in a temporary playlist.
static gboolean org_atheme_audacious_show_jtf_box(DBusGProxy *proxy, const gboolean IN_show, GError **error)
EXPORT void audacious_remote_playlist_add(DBusGProxy *proxy, GList *list)
Sends a list of URIs to Audacious to add to the playlist.
EXPORT void audacious_remote_show_prefs_box(DBusGProxy *proxy)
Tells audacious to show the preferences pane.
static gboolean org_atheme_audacious_toggle_stop_after(DBusGProxy *proxy, GError **error)
EXPORT gchar * audacious_remote_get_playlist_title(DBusGProxy *proxy, guint pos)
Queries Audacious about a playlist entry's title.
static gboolean org_atheme_audacious_delete(DBusGProxy *proxy, const guint IN_pos, GError **error)
static gboolean org_atheme_audacious_paused(DBusGProxy *proxy, gboolean *OUT_is_paused, GError **error)
static gboolean org_atheme_audacious_set_eq_preamp(DBusGProxy *proxy, const gdouble IN_preamp, GError **error)
EXPORT gboolean audacious_remote_is_running(DBusGProxy *proxy)
Check if an Audacious instance is running.
static gboolean org_atheme_audacious_open_list_to_temp(DBusGProxy *proxy, const char **IN_filenames, GError **error)
EXPORT void audacious_remote_set_eq(DBusGProxy *proxy, gdouble preamp, GArray *bands)
Tells audacious to set the equalizer up using the provided values.
static gboolean org_atheme_audacious_advance(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_stop_after(DBusGProxy *proxy, gboolean *OUT_is_stopping, GError **error)
EXPORT void audacious_remote_playlist_enqueue_to_temp(DBusGProxy *proxy, gchar *string)
Tells audacious to add an URI to a temporary playlist.
EXPORT void audacious_remote_set_eq_band(DBusGProxy *proxy, gint band, gdouble value)
Tells audacious to set an equalizer band's setting.
EXPORT gint audacious_remote_get_playlist_pos(DBusGProxy *proxy)
audacious_remote_get_playlist_pos:
static gboolean org_atheme_audacious_playqueue_add(DBusGProxy *proxy, const gint IN_pos, GError **error)
EXPORT void audacious_remote_playlist_clear(DBusGProxy *proxy)
audacious_remote_playlist_clear:
static gboolean org_atheme_audacious_play_pause(DBusGProxy *proxy, GError **error)
EXPORT void audacious_remote_playqueue_remove(DBusGProxy *proxy, guint pos)
Tells audacious to remove a playlist entry from the playqueue.
static gboolean org_atheme_audacious_toggle_aot(DBusGProxy *proxy, const gboolean IN_ontop, GError **error)
static gboolean org_atheme_audacious_version(DBusGProxy *proxy, char **OUT_version, GError **error)
static float b[EQ_BANDS][2]
EXPORT void audacious_remote_quit(DBusGProxy *proxy)
Requests audacious to quit.
static gboolean org_atheme_audacious_playlist_add(DBusGProxy *proxy, const char *IN_list, GError **error)
EXPORT gint audacious_remote_get_balance(DBusGProxy *proxy)
Queries audacious about the current balance.
EXPORT void audacious_remote_playlist(DBusGProxy *proxy, gchar **list, gint num, gboolean enqueue)
Sends a list of URIs to Audacious, either replacing current playlist or enqueuing them...
EXPORT gint audacious_remote_get_playlist_length(DBusGProxy *proxy)
audacious_remote_get_playlist_length:
EXPORT gchar * audacious_remote_playlist_get_active_name(DBusGProxy *proxy)
Returns the active playlist name.
EXPORT gint audacious_remote_get_playqueue_queue_position(DBusGProxy *proxy, guint pos)
Queries audacious about what the playqueue position is for a playlist entry.
EXPORT gboolean audacious_remote_is_paused(DBusGProxy *proxy)
audacious_remote_is_paused:
EXPORT void audacious_remote_set_balance(DBusGProxy *proxy, gint b)
Sets the balance in Audacious.
static gboolean org_atheme_audacious_show_filebrowser(DBusGProxy *proxy, const gboolean IN_show, GError **error)
static gboolean org_atheme_audacious_playqueue_is_queued(DBusGProxy *proxy, const gint IN_pos, gboolean *OUT_is_queued, GError **error)
EXPORT gchar * audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field, guint pos)
Queries Audacious about a playlist entry's tuple information.
static gboolean org_atheme_audacious_main_win_visible(DBusGProxy *proxy, gboolean *OUT_is_main_win, GError **error)
EXPORT void audacious_remote_playlist_add_url_string(DBusGProxy *proxy, gchar *string)
Tells audacious to add an URI to the playlist.
EXPORT gint audacious_remote_get_playlist_time(DBusGProxy *proxy, guint pos)
Queries Audacious about a playlist entry's length.
EXPORT void audacious_remote_main_win_toggle(DBusGProxy *proxy, gboolean show)
Toggles the main window's visibility.
static gboolean org_atheme_audacious_get_tuple_fields(DBusGProxy *proxy, char ***OUT_fields, GError **error)
EXPORT void audacious_remote_get_volume(DBusGProxy *proxy, gint *vl, gint *vr)
Queries audacious for the current volume settings.
EXPORT gboolean audacious_remote_is_playing(DBusGProxy *proxy)
Queries audacious about whether it is playing or not.
static gboolean org_atheme_audacious_show_prefs_box(DBusGProxy *proxy, const gboolean IN_show, GError **error)
EXPORT void audacious_remote_eject(DBusGProxy *proxy)
Tells audacious to display the open files pane.
static gboolean org_atheme_audacious_jump(DBusGProxy *proxy, const guint IN_pos, GError **error)
EXPORT gint audacious_remote_get_output_time(DBusGProxy *proxy)
audacious_remote_get_output_time:
EXPORT gboolean audacious_remote_is_repeat(DBusGProxy *proxy)
Queries audacious about whether or not the repeat feature is active.
static gboolean org_atheme_audacious_set_eq(DBusGProxy *proxy, const gdouble IN_preamp, const GArray *IN_bands, GError **error)
EXPORT void audacious_remote_toggle_stop_after(DBusGProxy *proxy)
EXPORT void audacious_remote_set_playlist_pos(DBusGProxy *proxy, guint pos)
audacious_remote_set_playlist_pos:
EXPORT void audacious_remote_toggle_repeat(DBusGProxy *proxy)
Tells audacious to toggle the repeat feature.
static gboolean org_atheme_audacious_get_active_playlist_name(DBusGProxy *proxy, char **OUT_plname, GError **error)
EXPORT void audacious_remote_play(DBusGProxy *proxy)
Requests audacious to begin playback.
EXPORT void audacious_remote_toggle_aot(DBusGProxy *proxy, gboolean ontop)
Tells audacious to set the always-on-top feature.
static gboolean org_atheme_audacious_position(DBusGProxy *proxy, guint *OUT_pos, GError **error)
EXPORT gint audacious_remote_get_playqueue_length(DBusGProxy *proxy)
Queries audacious about the playqueue's length.
static gboolean org_atheme_audacious_queue_get_list_pos(DBusGProxy *proxy, const guint IN_qpos, guint *OUT_pos, GError **error)
static gboolean org_atheme_audacious_length(DBusGProxy *proxy, gint *OUT_length, GError **error)
EXPORT void audacious_remote_pause(DBusGProxy *proxy)
Tells audacious to pause.
static gboolean org_atheme_audacious_auto_advance(DBusGProxy *proxy, gboolean *OUT_is_advance, GError **error)
EXPORT gint audacious_remote_get_playqueue_list_position(DBusGProxy *proxy, guint qpos)
Queries audacious what is the playlist position for given a playqueue entry index.
static gboolean org_atheme_audacious_toggle_shuffle(DBusGProxy *proxy, GError **error)
EXPORT gboolean audacious_remote_is_stop_after(DBusGProxy *proxy)
static gboolean org_atheme_audacious_equalizer_activate(DBusGProxy *proxy, const gboolean IN_active, GError **error)
EXPORT gdouble audacious_remote_get_eq_preamp(DBusGProxy *proxy)
Queries audacious about the equalizer preamp's setting.
static gboolean org_atheme_audacious_volume(DBusGProxy *proxy, gint *OUT_vl, gint *OUT_vr, GError **error)
EXPORT void audacious_remote_playlist_prev(DBusGProxy *proxy)
audacious_remote_playlist_prev:
EXPORT gchar ** audacious_remote_get_tuple_fields(DBusGProxy *proxy)
Returns a array of strings with available tuple field names.
static gboolean org_atheme_audacious_play(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_playqueue_remove(DBusGProxy *proxy, const gint IN_pos, GError **error)
static gboolean org_atheme_audacious_stop(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_song_filename(DBusGProxy *proxy, const guint IN_pos, char **OUT_filename, GError **error)
static gboolean org_atheme_audacious_song_tuple(DBusGProxy *proxy, const guint IN_pos, const char *IN_tuple, GValue *OUT_value, GError **error)
static gboolean org_atheme_audacious_quit(DBusGProxy *proxy, GError **error)
EXPORT void audacious_remote_get_eq(DBusGProxy *proxy, gdouble *preamp, GArray **bands)
Queries audacious about the equalizer settings.
static gboolean org_atheme_audacious_clear(DBusGProxy *proxy, GError **error)
EXPORT gdouble audacious_remote_get_eq_band(DBusGProxy *proxy, gint band)
Queries audacious about an equalizer band's value.
static gboolean org_atheme_audacious_eject(DBusGProxy *proxy, GError **error)
EXPORT gboolean audacious_remote_is_main_win(DBusGProxy *proxy)
Queries Audacious about the main window's visibility.
static gboolean org_atheme_audacious_balance(DBusGProxy *proxy, gint *OUT_balance, GError **error)
static gboolean org_atheme_audacious_playqueue_clear(DBusGProxy *proxy, GError **error)
static gboolean org_atheme_audacious_toggle_repeat(DBusGProxy *proxy, GError **error)
EXPORT void audacious_remote_toggle_about_box(DBusGProxy *proxy, gboolean show)
Tells audacious to show/hide the about box.
EXPORT gboolean audacious_remote_playqueue_is_queued(DBusGProxy *proxy, guint pos)
Queries audacious about whether or not a playlist entry is in the playqueue.
EXPORT gint audacious_remote_get_main_volume(DBusGProxy *proxy)
Queries audacious about the current volume.
EXPORT void audacious_remote_playqueue_clear(DBusGProxy *proxy)
audacious_remote_playqueue_clear:
static gboolean org_atheme_audacious_show_main_win(DBusGProxy *proxy, const gboolean IN_show, GError **error)
static gboolean org_atheme_audacious_shuffle(DBusGProxy *proxy, gboolean *OUT_is_shuffle, GError **error)
EXPORT gboolean audacious_remote_is_shuffle(DBusGProxy *proxy)
Queries audacious about whether or not the shuffle feature is active.
static gboolean org_atheme_audacious_song_title(DBusGProxy *proxy, const guint IN_pos, char **OUT_title, GError **error)
static gboolean org_atheme_audacious_get_eq(DBusGProxy *proxy, gdouble *OUT_preamp, GArray **OUT_bands, GError **error)
EXPORT void audacious_remote_set_eq_preamp(DBusGProxy *proxy, gdouble preamp)
Tells audacious to set the equalizer's preamp setting.
EXPORT void audacious_remote_toggle_prefs_box(DBusGProxy *proxy, gboolean show)
Tells audacious to show/hide the preferences pane.
static gboolean org_atheme_audacious_info(DBusGProxy *proxy, gint *OUT_rate, gint *OUT_freq, gint *OUT_nch, GError **error)
EXPORT void audacious_remote_toggle_advance(DBusGProxy *proxy)
Tells audacious to toggle the no-playlist-advance feature.
static gboolean org_atheme_audacious_show_about_box(DBusGProxy *proxy, const gboolean IN_show, GError **error)
static gboolean org_atheme_audacious_set_volume(DBusGProxy *proxy, const gint IN_vl, const gint IN_vr, GError **error)
EXPORT void audacious_remote_toggle_shuffle(DBusGProxy *proxy)
Tells audacious to toggle the shuffle feature.
EXPORT void audacious_remote_set_main_volume(DBusGProxy *proxy, gint v)
Sets the volume in Audacious.
static gboolean org_atheme_audacious_open_list(DBusGProxy *proxy, const char **IN_filenames, GError **error)
EXPORT void audacious_remote_set_volume(DBusGProxy *proxy, gint vl, gint vr)
Sets the volume for the left and right channels in Audacious.
static gboolean org_atheme_audacious_reverse(DBusGProxy *proxy, GError **error)
EXPORT void audacious_remote_jump_to_time(DBusGProxy *proxy, guint pos)
audacious_remote_jump_to_time:
EXPORT void audacious_remote_toggle_filebrowser(DBusGProxy *proxy, gboolean show)
Tells audacious to show the filebrowser dialog.
EXPORT void audacious_remote_playqueue_add(DBusGProxy *proxy, guint pos)
Tells audacious to add a playlist entry to the playqueue.
EXPORT gchar * audacious_remote_get_version(DBusGProxy *proxy)
Queries Audacious for its version identifier.
static gboolean org_atheme_audacious_repeat(DBusGProxy *proxy, gboolean *OUT_is_repeat, GError **error)
EXPORT void audacious_remote_toggle_jtf_box(DBusGProxy *proxy, gboolean show)
Tells audacious to show/hide the Jump-to-File pane.
static gboolean org_atheme_audacious_add_url(DBusGProxy *proxy, const char *IN_url, GError **error)
EXPORT void audacious_remote_play_pause(DBusGProxy *proxy)
Tells audacious to toggle between play and pause.
EXPORT void audacious_remote_get_info(DBusGProxy *proxy, gint *rate, gint *freq, gint *nch)
Queries Audacious about the current audio format.
static gboolean org_atheme_audacious_time(DBusGProxy *proxy, guint *OUT_time, GError **error)
EXPORT void audacious_remote_show_jtf_box(DBusGProxy *proxy)
Tells audacious to show the Jump-to-File pane.
static gboolean org_atheme_audacious_get_eq_preamp(DBusGProxy *proxy, gdouble *OUT_preamp, GError **error)
static gboolean org_atheme_audacious_song_frames(DBusGProxy *proxy, const guint IN_pos, gint *OUT_length, GError **error)
EXPORT void audacious_remote_playlist_ins_url_string(DBusGProxy *proxy, gchar *string, guint pos)
Tells audacious to add an URI to the playlist at a specific position.