View | Details | Raw Unified | Return to bug 8576
Collapse All | Expand All

(-)xmms-1.2.10.orig/libxmms/xmmsctrl.c (+15 lines)
Lines 412-417 Link Here
412
	remote_cmd(session, CMD_PLAYLIST_CLEAR);
412
	remote_cmd(session, CMD_PLAYLIST_CLEAR);
413
}
413
}
414
414
415
void xmms_remote_playqueue_add(gint session, gint pos)
416
{
417
	remote_send_guint32(session, CMD_PLAYQUEUE_ADD, pos);
418
}
419
420
void xmms_remote_playqueue_remove(gint session, gint pos)
421
{
422
	remote_send_guint32(session, CMD_PLAYQUEUE_REMOVE, pos);
423
}
424
425
gint xmms_remote_get_playqueue_length(gint session)
426
{
427
	return remote_get_gint(session, CMD_GET_PLAYQUEUE_LENGTH);
428
}
429
415
gint xmms_remote_get_output_time(gint session)
430
gint xmms_remote_get_output_time(gint session)
416
{
431
{
417
	return remote_get_gint(session, CMD_GET_OUTPUT_TIME);
432
	return remote_get_gint(session, CMD_GET_OUTPUT_TIME);
(-)xmms-1.2.10.orig/libxmms/xmmsctrl.h (+4 lines)
Lines 82-87 Link Here
82
/* Added in XMMS 1.2.6 */
82
/* Added in XMMS 1.2.6 */
83
void xmms_remote_play_pause(gint session);
83
void xmms_remote_play_pause(gint session);
84
void xmms_remote_playlist_ins_url_string(gint session, gchar * string, gint pos);
84
void xmms_remote_playlist_ins_url_string(gint session, gchar * string, gint pos);
85
/* Added in XMMS 1.2.11 */
86
void xmms_remote_playqueue_add(gint session, gint pos);
87
void xmms_remote_playqueue_remove(gint session, gint pos);
88
gint xmms_remote_get_playqueue_length(gint session);
85
89
86
	
90
	
87
#ifdef __cplusplus
91
#ifdef __cplusplus
(-)xmms-1.2.10.orig/xmms/controlsocket.c (+14 lines)
Lines 441-446 Link Here
441
				ctrl_write_gfloat(pkt->fd, equalizerwin_get_band(i));
441
				ctrl_write_gfloat(pkt->fd, equalizerwin_get_band(i));
442
				ctrl_ack_packet(pkt);
442
				ctrl_ack_packet(pkt);
443
				break;
443
				break;
444
			case CMD_GET_PLAYQUEUE_LENGTH:
445
				ctrl_write_gint(pkt->fd, get_playlist_queue_length());
446
				ctrl_ack_packet(pkt);
447
				break;
444
			default:
448
			default:
445
				pthread_mutex_lock(&packet_list_mutex);
449
				pthread_mutex_lock(&packet_list_mutex);
446
				packet_list = g_list_append(packet_list, pkt);
450
				packet_list = g_list_append(packet_list, pkt);
Lines 583-588 Link Here
583
				 */
587
				 */
584
				pthread_mutex_unlock(&packet_list_mutex);
588
				pthread_mutex_unlock(&packet_list_mutex);
585
				mainwin_quit_cb();
589
				mainwin_quit_cb();
590
				break;
591
			case CMD_PLAYQUEUE_ADD:
592
				num = *((guint32 *) data);
593
				if (num < get_playlist_length())
594
					playlist_queue_position(num);
595
				break;
596
			case CMD_PLAYQUEUE_REMOVE:
597
				num = *((guint32 *) data);
598
				if (num < get_playlist_length())
599
					playlist_queue_remove(num);
586
				break;
600
				break;
587
			default:
601
			default:
588
				g_log(NULL, G_LOG_LEVEL_MESSAGE, "Unknown socket command received");
602
				g_log(NULL, G_LOG_LEVEL_MESSAGE, "Unknown socket command received");
(-)xmms-1.2.10.orig/xmms/controlsocket.h (+1 lines)
Lines 46-51 Link Here
46
	CMD_GET_EQ, CMD_GET_EQ_PREAMP, CMD_GET_EQ_BAND,
46
	CMD_GET_EQ, CMD_GET_EQ_PREAMP, CMD_GET_EQ_BAND,
47
	CMD_SET_EQ, CMD_SET_EQ_PREAMP, CMD_SET_EQ_BAND,
47
	CMD_SET_EQ, CMD_SET_EQ_PREAMP, CMD_SET_EQ_BAND,
48
	CMD_QUIT, CMD_PLAYLIST_INS_URL_STRING, CMD_PLAYLIST_INS, CMD_PLAY_PAUSE,
48
	CMD_QUIT, CMD_PLAYLIST_INS_URL_STRING, CMD_PLAYLIST_INS, CMD_PLAY_PAUSE,
49
	CMD_PLAYQUEUE_ADD, CMD_GET_PLAYQUEUE_LENGTH, CMD_PLAYQUEUE_REMOVE
49
};
50
};
50
51
51
typedef struct
52
typedef struct
(-)xmms-1.2.10.orig/xmms/playlist.c (-1 / +29 lines)
Lines 100-105 Link Here
100
		playlist_position = NULL;
