ALT Linux Bugzilla
– Attachment 1269 Details for
Bug 8576
[FR] add queue control patch for better imms
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
http://www.luminal.org/files/imms/xmms-queue-control.diff
xmms-queue-control.diff (text/plain), 4.82 KB, created by
Michael Shigorin
on 2005-11-30 10:11:47 MSK
(
hide
)
Description:
http://www.luminal.org/files/imms/xmms-queue-control.diff
Filename:
MIME Type:
Creator:
Michael Shigorin
Created:
2005-11-30 10:11:47 MSK
Size:
4.82 KB
patch
obsolete
>diff -ru xmms-1.2.10.orig/libxmms/xmmsctrl.c xmms-1.2.10/libxmms/xmmsctrl.c >--- xmms-1.2.10.orig/libxmms/xmmsctrl.c Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/libxmms/xmmsctrl.c Thu Aug 19 10:56:24 2004 >@@ -412,6 +412,21 @@ > remote_cmd(session, CMD_PLAYLIST_CLEAR); > } > >+void xmms_remote_playqueue_add(gint session, gint pos) >+{ >+ remote_send_guint32(session, CMD_PLAYQUEUE_ADD, pos); >+} >+ >+void xmms_remote_playqueue_remove(gint session, gint pos) >+{ >+ remote_send_guint32(session, CMD_PLAYQUEUE_REMOVE, pos); >+} >+ >+gint xmms_remote_get_playqueue_length(gint session) >+{ >+ return remote_get_gint(session, CMD_GET_PLAYQUEUE_LENGTH); >+} >+ > gint xmms_remote_get_output_time(gint session) > { > return remote_get_gint(session, CMD_GET_OUTPUT_TIME); >diff -ru xmms-1.2.10.orig/libxmms/xmmsctrl.h xmms-1.2.10/libxmms/xmmsctrl.h >--- xmms-1.2.10.orig/libxmms/xmmsctrl.h Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/libxmms/xmmsctrl.h Thu Aug 19 10:56:24 2004 >@@ -82,6 +82,10 @@ > /* Added in XMMS 1.2.6 */ > void xmms_remote_play_pause(gint session); > void xmms_remote_playlist_ins_url_string(gint session, gchar * string, gint pos); >+/* Added in XMMS 1.2.11 */ >+void xmms_remote_playqueue_add(gint session, gint pos); >+void xmms_remote_playqueue_remove(gint session, gint pos); >+gint xmms_remote_get_playqueue_length(gint session); > > > #ifdef __cplusplus >diff -ru xmms-1.2.10.orig/xmms/controlsocket.c xmms-1.2.10/xmms/controlsocket.c >--- xmms-1.2.10.orig/xmms/controlsocket.c Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/xmms/controlsocket.c Thu Aug 19 10:56:24 2004 >@@ -441,6 +441,10 @@ > ctrl_write_gfloat(pkt->fd, equalizerwin_get_band(i)); > ctrl_ack_packet(pkt); > break; >+ case CMD_GET_PLAYQUEUE_LENGTH: >+ ctrl_write_gint(pkt->fd, get_playlist_queue_length()); >+ ctrl_ack_packet(pkt); >+ break; > default: > pthread_mutex_lock(&packet_list_mutex); > packet_list = g_list_append(packet_list, pkt); >@@ -583,6 +587,16 @@ > */ > pthread_mutex_unlock(&packet_list_mutex); > mainwin_quit_cb(); >+ break; >+ case CMD_PLAYQUEUE_ADD: >+ num = *((guint32 *) data); >+ if (num < get_playlist_length()) >+ playlist_queue_position(num); >+ break; >+ case CMD_PLAYQUEUE_REMOVE: >+ num = *((guint32 *) data); >+ if (num < get_playlist_length()) >+ playlist_queue_remove(num); > break; > default: > g_log(NULL, G_LOG_LEVEL_MESSAGE, "Unknown socket command received"); >diff -ru xmms-1.2.10.orig/xmms/controlsocket.h xmms-1.2.10/xmms/controlsocket.h >--- xmms-1.2.10.orig/xmms/controlsocket.h Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/xmms/controlsocket.h Thu Aug 19 10:56:24 2004 >@@ -46,6 +46,7 @@ > CMD_GET_EQ, CMD_GET_EQ_PREAMP, CMD_GET_EQ_BAND, > CMD_SET_EQ, CMD_SET_EQ_PREAMP, CMD_SET_EQ_BAND, > CMD_QUIT, CMD_PLAYLIST_INS_URL_STRING, CMD_PLAYLIST_INS, CMD_PLAY_PAUSE, >+ CMD_PLAYQUEUE_ADD, CMD_GET_PLAYQUEUE_LENGTH, CMD_PLAYQUEUE_REMOVE > }; > > typedef struct >diff -ru xmms-1.2.10.orig/xmms/playlist.c xmms-1.2.10/xmms/playlist.c >--- xmms-1.2.10.orig/xmms/playlist.c Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/xmms/playlist.c Thu Aug 19 11:00:07 2004 >@@ -100,6 +100,12 @@ > playlist_position = NULL; > } > >+ if (queued_list) >+ { >+ g_list_free(queued_list); >+ queued_list = NULL; >+ } >+ > pthread_mutex_unlock(&playlist_mutex); > playlist_generate_shuffle_list(); > playlistwin_update_list(); >@@ -769,6 +775,16 @@ > queued_list = g_list_append(queued_list, data); > } > >+gint get_playlist_queue_length() >+{ >+ gint qlength; >+ >+ PL_LOCK(); >+ qlength = g_list_length(queued_list); >+ PL_UNLOCK(); >+ >+ return qlength; >+} > > void playlist_queue_selected(void) > { >@@ -823,6 +839,18 @@ > > playlistwin_update_list(); > } >+ >+void playlist_queue_remove(int pos) >+{ >+ void *entry; >+ >+ PL_LOCK(); >+ entry = g_list_nth_data(playlist, pos); >+ queued_list = g_list_remove(queued_list, entry); >+ PL_UNLOCK(); >+ >+ playlistwin_update_list(); >+} > > int playlist_get_queue_position(PlaylistEntry *entry) > { >@@ -900,7 +928,7 @@ > if (cfg.shuffle) > { > playlist_position = NULL; >- __playlist_generate_shuffle_list(); >+ __playlist_generate_shuffle_list(); > } > else > playlist_position = playlist->data; >diff -ru xmms-1.2.10.orig/xmms/playlist.h xmms-1.2.10/xmms/playlist.h >--- xmms-1.2.10.orig/xmms/playlist.h Thu Aug 19 10:42:33 2004 >+++ xmms-1.2.10/xmms/playlist.h Thu Aug 19 10:56:24 2004 >@@ -22,10 +22,10 @@ > > typedef struct > { >- gchar *filename; >- gchar *title; >- gint length; >- gboolean selected; >+ gchar *filename; >+ gchar *title; >+ gint length; >+ gboolean selected; > } > PlaylistEntry; > >@@ -48,7 +48,9 @@ > void playlist_queue_selected(void); > void playlist_queue_position(gint pos); > gboolean playlist_is_position_queued(int pos); >+gint get_playlist_queue_length(); > void playlist_clear_queue(void); >+void playlist_queue_remove(int pos); > int playlist_get_queue_position(PlaylistEntry *entry); > void playlist_eof_reached(void); > void playlist_set_position(gint pos);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 8576
: 1269 |
1721