Mercurial > audlegacy-plugins
annotate src/mplayer/xmmsmplayer.c @ 157:34b6f9d5633a trunk
[svn] - use xmms_show_message() here.
author | nenolod |
---|---|
date | Tue, 31 Oct 2006 12:45:32 -0800 |
parents | 33d24bd94ccc |
children | 81592119ee73 |
rev | line source |
---|---|
135
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
1 #include <gtk/gtk.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
2 #include <gdk/gdk.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
3 #include <gdk/gdkx.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
4 #include <glib.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
5 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
6 #include <stdlib.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
7 #include <string.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
8 #include <ctype.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
9 #include <pthread.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
10 #include <audacious/plugin.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
11 #include <audacious/beepctrl.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
12 #include <audacious/rcfile.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
13 #include <audacious/util.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
14 #include <unistd.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
15 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
16 #include <fcntl.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
17 #include <sys/stat.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
18 #include <sys/time.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
19 #include <sys/types.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
20 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
21 #include <stdio.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
22 #include <sys/wait.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
23 #include <X11/Xlib.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
24 #include <X11/Xutil.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
25 #include <X11/Xos.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
26 #include <X11/Xatom.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
27 #include <X11/keysym.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
28 #include <assert.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
29 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
30 #include <X11/Xmd.h> |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
31 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
32 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
33 #include "xmmsmplayer.h" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
34 static Atom XA_WIN_LAYER; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
35 static Atom XA_NET_WM_STATE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
36 static Atom XA_NET_WM_STATE_FULLSCREEN; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
37 static Atom XA_NET_WM_STATE_ABOVE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
38 static Atom XA_NET_WM_STATE_STAYS_ON_TOP; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
39 static Atom XA_NET_WM_STATE_BELOW; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
40 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
41 static Window mplayer_video = 0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
42 static gchar mplayer_wid[16]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
43 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
44 static int mplayer_pipe[2]; /* Control mplayer thru this pipe */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
45 static pthread_t mplayer_tid; /* Thread id */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
46 static gchar *mplayer_file=NULL; /* filename */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
47 static struct mplayer_info *mplayer_current_info=NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
48 static gint mplayer_current_time=0; /* to be returned to xmms */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
49 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
50 static char *mplayer_fifoname=NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
51 static InputPlugin *mplayer_ip=NULL; /* Information to be returned to xmms */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
52 static gint mplayer_playing=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
53 static struct mplayer_cfg *mplayer_current_cfg=NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
54 static Display *dis = NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
55 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
56 InputPlugin *get_iplugin_info(void){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
57 if(!mplayer_ip){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
58 mplayer_ip=(InputPlugin *) malloc(sizeof (InputPlugin)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
59 memset(mplayer_ip,0,sizeof (InputPlugin)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
60 mplayer_ip->description = strdup("MPlayer Plugin for Xmms"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
61 mplayer_ip->init = mplayer_init; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
62 mplayer_ip->is_our_file = mplayer_is_our_file; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
63 mplayer_ip->play_file = mplayer_play_file; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
64 mplayer_ip->stop = mplayer_stop; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
65 mplayer_ip->pause = mplayer_pause; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
66 mplayer_ip->seek = mplayer_seek; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
67 mplayer_ip->get_time = mplayer_get_time; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
68 mplayer_ip->get_song_info = mplayer_get_song_info; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
69 mplayer_ip->set_info = NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
70 mplayer_ip->cleanup = mplayer_cleanup; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
71 mplayer_ip->about = mplayer_about; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
72 mplayer_ip->configure = mplayer_configure; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
73 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
74 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
75 return mplayer_ip; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
76 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
77 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
78 void mplayer_init(){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
79 /*Add read configure!! */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
80 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
81 /*mplayer_playing=0;*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
82 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
83 int mplayer_is_our_file(char *filename){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
84 gchar *ext; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
85 ext = strrchr(filename, '.'); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
86 if (ext){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
87 if((!strcasecmp(ext, ".mpg")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
88 (!strcasecmp(ext, ".mpeg")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
89 (!strcasecmp(ext, ".divx")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
90 (!strcasecmp(ext, ".qt")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
91 (!strcasecmp(ext, ".mov")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
92 (!strcasecmp(ext, ".mp2")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
93 (!strcasecmp(ext, ".mpa")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
94 (!strcasecmp(ext, ".dat")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
95 (!strcasecmp(ext, ".rm")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
96 (!strcasecmp(ext, ".swf")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
97 (!strcasecmp(ext, ".wma")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
98 (!strcasecmp(ext, ".wmv")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
99 (!strcasecmp(ext, ".wmp")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
100 (!strcasecmp(ext, ".asf")) || |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
101 (!strcasecmp(ext, ".avi")) |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
102 ) return TRUE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
103 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
104 return FALSE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
105 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
106 void mplayer_play_file(char *filename){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
107 pthread_attr_t tattr; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
108 void *arg; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
109 int ret,pipe_ret; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
110 gchar temp[10]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
111 gchar *username; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
112 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
113 mplayer_debugf("debug-play-in\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
114 mplayer_file=filename; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
115 pipe_ret=pipe(mplayer_pipe); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
116 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
117 if(mplayer_current_info)g_free(mplayer_current_info); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
118 mplayer_current_info = mplayer_read_file_info(filename); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
119 mplayer_debugf("Setting info:\n%sTerm\n%i\n%i\n%i\n%i\n\n", |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
120 mplayer_current_info->caption, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
121 mplayer_current_info->length * 1000, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
122 mplayer_current_info->abr, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
123 mplayer_current_info->rate, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
124 mplayer_current_info->nch); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
125 mplayer_debugf("debug-play-fileinfo-done\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
126 /* usleep(100000);*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
127 mplayer_ip->set_info(mplayer_current_info->caption, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
128 mplayer_current_info->length * 1000, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
129 mplayer_current_info->abr, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
130 mplayer_current_info->rate, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
131 mplayer_current_info->nch); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
132 mplayer_debugf("debug-play-sent-info\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
133 mplayer_debugf("debug- reading configfile\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
134 if (mplayer_current_cfg){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
135 g_free(mplayer_current_cfg->extra); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
136 g_free(mplayer_current_cfg); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
137 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
138 mplayer_current_cfg=mplayer_read_cfg(); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
139 if(mplayer_current_cfg->onewin &&(!mplayer_video)){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
140 /* mplayer_video=gtk_window_new(GTK_WINDOW_DIALOG); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
141 gtk_widget_set_usize(GTK_WIDGET(mplayer_video), 320, 240); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
142 gtk_window_set_title(GTK_WINDOW(mplayer_video), "XMMS - MPlayer"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
143 gtk_signal_connect(GTK_OBJECT(mplayer_video), |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
144 "destroy", |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
145 GTK_SIGNAL_FUNC(mplayer_quitting_video), |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
146 NULL); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
147 gtk_widget_show(mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
148 sprintf(mplayer_wid,"%i",GDK_WINDOW_XWINDOW(mplayer_video->window)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
149 */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
150 if(!dis) dis = XOpenDisplay(NULL); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
151 assert(dis); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
152 XEvent report; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
153 int blackColor = BlackPixel(dis, DefaultScreen(dis)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
154 int whiteColor = WhitePixel(dis, DefaultScreen(dis)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
155 mplayer_video = XCreateSimpleWindow(dis, DefaultRootWindow(dis), 0, 0, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
156 320, 240, 0, blackColor, blackColor); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
157 XMapWindow(dis,mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
158 XFlush(dis); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
159 XSelectInput (dis, mplayer_video, KeyPressMask); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
160 sprintf(mplayer_wid,"%i",mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
161 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
162 if((!mplayer_current_cfg->onewin) &&(mplayer_video)){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
163 XDestroyWindow(dis,mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
164 mplayer_video=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
165 mplayer_wid[0]='\0'; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
166 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
167 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
168 if(!mplayer_fifoname){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
169 username = getenv("LOGNAME"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
170 if(!username)username = getenv("USERNAME"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
171 if(!username)username = getenv("USER"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
172 sprintf(temp,"%i",getpid()); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
173 if (!username)mplayer_fifoname=g_strconcat("/tmp/xmmsmplayer-",temp,(char*)0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
174 else mplayer_fifoname=g_strconcat("/tmp/xmmsmplayer-",username,"-",temp,(char*)0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
175 mkfifo(mplayer_fifoname,0600); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
176 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
177 mplayer_ip->output->open_audio(FMT_S16_LE, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
178 mplayer_current_info->rate, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
179 mplayer_current_info->nch); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
180 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
181 mplayer_debugf("debug- read configfile\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
182 if (mplayer_playing==1) mplayer_debugf("Duplicate call!! -- Panic \n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
183 else mplayer_playing=1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
184 mplayer_debugf("debug-play-creating-thread\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
185 ret = pthread_create(&mplayer_tid, NULL, mplayer_play_loop, arg); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
186 mplayer_debugf("debug-play-out\n\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
187 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
188 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
189 void mplayer_stop(){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
190 int ret; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
191 if (mplayer_playing==0) mplayer_debugf("Confusion: Restopped!\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
192 else { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
193 mplayer_playing=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
194 if(mplayer_current_cfg->xmmsaudio)mplayer_ip->output->close_audio(); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
195 if (write(mplayer_pipe[1],"quit\n",5)==5){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
196 mplayer_debugf("debug-stop-if\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
197 }; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
198 mplayer_debugf("debug-stop\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
199 ret = pthread_join(mplayer_tid, NULL); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
200 mplayer_debugf("debug-stop\n\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
201 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
202 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
203 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
204 void mplayer_cleanup(){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
205 if (mplayer_playing) mplayer_stop(); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
206 if (mplayer_fifoname){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
207 remove(mplayer_fifoname); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
208 g_free(mplayer_fifoname); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
209 mplayer_fifoname=NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
210 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
211 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
212 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
213 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
214 void mplayer_pause(short p){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
215 write(mplayer_pipe[1],"pause\n",6); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
216 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
217 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
218 void mplayer_seek(int t){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
219 char buff[16]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
220 if(mplayer_playing){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
221 sprintf(buff,"seek %i\n",(t - mplayer_current_time)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
222 write(mplayer_pipe[1],buff,strlen(buff)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
223 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
224 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
225 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
226 gint mplayer_get_time(){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
227 return (mplayer_current_time*1000) ; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
228 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
229 void mplayer_get_song_info(char * filename, char ** title, int * length){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
230 struct mplayer_info *info; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
231 char *temp,*name; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
232 info = mplayer_read_file_info(filename); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
233 *title = g_strdup(info->caption); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
234 *length = (info->length * 1000); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
235 g_free(info); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
236 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
237 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
238 void *mplayer_play_loop(void *arg){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
239 char buff[35]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
240 int mplayer_slave_pid; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
241 int i,read_length,playtime,one_read; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
242 int mplayer_status_pipe[2]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
243 int mplayer_error_stream; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
244 int mplayer_fifo_fd; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
245 int pipe_ret; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
246 char **params; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
247 char audio_buff[MPLAYER_AUDIO_SIZE]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
248 int audio_buff_read; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
249 gboolean audio_flag, status_flag; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
250 struct timespec nanotime; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
251 nanotime.tv_sec=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
252 nanotime.tv_nsec=1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
253 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
254 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
255 pipe_ret=pipe(mplayer_status_pipe); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
256 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
257 if ((mplayer_slave_pid=vfork())==0){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
258 //close(mplayer_pipe[1]); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
259 mplayer_debugf("debug Pre-exec!\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
260 mplayer_error_stream=open("/dev/null",0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
261 mplayer_debugf("debug Making vector\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
262 params=mplayer_make_vector(); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
263 mplayer_debugf("debug Made vector\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
264 close(0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
265 close(1); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
266 close(2); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
267 if(dup2(mplayer_pipe[0],0)!=0) mplayer_debugf("duplication error\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
268 if(dup2(mplayer_status_pipe[1],1)!=0) mplayer_debugf("duplication error\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
269 if(dup2(mplayer_error_stream,2)!=0) mplayer_debugf("duplication error\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
270 /*i=execlp("mplayer","mplayer","-vo","x11","-zoom","-sws","2","-framedrop","-slave","-wid",mplayer_wid,mplayer_file,(char *)0);*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
271 i=execvp("mplayer",params); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
272 mplayer_debugf("Fatal Error: Couldnt start MPlayer! exec returned %i\n",i); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
273 _exit(-1); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
274 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
275 else{ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
276 close(mplayer_status_pipe[1]); /* EXTREMELY IMPORTANT, a little tricky! */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
277 close(mplayer_pipe[0]); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
278 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
279 mplayer_debugf("debug - Opening fifo...\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
280 mplayer_fifo_fd=open(mplayer_fifoname,O_RDONLY); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
281 mplayer_debugf("debug - Opened fifo\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
282 fcntl(mplayer_status_pipe[0],F_SETFL,O_NDELAY); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
283 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
284 audio_buff_read=-1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
285 read_length=-1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
286 one_read=-1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
287 while((wait3((union wait *)0,WNOHANG,(struct rusage *)0)!=mplayer_slave_pid)&&(mplayer_playing==1)){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
288 audio_flag=FALSE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
289 status_flag=FALSE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
290 /* Window event code here */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
291 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
292 // do{ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
293 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
294 /* mplayer_debugf("debug - reading fifo...\n");*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
295 audio_buff_read=read(mplayer_fifo_fd,audio_buff,MPLAYER_AUDIO_SIZE); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
296 if (audio_buff_read==0) break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
297 if (audio_buff_read>0){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
298 mplayer_ip->output->write_audio(audio_buff,audio_buff_read); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
299 /*mplayer_ip->add_vis_pcm();*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
300 audio_flag=TRUE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
301 mplayer_debugf(" %i ",audio_buff_read); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
302 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
303 //} |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
304 //while(audio_buff_read>0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
305 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
306 do{ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
307 if(mplayer_current_cfg->onewin ){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
308 XEvent report; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
309 if(XCheckWindowEvent(dis,mplayer_video,KeyPressMask, &report)){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
310 if (XLookupKeysym(&report.xkey, 0) == XK_f){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
311 fprintf (stdout, "The f was pressed.\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
312 XMoveResizeWindow(dis,mplayer_video,0,0,1280,1024); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
313 XMapRaised(dis,mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
314 XRaiseWindow(dis,mplayer_video); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
315 XSetTransientForHint(dis,mplayer_video, RootWindow(dis,0)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
316 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
317 XClientMessageEvent xev; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
318 char *state; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
319 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
320 memset( &xev,0,sizeof( xev ) ); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
321 xev.type=ClientMessage; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
322 xev.message_type=XA_WIN_LAYER; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
323 xev.display=dis; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
324 xev.window=mplayer_video; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
325 xev.format=32; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
326 xev.data.l[0]=10; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
327 xev.data.l[1]=CurrentTime; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
328 XSendEvent( dis,RootWindow( dis,0),False,SubstructureRedirectMask,(XEvent*)&xev ); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
329 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
330 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
331 fprintf(stdout,"Cleared 1\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
332 XSetWindowAttributes attr; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
333 attr.override_redirect = True; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
334 XChangeWindowAttributes(dis,mplayer_video, CWOverrideRedirect, &attr); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
335 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
336 XFlush(dis); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
337 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
338 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
339 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
340 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
341 one_read= read(mplayer_status_pipe[0],buff+read_length,1); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
342 if (one_read==0) break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
343 if (one_read > 0) { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
344 status_flag=TRUE; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
345 if ((buff[read_length]==(char)13)||(buff[read_length]==(char)10)) read_length=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
346 if (read_length < 32 ) read_length++; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
347 if (read_length >= 16){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
348 sscanf(buff+3,"%i",&playtime); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
349 mplayer_current_time=playtime; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
350 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
351 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
352 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
353 while (one_read>0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
354 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
355 /* |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
356 audio_buff_read=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
357 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
358 mplayer_debugf("debug - reading fifo...\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
359 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
360 audio_buff_read=read(mplayer_fifo_fd,audio_buff,MPLAYER_AUDIO_SIZE); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
361 if (audio_buff_read>0)mplayer_ip->output->write_audio(audio_buff,audio_buff_read); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
362 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
363 read_length=read(mplayer_status_pipe[0],buff,1); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
364 if(read_length>0){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
365 if ((buff[0]==(char)13)||(buff[0]==(char)10) ) { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
366 one_read=1; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
367 read_length=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
368 while((read_length<16)&&(one_read>0)) { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
369 audio_buff_read=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
370 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
371 mplayer_debugf("debug - readin fifo...\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
372 audio_buff_read=read(mplayer_fifo_fd,audio_buff,MPLAYER_AUDIO_SIZE); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
373 mplayer_debugf("debug - read fifo...%i\n", audio_buff_read); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
374 if (audio_buff_read>0)mplayer_ip->output->write_audio(audio_buff,audio_buff_read); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
375 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
376 mplayer_debugf("debug - readin status...\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
377 one_read= read(mplayer_status_pipe[0],buff+read_length,16-read_length); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
378 read_length += one_read; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
379 if ((audio_buff_read <= 0)&&(one_read <= 0)) usleep(5); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
380 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
381 sscanf(buff+3,"%i",&playtime); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
382 mplayer_current_time=playtime;} |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
383 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
384 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
385 else if ((audio_buff_read <= 0)&&(read_length <= 0)) usleep(5); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
386 */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
387 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
388 //else if (read_length == -1) break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
389 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
390 if (mplayer_playing==1){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
391 if(mplayer_current_cfg->xmmsaudio)mplayer_ip->output->close_audio(); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
392 mplayer_playing=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
393 xmms_remote_playlist_next(ctrlsocket_get_session_id()); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
394 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
395 // if (mplayer_dont_spawn) mplayer_dont_spawn=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
396 // else xmms_remote_playlist_next(ctrlsocket_get_session_id()); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
397 pthread_exit(NULL); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
398 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
399 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
400 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
401 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
402 struct mplayer_info *mplayer_read_file_info(char *filename){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
403 struct mplayer_info *info; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
404 int datalength,done=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
405 FILE *inquiry, *size_query; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
406 char mplayer_command[256]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
407 char buff[4096]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
408 char *temp; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
409 info=(struct mplayer_info *)malloc(sizeof(struct mplayer_info)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
410 memset((char *)info,0,sizeof(struct mplayer_info)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
411 sprintf(mplayer_command,"mplayer -slave -identify -vo null -ao null -frames 0 \"%s\" 2> /dev/null",filename); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
412 inquiry=popen(mplayer_command,"r"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
413 done=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
414 while((!feof(inquiry)) && (done <4000) ){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
415 fscanf(inquiry,"%c",(buff+done)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
416 done++; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
417 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
418 buff[done]=(char)0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
419 pclose(inquiry); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
420 mplayer_debugf("debug-id\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
421 temp=strstr(buff,"Name:"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
422 if (temp) mplayer_read_to_eol(info->title,temp+5); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
423 mplayer_debugf("debug-id\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
424 temp=strstr(buff,"Artist:"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
425 if (temp) mplayer_read_to_eol(info->artist,temp+7); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
426 mplayer_debugf("debug-id\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
427 temp=strstr(buff,"ID_VIDEO_BITRATE="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
428 if (temp) sscanf(temp+strlen("ID_VIDEO_BITRATE=") ,"%i",&(info->vbr)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
429 temp=strstr(buff,"ID_VIDEO_WIDTH="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
430 if (temp) sscanf(temp+strlen("ID_VIDEO_WIDTH=") ,"%i",&(info->x)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
431 temp=strstr(buff,"ID_VIDEO_HEIGHT="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
432 if (temp) sscanf(temp+strlen("ID_VIDEO_HEIGHT=") ,"%i",&(info->y)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
433 temp=strstr(buff,"ID_AUDIO_BITRATE="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
434 if (temp) sscanf(temp+strlen("ID_AUDIO_BITRATE="),"%i",&(info->abr)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
435 info->br = info->abr + info->vbr; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
436 temp=strstr(buff,"ID_AUDIO_RATE="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
437 if (temp) sscanf(temp+strlen("ID_AUDIO_RATE="),"%i",&(info->rate)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
438 temp=strstr(buff,"ID_AUDIO_NCH="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
439 if (temp) sscanf(temp+strlen("ID_AUDIO_NCH="),"%i",&(info->nch)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
440 temp=strstr(buff,"ID_LENGTH="); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
441 if (temp) sscanf(temp+strlen("ID_LENGTH="),"%i",&(info->length)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
442 else{ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
443 sprintf(mplayer_command,"du -b \"%s\" ",filename); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
444 size_query=popen(mplayer_command,"r"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
445 fscanf(size_query,"%i",&(info->filesize)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
446 pclose(size_query); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
447 if (info->br > 0) info->length=((info->filesize * 8)/(info->br));} |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
448 mplayer_debugf("debug-id\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
449 info->filename=filename; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
450 if((strlen(info->artist)+strlen(info->title)>0)){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
451 sprintf(info->caption,"%s - %s",info->artist,info->title);} |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
452 else{ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
453 temp = g_strdup(g_basename(filename)); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
454 strcpy(info->caption,temp); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
455 free(temp); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
456 if ((temp = strrchr(info->caption, '.')) != NULL) |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
457 *temp = '\0'; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
458 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
459 mplayer_debugf("debug-id\n\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
460 return info; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
461 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
462 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
463 char **mplayer_make_vector(){ /*To be passed to exec*/ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
464 char** vector; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
465 char** temp; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
466 int i=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
467 vector =(char **)malloc(sizeof(char*)*MPLAYER_MAX_VECTOR); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
468 memset(vector,0,sizeof(char*)*MPLAYER_MAX_VECTOR); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
469 mplayer_vector_append(vector,"mplayer"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
470 mplayer_vector_append(vector,"-slave"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
471 if(mplayer_current_cfg->vo){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
472 mplayer_vector_append(vector,"-vo"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
473 switch(mplayer_current_cfg->vo){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
474 case MPLAYER_VO_XV: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
475 mplayer_vector_append(vector,"xv"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
476 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
477 case MPLAYER_VO_X11: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
478 mplayer_vector_append(vector,"x11"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
479 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
480 case MPLAYER_VO_GL: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
481 mplayer_vector_append(vector,"gl"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
482 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
483 case MPLAYER_VO_SDL: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
484 mplayer_vector_append(vector,"sdl"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
485 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
486 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
487 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
488 if(mplayer_current_cfg->ao){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
489 mplayer_vector_append(vector,"-ao"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
490 switch( mplayer_current_cfg->ao){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
491 case MPLAYER_AO_OSS: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
492 mplayer_vector_append(vector,"oss"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
493 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
494 case MPLAYER_AO_ARTS: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
495 mplayer_vector_append(vector,"arts"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
496 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
497 case MPLAYER_AO_ESD: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
498 mplayer_vector_append(vector,"esd"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
499 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
500 case MPLAYER_AO_ALSA: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
501 mplayer_vector_append(vector,"alsa"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
502 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
503 case MPLAYER_AO_SDL: |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
504 mplayer_vector_append(vector,"sdl"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
505 break; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
506 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
507 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
508 if(mplayer_current_cfg->zoom) mplayer_vector_append(vector,"-zoom"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
509 if(mplayer_current_cfg->framedrop)mplayer_vector_append(vector,"-framedrop"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
510 if(mplayer_current_cfg->idx) mplayer_vector_append(vector,"-idx"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
511 if(mplayer_current_cfg->onewin){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
512 mplayer_vector_append(vector,"-wid"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
513 mplayer_vector_append(vector,mplayer_wid);} |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
514 if(mplayer_current_cfg->xmmsaudio){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
515 mplayer_vector_append(vector,"-ao"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
516 mplayer_vector_append(vector,"pcm"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
517 mplayer_vector_append(vector,"-aofile"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
518 mplayer_vector_append(vector,mplayer_fifoname); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
519 mplayer_vector_append(vector,"-autosync"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
520 mplayer_vector_append(vector,"10000"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
521 mplayer_vector_append(vector,"-nowaveheader"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
522 mplayer_vector_append(vector,"-format"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
523 mplayer_vector_append(vector,"128"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
524 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
525 if(mplayer_current_cfg->extra){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
526 mplayer_debugf("debug - adding extra options\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
527 temp= g_strsplit(mplayer_current_cfg->extra," ",0); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
528 while(temp[i]){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
529 mplayer_vector_append(vector,temp[i]); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
530 i++; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
531 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
532 g_strfreev(temp); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
533 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
534 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
535 mplayer_vector_append(vector,mplayer_file); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
536 return vector; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
537 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
538 void mplayer_vector_append(char**vector,char*param){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
539 int i=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
540 while(vector[i])i++; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
541 if(i >= (MPLAYER_MAX_VECTOR -1)) { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
542 mplayer_debugf("Too many arguments to mplayer!!\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
543 mplayer_debugf("Ignoring parameter: %s\n",param); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
544 return; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
545 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
546 mplayer_debugf("Adding parameter: %s\n",param); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
547 vector[i]=strdup(param); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
548 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
549 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
550 void mplayer_read_to_eol(char *str1,char *str2){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
551 /* copy str2 to str1 till \n is reached in str2 */ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
552 int i=0,j=0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
553 while(!((str2[j]=='\n')||(str2[j]==(char)0)||(str2[j]==(char)10)||(j>32) )) |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
554 str1[i++]=str2[j++]; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
555 str1[i]=(char)0; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
556 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
557 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
558 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
559 static void mplayer_about(void) |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
560 { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
561 static GtkWidget *window = NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
562 if (window) |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
563 return; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
564 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
565 window = xmms_show_message( |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
566 "About " PACKAGE, |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
567 PACKAGE " " VERSION "\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
568 "Author: " " Nandan Dixit " " <nandan@cse.iitb.ac.in>" "\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
569 "http://xmmsmplayer.sourceforge.net/" "\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
570 "Ported to Audacious: " " Aaron Sheldon " "\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
571 "http://audacious-media-player.org/" "\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
572 "This library is free software; you can redistribute it and/or\n" |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
573 "modify it under the terms of the GNU Library General Public\n", |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
574 "Ok", FALSE, NULL, NULL); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
575 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
576 gtk_signal_connect(GTK_OBJECT(window), "destroy", |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
577 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &window); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
578 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
579 gtk_widget_show(window); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
580 |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
581 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
582 /* |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
583 void mplayer_quitting_video(GtkWidget *widget, gpointer data) { |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
584 mplayer_debugf("debug - entered quitting_video\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
585 if(widget==mplayer_video){ |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
586 mplayer_debugf("debug - correct widget\n"); |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
587 mplayer_video=NULL; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
588 mplayer_wid[0]='\0'; |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
589 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
590 } |
33d24bd94ccc
[svn] Adds mplayer controls the plugin pack. I don't know crap about
asheldon
parents:
diff
changeset
|
591 */ |