100
		playlist_position = NULL;
101
	}
101
	}
102
102
103
	if (queued_list)
104
	{
105
		g_list_free(queued_list);
106
		queued_list = NULL;
107
	}
108
103
	pthread_mutex_unlock(&playlist_mutex);
109
	pthread_mutex_unlock(&playlist_mutex);
104
	playlist_generate_shuffle_list();
110
	playlist_generate_shuffle_list();
105
	playlistwin_update_list();
111
	playlistwin_update_list();
Lines 769-774 Link Here
769
		queued_list = g_list_append(queued_list, data);
775
		queued_list = g_list_append(queued_list, data);
770
}
776
}
771
777
778
gint get_playlist_queue_length()
779
{
780
	gint qlength;
781
782
	PL_LOCK();
783
	qlength = g_list_length(queued_list);
784
	PL_UNLOCK();
785
786
	return qlength;
787
}
772
788
773
void playlist_queue_selected(void)
789
void playlist_queue_selected(void)
774
{
790
{
Lines 823-828 Link Here
823
 
839
 
824
	playlistwin_update_list();
840
	playlistwin_update_list();
825
}
841
}
842
843
void playlist_queue_remove(int pos)
844
{
845
	void *entry;
846
847
	PL_LOCK();
848
	entry = g_list_nth_data(playlist, pos);
849
	queued_list = g_list_remove(queued_list, entry);
850
	PL_UNLOCK();
851
852
	playlistwin_update_list();
853
}
826
 
854
 
827
int playlist_get_queue_position(PlaylistEntry *entry)
855
int playlist_get_queue_position(PlaylistEntry *entry)
828
{
856
{
Lines 900-906 Link Here
900
		if (cfg.shuffle)
928
		if (cfg.shuffle)
901
		{
929
		{
902
			playlist_position = NULL;
930
			playlist_position = NULL;
903
  			__playlist_generate_shuffle_list();
931
			__playlist_generate_shuffle_list();
904
		}
932
		}
905
		else
933
		else
906
			playlist_position = playlist->data;
934
			playlist_position = playlist->data;
(-)xmms-1.2.10.orig/xmms/playlist.h (-4 / +6 lines)
Lines 22-31 Link Here
22
22
23
typedef struct
23
typedef struct
24
{
24
{
25
	gchar *filename;
25
        gchar *filename;
26
	gchar *title;
26
        gchar *title;
27
	gint length;
27
        gint length;
28
	gboolean selected;
28
        gboolean selected;
29
}
29
}
30
PlaylistEntry;
30
PlaylistEntry;
31
31
Lines 48-54 Link Here
48
void playlist_queue_selected(void);
48
void playlist_queue_selected(void);
49
void playlist_queue_position(gint pos);
49
void playlist_queue_position(gint pos);
50
gboolean playlist_is_position_queued(int pos);
50
gboolean playlist_is_position_queued(int pos);
51
gint get_playlist_queue_length();
51
void playlist_clear_queue(void);
52
void playlist_clear_queue(void);
53
void playlist_queue_remove(int pos);
52
int playlist_get_queue_position(PlaylistEntry *entry);
54
int playlist_get_queue_position(PlaylistEntry *entry);
53
void playlist_eof_reached(void);
55
void playlist_eof_reached(void);
54
void playlist_set_position(gint pos);
56
void playlist_set_position(gint pos);

Return to bug 8576