annotate src/audacious/auddrct.c @ 2785:182aa34ae6c4 trunk

[svn] - implement some audacious-remote functions. - implement some audacious-drct functions. - make some command line options work. (this may incur very slow startup.) - suppress warnings.
author yaz
date Tue, 22 May 2007 15:17:15 -0700
parents 7adb736cb824
children 2d915b3e3e52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
1 /*
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
2 * Audacious: A cross-platform multimedia player
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
3 * Copyright (c) 2007 Giacomo Lozito
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
4 *
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
7 * the Free Software Foundation; under version 2 of the License.
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
8 *
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
12 * GNU General Public License for more details.
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
13 *
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
17 * 02110-1301, USA.
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
18 */
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
19
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
20 /* audacious_drct_* provides a handy interface for player
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
21 plugins, originally intended for migration from xmms_remote_* calls */
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
22
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
23
2743
2e86136729f1 [svn] - auddrct: more calls implemented (part 2)
giacomo
parents: 2742
diff changeset
24 #include "main.h"
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
25 #include "input.h"
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
26 #include "playback.h"
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
27 #include "ui_main.h"
2743
2e86136729f1 [svn] - auddrct: more calls implemented (part 2)
giacomo
parents: 2742
diff changeset
28 #include "ui_playlist.h"
2e86136729f1 [svn] - auddrct: more calls implemented (part 2)
giacomo
parents: 2742
diff changeset
29 #include "ui_equalizer.h"
2745
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
30 #include "ui_jumptotrack.h"
2760
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
31 #include "auddrct.h"
2775
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
32 #include "playlist.h"
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
33
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
34
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
35 /* player */
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
36
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
37 void
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
38 audacious_drct_quit ( void )
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
39 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
40 mainwin_quit_cb();
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
41 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
42 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
43
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
44 void
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
45 audacious_drct_eject ( void )
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
46 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
47 if (has_x11_connection)
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
48 mainwin_eject_pushed();
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
49 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
50 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
51
2745
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
52 void
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
53 audacious_drct_jtf_show ( void )
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
54 {
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
55 if (has_x11_connection)
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
56 ui_jump_to_track();
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
57 return;
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
58 }
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
59
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
60 gboolean
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
61 audacious_drct_main_win_is_visible ( void )
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
62 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
63 return cfg.player_visible;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
64 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
65
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
66 void
2744
8ab4ef180201 [svn] - auddrct: more calls implemented (part 3)
giacomo
parents: 2743
diff changeset
67 audacious_drct_main_win_toggle ( gboolean show )
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
68 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
69 if (has_x11_connection)
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
70 mainwin_show(show);
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
71 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
72 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
73
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
74 gboolean
2744
8ab4ef180201 [svn] - auddrct: more calls implemented (part 3)
giacomo
parents: 2743
diff changeset
75 audacious_drct_eq_win_is_visible ( void )
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
76 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
77 return cfg.equalizer_visible;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
78 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
79
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
80 void
2744
8ab4ef180201 [svn] - auddrct: more calls implemented (part 3)
giacomo
parents: 2743
diff changeset
81 audacious_drct_eq_win_toggle ( gboolean show )
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
82 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
83 if (has_x11_connection)
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
84 equalizerwin_show(show);
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
85 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
86 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
87
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
88 gboolean
2744
8ab4ef180201 [svn] - auddrct: more calls implemented (part 3)
giacomo
parents: 2743
diff changeset
89 audacious_drct_pl_win_is_visible ( void )
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
90 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
91 return cfg.playlist_visible;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
92 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
93
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
94 void
2744
8ab4ef180201 [svn] - auddrct: more calls implemented (part 3)
giacomo
parents: 2743
diff changeset
95 audacious_drct_pl_win_toggle ( gboolean show )
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
96 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
97 if (has_x11_connection) {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
98 if (show)
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
99 playlistwin_show();
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
100 else
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
101 playlistwin_hide();
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
102 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
103 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
104 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
105
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
106 void audacious_drct_set_skin(gchar *skinfile)
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
107 {
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
108 if (has_x11_connection)
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
109 bmp_active_skin_load(skinfile);
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
110 }
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
111
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
112 void audacious_drct_show_jtf_box(void)
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
113 {
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
114 if (!has_x11_connection)
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
115 return;
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
116 ui_jump_to_track();
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
117 }
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
118
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
119 void audacious_drct_activate(void)
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
120 {
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
121 gtk_window_present(GTK_WINDOW(mainwin));
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
122 }
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
123
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
124 /* playback */
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
125
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
126 void
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
127 audacious_drct_play ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
128 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
129 if (playback_get_paused())
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
130 playback_pause();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
131 else if (playlist_get_length(playlist_get_active()))
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
132 playback_initiate();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
133 else
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
134 mainwin_eject_pushed();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
135 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
136 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
137
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
138 void
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
139 audacious_drct_pause ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
140 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
141 playback_pause();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
142 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
143 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
144
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
145 void
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
146 audacious_drct_stop ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
147 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
148 ip_data.stop = TRUE;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
149 playback_stop();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
150 ip_data.stop = FALSE;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
151 mainwin_clear_song_info();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
152 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
153 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
154
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
155 gboolean
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
156 audacious_drct_get_playing ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
157 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
158 return playback_get_playing();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
159 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
160
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
161 gboolean
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
162 audacious_drct_get_paused ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
163 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
164 return playback_get_paused();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
165 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
166
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
167 gboolean
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
168 audacious_drct_get_stopped ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
169 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
170 return !playback_get_playing();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
171 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
172
2748
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
173 void
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
174 audacious_drct_get_info( gint *rate, gint *freq, gint *nch)
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
175 {
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
176 playback_get_sample_params(rate, freq, nch);
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
177 }
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
178
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
179 gint
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
180 audacious_drct_get_time ( void )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
181 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
182 gint time;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
183 if (playback_get_playing())
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
184 time = playback_get_time();
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
185 else
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
186 time = 0;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
187 return time;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
188 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
189
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
190 void
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
191 audacious_drct_seek ( guint pos )
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
192 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
193 if (playlist_get_current_length(playlist_get_active()) > 0 &&
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
194 pos < (guint)playlist_get_current_length(playlist_get_active()))
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
195 playback_seek(pos / 1000);
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
196 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
197 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
198
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
199 void
2760
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
200 audacious_drct_get_volume ( gint *vl, gint *vr )
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
201 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
202 input_get_volume(vl, vr);
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
203 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
204 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
205
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
206 void
2760
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
207 audacious_drct_set_volume ( gint vl, gint vr )
2739
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
208 {
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
209 if (vl > 100)
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
210 vl = 100;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
211 if (vr > 100)
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
212 vr = 100;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
213 input_set_volume(vl, vr);
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
214 return;
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
215 }
953001c668ae [svn] - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed
giacomo
parents:
diff changeset
216
2760
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
217 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
218 audacious_drct_get_volume_main( gint *v )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
219 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
220 gint vl, vr;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
221 audacious_drct_get_volume(&vl, &vr);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
222 *v = (vl > vr) ? vl : vr;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
223 return;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
224 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
225
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
226 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
227 audacious_drct_set_volume_main ( gint v )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
228 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
229 gint b, vl, vr;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
230 audacious_drct_get_volume_balance(&b);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
231 if (b < 0) {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
232 vl = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
233 vr = (v * (100 - abs(b))) / 100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
234 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
235 else if (b > 0) {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
236 vl = (v * (100 - b)) / 100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
237 vr = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
238 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
239 else
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
240 vl = vr = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
241 audacious_drct_set_volume(vl, vr);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
242 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
243
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
244 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
245 audacious_drct_get_volume_balance ( gint *b )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
246 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
247 gint vl, vr;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
248 input_get_volume(&vl, &vr);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
249 if (vl < 0 || vr < 0)
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
250 *b = 0;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
251 else if (vl > vr)
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
252 *b = -100 + ((vr * 100) / vl);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
253 else if (vr > vl)
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
254 *b = 100 - ((vl * 100) / vr);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
255 else
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
256 *b = 0;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
257 return;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
258 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
259
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
260 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
261 audacious_drct_set_volume_balance ( gint b )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
262 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
263 gint v, vl, vr;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
264 if (b < -100)
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
265 b = -100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
266 if (b > 100)
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
267 b = 100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
268 audacious_drct_get_volume_main(&v);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
269 if (b < 0) {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
270 vl = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
271 vr = (v * (100 - abs(b))) / 100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
272 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
273 else if (b > 0) {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
274 vl = (v * (100 - b)) / 100;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
275 vr = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
276 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
277 else
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
278 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
279 vl = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
280 vr = v;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
281 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
282 audacious_drct_set_volume(vl, vr);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
283 return;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
284 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
285
2742
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
286
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
287 /* playlist */
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
288
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
289 void
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
290 audacious_drct_pl_next ( void )
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
291 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
292 playlist_next(playlist_get_active());
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
293 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
294 }
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
295
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
296 void
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
297 audacious_drct_pl_prev ( void )
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
298 {
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
299 playlist_prev(playlist_get_active());
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
300 return;
1333d28e2c50 [svn] - auddrct: more calls implemented
giacomo
parents: 2739
diff changeset
301 }
2745
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
302
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
303 gboolean
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
304 audacious_drct_pl_repeat_is_enabled( void )
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
305 {
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
306 return cfg.repeat;
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
307 }
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
308
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
309 void
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
310 audacious_drct_pl_repeat_toggle( void )
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
311 {
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
312 mainwin_repeat_pushed(!cfg.repeat);
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
313 return;
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
314 }
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
315
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
316 gboolean
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
317 audacious_drct_pl_repeat_is_shuffled( void )
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
318 {
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
319 return cfg.shuffle;
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
320 }
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
321
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
322 void
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
323 audacious_drct_pl_shuffle_toggle( void )
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
324 {
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
325 mainwin_shuffle_pushed(!cfg.shuffle);
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
326 return;
72781ef7ece3 [svn] - auddrct: more calls implemented (part 4)
giacomo
parents: 2744
diff changeset
327 }
2748
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
328
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
329 gchar *
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
330 audacious_drct_pl_get_title( gint pos )
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
331 {
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
332 return playlist_get_songtitle(playlist_get_active(), pos);
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
333 }
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
334
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
335 gint
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
336 audacious_drct_pl_get_time( gint pos )
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
337 {
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
338 return playlist_get_songtime(playlist_get_active(), pos);
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
339 }
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
340
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
341 gint
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
342 audacious_drct_pl_get_pos( void )
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
343 {
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
344 return playlist_get_position_nolock(playlist_get_active());
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
345 }
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
346
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
347 gchar *
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
348 audacious_drct_pl_get_file( gint pos )
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
349 {
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
350 return playlist_get_filename(playlist_get_active(), pos);
4f2fd69771dc [svn] - auddrct: more calls implemented (part 5)
yaz
parents: 2745
diff changeset
351 }
2760
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
352
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
353 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
354 audacious_drct_pl_add ( GList * list )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
355 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
356 GList *node = list;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
357 while ( node != NULL )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
358 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
359 playlist_add_url(playlist_get_active(), (gchar*)node->data);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
360 node = g_list_next(node);
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
361 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
362 return;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
363 }
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
364
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
365 void
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
366 audacious_drct_pl_clear ( void )
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
367 {
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
368 playlist_clear(playlist_get_active());
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
369 mainwin_clear_song_info();
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
370 mainwin_set_info_text();
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
371 return;
c2613269f913 [svn] - auddrct: more calls implemented (part 6)
giacomo
parents: 2748
diff changeset
372 }
2775
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
373
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
374
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
375 /* following functions are not tested yet. be careful. --yaz */
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
376 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
377 audacious_drct_pl_delete ( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
378 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
379 GDK_THREADS_ENTER();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
380 playlist_delete_index(playlist_get_active(), pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
381 GDK_THREADS_LEAVE();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
382 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
383
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
384 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
385 audacious_drct_pl_set_pos( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
386 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
387 Playlist *playlist = playlist_get_active();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
388 if (pos < (guint)playlist_get_length(playlist))
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
389 playlist_set_position(playlist, pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
390 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
391
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
392 gint
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
393 audacious_drct_pl_get_length( void )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
394 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
395 return playlist_get_length(playlist_get_active());
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
396 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
397
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
398 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
399 audacious_drct_pl_ins_url_string( gchar * string, gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
400 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
401 playlist_ins_url(playlist_get_active(), string, pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
402 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
403
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
404 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
405 audacious_drct_pl_add_url_string( gchar * string )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
406 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
407 GDK_THREADS_ENTER();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
408 playlist_add_url(playlist_get_active(), string);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
409 GDK_THREADS_LEAVE();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
410 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
411
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
412 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
413 audacious_drct_pl_enqueue_to_temp( gchar * string )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
414 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
415 Playlist *new_pl = playlist_new();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
416
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
417 GDK_THREADS_ENTER();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
418 playlist_select_playlist(new_pl);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
419 playlist_add_url(new_pl, string);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
420 GDK_THREADS_LEAVE();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
421 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
422
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
423
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
424 /* playqueue */
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
425 gint
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
426 audacious_drct_pq_get_length( void )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
427 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
428 return playlist_queue_get_length(playlist_get_active());
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
429 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
430
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
431 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
432 audacious_drct_pq_add( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
433 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
434 Playlist *playlist = playlist_get_active();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
435 if (pos < (guint)playlist_get_length(playlist))
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
436 playlist_queue_position(playlist, pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
437 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
438
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
439 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
440 audacious_drct_pq_remove( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
441 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
442 Playlist *playlist = playlist_get_active();
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
443 if (pos < (guint)playlist_get_length(playlist))
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
444 playlist_queue_remove(playlist_get_active(), pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
445 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
446
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
447 void
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
448 audacious_drct_pq_clear( void )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
449 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
450 playlist_clear_queue(playlist_get_active());
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
451 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
452
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
453 gboolean
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
454 audacious_drct_pq_is_queued( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
455 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
456 return playlist_is_position_queued(playlist_get_active(), pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
457 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
458
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
459 gint
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
460 audacious_drct_pq_get_position( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
461 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
462 return playlist_get_queue_position_number(playlist_get_active(), pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
463 }
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
464
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
465 gint
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
466 audaciuos_drct_pq_get_queue_position( gint pos )
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
467 {
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
468 return playlist_get_queue_position_number(playlist_get_active(), pos);
7adb736cb824 [svn] - auddrct: more calls implemented (part 7)
yaz
parents: 2760
diff changeset
469 }
2785
182aa34ae6c4 [svn] - implement some audacious-remote functions.
yaz
parents: 2775
diff changeset
470