From a0c1805bd992c0ae1fa018156358d831fbaf8f93 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 15 Mar 2001 01:42:20 +0000 Subject: [PATCH] * Bug fixes and enhancements in the Gtk+/Gnome interfaces. o the slider should behave correctly and stop jumping here and there (this bug is _not_ related to Stef's similar bug) o added an "open network" menu (useless since the input doesn't handle it properly yet) o tried to reorganize gnome_callbacks.c and gtk_callbacks.c o stream date is now displayed instead of percentage o renamed gnome_sys.h to intf_gnome.h, and gtk_sys.h to intf_gtk.h * Changed documentation and package creation files. o added versioned conflicts/replaces to vlc-gtk (Closes Debian bug #88796) o removed useless or outdated documentation from doc/* o moved vlc.1 manpage from debian/vlc.1 to doc/vlc.1 * Added basic Qt interface. o working features: slide bar, open file, toolbar, popup menu o added "qvlc" alias, equivalent to "vlc -I qt" o known issues : no "open disc" or "open network" menus yet the IntfWindow class is never cleaned on destruction the popup menu always pop at the middle of the screen * Misc fixes/updates. o renamed netutils.h functions from input_* to network_* o renamed *plst* files and functions to *playlist* (it was stupid from me to name them "plst") o made a few input error messages more meaningful o added -I, -A and -V short flags, corresponding to --intf, --audio and --video I got a lot of conflicts on this commit, lart me if I forgot a file or made old bugs reappear. --- INSTALL | 11 +- Makefile.in | 29 +- configure | 381 ++++----- configure.in | 7 +- debian/changelog | 6 + debian/changelog-css | 12 + debian/control | 18 + debian/control-css | 2 +- debian/rules | 25 +- doc/bugs | 28 - doc/headers | 96 --- doc/portage | 7 - doc/vlan-server | 116 --- {debian => doc}/vlc.1 | 16 +- include/{intf_plst.h => intf_playlist.h} | 24 +- include/netutils.h | 7 +- include/tests.h | 2 +- plugins/beos/intf_beos.cpp | 10 +- plugins/gnome/gnome_callbacks.c | 778 ++++++++++-------- plugins/gnome/gnome_callbacks.h | 45 +- plugins/gnome/gnome_interface.c | 375 +++++++-- plugins/gnome/gnome_interface.h | 1 + plugins/gnome/intf_gnome.c | 163 ++-- plugins/gnome/intf_gnome.glade | 564 ++++++++++--- plugins/gnome/{gnome_sys.h => intf_gnome.h} | 24 +- plugins/gtk/gtk_callbacks.c | 197 +++-- plugins/gtk/gtk_callbacks.h | 40 +- plugins/gtk/gtk_interface.c | 469 ++++++++--- plugins/gtk/gtk_interface.h | 1 + plugins/gtk/gtk_playlist.c | 35 +- plugins/gtk/intf_gtk.c | 157 ++-- plugins/gtk/intf_gtk.glade | 600 +++++++++++--- plugins/gtk/{gtk_sys.h => intf_gtk.h} | 24 +- plugins/mpeg/input_ps.c | 4 +- plugins/qt/.cvsignore | 1 + plugins/qt/intf_qt.cpp | 618 ++++++++++++++ plugins/qt/qt.cpp | 113 +++ src/input/input.c | 12 +- src/input/input_ext-intf.c | 2 +- src/input/input_programs.c | 8 +- src/input/mpeg_system.c | 4 +- src/interface/interface.c | 4 +- .../{intf_plst.c => intf_playlist.c} | 41 +- src/interface/main.c | 46 +- src/misc/netutils.c | 16 +- 45 files changed, 3645 insertions(+), 1494 deletions(-) delete mode 100644 doc/bugs delete mode 100644 doc/headers delete mode 100644 doc/portage delete mode 100644 doc/vlan-server rename {debian => doc}/vlc.1 (94%) rename include/{intf_plst.h => intf_playlist.h} (82%) rename plugins/gnome/{gnome_sys.h => intf_gnome.h} (79%) rename plugins/gtk/{gtk_sys.h => intf_gtk.h} (83%) create mode 100644 plugins/qt/.cvsignore create mode 100644 plugins/qt/intf_qt.cpp create mode 100644 plugins/qt/qt.cpp rename src/interface/{intf_plst.c => intf_playlist.c} (90%) diff --git a/INSTALL b/INSTALL index db23093014..a27e29d8d8 100644 --- a/INSTALL +++ b/INSTALL @@ -12,11 +12,18 @@ See `./configure --help' for more information. Then, run `make' to build vlc. -Here is a shortcut to copy-paste for a clean build: +Here is a shortcut to copy-paste for a complete build: make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \ --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \ - --enable-alsa --enable-mga --enable-gtk && make + --enable-alsa --enable-mga --enable-gtk --enable-qt && make + +If you intend to debug stuff, you may want to disable optimizations: + + make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \ + --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \ + --enable-alsa --enable-mga --enable-gtk --enable-qt \ + --disable-optimizatons && make Installing and running VideoLAN diff --git a/Makefile.in b/Makefile.in index 7bae51a485..6d93cf520f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -190,7 +190,7 @@ INTERFACE = src/interface/main.o \ src/interface/intf_msg.o \ src/interface/intf_cmd.o \ src/interface/intf_ctrl.o \ - src/interface/intf_plst.o \ + src/interface/intf_playlist.o \ src/interface/intf_channels.o \ src/interface/intf_console.o \ src/interface/intf_urldecode.o \ @@ -334,9 +334,11 @@ PLUGIN_GNOME = plugins/gnome/gnome.o \ plugins/gnome/gnome_interface.o \ plugins/gnome/gnome_support.o +PLUGIN_QT = plugins/qt/qt.o \ + plugins/qt/intf_qt.o + PLUGIN_KDE = plugins/kde/kde.o \ - plugins/kde/intf_kde.o \ - plugins/kde/kvlc.o + plugins/kde/intf_kde.o PLUGIN_IDCT = plugins/idct/idct.o \ plugins/idct/idct_common.o @@ -431,6 +433,7 @@ NONSTD_PLUGIN_OBJ = \ NONSTD_CPP_PLUGIN_OBJ = \ $(PLUGIN_BEOS) \ + $(PLUGIN_QT) \ $(PLUGIN_KDE) # @@ -456,7 +459,7 @@ all: vlc @ALIASES@ plugins clean: rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) rm -f plugins/*/*.o src/*/*.o lib/*.so - rm -f vlc kvlc gvlc + rm -f vlc gvlc kvlc qvlc distclean: clean rm -f src/*/*.o plugins/*/*.o **/*~ *.log @@ -494,7 +497,7 @@ show: snapshot: rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss* # copy archive in /tmp - find -type d | grep -v CVS | grep -v '^\.dep' | while read i ; \ + find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \ do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \ done find debian -mindepth 1 -maxdepth 1 -type d | \ @@ -534,7 +537,7 @@ FORCE: # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat # the namespace # -gvlc kvlc: vlc +gvlc kvlc qvlc: vlc rm -f $@ && ln -s vlc $@ @@ -569,18 +572,25 @@ $(STD_PLUGIN_OBJ): %.o: %.c $(PLUGIN_GTK): %.o: Makefile.dep $(PLUGIN_GTK): %.o: .dep/%.d $(PLUGIN_GTK): %.o: %.c - $(CC) $(CFLAGS) $(PCFLAGS) `glib-config --cflags glib` `gtk-config --cflags gtk` -c -o $@ $< + $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $< $(PLUGIN_GNOME): %.o: Makefile.dep $(PLUGIN_GNOME): %.o: .dep/%.d $(PLUGIN_GNOME): %.o: %.c - $(CC) $(CFLAGS) $(PCFLAGS) `glib-config --cflags glib` `gnome-config --cflags gnomeui` -c -o $@ $< + $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $< $(PLUGIN_GLIDE): %.o: Makefile.dep $(PLUGIN_GLIDE): %.o: .dep/%.d $(PLUGIN_GLIDE): %.o: %.c $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $< +$(PLUGIN_QT): %.o: Makefile.dep +$(PLUGIN_QT): %.o: .dep/%.dpp +$(PLUGIN_QT): %.o: %.moc + $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -c -o $@ $(<:%.moc=%.cpp) +$(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp + moc -i $< -o $@ + $(PLUGIN_KDE): %.o: Makefile.dep $(PLUGIN_KDE): %.o: .dep/%.dpp $(PLUGIN_KDE): %.o: %.cpp @@ -621,6 +631,9 @@ endif lib/dsp.so: $(PLUGIN_DSP) $(CC) $(PCFLAGS) -shared -o $@ $^ +lib/qt.so: $(PLUGIN_QT) + $(CC) $(PCFLAGS) -shared -o $@ $^ -lqt + lib/kde.so: $(PLUGIN_KDE) $(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl diff --git a/configure b/configure index 4c1e52bc18..46c3f4799b 100755 --- a/configure +++ b/configure @@ -41,6 +41,8 @@ ac_help="$ac_help --with-glide[=name] Glide (3dfx) support (default disabled)" ac_help="$ac_help --enable-ncurses ncurses interface support (default disabled)" +ac_help="$ac_help + --enable-qt Qt interface support (default disabled)" ac_help="$ac_help --enable-kde KDE interface support (default disabled)" ac_help="$ac_help @@ -589,7 +591,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:593: checking host system type" >&5 +echo "configure:595: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -616,7 +618,7 @@ VLC_CODENAME=Urumov echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:620: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:622: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -646,7 +648,7 @@ if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:650: checking for $ac_word" >&5 +echo "configure:652: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -676,7 +678,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:680: checking for $ac_word" >&5 +echo "configure:682: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -727,7 +729,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:731: checking for $ac_word" >&5 +echo "configure:733: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -759,7 +761,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:765: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -770,12 +772,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 774 "configure" +#line 776 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -801,12 +803,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:805: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:807: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:810: checking whether we are using GNU C" >&5 +echo "configure:812: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -815,7 +817,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -834,7 +836,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:838: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:840: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -868,7 +870,7 @@ fi fi if test -z "$CPP"; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:872: checking how to run the C preprocessor" >&5 +echo "configure:874: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -883,13 +885,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -900,13 +902,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -917,13 +919,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -961,7 +963,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:965: checking for a BSD compatible install" >&5 +echo "configure:967: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1015,18 +1017,18 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1019: checking for working const" >&5 +echo "configure:1021: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1090,14 +1092,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1094: checking whether byte ordering is bigendian" >&5 +echo "configure:1096: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1108,11 +1110,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1123,7 +1125,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1143,7 +1145,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1181,9 +1183,9 @@ fi echo $ac_n "checking whether compiler accepts bswap x86 instruction""... $ac_c" 1>&6 -echo "configure:1185: checking whether compiler accepts bswap x86 instruction" >&5 +echo "configure:1187: checking whether compiler accepts bswap x86 instruction" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_X86_BSWAP 1 @@ -1208,12 +1210,12 @@ rm -f conftest* for ac_func in gettimeofday select strerror strtod strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1212: checking for $ac_func" >&5 +echo "configure:1214: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1263,12 +1265,12 @@ done for ac_func in setenv putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1267: checking for $ac_func" >&5 +echo "configure:1269: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1316,12 +1318,12 @@ fi done echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1320: checking for connect" >&5 +echo "configure:1322: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1362,7 +1364,7 @@ if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1366: checking for connect in -lsocket" >&5 +echo "configure:1368: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1370,7 +1372,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1411,12 +1413,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1415: checking for gethostbyname" >&5 +echo "configure:1417: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1457,7 +1459,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1461: checking for gethostbyname in -lnsl" >&5 +echo "configure:1463: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1465,7 +1467,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1506,12 +1508,12 @@ fi fi echo $ac_n "checking for nanosleep""... $ac_c" 1>&6 -echo "configure:1510: checking for nanosleep" >&5 +echo "configure:1512: checking for nanosleep" >&5 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_nanosleep=yes" else @@ -1552,7 +1554,7 @@ if eval "test \"`echo '$ac_cv_func_'nanosleep`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6 -echo "configure:1556: checking for nanosleep in -lrt" >&5 +echo "configure:1558: checking for nanosleep in -lrt" >&5 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1560,7 +1562,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1597,7 +1599,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6 -echo "configure:1601: checking for nanosleep in -lposix4" >&5 +echo "configure:1603: checking for nanosleep in -lposix4" >&5 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1605,7 +1607,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1650,12 +1652,12 @@ fi for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1654: checking for $ac_func" >&5 +echo "configure:1656: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1703,12 +1705,12 @@ fi done echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1707: checking for inet_aton" >&5 +echo "configure:1709: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1749,7 +1751,7 @@ if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1753: checking for inet_aton in -lresolv" >&5 +echo "configure:1755: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1757,7 +1759,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1800,12 +1802,12 @@ fi for ac_func in vasprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1804: checking for $ac_func" >&5 +echo "configure:1806: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1856,17 +1858,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1860: checking for $ac_hdr" >&5 +echo "configure:1862: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1895,12 +1897,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1899: checking for $ac_func" >&5 +echo "configure:1901: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1948,7 +1950,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1952: checking for working mmap" >&5 +echo "configure:1954: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1956,7 +1958,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include -#include -#include - -#ifdef HAVE_UNISTD_H -# include -#endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2046,7 +2045,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = (char*)malloc(pagesize); + data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2067,7 +2066,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = (char*)malloc(2 * pagesize); + data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2085,7 +2084,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = (char*)malloc(pagesize); + data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2099,7 +2098,7 @@ main() } EOF -if { (eval echo configure:2103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2122,12 +2121,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2126: checking return type of signal handlers" >&5 +echo "configure:2125: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2144,7 +2143,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2163,7 +2162,7 @@ EOF echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2167: checking for dlopen in -ldl" >&5 +echo "configure:2166: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2171,7 +2170,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2210,7 +2209,7 @@ else fi echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6 -echo "configure:2214: checking for optarg in -lgnugetopt" >&5 +echo "configure:2213: checking for optarg in -lgnugetopt" >&5 ac_lib_var=`echo gnugetopt'_'optarg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2218,7 +2217,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnugetopt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2257,7 +2256,7 @@ else fi echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6 -echo "configure:2261: checking for _ in -lbe" >&5 +echo "configure:2260: checking for _ in -lbe" >&5 ac_lib_var=`echo be'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2265,7 +2264,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbe $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2304,7 +2303,7 @@ else fi echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6 -echo "configure:2308: checking for _ in -lgame" >&5 +echo "configure:2307: checking for _ in -lgame" >&5 ac_lib_var=`echo game'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2312,7 +2311,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgame $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2351,7 +2350,7 @@ else fi echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6 -echo "configure:2355: checking for _ in -lroot" >&5 +echo "configure:2354: checking for _ in -lroot" >&5 ac_lib_var=`echo root'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2359,7 +2358,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lroot $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2398,7 +2397,7 @@ else fi echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6 -echo "configure:2402: checking for powl in -lm" >&5 +echo "configure:2401: checking for powl in -lm" >&5 ac_lib_var=`echo m'_'powl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2406,7 +2405,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2445,7 +2444,7 @@ else fi echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2449: checking for pthread_create in -lpthread" >&5 +echo "configure:2448: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2453,7 +2452,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2492,7 +2491,7 @@ else fi echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6 -echo "configure:2496: checking for thread_create in -lthreads" >&5 +echo "configure:2495: checking for thread_create in -lthreads" >&5 ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2500,7 +2499,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2540,12 +2539,12 @@ fi echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:2544: checking for getopt_long" >&5 +echo "configure:2543: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -2595,17 +2594,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2599: checking for $ac_hdr" >&5 +echo "configure:2598: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2635,17 +2634,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2639: checking for $ac_hdr" >&5 +echo "configure:2638: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2675,17 +2674,17 @@ for ac_hdr in sys/sockio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2679: checking for $ac_hdr" >&5 +echo "configure:2678: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2715,17 +2714,17 @@ for ac_hdr in fcntl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2719: checking for $ac_hdr" >&5 +echo "configure:2718: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2755,17 +2754,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2759: checking for $ac_hdr" >&5 +echo "configure:2758: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2795,17 +2794,17 @@ for ac_hdr in dlfcn.h image.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2799: checking for $ac_hdr" >&5 +echo "configure:2798: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2835,17 +2834,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2839: checking for $ac_hdr" >&5 +echo "configure:2838: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2875,17 +2874,17 @@ for ac_hdr in machine/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2879: checking for $ac_hdr" >&5 +echo "configure:2878: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2916,17 +2915,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2920: checking for $ac_hdr" >&5 +echo "configure:2919: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2957,9 +2956,9 @@ save_CFLAGS=$CFLAGS CFLAGS="${CFLAGS} -Wall -Werror" echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 -echo "configure:2961: checking for ntohl in sys/param.h" >&5 +echo "configure:2960: checking for ntohl in sys/param.h" >&5 cat > conftest.$ac_ext < void foo() { int meuh; ntohl(meuh); } @@ -2967,7 +2966,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define NTOHL_IN_SYS_PARAM_H 1 @@ -2984,16 +2983,16 @@ rm -f conftest* CFLAGS="${CFLAGS} -rdynamic" echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6 -echo "configure:2988: checking if \$CC accepts -rdynamic" >&5 +echo "configure:2987: checking if \$CC accepts -rdynamic" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* DYNAMIC_FLAG="-rdynamic" echo "$ac_t""yes" 1>&6 @@ -3008,9 +3007,9 @@ rm -f conftest* CFLAGS=$save_CFLAGS echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3012: checking for boolean_t in sys/types.h" >&5 +echo "configure:3011: checking for boolean_t in sys/types.h" >&5 cat > conftest.$ac_ext < void quux() { boolean_t foo; } @@ -3018,7 +3017,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BOOLEAN_T_IN_SYS_TYPES_H 1 @@ -3034,18 +3033,18 @@ fi rm -f conftest* echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3038: checking for working const" >&5 +echo "configure:3037: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3109,12 +3108,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3113: checking for ANSI C header files" >&5 +echo "configure:3112: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3122,7 +3121,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3139,7 +3138,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3157,7 +3156,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3178,7 +3177,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3189,7 +3188,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3213,12 +3212,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3217: checking for size_t" >&5 +echo "configure:3216: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3246,12 +3245,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3250: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3249: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3260,7 +3259,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3292,17 +3291,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3296: checking for $ac_hdr" >&5 +echo "configure:3295: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3327,17 +3326,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3331: checking for $ac_hdr" >&5 +echo "configure:3330: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3364,7 +3363,7 @@ fi done cat > conftest.$ac_ext < EOF @@ -3443,7 +3442,6 @@ if test x$host_os = xbeos; then else GVLC=0 -KVLC=0 # Check whether --enable-dummy or --disable-dummy was given. if test "${enable_dummy+set}" = set; then @@ -3534,10 +3532,16 @@ if test "${enable_ncurses+set}" = set; then if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi fi +# Check whether --enable-qt or --disable-qt was given. +if test "${enable_qt+set}" = set; then + enableval="$enable_qt" + if test x$enable_qt = xyes; then PLUGINS=${PLUGINS}"qt "; ALIASES=${ALIASES}"qvlc "; fi +fi + # Check whether --enable-kde or --disable-kde was given. if test "${enable_kde+set}" = set; then enableval="$enable_kde" - if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; KVLC=1; fi + if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi fi # Check whether --enable-gnome or --disable-gnome was given. @@ -3566,17 +3570,17 @@ if test "${enable_alsa+set}" = set; then enableval="$enable_alsa" if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 -echo "configure:3570: checking for sys/asoundlib.h" >&5 +echo "configure:3574: checking for sys/asoundlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3593,7 +3597,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:3597: checking for main in -lasound" >&5 +echo "configure:3601: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3601,14 +3605,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3638,7 +3642,6 @@ fi if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi -if test x$KVLC = x1 ; then ALIASES=${ALIASES}"kvlc "; fi fi diff --git a/configure.in b/configure.in index c8a3d616fc..5d826eaf87 100644 --- a/configure.in +++ b/configure.in @@ -148,7 +148,6 @@ dnl default case else GVLC=0 -KVLC=0 AC_ARG_ENABLE(dummy, [ --disable-dummy dummy module (default enabled)]) @@ -209,9 +208,12 @@ AC_ARG_WITH(glide, AC_ARG_ENABLE(ncurses, [ --enable-ncurses ncurses interface support (default disabled)], [if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi]) +AC_ARG_ENABLE(qt, + [ --enable-qt Qt interface support (default disabled)], + [if test x$enable_qt = xyes; then PLUGINS=${PLUGINS}"qt "; ALIASES=${ALIASES}"qvlc "; fi]) AC_ARG_ENABLE(kde, [ --enable-kde KDE interface support (default disabled)], - [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; KVLC=1; fi]) + [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASES=${ALIASES}"kvlc "; fi]) AC_ARG_ENABLE(gnome, [ --enable-gnome Gnome interface support (default disabled)], [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi]) @@ -227,7 +229,6 @@ AC_ARG_ENABLE(alsa, [if test x$enable_alsa = xyes; then AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false") if test $have_alsa = true; then PLUGINS=${PLUGINS}"alsa "; fi; fi]) if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi -if test x$KVLC = x1 ; then ALIASES=${ALIASES}"kvlc "; fi fi diff --git a/debian/changelog b/debian/changelog index b45def20ef..6fff0b0bc2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vlc (0.2.63-3) unstable; urgency=low + + * Added versioned conflicts/replaces to vlc-gtk (Closes: #88796). + + -- Samuel Hocevar Wed, 7 Mar 2001 20:47:48 +0100 + vlc (0.2.63-2) unstable; urgency=low * Glide shouldn't cause any non-x86 problems anymore (Closes: #88583). diff --git a/debian/changelog-css b/debian/changelog-css index c2b32eb01d..ec5c369701 100644 --- a/debian/changelog-css +++ b/debian/changelog-css @@ -1,3 +1,15 @@ +vlc-css (0.2.63-3) unstable; urgency=low + + * New vlc package. + + -- Samuel Hocevar Wed, 7 Mar 2001 20:47:48 +0100 + +vlc-css (0.2.63-2) unstable; urgency=low + + * Fixed versioned dependencies against vlc. + + -- Samuel Hocevar Mon, 5 Mar 2001 21:37:19 +0100 + vlc-css (0.2.63-1) unstable; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 64187b21dd..6ea38a576e 100644 --- a/debian/control +++ b/debian/control @@ -26,6 +26,8 @@ Description: Gnome plugin for the VideoLAN Client Package: vlc-gtk Architecture: any Depends: vlc (= ${Source-Version}), ${shlibs:Depends} +Replaces: vlc-gnome (<= 0.2.63-2) +Conflicts: vlc-gnome (<= 0.2.63-2) Description: Gtk+ plugin for the VideoLAN Client VideoLAN is a free MPEG, MPEG2 and DVD software solution. . @@ -73,3 +75,19 @@ Description: Glide plugin for the VideoLAN Client VideoLAN is a free MPEG, MPEG2 and DVD software solution. . This is a Glide (3dfx) plugin for the VideoLAN Client. + +Package: vlc-qt +Architecture: any +Depends: vlc (= ${Source-Version}), ${shlibs:Depends} +Description: Qt plugin for the VideoLAN Client + VideoLAN is a free MPEG, MPEG2 and DVD software solution. + . + This plugin adds a Qt interface to the VideoLAN Client. + +Package: vlc-kde +Architecture: any +Depends: vlc (= ${Source-Version}), ${shlibs:Depends} +Description: KDE plugin for the VideoLAN Client + VideoLAN is a free MPEG, MPEG2 and DVD software solution. + . + This plugin adds a KDE interface to the VideoLAN Client. diff --git a/debian/control-css b/debian/control-css index 7e2dcc9169..efbc855877 100644 --- a/debian/control-css +++ b/debian/control-css @@ -7,7 +7,7 @@ Standards-Version: 3.0.1 Package: vlc-css Architecture: any -Depends: ${shlibs:Depends}, vlc +Depends: ${shlibs:Depends}, vlc (= ${Source-Version}) Description: CSS plugin for the VideoLAN Client VideoLAN is a free MPEG, MPEG2 and DVD software solution. . diff --git a/debian/rules b/debian/rules index 4e5670295b..f3d0d2fbd9 100755 --- a/debian/rules +++ b/debian/rules @@ -18,13 +18,13 @@ build-stamp: --infodir=\$${prefix}/share/info \ --enable-gnome --enable-gtk --enable-fb --with-glide \ --with-ggi --with-sdl --enable-esd --enable-alsa \ - --disable-ppro ; \ + --with-qt --with-kde --disable-ppro ; \ else \ ./configure --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --enable-gnome --enable-gtk --enable-fb --with-ggi \ - --with-sdl --enable-esd --enable-alsa; \ + --with-qt --with-kde --with-sdl --enable-esd --enable-alsa; \ fi $(MAKE) @@ -49,7 +49,12 @@ install: build DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr # make symlinks for packages - for alias in ggi gtk gnome glide esd sdl alsa ; do \ + if [ $(DEB_BUILD_ARCH) = i386 ]; then \ + $$aliases="ggi gtk gnome glide esd sdl alsa qt kde" ; \ + else \ + $$aliases="ggi gtk gnome esd sdl alsa qt kde" ; \ + fi ; \ + for alias `echo $$aliases` ; do \ mkdir -p debian/vlc-$$alias/usr/share/doc/ ; \ ln -s vlc debian/vlc-$$alias/usr/share/doc/vlc-$$alias ; \ mkdir -p debian/vlc-$$alias/usr/lib/videolan/vlc/ ; \ @@ -59,12 +64,22 @@ install: build mkdir -p debian/vlc-gtk/usr/bin/ mv debian/vlc/usr/bin/gvlc debian/vlc-gtk/usr/bin/ + mkdir -p debian/vlc-kde/usr/bin/ + mv debian/vlc/usr/bin/kvlc debian/vlc-kde/usr/bin/ + mkdir -p debian/vlc-qt/usr/bin/ + mv debian/vlc/usr/bin/qvlc debian/vlc-qt/usr/bin/ + mkdir -p debian/vlc-gtk/usr/share/videolan/ mv debian/vlc/usr/share/videolan/gvlc.png \ debian/vlc/usr/share/videolan/gvlc.xpm \ debian/vlc-gtk/usr/share/videolan/ + mkdir -p debian/vlc-gtk/usr/share/man/man1/ ln -s vlc.1.gz debian/vlc-gtk/usr/share/man/man1/gvlc.1.gz + mkdir -p debian/vlc-kde/usr/share/man/man1/ + ln -s vlc.1.gz debian/vlc-kde/usr/share/man/man1/kvlc.1.gz + mkdir -p debian/vlc-qt/usr/share/man/man1/ + ln -s vlc.1.gz debian/vlc-qt/usr/share/man/man1/qvlc.1.gz # Build architecture-independent files here. binary-indep: build install @@ -83,10 +98,10 @@ binary-arch: build install # dh_installpam # dh_installinit dh_installcron - dh_installmanpages -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa + dh_installmanpages -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa -Nvlc-qt -Nvlc-kde doc/vlc.1 dh_installinfo # dh_undocumented - dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa + dh_installchangelogs -Nvlc-gnome -Nvlc-gtk -Nvlc-ggi -Nvlc-glide -Nvlc-esd -Nvlc-sdl -Nvlc-alsa -Nvlc-qt -Nvlc-kde dh_link dh_strip dh_compress diff --git a/doc/bugs b/doc/bugs deleted file mode 100644 index b58f991395..0000000000 --- a/doc/bugs +++ /dev/null @@ -1,28 +0,0 @@ -* interface : - + il semble que si l'on envoie 2 messages de logs l'un immediatement - apres l'autre, le 2e ne soit jamais affiche (cf debut du DemuxPES) - + l'envoi repeté de commandes dans la console provoque un segfault - - ce bug est du à la xconsole, qu'il faudra de toute manière - reprogrammer avec un widget quelconque (je recommande wx, qui est - portable, mais moche il est vrai), donc je vais pas me casser à le - corriger (Ptyx) - - vérifier qu'il est bien du à xconsole et non à intf_ExecCommand :-\ - (Ptyx) - -* video_output/X11 : - + quand une XShmImage n'a jamais été affichée, la fermer provoque une - erreur (fatale ?) du serveur -> plantage de vout_thread - + erreur lors de la fermeture 'brutale' de la fenêtre - - en cours de correction - j'ai trouvé comment signaler au WM qu'une - fenêtre est capable de se fermer propremenet sur un ClientMessage, - mais pas encore comment intercepter ce ClientMessage :-\ (Ptyx) - -* input : - + lorsque le vlc est appelé avec --novideo, le son n'est pas joué, bien - que décodé... parce que la synchro ou l'input n'envoie pas de date à - l'audio decoder... parce que les PCRs sont contenus dans la partie - video... solution : traiter TOUS les TS, afin de pouvoir récupérer les - PCRs (MaXX) - -* ac3_decoder : - + éviter le SIGSEGV lorsque le décodeur se mange du garbage (MaXX) diff --git a/doc/headers b/doc/headers deleted file mode 100644 index 0fa4413900..0000000000 --- a/doc/headers +++ /dev/null @@ -1,96 +0,0 @@ -Schéma de dépendance des headers et règles d'écriture -===================================================== - -Ce document décrit les dépendances entre les différents headers utilisés -par le projet, ainsi que l'ordre dans lequel ils devraient être appelés. -La totalité de ces headers, dans l'ordre, est regroupé dans le fichier -"all.h", pour faciliter la mise en place de nouvelles structures. - -Les headers inscrits entre parenthèses sont nécessaires indirectement. - -Merci de maintenir ce fichier à jour. - -Headers systèmes (appelés par ordre de repertoire et alphabetique) ------------------------------------------------------------------- - -#include -#include -#include -#include -#include -#include -#include - -Headers communs ---------------- - -#include "config.h" -#include "common.h" -> may depend of "config.h" -#include "mtime.h" -#include "netutils.h" -> -#include "xutils.h" -> - - -Input ------ - -#include "input.h" -> , , "config.h", "common.h" -#include "input_vlan.h" -> , -#include "decoder_fifo.h" -> , (), ("config.h"), ("common.h"), "input.h" -#include "netlist.h" -> , (), "config.h", ("common.h"), "input.h" -#include "pcr.h" -> (), (), ("config.h"), ("common.h"), "input.h" -#include "psi.h" -> (), (), ("config.h"), ("common.h"), "input.h" - -Audio ------ - -#include "audio_decoder.h" -> *le néant :)* -#include "audio_output.h" -> , , "config.h", "common.h", "mtime.h" -#include "audio_dsp.h" -> (), (), ("config.h"), ("common.h"), - ("mtime.h"), "audio_output.h" - -Video ------ - -#include "video.h" -> ("config.h"), "common.h", "mtime.h" -#include "video_graphics.h" -> ("config.h"), ("common.h"), ("mtime.h"), "video.h" -#include "video_output.h" -> , "config.h", "common.h", ("mtime.h"), "video.h" -#include "video_x11.h" -> () , , - ("config.h"), ("common.h"), ("mtime.h"), "video.h", "video_output.h" -#include "video_decoder.h" -> , (), ("config.h"), "common.h", ("mtime.h"), - "input.h", "decoder_fifo.h", ("video.h"), "video_output.h" - -Interface ---------- - -#include "xconsole.h" -> , "config.h" -#include "interface.h" -> (), (), (), - (), "config.h", "common.h", ("mtime.h"), - "input.h", ("video.h"), "video_output.h", "xconsole.h" -#include "intf_msg.h" -> , "config.h", "common.h", "mtime.h" -#include "intf_cmd.h" -#include "control.h" -> ?? -#include "intf_ctrl.h" -> "intf_cmd.h" - -Ressources partagées --------------------- - -#include "pgm_data.h" -> (), (), (), (), - (), - (), ("config.h"), "common.h", ("mtime.h"), - "input.h", "input_vlan.h", "audio_output.h" , "video.h", - ("video_output.h"), "xconsole.h", "interface.h", "intf_msg.h" - -Autres headers, qui sont condamnés à disparaitre ou ne sont pas utilisés ------------------------------------------------------------------------- - -#include "network.h" illisible, uniquement utilisé dans network.c -#include "rsc_files.h" -xconsole will also change - - - - - - - diff --git a/doc/portage b/doc/portage deleted file mode 100644 index ca4746c833..0000000000 --- a/doc/portage +++ /dev/null @@ -1,7 +0,0 @@ -FreeBSD: - -#ifdef __FreeBSD__ - -remplacer les sys/soundcard.h par machine/soundcard.c - -problème avec getopt - -LinuxPPC: - -problème avec la libpthreads ? (ou avec le serveur X ?) diff --git a/doc/vlan-server b/doc/vlan-server deleted file mode 100644 index 7cbd96ea47..0000000000 --- a/doc/vlan-server +++ /dev/null @@ -1,116 +0,0 @@ -Vlan server protocol and library *draft* -======================================== - -telnet-based protocol. Client commands are text, server responses are numbers followed by -an explicative text (like irc). Common messages number should probalbly be grouped. - -Two different notions: session and connexion - session has a long timeout (several hours), and should not use server-side resources - connexion has a short timeout (a few minutes) and can use server-side resources (thread) - -A vlan resource (switch+port) is identified by a unique id. Changes can obviously be done -with this id, but also, for administrative facilities, with other identifiers. - -Client commands: - -LOGIN [] - -> open connexion, required before any communication with server. Login and password should - correspond to groups (admin, users...) rather than individual ids. Application is for stats. - answers: 100: ok - 101: rejected, invalid login - 102: rejected, too many connexions - 103: rejected, forbidden source - 104: rejected, already logged in - 109: rejected, other reason - password required - -PASS - -LOGOUT -> close connexion - answer: 200: ok, session closed - -OPEN - -> open session. required before any write operations - answers: 300: - 301: rejected, not authorized - 302: rejected, too many sessions - 399: rejected, other reason - -RECOVER - -> recover session. Both id are required for security. - answer: 400: ok - 401: rejected, not authorized (invalid login or something else) - 402: rejected, invalid ids - 403: rejected, session already active on another connexion - 499: rejected, other reason - -CLOSE [] - -> close session. Session must be active for normal users. - answer: 500: ok, session closed - 501: error, not loged in - 502: error: active session - 503: error: not authorized - -STATUS ME -STATUS MAC -STATUS IP -STATUS ID - give informations about something - answer: 600: mark beginning of status info - 601: mark end of status info - 602: error, not authorized - 603: error, unknown - 604: error, request failed - 610: - 611: - 612: - 613: - 614: - 615: - 616: - 617: - 699: error, other reason - -LOCK ME -LOCK MAC -LOCK IP -LOCK ID - lock a resource id (session required) - answers: - -UNLOCK ME -UNLOCK MAC -UNLOCK IP -UNLOCK ID - unlock a resource id (session required) - answers: - -CHANGE ME -CHANGE MAC -CHANGE IP -CHANGE ID - change a vlan (session required) - -Administrative commands: - -HELP - print list of commands - answer: - -KICK - -RESET - -LIST IDS -LIST MACS -LIST IPS -LIST SESSIONS -LIST CONNECTIONS -LIST LOGINS - -QUIT - -CONFIRM - - - diff --git a/debian/vlc.1 b/doc/vlc.1 similarity index 94% rename from debian/vlc.1 rename to doc/vlc.1 index 6441a596fe..3015c2007a 100644 --- a/debian/vlc.1 +++ b/doc/vlc.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH VLC 1 "August 15, 2000" +.TH VLC 1 "March 10, 2001" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -16,7 +16,7 @@ .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME -vlc, gvlc, kvlc \- The VideoLAN Client +vlc, gvlc, kvlc, qvlc \- The VideoLAN Client .SH SYNOPSIS .B vlc .RI [ OPTIONS ] @@ -25,15 +25,15 @@ vlc, gvlc, kvlc \- The VideoLAN Client .SH DESCRIPTION This manual page documents briefly the .B vlc -, a free MPEG2 player. +, a free MPEG, MPEG2 and DVD player. .SH OPTIONS .B vlc follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP -.B \-\-intf -Specify an interface module: "gnome", "curses", "shell", for instance. +.B \-I, \-\-intf +Specify an interface module: "gnome", "curses", "qt", for instance. .TP .B \-\-warning Select the warning level. 0 is the most verbose, 3 is almost mute. @@ -41,7 +41,7 @@ Select the warning level. 0 is the most verbose, 3 is almost mute. .B \-\-noaudio Disable audio output. .TP -.B \-\-aout +.B \-A, \-\-aout Specify an audio output module: "dsp", "esd", for instance. .TP .B \-\-stereo, \-\-mono @@ -50,7 +50,7 @@ Choose stereo or mono audio output .B \-\-novideo Disable video output. .TP -.B \-\-vout +.B \-V, \-\-vout Specify a video output module: "x11", "sdl", "fb", for instance. .TP .B \-\-motion @@ -88,7 +88,7 @@ heuristics based on CPU usage. displays I and P images and every second B image, and `IPB' forces displaying of all images. -Note that vlc is certainly going to crash if you ask it to +Note that vlc is not guaranteed to behave properly if you ask it to display more images than your CPU can cope with. .TP .B \-t, \-\-dvdtitle diff --git a/include/intf_plst.h b/include/intf_playlist.h similarity index 82% rename from include/intf_plst.h rename to include/intf_playlist.h index 35144a455b..86d4c7dd0e 100644 --- a/include/intf_plst.h +++ b/include/intf_playlist.h @@ -1,5 +1,5 @@ /***************************************************************************** - * intf_plst.h : Playlist functions + * intf_playlist.h : Playlist functions ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN * @@ -51,7 +51,7 @@ typedef struct playlist_s playlist_item_t* p_item; } playlist_t; -/* Used by intf_PlstAdd */ +/* Used by intf_PlaylistAdd */ #define PLAYLIST_START 0 #define PLAYLIST_END -1 @@ -67,13 +67,13 @@ typedef struct playlist_s /***************************************************************************** * Prototypes *****************************************************************************/ -playlist_t * intf_PlstCreate ( void ); -void intf_PlstInit ( playlist_t * p_playlist ); -int intf_PlstAdd ( playlist_t * p_playlist, - int i_pos, char * psz_item ); -int intf_PlstDelete ( playlist_t * p_playlist, - int i_pos ); -void intf_PlstNext ( playlist_t * p_playlist ); -void intf_PlstPrev ( playlist_t * p_playlist ); -void intf_PlstDestroy ( playlist_t * p_playlist ); -void intf_PlstJumpto ( playlist_t * p_playlist , int i_pos); +playlist_t * intf_PlaylistCreate ( void ); +void intf_PlaylistInit ( playlist_t * p_playlist ); +int intf_PlaylistAdd ( playlist_t * p_playlist, + int i_pos, const char * psz_item ); +int intf_PlaylistDelete ( playlist_t * p_playlist, int i_pos ); +void intf_PlaylistNext ( playlist_t * p_playlist ); +void intf_PlaylistPrev ( playlist_t * p_playlist ); +void intf_PlaylistDestroy ( playlist_t * p_playlist ); +void intf_PlaylistJumpto ( playlist_t * p_playlist , int i_pos); + diff --git a/include/netutils.h b/include/netutils.h index 803162b7a9..c7649c2c27 100644 --- a/include/netutils.h +++ b/include/netutils.h @@ -3,7 +3,7 @@ * This header describes miscellanous utility functions shared between several * modules. ***************************************************************************** - * Copyright (C) 1999, 2000 VideoLAN + * Copyright (C) 1999, 2000, 2001 VideoLAN * * Authors: Vincent Seguin <seguin@via.ecp.fr> * Henri Fallon <henri@videolan.org> @@ -26,5 +26,6 @@ /***************************************************************************** * Prototypes *****************************************************************************/ -int input_BuildLocalAddr( struct sockaddr_in *, int, boolean_t ); -int input_BuildRemoteAddr(struct sockaddr_in *, char * ); +int network_BuildLocalAddr ( struct sockaddr_in *, int, boolean_t ); +int network_BuildRemoteAddr( struct sockaddr_in *, char * ); + diff --git a/include/tests.h b/include/tests.h index 47bc8b1a27..c6bd76183b 100644 --- a/include/tests.h +++ b/include/tests.h @@ -3,7 +3,7 @@ ***************************************************************************** * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN * - * Authors: + * Authors: Samuel Hocevar <sam@zoy.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/plugins/beos/intf_beos.cpp b/plugins/beos/intf_beos.cpp index c37ba6063a..17559bad33 100644 --- a/plugins/beos/intf_beos.cpp +++ b/plugins/beos/intf_beos.cpp @@ -2,7 +2,7 @@ * intf_beos.cpp: beos interface ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: intf_beos.cpp,v 1.19 2001/03/07 16:32:59 richards Exp $ + * $Id: intf_beos.cpp,v 1.20 2001/03/15 01:42:19 sam Exp $ * * Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Samuel Hocevar <sam@zoy.org> @@ -76,7 +76,7 @@ extern "C" #include "input_ext-intf.h" #include "interface.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "intf_msg.h" #include "audio_output.h" #include "MsgVals.h" @@ -263,7 +263,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) if(p_message->FindString("device", device) != B_ERROR) { sprintf(device_method_and_name, "dvd:%s", *device); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, device_method_and_name ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, device_method_and_name ); } break; @@ -387,8 +387,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) if( p_message->FindRef( "refs", &ref ) == B_OK ) { BPath path( &ref ); - char * psz_name = strdup(path.Path()); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_name ); + intf_PlaylistAdd( p_main->p_playlist, + PLAYLIST_END, path.Path() ); } } diff --git a/plugins/gnome/gnome_callbacks.c b/plugins/gnome/gnome_callbacks.c index 67465adef8..6e38331af1 100644 --- a/plugins/gnome/gnome_callbacks.c +++ b/plugins/gnome/gnome_callbacks.c @@ -39,13 +39,13 @@ #include "input_ext-intf.h" #include "interface.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "intf_msg.h" -#include "gnome_sys.h" #include "gnome_callbacks.h" #include "gnome_interface.h" #include "gnome_support.h" +#include "intf_gnome.h" #include "main.h" @@ -58,9 +58,112 @@ static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) "p_intf" ) ); } + +/***************************************************************************** + * Interface callbacks + ***************************************************************************** + * The following callbacks are related to the main interface window. + *****************************************************************************/ +void +on_intf_window_destroy (GtkObject *object, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); +} + + +gboolean +on_slider_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->p_sys->b_slider_free = 0; + vlc_mutex_unlock( &p_intf->change_lock ); + + return FALSE; +} + + +gboolean +on_slider_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->p_sys->b_slider_free = 1; + vlc_mutex_unlock( &p_intf->change_lock ); + + return FALSE; +} + + +void +on_intf_window_drag_data_received (GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data) +{ + char *psz_text = data->data; + int i_len = strlen( psz_text ); + + switch( info ) + { + case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */ + + if( i_len < 1 ) + { + return; + } + + /* get rid of ' ' at the end */ + *( psz_text + i_len - 1 ) = 0; + + intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); + + break; + + case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */ + + if( i_len < 2 ) + { + return; + } + + /* get rid of \r\n at the end */ + *( psz_text + i_len - 2 ) = 0; + + intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); + break; + + default: + + intf_ErrMsg( "intf error: unknown dropped type"); + break; + } +} + + /***************************************************************************** - * Callbacks - ******************************************************************************/ + * Menubar callbacks + ***************************************************************************** + * The following callbacks are related to the menubar of the main + * interface window. + *****************************************************************************/ void on_menubar_open_activate (GtkMenuItem *menuitem, gpointer user_data) @@ -80,13 +183,37 @@ on_menubar_open_activate (GtkMenuItem *menuitem, } +void +on_menubar_disc_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_disc ); + gdk_window_raise( p_intf->p_sys->p_disc->window ); +} + + +void +on_menubar_network_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); +} + + void on_menubar_exit_activate (GtkMenuItem *menuitem, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + vlc_mutex_lock( &p_intf->change_lock ); p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); } @@ -107,6 +234,75 @@ on_menubar_playlist_activate (GtkMenuItem *menuitem, } +void +on_menubar_audio_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + es_descriptor_t * p_es; + + p_es = (es_descriptor_t*)user_data; + + input_ChangeES( p_intf->p_input, p_es, 1 ); +} + + +void +on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + es_descriptor_t * p_es; + + p_es = (es_descriptor_t*)user_data; + + input_ChangeES( p_intf->p_input, p_es, 2 ); +} + + +void +on_menubar_title_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)user_data ); + p_intf->p_sys->b_menus_update = 1; + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); +} + + +void +on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + input_area_t * p_area = p_intf->p_input->stream.p_selected_area; + gint i_chapter = (gint)user_data; + + p_area->i_part = i_chapter; + + p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area ); + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); +} + +void +on_menubar_modules_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) ) + { + p_intf->p_sys->p_modules = create_intf_modules(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_modules ); + gdk_window_raise( p_intf->p_sys->p_modules->window ); +} + + void on_menubar_preferences_activate (GtkMenuItem *menuitem, gpointer user_data) @@ -132,6 +328,12 @@ on_menubar_about_activate (GtkMenuItem *menuitem, } +/***************************************************************************** + * Toolbar callbacks + ***************************************************************************** + * The following callbacks are related to the toolbar of the main + * interface window. + *****************************************************************************/ void on_toolbar_open_clicked (GtkButton *button, gpointer user_data) @@ -151,6 +353,28 @@ on_toolbar_open_clicked (GtkButton *button, } +void +on_toolbar_disc_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_disc ); + gdk_window_raise( p_intf->p_sys->p_disc->window ); +} + + +void +on_toolbar_network_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); +} + + void on_toolbar_back_clicked (GtkButton *button, gpointer user_data) @@ -193,6 +417,32 @@ on_toolbar_pause_clicked (GtkButton *button, } +void +on_toolbar_slow_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); + } +} + + +void +on_toolbar_fast_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + } +} + + void on_toolbar_playlist_clicked (GtkButton *button, gpointer user_data) @@ -219,8 +469,8 @@ on_toolbar_prev_clicked (GtkButton *button, if( p_intf->p_input != NULL ) { /* FIXME: temporary hack */ - intf_PlstPrev( p_main->p_playlist ); - intf_PlstPrev( p_main->p_playlist ); + intf_PlaylistPrev( p_main->p_playlist ); + intf_PlaylistPrev( p_main->p_playlist ); p_intf->p_input->b_eof = 1; } } @@ -240,6 +490,12 @@ on_toolbar_next_clicked (GtkButton *button, } +/***************************************************************************** + * Popup callbacks + ***************************************************************************** + * The following callbacks are related to the popup menu. The popup + * menu is activated when right-clicking on the video output window. + *****************************************************************************/ void on_popup_play_activate (GtkMenuItem *menuitem, gpointer user_data) @@ -267,355 +523,292 @@ on_popup_pause_activate (GtkMenuItem *menuitem, void -on_popup_exit_activate (GtkMenuItem *menuitem, +on_popup_slow_activate (GtkMenuItem *menuitem, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - p_intf->b_die = 1; + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); + } } void -on_intf_window_destroy (GtkObject *object, +on_popup_fast_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - /* FIXME don't destroy the window, just hide it */ - p_intf->b_die = 1; - p_intf->p_sys->p_window = NULL; + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + } } void -on_fileopen_ok_clicked (GtkButton *button, - gpointer user_data) +on_popup_audio_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) { - GtkWidget *filesel; - gchar *filename; + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + es_descriptor_t * p_es; - filesel = gtk_widget_get_toplevel (GTK_WIDGET (button)); - gtk_widget_hide (filesel); - filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); + p_es = (es_descriptor_t*)user_data; - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); + input_ChangeES( p_intf->p_input, p_es, 1 ); } void -on_fileopen_cancel_clicked (GtkButton *button, - gpointer user_data) +on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) { - gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); -} - + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + es_descriptor_t * p_es; -void -on_intf_fileopen_destroy (GtkObject *object, - gpointer user_data) -{ - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" ); + p_es = (es_descriptor_t*)user_data; - p_intf->p_sys->p_fileopen = NULL; + input_ChangeES( p_intf->p_input, p_es, 2 ); } void -on_popup_open_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_popup_navigation_toggle (GtkCheckMenuItem *menuitem, + gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - - /* If we have never used the file selector, open it */ - if( p_intf->p_sys->p_fileopen == NULL) + if( menuitem->active ) { - p_intf->p_sys->p_fileopen = create_intf_fileopen(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), - "p_intf", p_intf ); - } + intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + input_area_t * p_area; + gint i_title; + gint i_chapter; - gtk_widget_show( p_intf->p_sys->p_fileopen ); - gdk_window_raise( p_intf->p_sys->p_fileopen->window ); + i_title = (gint)(user_data) / 100 ; + i_chapter = (gint)(user_data) - ( 100 * i_title ); + + if( i_title != p_intf->p_input->stream.p_selected_area->i_id ) + { + p_intf->p_sys->b_menus_update = 1; + } + + p_area = p_intf->p_input->stream.pp_areas[i_title]; + p_area->i_part = i_chapter; + + p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area ); + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); + } } void -on_popup_about_activate (GtkMenuItem *menuitem, +on_popup_open_activate (GtkMenuItem *menuitem, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) { - p_intf->p_sys->p_about = create_intf_about(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ), + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), "p_intf", p_intf ); } - gtk_widget_show( p_intf->p_sys->p_about ); - gdk_window_raise( p_intf->p_sys->p_about->window ); -} - -void -on_intf_playlist_destroy (GtkObject *object, - gpointer user_data) -{ - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_playlist" ); - - p_intf->p_sys->p_playlist = NULL; + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); } void -on_playlist_close_clicked (GtkButton *button, +on_popup_disc_activate (GtkMenuItem *menuitem, gpointer user_data) { - gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + gtk_widget_show( p_intf->p_sys->p_disc ); + gdk_window_raise( p_intf->p_sys->p_disc->window ); } void -on_popup_slow_activate (GtkMenuItem *menuitem, +on_popup_network_activate (GtkMenuItem *menuitem, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - if( p_intf->p_input != NULL ) - { - input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); - } + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); } void -on_popup_fast_activate (GtkMenuItem *menuitem, +on_popup_about_activate (GtkMenuItem *menuitem, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - if( p_intf->p_input != NULL ) + if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) { - input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + p_intf->p_sys->p_about = create_intf_about(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ), + "p_intf", p_intf ); } + gtk_widget_show( p_intf->p_sys->p_about ); + gdk_window_raise( p_intf->p_sys->p_about->window ); } void -on_toolbar_slow_clicked (GtkButton *button, +on_popup_exit_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - if( p_intf->p_input != NULL ) - { - input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); - } + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); } +/***************************************************************************** + * Fileopen callbacks + ***************************************************************************** + * The following callbacks are related to the file requester. + *****************************************************************************/ void -on_toolbar_fast_clicked (GtkButton *button, +on_intf_fileopen_destroy (GtkObject *object, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" ); - if( p_intf->p_input != NULL ) - { - input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); - } + p_intf->p_sys->p_fileopen = NULL; } -gboolean -on_hscale_button_release_event (GtkWidget *widget, - GdkEventButton *event, +void +on_fileopen_ok_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); - - GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) ); - off_t i_seek; - - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_input != NULL ) - { - i_seek = (p_adj->value * - p_intf->p_input->stream.p_selected_area->i_size) / 100; - input_Seek( p_intf->p_input, i_seek ); - } - p_intf->p_sys->b_scale_isfree = 1; + GtkWidget *filesel; + gchar *filename; - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + filesel = gtk_widget_get_toplevel (GTK_WIDGET (button)); + gtk_widget_hide (filesel); + filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); - return FALSE; + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); } -gboolean -on_hscale_button_press_event (GtkWidget *widget, - GdkEventButton *event, +void +on_fileopen_cancel_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); - - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - p_intf->p_sys->b_scale_isfree = 0; - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); - - return FALSE; + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } - +/***************************************************************************** + * Playlist callbacks + ***************************************************************************** + * The following callbacks are related to the playlist. + *****************************************************************************/ void -on_intf_modules_destroy (GtkObject *object, +on_intf_playlist_destroy (GtkObject *object, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_playlist" ); + p_intf->p_sys->p_playlist = NULL; } void -on_modules_ok_clicked (GtkButton *button, +on_playlist_ok_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" ); - - gtk_widget_hide( p_intf->p_sys->p_modules ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_playlist" ); + gtk_widget_hide( p_intf->p_sys->p_playlist ); } void -on_modules_apply_clicked (GtkButton *button, +on_playlist_close_clicked (GtkButton *button, gpointer user_data) { - + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } + +/***************************************************************************** + * Module manager callbacks + ***************************************************************************** + * The following callbacks are related to the module manager. + *****************************************************************************/ void -on_modules_cancel_clicked (GtkButton *button, +on_intf_modules_destroy (GtkObject *object, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" ); - gtk_widget_hide( p_intf->p_sys->p_modules ); } void -on_playlist_ok_clicked (GtkButton *button, +on_modules_ok_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_playlist" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" ); - gtk_widget_hide( p_intf->p_sys->p_playlist ); + gtk_widget_hide( p_intf->p_sys->p_modules ); } void -on_menubar_modules_activate (GtkMenuItem *menuitem, +on_modules_apply_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) ) - { - p_intf->p_sys->p_modules = create_intf_modules(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ), - "p_intf", p_intf ); - } - gtk_widget_show( p_intf->p_sys->p_modules ); - gdk_window_raise( p_intf->p_sys->p_modules->window ); } void -on_intf_window_drag_data_received (GtkWidget *widget, - GdkDragContext *drag_context, - gint x, - gint y, - GtkSelectionData *data, - guint info, - guint time, +on_modules_cancel_clicked (GtkButton *button, gpointer user_data) { - char *psz_text = data->data; - int i_len = strlen( psz_text ); - - switch( info ) - { - case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */ - - if( i_len < 1 ) - { - return; - } - - /* get rid of ' ' at the end */ - *( psz_text + i_len - 1 ) = 0; - - intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); - - break; - - case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */ - - if( i_len < 2 ) - { - return; - } - - /* get rid of \r\n at the end */ - *( psz_text + i_len - 2 ) = 0; - - intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); - break; - - default: - - intf_ErrMsg( "intf error: unknown dropped type"); - break; - } + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } +/***************************************************************************** + * Open disc callbacks + ***************************************************************************** + * The following callbacks are related to the disc manager. + *****************************************************************************/ void -on_menubar_disc_activate (GtkMenuItem *menuitem, +on_disc_dvd_toggled (GtkToggleButton *togglebutton, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - - if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) ) + if( togglebutton->active ) { - p_intf->p_sys->p_disc = create_intf_disc(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ), - "p_intf", p_intf ); + gtk_entry_set_text( GTK_ENTRY( lookup_widget( + GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/dvd" ); } - gtk_widget_show( p_intf->p_sys->p_disc ); - gdk_window_raise( p_intf->p_sys->p_disc->window ); } void -on_toolbar_disc_clicked (GtkButton *button, +on_disc_vcd_toggled (GtkToggleButton *togglebutton, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); - - if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) ) + if( togglebutton->active ) { - p_intf->p_sys->p_disc = create_intf_disc(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ), - "p_intf", p_intf ); + gtk_entry_set_text( GTK_ENTRY( lookup_widget( + GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/cdrom" ); } - gtk_widget_show( p_intf->p_sys->p_disc ); - gdk_window_raise( p_intf->p_sys->p_disc->window ); } @@ -649,7 +842,7 @@ on_disc_ok_clicked (GtkButton *button, } else { - intf_ErrMsg( "intf error: unknown toggle button configuration" ); + intf_ErrMsg( "intf error: unknown disc type toggle button position" ); free( psz_source ); return; } @@ -665,7 +858,8 @@ on_disc_ok_clicked (GtkButton *button, /* Build source name and add it to playlist */ sprintf( psz_source, "%s:%s", psz_method, psz_device ); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); + free( psz_source ); gtk_widget_hide( p_intf->p_sys->p_disc ); } @@ -675,175 +869,71 @@ void on_disc_cancel_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" ); - - gtk_widget_hide( p_intf->p_sys->p_disc ); -} - - -void -on_disc_dvd_toggled (GtkToggleButton *togglebutton, - gpointer user_data) -{ - if( togglebutton->active ) - { - gtk_entry_set_text( GTK_ENTRY( lookup_widget( - GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/dvd" ); - } + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } +/***************************************************************************** + * Network stream callbacks + ***************************************************************************** + * The following callbacks are related to the network stream manager. + *****************************************************************************/ void -on_disc_vcd_toggled (GtkToggleButton *togglebutton, +on_network_ok_clicked (GtkButton *button, gpointer user_data) { - if( togglebutton->active ) - { - gtk_entry_set_text( GTK_ENTRY( lookup_widget( - GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/cdrom" ); - } -} + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_network" ); + char *psz_source, *psz_server, *psz_protocol; + unsigned int i_port; + psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget( + GTK_WIDGET(button), "network_server" ) ) ); -void -on_popup_disc_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - - if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) ) + /* Check which protocol was activated */ + if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), + "network_ts" ) )->active ) { - p_intf->p_sys->p_disc = create_intf_disc(); - gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ), - "p_intf", p_intf ); + psz_protocol = "ts"; } - gtk_widget_show( p_intf->p_sys->p_disc ); - gdk_window_raise( p_intf->p_sys->p_disc->window ); -} - - -void -on_popup_audio_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) + else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), + "network_rtp" ) )->active ) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - es_descriptor_t * p_es; - - p_es = (es_descriptor_t*)user_data; - - input_ChangeES( p_intf->p_input, p_es, 1 ); + psz_protocol = "rtp"; } -} - - -void -on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) + else { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - es_descriptor_t * p_es; - - p_es = (es_descriptor_t*)user_data; - - input_ChangeES( p_intf->p_input, p_es, 2 ); + intf_ErrMsg( "intf error: unknown protocol toggle button position" ); + return; } -} - -void -on_menubar_audio_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) + /* Get the port number and make sure it will not overflow 5 characters */ + i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( + lookup_widget( GTK_WIDGET(button), "network_port" ) ) ); + if( i_port > 65535 ) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - es_descriptor_t * p_es; - - p_es = (es_descriptor_t*)user_data; - - input_ChangeES( p_intf->p_input, p_es, 1 ); + intf_ErrMsg( "intf error: invalid port %i", i_port ); } -} - -void -on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) + /* Allocate room for "protocol://server:port" */ + psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 ); + if( psz_source == NULL ) { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - es_descriptor_t * p_es; - - p_es = (es_descriptor_t*)user_data; - - input_ChangeES( p_intf->p_input, p_es, 2 ); + return; } -} - - -void -on_popup_navigation_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) - { - intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); - input_area_t * p_area; - gint i_title; - gint i_chapter; - - i_title = (gint)(user_data) / 100 ; - i_chapter = (gint)(user_data) - ( 100 * i_title ); - - if( i_title != p_intf->p_input->stream.p_selected_area->i_id ) - { - p_intf->p_sys->b_menus_update = 1; - } + + /* Build source name and add it to playlist */ + sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); + free( psz_source ); - p_area = p_intf->p_input->stream.pp_areas[i_title]; - p_area->i_part = i_chapter; - - p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area ); - input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); - } + gtk_widget_hide( p_intf->p_sys->p_network ); } void -on_menubar_title_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) +on_network_cancel_clicked (GtkButton *button, + gpointer user_data) { - if( menuitem->active ) - { - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - - p_intf->p_input->pf_set_area( p_intf->p_input, - (input_area_t*)user_data ); - p_intf->p_sys->b_menus_update = 1; - input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); - } + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } - -void -on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem, - gpointer user_data) -{ - if( menuitem->active ) - { - intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), - "intf_window" ); - input_area_t * p_area = p_intf->p_input->stream.p_selected_area; - gint i_chapter = (gint)user_data; - - p_area->i_part = i_chapter; - - p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area ); - input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); - } -} diff --git a/plugins/gnome/gnome_callbacks.h b/plugins/gnome/gnome_callbacks.h index a27b0677ac..7329a93910 100644 --- a/plugins/gnome/gnome_callbacks.h +++ b/plugins/gnome/gnome_callbacks.h @@ -145,21 +145,6 @@ void on_toolbar_fast_clicked (GtkButton *button, gpointer user_data); -gboolean -on_hscale_button_release_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data); - -gboolean -on_hscale_button_release_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data); - -gboolean -on_hscale_button_press_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data); - void on_intf_modules_destroy (GtkObject *object, gpointer user_data); @@ -254,6 +239,36 @@ void on_menubar_title_toggle (GtkCheckMenuItem *menuitem, gpointer user_data); +void +on_menubar_network_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_toolbar_network_clicked (GtkButton *button, + gpointer user_data); + +void +on_network_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_network_cancel_clicked (GtkButton *button, + gpointer user_data); + +void +on_popup_network_activate (GtkMenuItem *menuitem, + gpointer user_data); + +gboolean +on_slider_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); + +gboolean +on_slider_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); + void on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem, gpointer user_data); diff --git a/plugins/gnome/gnome_interface.c b/plugins/gnome/gnome_interface.c index cf0f1bd99b..44e58da8aa 100644 --- a/plugins/gnome/gnome_interface.c +++ b/plugins/gnome/gnome_interface.c @@ -33,6 +33,13 @@ static GnomeUIInfo menubar_file_menu_uiinfo[] = GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, 0, (GdkModifierType) 0, NULL }, + { + GNOME_APP_UI_ITEM, N_("_Network Stream..."), + N_("Select a Network Stream"), + (gpointer) on_menubar_network_activate, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH, + 0, (GdkModifierType) 0, NULL + }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_EXIT_ITEM (on_menubar_exit_activate, NULL), GNOMEUIINFO_END @@ -117,6 +124,7 @@ create_intf_window (void) GtkWidget *tmp_toolbar_icon; GtkWidget *toolbar_file; GtkWidget *toolbar_disc; + GtkWidget *toolbar_network; GtkWidget *toolbar_back; GtkWidget *toolbar_stop; GtkWidget *toolbar_play; @@ -127,10 +135,11 @@ create_intf_window (void) GtkWidget *toolbar_prev; GtkWidget *toolbar_next; GtkWidget *vbox2; - GtkWidget *entry1; - GtkWidget *label6; - GtkWidget *hscale; - GtkWidget *label13; + GtkWidget *hbox4; + GtkWidget *label_date; + GtkWidget *label_status; + GtkWidget *label_bar; + GtkWidget *slider; GtkWidget *appbar; intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client")); @@ -160,15 +169,20 @@ create_intf_window (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (menubar_file_menu_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator1", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_network", menubar_file_menu_uiinfo[2].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (menubar_file_menu_uiinfo[3].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_exit", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator1", menubar_file_menu_uiinfo[3].widget, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_ref (menubar_file_menu_uiinfo[4].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_exit", + menubar_file_menu_uiinfo[4].widget, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_ref (menubar_uiinfo[1].widget); gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_view", menubar_uiinfo[1].widget, @@ -249,7 +263,6 @@ create_intf_window (void) gnome_app_add_toolbar (GNOME_APP (intf_window), GTK_TOOLBAR (toolbar), "toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE, GNOME_DOCK_TOP, 1, 0, 2); - gtk_container_set_border_width (GTK_CONTAINER (toolbar), 1); gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar), 16); gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_SPACE_LINE); gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE); @@ -278,6 +291,18 @@ create_intf_window (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (toolbar_disc); + tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_REFRESH); + toolbar_network = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Net"), + _("Select a Network Stream"), NULL, + tmp_toolbar_icon, NULL, NULL); + gtk_widget_ref (toolbar_network); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_network", toolbar_network, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_network); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BACK); @@ -400,40 +425,42 @@ create_intf_window (void) gtk_widget_show (vbox2); gnome_app_set_contents (GNOME_APP (intf_window), vbox2); - entry1 = gtk_entry_new (); - gtk_widget_ref (entry1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "entry1", entry1, + hbox4 = gtk_hbox_new (TRUE, 0); + gtk_widget_ref (hbox4); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "hbox4", hbox4, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (entry1); - gtk_box_pack_start (GTK_BOX (vbox2), entry1, FALSE, FALSE, 0); - gtk_entry_set_text (GTK_ENTRY (entry1), _("Tired of boring stub messages ? Write your own exciting message here !!")); + gtk_widget_show (hbox4); + gtk_box_pack_start (GTK_BOX (vbox2), hbox4, TRUE, TRUE, 0); - label6 = gtk_label_new (_("This part of the interface doesn't work yet. You can drag the slider below, though:")); - gtk_widget_ref (label6); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "label6", label6, + label_date = gtk_label_new (_("-:--:--")); + gtk_widget_ref (label_date); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_date", label_date, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label6); - gtk_box_pack_start (GTK_BOX (vbox2), label6, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5); - gtk_misc_set_padding (GTK_MISC (label6), 5, 0); + gtk_widget_show (label_date); + gtk_box_pack_start (GTK_BOX (hbox4), label_date, FALSE, FALSE, 0); - hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0))); - gtk_widget_ref (hscale); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale, + label_status = gtk_label_new (_("Status: foo")); + gtk_widget_ref (label_status); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_status", label_status, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hscale); - gtk_box_pack_start (GTK_BOX (vbox2), hscale, FALSE, FALSE, 0); - gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_BOTTOM); - gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED); + gtk_widget_show (label_status); + gtk_box_pack_start (GTK_BOX (hbox4), label_status, FALSE, FALSE, 0); - label13 = gtk_label_new (_("HEY ! YOU CAN DROP A FILE ON VLC TOO :-)")); - gtk_widget_ref (label13); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "label13", label13, + label_bar = gtk_label_new (_("Bar: baz")); + gtk_widget_ref (label_bar); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_bar", label_bar, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label13); - gtk_box_pack_start (GTK_BOX (vbox2), label13, FALSE, FALSE, 0); - gtk_misc_set_padding (GTK_MISC (label13), 0, 5); + gtk_widget_show (label_bar); + gtk_box_pack_start (GTK_BOX (hbox4), label_bar, FALSE, FALSE, 0); + + slider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0, 6.25, 0))); + gtk_widget_ref (slider); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider", slider, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (slider); + gtk_box_pack_start (GTK_BOX (vbox2), slider, TRUE, TRUE, 0); + gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE); + gtk_scale_set_digits (GTK_SCALE (slider), 0); appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER); gtk_widget_ref (appbar); @@ -455,6 +482,9 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (toolbar_disc), "clicked", GTK_SIGNAL_FUNC (on_toolbar_disc_clicked), NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_network), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_network_clicked), + NULL); gtk_signal_connect (GTK_OBJECT (toolbar_back), "clicked", GTK_SIGNAL_FUNC (on_toolbar_back_clicked), NULL); @@ -482,16 +512,44 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked", GTK_SIGNAL_FUNC (on_toolbar_next_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (hscale), "button_release_event", - GTK_SIGNAL_FUNC (on_hscale_button_release_event), + gtk_signal_connect (GTK_OBJECT (slider), "button_press_event", + GTK_SIGNAL_FUNC (on_slider_button_press_event), NULL); - gtk_signal_connect (GTK_OBJECT (hscale), "button_press_event", - GTK_SIGNAL_FUNC (on_hscale_button_press_event), + gtk_signal_connect (GTK_OBJECT (slider), "button_release_event", + GTK_SIGNAL_FUNC (on_slider_button_release_event), NULL); return intf_window; } +static GnomeUIInfo popup_file_menu_uiinfo[] = +{ + { + GNOME_APP_UI_ITEM, N_("_Open File..."), + N_("Open a File"), + (gpointer) on_popup_open_activate, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, + 0, (GdkModifierType) 0, NULL + }, + { + GNOME_APP_UI_ITEM, N_("Open _Disc..."), + N_("Open a DVD or VCD"), + (gpointer) on_popup_disc_activate, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, + 0, (GdkModifierType) 0, NULL + }, + { + GNOME_APP_UI_ITEM, N_("_Network Stream..."), + N_("Select a Network Stream"), + (gpointer) on_popup_network_activate, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH, + 0, (GdkModifierType) 0, NULL + }, + GNOMEUIINFO_SEPARATOR, + GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL), + GNOMEUIINFO_END +}; + static GnomeUIInfo intf_popup_uiinfo[] = { { @@ -523,21 +581,6 @@ static GnomeUIInfo intf_popup_uiinfo[] = 0, (GdkModifierType) 0, NULL }, GNOMEUIINFO_SEPARATOR, - { - GNOME_APP_UI_ITEM, N_("_Open File..."), - N_("Open a File"), - (gpointer) on_popup_open_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, - 0, (GdkModifierType) 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Open _Disc..."), - N_("Open a DVD or VCD"), - (gpointer) on_popup_disc_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, - 0, (GdkModifierType) 0, NULL - }, - GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("_Navigation"), N_("Navigate through titles and chapters"), @@ -545,9 +588,8 @@ static GnomeUIInfo intf_popup_uiinfo[] = GNOME_APP_PIXMAP_NONE, NULL, 0, (GdkModifierType) 0, NULL }, - GNOMEUIINFO_SEPARATOR, { - GNOME_APP_UI_ITEM, N_("Audio"), + GNOME_APP_UI_ITEM, N_("_Audio"), N_("Select audio channel"), (gpointer) NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, @@ -560,8 +602,8 @@ static GnomeUIInfo intf_popup_uiinfo[] = GNOME_APP_PIXMAP_NONE, NULL, 0, (GdkModifierType) 0, NULL }, + GNOMEUIINFO_MENU_FILE_TREE (popup_file_menu_uiinfo), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL), GNOMEUIINFO_MENU_EXIT_ITEM (on_popup_exit_activate, NULL), GNOMEUIINFO_END }; @@ -597,61 +639,66 @@ create_intf_popup (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[4].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator3", intf_popup_uiinfo[4].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[5].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation", intf_popup_uiinfo[5].widget, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_set_sensitive (intf_popup_uiinfo[5].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[6].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_disc", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", intf_popup_uiinfo[6].widget, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_set_sensitive (intf_popup_uiinfo[6].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[7].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator3", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle", intf_popup_uiinfo[7].widget, (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_set_sensitive (intf_popup_uiinfo[7].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[8].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file", intf_popup_uiinfo[8].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[8].widget, FALSE); - gtk_widget_ref (intf_popup_uiinfo[9].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator8", - intf_popup_uiinfo[9].widget, + gtk_widget_ref (popup_file_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", + popup_file_menu_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[10].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", - intf_popup_uiinfo[10].widget, + gtk_widget_ref (popup_file_menu_uiinfo[1].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_disc", + popup_file_menu_uiinfo[1].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[10].widget, FALSE); - gtk_widget_ref (intf_popup_uiinfo[11].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle", - intf_popup_uiinfo[11].widget, + gtk_widget_ref (popup_file_menu_uiinfo[2].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_network", + popup_file_menu_uiinfo[2].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[11].widget, FALSE); - gtk_widget_ref (intf_popup_uiinfo[12].widget); + gtk_widget_ref (popup_file_menu_uiinfo[3].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator4", - intf_popup_uiinfo[12].widget, + popup_file_menu_uiinfo[3].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[13].widget); + gtk_widget_ref (popup_file_menu_uiinfo[4].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about", - intf_popup_uiinfo[13].widget, + popup_file_menu_uiinfo[4].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[14].widget); + gtk_widget_ref (intf_popup_uiinfo[9].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2", + intf_popup_uiinfo[9].widget, + (GtkDestroyNotify) gtk_widget_unref); + + gtk_widget_ref (intf_popup_uiinfo[10].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", - intf_popup_uiinfo[14].widget, + intf_popup_uiinfo[10].widget, (GtkDestroyNotify) gtk_widget_unref); return intf_popup; @@ -703,6 +750,7 @@ create_intf_fileopen (void) intf_fileopen = gtk_file_selection_new (_("Open File")); gtk_object_set_data (GTK_OBJECT (intf_fileopen), "intf_fileopen", intf_fileopen); gtk_container_set_border_width (GTK_CONTAINER (intf_fileopen), 10); + gtk_window_set_modal (GTK_WINDOW (intf_fileopen), TRUE); fileopen_ok = GTK_FILE_SELECTION (intf_fileopen)->ok_button; gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_ok", fileopen_ok); @@ -918,6 +966,7 @@ create_intf_disc (void) intf_disc = gnome_dialog_new (_("Open Disc"), NULL); gtk_object_set_data (GTK_OBJECT (intf_disc), "intf_disc", intf_disc); + gtk_window_set_modal (GTK_WINDOW (intf_disc), TRUE); gtk_window_set_policy (GTK_WINDOW (intf_disc), FALSE, FALSE, FALSE); dialog_vbox4 = GNOME_DIALOG (intf_disc)->vbox; @@ -1079,3 +1128,171 @@ create_intf_disc (void) return intf_disc; } +GtkWidget* +create_intf_network (void) +{ + GtkWidget *intf_network; + GtkWidget *vbox5; + GtkWidget *hbox3; + GtkWidget *frame3; + GtkWidget *vbox6; + GSList *network_group = NULL; + GtkWidget *network_ts; + GtkWidget *network_rtp; + GtkWidget *network_http; + GtkWidget *frame4; + GtkWidget *table2; + GtkWidget *label17; + GtkWidget *label18; + GtkObject *network_port_adj; + GtkWidget *network_port; + GtkWidget *network_server; + GtkWidget *hbuttonbox1; + GtkWidget *network_ok; + GtkWidget *network_cancel; + + intf_network = gnome_dialog_new (_("Network Stream"), NULL); + gtk_object_set_data (GTK_OBJECT (intf_network), "intf_network", intf_network); + gtk_window_set_modal (GTK_WINDOW (intf_network), TRUE); + gtk_window_set_policy (GTK_WINDOW (intf_network), FALSE, FALSE, FALSE); + + vbox5 = GNOME_DIALOG (intf_network)->vbox; + gtk_object_set_data (GTK_OBJECT (intf_network), "vbox5", vbox5); + gtk_widget_show (vbox5); + + hbox3 = gtk_hbox_new (FALSE, 5); + gtk_widget_ref (hbox3); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox3", hbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox3); + gtk_box_pack_start (GTK_BOX (vbox5), hbox3, TRUE, TRUE, 0); + + frame3 = gtk_frame_new (_("Protocol")); + gtk_widget_ref (frame3); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame3", frame3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame3); + gtk_box_pack_start (GTK_BOX (hbox3), frame3, TRUE, TRUE, 0); + + vbox6 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox6); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "vbox6", vbox6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox6); + gtk_container_add (GTK_CONTAINER (frame3), vbox6); + + network_ts = gtk_radio_button_new_with_label (network_group, _("TS")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_ts)); + gtk_widget_ref (network_ts); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_ts", network_ts, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_ts); + gtk_box_pack_start (GTK_BOX (vbox6), network_ts, FALSE, FALSE, 0); + + network_rtp = gtk_radio_button_new_with_label (network_group, _("RTP")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_rtp)); + gtk_widget_ref (network_rtp); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_rtp", network_rtp, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_rtp); + gtk_box_pack_start (GTK_BOX (vbox6), network_rtp, FALSE, FALSE, 0); + gtk_widget_set_sensitive (network_rtp, FALSE); + + network_http = gtk_radio_button_new_with_label (network_group, _("HTTP")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_http)); + gtk_widget_ref (network_http); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_http", network_http, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_http); + gtk_box_pack_start (GTK_BOX (vbox6), network_http, FALSE, FALSE, 0); + gtk_widget_set_sensitive (network_http, FALSE); + + frame4 = gtk_frame_new (_("Server")); + gtk_widget_ref (frame4); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame4", frame4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame4); + gtk_box_pack_start (GTK_BOX (hbox3), frame4, TRUE, TRUE, 0); + + table2 = gtk_table_new (2, 2, FALSE); + gtk_widget_ref (table2); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "table2", table2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (frame4), table2); + gtk_container_set_border_width (GTK_CONTAINER (table2), 5); + gtk_table_set_row_spacings (GTK_TABLE (table2), 5); + gtk_table_set_col_spacings (GTK_TABLE (table2), 5); + + label17 = gtk_label_new (_("Address")); + gtk_widget_ref (label17); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "label17", label17, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label17); + gtk_table_attach (GTK_TABLE (table2), label17, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label17), 0, 0.5); + + label18 = gtk_label_new (_("Port")); + gtk_widget_ref (label18); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "label18", label18, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label18); + gtk_table_attach (GTK_TABLE (table2), label18, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5); + + network_port_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10); + network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0); + gtk_widget_ref (network_port); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port", network_port, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_port); + gtk_table_attach (GTK_TABLE (table2), network_port, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + network_server = gtk_entry_new (); + gtk_widget_ref (network_server); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server", network_server, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_server); + gtk_table_attach (GTK_TABLE (table2), network_server, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_text (GTK_ENTRY (network_server), _("vls")); + + hbuttonbox1 = GNOME_DIALOG (intf_network)->action_area; + gtk_object_set_data (GTK_OBJECT (intf_network), "hbuttonbox1", hbuttonbox1); + gtk_widget_show (hbuttonbox1); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 8); + + gnome_dialog_append_button (GNOME_DIALOG (intf_network), GNOME_STOCK_BUTTON_OK); + network_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_network)->buttons)->data); + gtk_widget_ref (network_ok); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_ok", network_ok, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_ok); + GTK_WIDGET_SET_FLAGS (network_ok, GTK_CAN_DEFAULT); + + gnome_dialog_append_button (GNOME_DIALOG (intf_network), GNOME_STOCK_BUTTON_CANCEL); + network_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_network)->buttons)->data); + gtk_widget_ref (network_cancel); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_cancel", network_cancel, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_cancel); + GTK_WIDGET_SET_FLAGS (network_cancel, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (network_ok), "clicked", + GTK_SIGNAL_FUNC (on_network_ok_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (network_cancel), "clicked", + GTK_SIGNAL_FUNC (on_network_cancel_clicked), + NULL); + + return intf_network; +} + diff --git a/plugins/gnome/gnome_interface.h b/plugins/gnome/gnome_interface.h index 2979135585..6aed3c6dcf 100644 --- a/plugins/gnome/gnome_interface.h +++ b/plugins/gnome/gnome_interface.h @@ -9,3 +9,4 @@ GtkWidget* create_intf_fileopen (void); GtkWidget* create_intf_modules (void); GtkWidget* create_intf_playlist (void); GtkWidget* create_intf_disc (void); +GtkWidget* create_intf_network (void); diff --git a/plugins/gnome/intf_gnome.c b/plugins/gnome/intf_gnome.c index 9021e0635e..34ee18a17a 100644 --- a/plugins/gnome/intf_gnome.c +++ b/plugins/gnome/intf_gnome.c @@ -2,7 +2,7 @@ * intf_gnome.c: Gnome interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: intf_gnome.c,v 1.21 2001/03/15 00:37:04 stef Exp $ + * $Id: intf_gnome.c,v 1.22 2001/03/15 01:42:19 sam Exp $ * * Authors: Samuel Hocevar <sam@zoy.org> * @@ -49,10 +49,10 @@ #include "intf_msg.h" #include "interface.h" -#include "gnome_sys.h" #include "gnome_callbacks.h" #include "gnome_interface.h" #include "gnome_support.h" +#include "intf_gnome.h" #include "main.h" @@ -72,6 +72,7 @@ static gint GnomeChapterMenu ( gpointer, GtkWidget *, static gint GnomeTitleMenu ( gpointer, GtkWidget *, void (*pf_toggle)(GtkCheckMenuItem *, gpointer) ); static gint GnomeSetupMenu ( intf_thread_t * p_intf ); +static void GnomeDisplayDate ( GtkAdjustment *p_adj ); /***************************************************************************** * g_atexit: kludge to avoid the Gnome thread to segfault at exit @@ -144,14 +145,11 @@ static int intf_Open( intf_thread_t *p_intf ) p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_menus_update = 1; - p_intf->p_sys->b_scale_isfree = 1; + p_intf->p_sys->b_slider_free = 1; p_intf->p_sys->pf_gtk_callback = NULL; p_intf->p_sys->pf_gdk_callback = NULL; - /* Initialize lock */ - vlc_mutex_init( &p_intf->p_sys->change_lock ); - return( 0 ); } @@ -160,9 +158,6 @@ static int intf_Open( intf_thread_t *p_intf ) *****************************************************************************/ static void intf_Close( intf_thread_t *p_intf ) { - /* Destroy lock */ - vlc_mutex_destroy( &p_intf->p_sys->change_lock ); - /* Destroy structure */ free( p_intf->p_sys ); } @@ -180,20 +175,26 @@ static void intf_Run( intf_thread_t *p_intf ) /* gnome_init needs to know the command line. We don't care, so we * give it an empty one */ char *p_args[] = { "" }; + int i_args = 1; /* The data types we are allowed to receive */ static GtkTargetEntry target_table[] = { { "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST }, - { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN } + { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN } }; + /* intf_Manage callback timeout */ + int i_timeout; + /* Initialize Gnome */ - gnome_init( p_main->psz_arg0, VERSION, 1, p_args ); + gnome_init( p_main->psz_arg0, VERSION, i_args, p_args ); /* Create some useful widgets that will certainly be used */ p_intf->p_sys->p_window = create_intf_window( ); p_intf->p_sys->p_popup = create_intf_popup( ); + p_intf->p_sys->p_disc = create_intf_disc( ); + p_intf->p_sys->p_network = create_intf_network( ); /* Set the title of the main window */ gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window), @@ -204,12 +205,28 @@ static void intf_Run( intf_thread_t *p_intf ) GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY ); + /* Get the interface labels */ + #define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \ + GTK_OBJECT( p_intf->p_sys->p_window ), name ) ) + p_intf->p_sys->p_label_date = P_LABEL( "label_date" ); + p_intf->p_sys->p_label_status = P_LABEL( "label_status" ); + #undef P_LABEL + + /* Connect the date display to the slider */ + #define P_SLIDER GTK_RANGE( gtk_object_get_data( \ + GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) ) + p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER ); + + gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed", + GTK_SIGNAL_FUNC( GnomeDisplayDate ), NULL ); + p_intf->p_sys->f_adj_oldvalue = 0; + #undef P_SLIDER + /* We don't create these ones yet because we perhaps won't need them */ p_intf->p_sys->p_about = NULL; p_intf->p_sys->p_playlist = NULL; p_intf->p_sys->p_modules = NULL; p_intf->p_sys->p_fileopen = NULL; - p_intf->p_sys->p_disc = NULL; /* Store p_intf to keep an eye on it */ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), @@ -218,27 +235,40 @@ static void intf_Run( intf_thread_t *p_intf ) gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup), "p_intf", p_intf ); + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_disc), + "p_intf", p_intf ); + + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_network), + "p_intf", p_intf ); + + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj), + "p_intf", p_intf ); + /* Show the control window */ gtk_widget_show( p_intf->p_sys->p_window ); /* Sleep to avoid using all CPU - since some interfaces needs to access * keyboard events, a 100ms delay is a good compromise */ - p_intf->p_sys->i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, - GnomeManage, p_intf ); - + i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GnomeManage, p_intf ); /* Enter gnome mode */ gtk_main(); - /* launch stored callbacks */ + /* Remove the timeout */ + gtk_timeout_remove( i_timeout ); + + /* Get rid of stored callbacks so we can unload the plugin */ if( p_intf->p_sys->pf_gtk_callback != NULL ) { - p_intf->p_sys->pf_gtk_callback(); + p_intf->p_sys->pf_gtk_callback( ); + p_intf->p_sys->pf_gtk_callback = NULL; - if( p_intf->p_sys->pf_gdk_callback != NULL ) - { - p_intf->p_sys->pf_gdk_callback(); - } + } + + if( p_intf->p_sys->pf_gdk_callback != NULL ) + { + p_intf->p_sys->pf_gdk_callback( ); + p_intf->p_sys->pf_gdk_callback = NULL; } } @@ -252,9 +282,9 @@ static void intf_Run( intf_thread_t *p_intf ) *****************************************************************************/ static gint GnomeManage( gpointer p_data ) { - intf_thread_t *p_intf = (void *)p_data; +#define p_intf ((intf_thread_t *)p_data) - vlc_mutex_lock( &p_intf->p_sys->change_lock ); + vlc_mutex_lock( &p_intf->change_lock ); /* If the "display popup" flag has changed */ if( p_intf->b_menu_change ) @@ -272,26 +302,34 @@ static gint GnomeManage( gpointer p_data ) } /* Manage the slider */ - if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL - && p_intf->p_sys->b_scale_isfree ) + if( p_intf->p_input != NULL ) { - GtkWidget *p_scale; - GtkAdjustment *p_adj; - - p_scale = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( - p_intf->p_sys->p_window ), "hscale" ) ); - p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) ); - - /* Update the value */ - p_adj->value = ( 100. * - p_intf->p_input->stream.p_selected_area->i_tell ) / - p_intf->p_input->stream.p_selected_area->i_size; - - /* Gtv does it this way. Why not. */ - gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj ); - gtk_range_slider_update ( GTK_RANGE( p_scale ) ); - gtk_range_clear_background ( GTK_RANGE( p_scale ) ); - gtk_range_draw_background ( GTK_RANGE( p_scale ) ); + float newvalue = p_intf->p_sys->p_adj->value; + +#define p_area p_intf->p_input->stream.p_selected_area + /* If the user hasn't touched the slider since the last time, + * then the input can safely change it */ + if( newvalue == p_intf->p_sys->f_adj_oldvalue ) + { + /* Update the value */ + p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = + ( 100. * p_area->i_tell ) / p_area->i_size; + + gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ), + "value_changed" ); + } + /* Otherwise, send message to the input if the user has + * finished dragging the slider */ + else if( p_intf->p_sys->b_slider_free ) + { + off_t i_seek = ( newvalue * p_area->i_size ) / 100; + + input_Seek( p_intf->p_input, i_seek ); + + /* Update the old value */ + p_intf->p_sys->f_adj_oldvalue = newvalue; + } +#undef p_area } /* Manage core vlc functions through the callback */ @@ -299,19 +337,20 @@ static gint GnomeManage( gpointer p_data ) if( p_intf->b_die ) { - /* Make sure we won't be called again */ - gtk_timeout_remove( p_intf->p_sys->i_timeout ); - - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); /* Prepare to die, young Skywalker */ gtk_main_quit(); + + /* Just in case */ return( FALSE ); } - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); return( TRUE ); + +#undef p_intf } /***************************************************************************** @@ -665,3 +704,33 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf ) return TRUE; } + +/***************************************************************************** + * GnomeDisplayDate: display stream date + ***************************************************************************** + * This function displays the current date related to the position in + * the stream. It is called whenever the slider changes its value. + *****************************************************************************/ +void GnomeDisplayDate( GtkAdjustment *p_adj ) +{ + intf_thread_t *p_intf; + + p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" ); + + if( p_intf->p_input != NULL ) + { +#define p_area p_intf->p_input->stream.p_selected_area + char psz_time[ OFFSETTOTIME_MAX_SIZE ]; + + vlc_mutex_lock( &p_intf->p_input->stream.stream_lock ); + + gtk_label_set_text( p_intf->p_sys->p_label_date, + input_OffsetToTime( p_intf->p_input, psz_time, + ( p_area->i_size * p_adj->value ) / 100 ) ); + + vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock ); +#undef p_area + } +} + + diff --git a/plugins/gnome/intf_gnome.glade b/plugins/gnome/intf_gnome.glade index ddb0aaf27c..bddf1134b7 100644 --- a/plugins/gnome/intf_gnome.glade +++ b/plugins/gnome/intf_gnome.glade @@ -12,6 +12,7 @@ <gettext_support>True</gettext_support> <output_main_file>False</output_main_file> <output_build_files>False</output_build_files> + <backup_source_files>False</backup_source_files> <main_source_file>gnome_interface.c</main_source_file> <main_header_file>gnome_interface.h</main_header_file> <handler_source_file>gnome_callbacks.c</handler_source_file> @@ -110,6 +111,20 @@ <stock_icon>GNOME_STOCK_MENU_CDROM</stock_icon> </widget> + <widget> + <class>GtkPixmapMenuItem</class> + <name>menubar_network</name> + <tooltip>Select a Network Stream</tooltip> + <signal> + <name>activate</name> + <handler>on_menubar_network_activate</handler> + <last_modification_time>Mon, 12 Mar 2001 14:33:42 GMT</last_modification_time> + </signal> + <label>_Network Stream...</label> + <right_justify>False</right_justify> + <stock_icon>GNOME_STOCK_MENU_REFRESH</stock_icon> + </widget> + <widget> <class>GtkMenuItem</class> <name>separator1</name> @@ -266,7 +281,6 @@ <widget> <class>GnomeDockItem</class> <name>dockitem_toolbar</name> - <border_width>1</border_width> <placement>GNOME_DOCK_TOP</placement> <band>1</band> <position>0</position> @@ -281,7 +295,6 @@ <widget> <class>GtkToolbar</class> <name>toolbar</name> - <border_width>1</border_width> <orientation>GTK_ORIENTATION_HORIZONTAL</orientation> <type>GTK_TOOLBAR_BOTH</type> <space_size>16</space_size> @@ -317,6 +330,20 @@ <stock_pixmap>GNOME_STOCK_PIXMAP_CDROM</stock_pixmap> </widget> + <widget> + <class>GtkButton</class> + <child_name>Toolbar:button</child_name> + <name>toolbar_network</name> + <tooltip>Select a Network Stream</tooltip> + <signal> + <name>clicked</name> + <handler>on_toolbar_network_clicked</handler> + <last_modification_time>Mon, 12 Mar 2001 14:32:18 GMT</last_modification_time> + </signal> + <label>Net</label> + <stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap> + </widget> + <widget> <class>GtkButton</class> <child_name>Toolbar:button</child_name> @@ -462,82 +489,96 @@ <spacing>0</spacing> <widget> - <class>GtkEntry</class> - <name>entry1</name> - <can_focus>True</can_focus> - <editable>True</editable> - <text_visible>True</text_visible> - <text_max_length>0</text_max_length> - <text>Tired of boring stub messages ? Write your own exciting message here !!</text> + <class>GtkHBox</class> + <name>hbox4</name> + <homogeneous>True</homogeneous> + <spacing>0</spacing> <child> <padding>0</padding> - <expand>False</expand> - <fill>False</fill> + <expand>True</expand> + <fill>True</fill> </child> - </widget> - <widget> - <class>GtkLabel</class> - <name>label6</name> - <label>This part of the interface doesn't work yet. You can drag the slider below, though:</label> - <justify>GTK_JUSTIFY_LEFT</justify> - <wrap>False</wrap> - <xalign>0</xalign> - <yalign>0.5</yalign> - <xpad>5</xpad> - <ypad>0</ypad> - <child> - <padding>0</padding> - <expand>False</expand> - <fill>False</fill> - </child> + <widget> + <class>GtkLabel</class> + <name>label_date</name> + <label>-:--:--</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label_status</name> + <label>Status: foo</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> + + <widget> + <class>GtkLabel</class> + <name>label_bar</name> + <label>Bar: baz</label> + <justify>GTK_JUSTIFY_CENTER</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>False</fill> + </child> + </widget> </widget> <widget> <class>GtkHScale</class> - <name>hscale</name> + <name>slider</name> <can_focus>True</can_focus> <signal> - <name>button_release_event</name> - <handler>on_hscale_button_release_event</handler> - <last_modification_time>Tue, 13 Feb 2001 01:15:41 GMT</last_modification_time> + <name>button_press_event</name> + <handler>on_slider_button_press_event</handler> + <last_modification_time>Wed, 14 Mar 2001 13:46:55 GMT</last_modification_time> </signal> <signal> - <name>button_press_event</name> - <handler>on_hscale_button_press_event</handler> - <last_modification_time>Tue, 13 Feb 2001 02:55:04 GMT</last_modification_time> + <name>button_release_event</name> + <handler>on_slider_button_release_event</handler> + <last_modification_time>Wed, 14 Mar 2001 13:46:59 GMT</last_modification_time> </signal> - <draw_value>True</draw_value> - <value_pos>GTK_POS_BOTTOM</value_pos> - <digits>1</digits> - <policy>GTK_UPDATE_DELAYED</policy> + <draw_value>False</draw_value> + <value_pos>GTK_POS_TOP</value_pos> + <digits>0</digits> + <policy>GTK_UPDATE_CONTINUOUS</policy> <value>0</value> <lower>0</lower> <upper>100</upper> - <step>1</step> + <step>0</step> <page>6.25</page> <page_size>0</page_size> <child> <padding>0</padding> - <expand>False</expand> - <fill>False</fill> - </child> - </widget> - - <widget> - <class>GtkLabel</class> - <name>label13</name> - <label>HEY ! YOU CAN DROP A FILE ON VLC TOO :-)</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0.5</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>5</ypad> - <child> - <padding>0</padding> - <expand>False</expand> - <fill>False</fill> + <expand>True</expand> + <fill>True</fill> </child> </widget> </widget> @@ -613,40 +654,6 @@ <stock_icon>GNOME_STOCK_MENU_TIMER</stock_icon> </widget> - <widget> - <class>GtkMenuItem</class> - <name>separator2</name> - <right_justify>False</right_justify> - </widget> - - <widget> - <class>GtkPixmapMenuItem</class> - <name>popup_open</name> - <tooltip>Open a File</tooltip> - <signal> - <name>activate</name> - <handler>on_popup_open_activate</handler> - <last_modification_time>Sun, 04 Mar 2001 21:01:58 GMT</last_modification_time> - </signal> - <label>_Open File...</label> - <right_justify>False</right_justify> - <stock_icon>GNOME_STOCK_MENU_OPEN</stock_icon> - </widget> - - <widget> - <class>GtkPixmapMenuItem</class> - <name>popup_disc</name> - <tooltip>Open a DVD or VCD</tooltip> - <signal> - <name>activate</name> - <handler>on_popup_disc_activate</handler> - <last_modification_time>Sun, 04 Mar 2001 02:57:11 GMT</last_modification_time> - </signal> - <label>Open _Disc...</label> - <right_justify>False</right_justify> - <stock_icon>GNOME_STOCK_MENU_CDROM</stock_icon> - </widget> - <widget> <class>GtkMenuItem</class> <name>separator3</name> @@ -662,18 +669,12 @@ <right_justify>False</right_justify> </widget> - <widget> - <class>GtkMenuItem</class> - <name>separator8</name> - <right_justify>False</right_justify> - </widget> - <widget> <class>GtkMenuItem</class> <name>popup_audio</name> <sensitive>False</sensitive> <tooltip>Select audio channel</tooltip> - <label>Audio</label> + <label>_Audio</label> <right_justify>False</right_justify> </widget> @@ -688,19 +689,78 @@ <widget> <class>GtkMenuItem</class> - <name>separator4</name> - <right_justify>False</right_justify> + <name>popup_file</name> + <stock_item>GNOMEUIINFO_MENU_FILE_TREE</stock_item> + + <widget> + <class>GtkMenu</class> + <name>popup_file_menu</name> + + <widget> + <class>GtkPixmapMenuItem</class> + <name>popup_open</name> + <tooltip>Open a File</tooltip> + <signal> + <name>activate</name> + <handler>on_popup_open_activate</handler> + <last_modification_time>Sun, 04 Mar 2001 21:01:58 GMT</last_modification_time> + </signal> + <label>_Open File...</label> + <right_justify>False</right_justify> + <stock_icon>GNOME_STOCK_MENU_OPEN</stock_icon> + </widget> + + <widget> + <class>GtkPixmapMenuItem</class> + <name>popup_disc</name> + <tooltip>Open a DVD or VCD</tooltip> + <signal> + <name>activate</name> + <handler>on_popup_disc_activate</handler> + <last_modification_time>Sun, 04 Mar 2001 02:57:11 GMT</last_modification_time> + </signal> + <label>Open _Disc...</label> + <right_justify>False</right_justify> + <stock_icon>GNOME_STOCK_MENU_CDROM</stock_icon> + </widget> + + <widget> + <class>GtkPixmapMenuItem</class> + <name>popup_network</name> + <tooltip>Select a Network Stream</tooltip> + <signal> + <name>activate</name> + <handler>on_popup_network_activate</handler> + <last_modification_time>Mon, 12 Mar 2001 14:57:25 GMT</last_modification_time> + </signal> + <label>_Network Stream...</label> + <right_justify>False</right_justify> + <stock_icon>GNOME_STOCK_MENU_REFRESH</stock_icon> + </widget> + + <widget> + <class>GtkMenuItem</class> + <name>separator4</name> + <right_justify>False</right_justify> + </widget> + + <widget> + <class>GtkPixmapMenuItem</class> + <name>popup_about</name> + <signal> + <name>activate</name> + <handler>on_popup_about_activate</handler> + <last_modification_time>Mon, 12 Feb 2001 00:00:08 GMT</last_modification_time> + </signal> + <stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item> + </widget> + </widget> </widget> <widget> - <class>GtkPixmapMenuItem</class> - <name>popup_about</name> - <signal> - <name>activate</name> - <handler>on_popup_about_activate</handler> - <last_modification_time>Mon, 12 Feb 2001 00:00:08 GMT</last_modification_time> - </signal> - <stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item> + <class>GtkMenuItem</class> + <name>separator2</name> + <right_justify>False</right_justify> </widget> <widget> @@ -754,7 +814,7 @@ Henri Fallon <henri@via.ecp.fr> <title>Open File GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - False + True False True False @@ -1047,7 +1107,7 @@ Henri Fallon <henri@via.ecp.fr> Open Disc GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - False + True False False False @@ -1369,4 +1429,286 @@ Henri Fallon <henri@via.ecp.fr> + + GnomeDialog + intf_network + Network Stream + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox5 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + network_ok + True + True + + clicked + on_network_ok_clicked + Mon, 12 Mar 2001 14:56:40 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + network_cancel + True + True + + clicked + on_network_cancel_clicked + Mon, 12 Mar 2001 14:56:51 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkHBox + hbox3 + False + 5 + + 0 + True + True + + + + GtkFrame + frame3 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox6 + False + 0 + + + GtkRadioButton + network_ts + True + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_rtp + False + True + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_http + False + True + + False + True + network + + 0 + False + False + + + + + + + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table2 + 5 + 2 + 2 + False + 5 + 5 + + + GtkLabel + label17 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label18 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkSpinButton + network_port + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1234 + 0 + 65535 + 1 + 10 + 10 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + network_server + True + True + True + 0 + vls + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + + + + diff --git a/plugins/gnome/gnome_sys.h b/plugins/gnome/intf_gnome.h similarity index 79% rename from plugins/gnome/gnome_sys.h rename to plugins/gnome/intf_gnome.h index dab71dab7c..fadb04197f 100644 --- a/plugins/gnome/gnome_sys.h +++ b/plugins/gnome/intf_gnome.h @@ -1,8 +1,8 @@ /***************************************************************************** - * gnome_sys.h: private Gnome interface description + * intf_gnome.h: private Gnome interface description ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: gnome_sys.h,v 1.7 2001/03/07 11:56:33 stef Exp $ + * $Id: intf_gnome.h,v 1.3 2001/03/15 01:42:19 sam Exp $ * * Authors: Samuel Hocevar * @@ -33,18 +33,13 @@ typedef struct intf_sys_s { /* special actions */ - vlc_mutex_t change_lock; /* the change lock */ - boolean_t b_popup_changed; /* display menu ? */ boolean_t b_window_changed; /* window display toggled ? */ boolean_t b_playlist_changed; /* playlist display toggled ? */ - boolean_t b_scale_isfree; /* user isn't dragging scale ? */ + boolean_t b_slider_free; /* slider status */ boolean_t b_menus_update; - /* intf_Manage callback timeout */ - int i_timeout; - - /* windows and widgets */ + /* Windows and widgets */ GtkWidget * p_window; /* main window */ GtkWidget * p_popup; /* popup menu */ GtkWidget * p_playlist; /* playlist */ @@ -52,8 +47,17 @@ typedef struct intf_sys_s GtkWidget * p_about; /* about window */ GtkWidget * p_fileopen; /* file open window */ GtkWidget * p_disc; /* disc selection window */ + GtkWidget * p_network; /* network stream window */ + + /* The slider */ + GtkAdjustment * p_adj; /* slider adjustment object */ + float f_adj_oldvalue; /* previous value */ + + /* The window labels */ + GtkLabel * p_label_date; + GtkLabel * p_label_status; - /* XXX: ugly kludge */ + /* XXX: Ugly kludge, see intf_gnome.c */ void ( *pf_gtk_callback ) ( void ); void ( *pf_gdk_callback ) ( void ); diff --git a/plugins/gtk/gtk_callbacks.c b/plugins/gtk/gtk_callbacks.c index 78be55062f..81db397a2a 100644 --- a/plugins/gtk/gtk_callbacks.c +++ b/plugins/gtk/gtk_callbacks.c @@ -44,13 +44,13 @@ #include "input_ext-intf.h" #include "interface.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "intf_msg.h" #include "gtk_callbacks.h" #include "gtk_interface.h" #include "gtk_support.h" -#include "gtk_sys.h" +#include "intf_gtk.h" #include "main.h" @@ -90,7 +90,9 @@ on_menubar_exit_activate (GtkMenuItem *menuitem, { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + vlc_mutex_lock( &p_intf->change_lock ); p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); } void @@ -187,8 +189,8 @@ on_toolbar_prev_clicked (GtkButton *button, if( p_intf->p_input != NULL ) { /* FIXME: temporary hack */ - intf_PlstPrev( p_main->p_playlist ); - intf_PlstPrev( p_main->p_playlist ); + intf_PlaylistPrev( p_main->p_playlist ); + intf_PlaylistPrev( p_main->p_playlist ); p_intf->p_input->b_eof = 1; } } @@ -240,7 +242,9 @@ on_popup_exit_activate (GtkMenuItem *menuitem, { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + vlc_mutex_lock( &p_intf->change_lock ); p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); } void @@ -254,7 +258,7 @@ on_fileopen_ok_clicked (GtkButton *button, gtk_widget_hide (filesel); filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); } @@ -362,48 +366,6 @@ on_toolbar_fast_clicked (GtkButton *button, } -gboolean -on_hscale_button_release_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data) -{ - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); - - GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) ); - off_t i_seek; - - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_input != NULL ) - { - i_seek = (p_adj->value * - p_intf->p_input->stream.p_selected_area->i_size) / 100; - input_Seek( p_intf->p_input, i_seek ); - } - p_intf->p_sys->b_scale_isfree = 1; - - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); - - return FALSE; -} - - -gboolean -on_hscale_button_press_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data) -{ - intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); - - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - p_intf->p_sys->b_scale_isfree = 0; - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); - - return FALSE; -} - - - void on_intf_modules_destroy (GtkObject *object, gpointer user_data) @@ -477,7 +439,7 @@ on_intf_window_drag_data_received (GtkWidget *widget, p_intf->p_input->b_eof = 1; } - intf_PlstJumpto( p_main->p_playlist, end-1 ); + intf_PlaylistJumpto( p_main->p_playlist, end-1 ); } @@ -572,7 +534,7 @@ on_disc_ok_clicked (GtkButton *button, /* Build source name and add it to playlist */ sprintf( psz_source, "%s:%s", psz_method, psz_device ); - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); gtk_widget_hide( p_intf->p_sys->p_disc ); } @@ -731,7 +693,11 @@ on_intf_window_destroy (GtkWidget *widget, gpointer user_data) { intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); p_intf->b_die = 1; + vlc_mutex_unlock( &p_intf->change_lock ); + return TRUE; } @@ -764,7 +730,6 @@ on_playlist_clist_drag_motion (GtkWidget *widget, GtkCList * clist; gint row,col; int dummy; - gchar * text[2]; GdkColor color; intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" ); @@ -806,3 +771,135 @@ on_playlist_clist_drag_motion (GtkWidget *widget, return TRUE; } + +void +on_intf_network_destroy (GtkObject *object, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_network" ); + + p_intf->p_sys->p_network = NULL; +} + + +void +on_network_ok_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_network" ); + char *psz_source, *psz_server, *psz_protocol; + unsigned int i_port; + + psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget( + GTK_WIDGET(button), "network_server" ) ) ); + + /* Check which protocol was activated */ + if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), + "network_ts" ) )->active ) + { + psz_protocol = "ts"; + } + else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button), + "network_rtp" ) )->active ) + { + psz_protocol = "rtp"; + } + else + { + intf_ErrMsg( "intf error: unknown protocol toggle button position" ); + return; + } + + /* Get the port number and make sure it will not overflow 5 characters */ + i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( + lookup_widget( GTK_WIDGET(button), "network_port" ) ) ); + if( i_port > 65535 ) + { + intf_ErrMsg( "intf error: invalid port %i", i_port ); + } + + /* Allocate room for "protocol://server:port" */ + psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 ); + if( psz_source == NULL ) + { + return; + } + + /* Build source name and add it to playlist */ + sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source ); + free( psz_source ); + + gtk_widget_hide( p_intf->p_sys->p_network ); +} + + +void +on_network_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); +} + + +void +on_menubar_network_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); +} + + +void +on_popup_network_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); +} + +void +on_toolbar_network_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + gtk_widget_show( p_intf->p_sys->p_network ); + gdk_window_raise( p_intf->p_sys->p_network->window ); +} + + +gboolean +on_slider_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->p_sys->b_slider_free = 1; + vlc_mutex_unlock( &p_intf->change_lock ); + + return FALSE; +} + + +gboolean +on_slider_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->change_lock ); + p_intf->p_sys->b_slider_free = 0; + vlc_mutex_unlock( &p_intf->change_lock ); + + return FALSE; +} + diff --git a/plugins/gtk/gtk_callbacks.h b/plugins/gtk/gtk_callbacks.h index a55498f4b0..461f80ffdc 100644 --- a/plugins/gtk/gtk_callbacks.h +++ b/plugins/gtk/gtk_callbacks.h @@ -52,14 +52,8 @@ void on_toolbar_next_clicked (GtkButton *button, gpointer user_data); -gboolean -on_hscale_button_release_event (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data); - -gboolean -on_hscale_button_press_event (GtkWidget *widget, - GdkEventButton *event, +void +on_toolbar_network_clicked (GtkButton *button, gpointer user_data); void @@ -284,3 +278,33 @@ on_playlist_clist_drag_motion (GtkWidget *widget, gint y, guint time, gpointer user_data); + +void +on_intf_network_destroy (GtkObject *object, + gpointer user_data); + +void +on_network_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_network_cancel_clicked (GtkButton *button, + gpointer user_data); + +void +on_menubar_network_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_network_activate (GtkMenuItem *menuitem, + gpointer user_data); + +gboolean +on_slider_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); + +gboolean +on_slider_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); diff --git a/plugins/gtk/gtk_interface.c b/plugins/gtk/gtk_interface.c index d2deedb24a..1326ad705a 100644 --- a/plugins/gtk/gtk_interface.c +++ b/plugins/gtk/gtk_interface.c @@ -31,6 +31,7 @@ create_intf_window (void) GtkAccelGroup *menubar_file_menu_accels; GtkWidget *menubar_open; GtkWidget *menubar_disc; + GtkWidget *menubar_network; GtkWidget *separator4; GtkWidget *menubar_exit; GtkWidget *menubar_view; @@ -57,6 +58,7 @@ create_intf_window (void) GtkWidget *toolbar; GtkWidget *toolbar_open; GtkWidget *toolbar_disc; + GtkWidget *toolbar_network; GtkWidget *toolbar_back; GtkWidget *toolbar_stop; GtkWidget *toolbar_play; @@ -66,11 +68,12 @@ create_intf_window (void) GtkWidget *toolbar_playlist; GtkWidget *toolbar_prev; GtkWidget *toolbar_next; - GtkWidget *entry1; - GtkWidget *label6; - GtkWidget *hscale; - GtkWidget *label13; - GtkWidget *statusbar1; + GtkWidget *hbox7; + GtkWidget *label_date; + GtkWidget *label_status; + GtkWidget *label_bar; + GtkWidget *slider; + GtkWidget *intf_statusbar; GtkAccelGroup *accel_group; GtkTooltips *tooltips; @@ -147,6 +150,24 @@ create_intf_window (void) gtk_widget_show (menubar_disc); gtk_container_add (GTK_CONTAINER (menubar_file_menu), menubar_disc); gtk_tooltips_set_tip (tooltips, menubar_disc, _("Open a DVD or VCD"), NULL); + gtk_widget_add_accelerator (menubar_disc, "activate", accel_group, + GDK_F4, 0, + GTK_ACCEL_VISIBLE); + + menubar_network = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_network)->child), + _("_Network Stream...")); + gtk_widget_add_accelerator (menubar_network, "activate_item", menubar_file_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_network); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_network", menubar_network, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_network); + gtk_container_add (GTK_CONTAINER (menubar_file_menu), menubar_network); + gtk_tooltips_set_tip (tooltips, menubar_network, _("Select a Network Stream"), NULL); + gtk_widget_add_accelerator (menubar_network, "activate", accel_group, + GDK_F5, 0, + GTK_ACCEL_VISIBLE); separator4 = gtk_menu_item_new (); gtk_widget_ref (separator4); @@ -390,6 +411,17 @@ create_intf_window (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (toolbar_disc); + toolbar_network = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Net"), + _("Select a Network Stream"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_network); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_network", toolbar_network, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_network); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); toolbar_back = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), @@ -495,47 +527,48 @@ create_intf_window (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (toolbar_next); - entry1 = gtk_entry_new (); - gtk_widget_ref (entry1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "entry1", entry1, + hbox7 = gtk_hbox_new (TRUE, 0); + gtk_widget_ref (hbox7); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "hbox7", hbox7, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (entry1); - gtk_box_pack_start (GTK_BOX (vbox2), entry1, FALSE, TRUE, 0); - gtk_entry_set_text (GTK_ENTRY (entry1), _("Tired of boring stub messages ? Write your own exciting message here !!")); + gtk_widget_show (hbox7); + gtk_box_pack_start (GTK_BOX (vbox2), hbox7, TRUE, TRUE, 0); - label6 = gtk_label_new (_("This part of the interface doesn't work yet. You can drag the slider below, though:")); - gtk_widget_ref (label6); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "label6", label6, + label_date = gtk_label_new (_("-:--:--")); + gtk_widget_ref (label_date); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_date", label_date, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label6); - gtk_box_pack_start (GTK_BOX (vbox2), label6, FALSE, TRUE, 0); - gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); - gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5); - gtk_misc_set_padding (GTK_MISC (label6), 5, 0); + gtk_widget_show (label_date); + gtk_box_pack_start (GTK_BOX (hbox7), label_date, FALSE, FALSE, 0); - hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0))); - gtk_widget_ref (hscale); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale, + label_status = gtk_label_new (_("Status: foo")); + gtk_widget_ref (label_status); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_status", label_status, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hscale); - gtk_box_pack_start (GTK_BOX (vbox2), hscale, FALSE, TRUE, 0); - gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_BOTTOM); - gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED); + gtk_widget_show (label_status); + gtk_box_pack_start (GTK_BOX (hbox7), label_status, FALSE, FALSE, 0); - label13 = gtk_label_new (_("HEY ! YOU CAN DROP A FILE ON VLC TOO :-)")); - gtk_widget_ref (label13); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "label13", label13, + label_bar = gtk_label_new (_("Bar: baz")); + gtk_widget_ref (label_bar); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_bar", label_bar, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label13); - gtk_box_pack_start (GTK_BOX (vbox2), label13, FALSE, TRUE, 0); - gtk_misc_set_padding (GTK_MISC (label13), 0, 5); + gtk_widget_show (label_bar); + gtk_box_pack_start (GTK_BOX (hbox7), label_bar, FALSE, FALSE, 0); - statusbar1 = gtk_statusbar_new (); - gtk_widget_ref (statusbar1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "statusbar1", statusbar1, + slider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0))); + gtk_widget_ref (slider); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider", slider, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (statusbar1); - gtk_box_pack_end (GTK_BOX (vbox2), statusbar1, FALSE, TRUE, 0); + gtk_widget_show (slider); + gtk_box_pack_start (GTK_BOX (vbox2), slider, TRUE, TRUE, 0); + gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE); + + intf_statusbar = gtk_statusbar_new (); + gtk_widget_ref (intf_statusbar); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "intf_statusbar", intf_statusbar, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (intf_statusbar); + gtk_box_pack_start (GTK_BOX (vbox2), intf_statusbar, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (intf_window), "drag_data_received", GTK_SIGNAL_FUNC (on_intf_window_drag_data_received), @@ -549,6 +582,9 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (menubar_disc), "activate", GTK_SIGNAL_FUNC (on_menubar_disc_activate), NULL); + gtk_signal_connect (GTK_OBJECT (menubar_network), "activate", + GTK_SIGNAL_FUNC (on_menubar_network_activate), + NULL); gtk_signal_connect (GTK_OBJECT (menubar_exit), "activate", GTK_SIGNAL_FUNC (on_menubar_exit_activate), NULL); @@ -570,6 +606,9 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (toolbar_disc), "clicked", GTK_SIGNAL_FUNC (on_toolbar_disc_clicked), NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_network), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_network_clicked), + NULL); gtk_signal_connect (GTK_OBJECT (toolbar_back), "clicked", GTK_SIGNAL_FUNC (on_toolbar_back_clicked), NULL); @@ -597,11 +636,11 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked", GTK_SIGNAL_FUNC (on_toolbar_next_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (hscale), "button_release_event", - GTK_SIGNAL_FUNC (on_hscale_button_release_event), + gtk_signal_connect (GTK_OBJECT (slider), "button_release_event", + GTK_SIGNAL_FUNC (on_slider_button_release_event), NULL); - gtk_signal_connect (GTK_OBJECT (hscale), "button_press_event", - GTK_SIGNAL_FUNC (on_hscale_button_press_event), + gtk_signal_connect (GTK_OBJECT (slider), "button_press_event", + GTK_SIGNAL_FUNC (on_slider_button_press_event), NULL); gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips); @@ -622,16 +661,20 @@ create_intf_popup (void) GtkWidget *popup_slow; GtkWidget *popup_fast; GtkWidget *separator6; - GtkWidget *popup_open; - GtkWidget *popup_disc; + GtkWidget *main_window_toggle; GtkWidget *separator5; GtkWidget *popup_navigation; - GtkWidget *separator10; GtkWidget *popup_audio; GtkWidget *popup_subpictures; - GtkWidget *separator9; - GtkWidget *main_window_toggle; + GtkWidget *popup_file; + GtkWidget *popup_file_menu; + GtkAccelGroup *popup_file_menu_accels; + GtkWidget *popup_open; + GtkWidget *popup_disc; + GtkWidget *popup_network; + GtkWidget *separator12; GtkWidget *popup_about; + GtkWidget *separator9; GtkWidget *popup_exit; GtkTooltips *tooltips; @@ -681,29 +724,16 @@ create_intf_popup (void) gtk_container_add (GTK_CONTAINER (intf_popup), separator6); gtk_widget_set_sensitive (separator6, FALSE); - popup_open = gtk_menu_item_new_with_label (""); - tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_open)->child), - _("_Open File...")); - gtk_widget_add_accelerator (popup_open, "activate_item", intf_popup_accels, - tmp_key, 0, 0); - gtk_widget_ref (popup_open); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", popup_open, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (popup_open); - gtk_container_add (GTK_CONTAINER (intf_popup), popup_open); - gtk_tooltips_set_tip (tooltips, popup_open, _("Open a File"), NULL); - - popup_disc = gtk_menu_item_new_with_label (""); - tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_disc)->child), - _("Open _Disc...")); - gtk_widget_add_accelerator (popup_disc, "activate_item", intf_popup_accels, + main_window_toggle = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (main_window_toggle)->child), + _("Toggle _Interface")); + gtk_widget_add_accelerator (main_window_toggle, "activate_item", intf_popup_accels, tmp_key, 0, 0); - gtk_widget_ref (popup_disc); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_disc", popup_disc, + gtk_widget_ref (main_window_toggle); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "main_window_toggle", main_window_toggle, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (popup_disc); - gtk_container_add (GTK_CONTAINER (intf_popup), popup_disc); - gtk_tooltips_set_tip (tooltips, popup_disc, _("Open a DVD or VCD"), NULL); + gtk_widget_show (main_window_toggle); + gtk_container_add (GTK_CONTAINER (intf_popup), main_window_toggle); separator5 = gtk_menu_item_new (); gtk_widget_ref (separator5); @@ -713,7 +743,11 @@ create_intf_popup (void) gtk_container_add (GTK_CONTAINER (intf_popup), separator5); gtk_widget_set_sensitive (separator5, FALSE); - popup_navigation = gtk_menu_item_new_with_label (_("Navigation")); + popup_navigation = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_navigation)->child), + _("_Navigation")); + gtk_widget_add_accelerator (popup_navigation, "activate_item", intf_popup_accels, + tmp_key, 0, 0); gtk_widget_ref (popup_navigation); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation", popup_navigation, (GtkDestroyNotify) gtk_widget_unref); @@ -721,17 +755,9 @@ create_intf_popup (void) gtk_container_add (GTK_CONTAINER (intf_popup), popup_navigation); gtk_widget_set_sensitive (popup_navigation, FALSE); - separator10 = gtk_menu_item_new (); - gtk_widget_ref (separator10); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator10", separator10, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (separator10); - gtk_container_add (GTK_CONTAINER (intf_popup), separator10); - gtk_widget_set_sensitive (separator10, FALSE); - popup_audio = gtk_menu_item_new_with_label (""); tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_audio)->child), - _("A_udio")); + _("_Audio")); gtk_widget_add_accelerator (popup_audio, "activate_item", intf_popup_accels, tmp_key, 0, 0); gtk_widget_ref (popup_audio); @@ -743,7 +769,7 @@ create_intf_popup (void) popup_subpictures = gtk_menu_item_new_with_label (""); tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_subpictures)->child), - _("Sub _Pictures")); + _("_Subpictures")); gtk_widget_add_accelerator (popup_subpictures, "activate_item", intf_popup_accels, tmp_key, 0, 0); gtk_widget_ref (popup_subpictures); @@ -753,35 +779,86 @@ create_intf_popup (void) gtk_container_add (GTK_CONTAINER (intf_popup), popup_subpictures); gtk_widget_set_sensitive (popup_subpictures, FALSE); - separator9 = gtk_menu_item_new (); - gtk_widget_ref (separator9); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator9", separator9, + popup_file = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_file)->child), + _("_File")); + gtk_widget_add_accelerator (popup_file, "activate_item", intf_popup_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_file); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file", popup_file, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (separator9); - gtk_container_add (GTK_CONTAINER (intf_popup), separator9); - gtk_widget_set_sensitive (separator9, FALSE); + gtk_widget_show (popup_file); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_file); - main_window_toggle = gtk_menu_item_new_with_label (""); - tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (main_window_toggle)->child), - _("show/hide main _window")); - gtk_widget_add_accelerator (main_window_toggle, "activate_item", intf_popup_accels, + popup_file_menu = gtk_menu_new (); + gtk_widget_ref (popup_file_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file_menu", popup_file_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (popup_file), popup_file_menu); + popup_file_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (popup_file_menu)); + + popup_open = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_open)->child), + _("_Open File...")); + gtk_widget_add_accelerator (popup_open, "activate_item", popup_file_menu_accels, tmp_key, 0, 0); - gtk_widget_ref (main_window_toggle); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "main_window_toggle", main_window_toggle, + gtk_widget_ref (popup_open); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", popup_open, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (main_window_toggle); - gtk_container_add (GTK_CONTAINER (intf_popup), main_window_toggle); + gtk_widget_show (popup_open); + gtk_container_add (GTK_CONTAINER (popup_file_menu), popup_open); + gtk_tooltips_set_tip (tooltips, popup_open, _("Open a File"), NULL); + + popup_disc = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_disc)->child), + _("Open _Disc...")); + gtk_widget_add_accelerator (popup_disc, "activate_item", popup_file_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_disc); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_disc", popup_disc, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_disc); + gtk_container_add (GTK_CONTAINER (popup_file_menu), popup_disc); + gtk_tooltips_set_tip (tooltips, popup_disc, _("Open a DVD or VCD"), NULL); + + popup_network = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_network)->child), + _("_Network Stream...")); + gtk_widget_add_accelerator (popup_network, "activate_item", popup_file_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_network); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_network", popup_network, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_network); + gtk_container_add (GTK_CONTAINER (popup_file_menu), popup_network); + gtk_tooltips_set_tip (tooltips, popup_network, _("Select a Network Stream"), NULL); + + separator12 = gtk_menu_item_new (); + gtk_widget_ref (separator12); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator12", separator12, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (separator12); + gtk_container_add (GTK_CONTAINER (popup_file_menu), separator12); + gtk_widget_set_sensitive (separator12, FALSE); popup_about = gtk_menu_item_new_with_label (""); tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child), _("_About...")); - gtk_widget_add_accelerator (popup_about, "activate_item", intf_popup_accels, + gtk_widget_add_accelerator (popup_about, "activate_item", popup_file_menu_accels, tmp_key, 0, 0); gtk_widget_ref (popup_about); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about", popup_about, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (popup_about); - gtk_container_add (GTK_CONTAINER (intf_popup), popup_about); + gtk_container_add (GTK_CONTAINER (popup_file_menu), popup_about); + + separator9 = gtk_menu_item_new (); + gtk_widget_ref (separator9); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator9", separator9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (separator9); + gtk_container_add (GTK_CONTAINER (intf_popup), separator9); + gtk_widget_set_sensitive (separator9, FALSE); popup_exit = gtk_menu_item_new_with_label (""); tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_exit)->child), @@ -806,14 +883,17 @@ create_intf_popup (void) gtk_signal_connect (GTK_OBJECT (popup_fast), "activate", GTK_SIGNAL_FUNC (on_popup_fast_activate), NULL); + gtk_signal_connect (GTK_OBJECT (main_window_toggle), "activate", + GTK_SIGNAL_FUNC (on_main_window_toggle), + NULL); gtk_signal_connect (GTK_OBJECT (popup_open), "activate", GTK_SIGNAL_FUNC (on_popup_open_activate), NULL); gtk_signal_connect (GTK_OBJECT (popup_disc), "activate", GTK_SIGNAL_FUNC (on_popup_disc_activate), NULL); - gtk_signal_connect (GTK_OBJECT (main_window_toggle), "activate", - GTK_SIGNAL_FUNC (on_main_window_toggle), + gtk_signal_connect (GTK_OBJECT (popup_network), "activate", + GTK_SIGNAL_FUNC (on_popup_network_activate), NULL); gtk_signal_connect (GTK_OBJECT (popup_about), "activate", GTK_SIGNAL_FUNC (on_popup_about_activate), @@ -883,7 +963,7 @@ create_intf_about (void) gtk_widget_show (frame1); gtk_box_pack_start (GTK_BOX (vbox3), frame1, FALSE, FALSE, 0); - label16 = gtk_label_new (_("R\351gis Duchesne \nMichel Lespinasse \nOlivier Pomel \nPierre Baillet \nJean-Philippe Grimaldi \nAndres Krapf \nChristophe Massiot \nVincent Seguin \nBenoit Steiner \nArnaud de Bossoreille de Ribou \nJean-Marc Dressler \nGa\353l Hendryckx \nSamuel Hocevar \nBrieuc Jeunhomme \nMichel Kaempf \nSt\351phane Borel \nRenaud Dartus \nHenri Fallon ")); + label16 = gtk_label_new (_("Régis Duchesne \nMichel Lespinasse \nOlivier Pomel \nPierre Baillet \nJean-Philippe Grimaldi \nAndres Krapf \nChristophe Massiot \nVincent Seguin \nBenoit Steiner \nArnaud de Bossoreille de Ribou \nJean-Marc Dressler \nGaël Hendryckx \nSamuel Hocevar \nBrieuc Jeunhomme \nMichel Kaempf \nStéphane Borel \nRenaud Dartus \nHenri Fallon ")); gtk_widget_ref (label16); gtk_object_set_data_full (GTK_OBJECT (intf_about), "label16", label16, (GtkDestroyNotify) gtk_widget_unref); @@ -934,6 +1014,7 @@ create_intf_fileopen (void) intf_fileopen = gtk_file_selection_new (_("Select File")); gtk_object_set_data (GTK_OBJECT (intf_fileopen), "intf_fileopen", intf_fileopen); gtk_container_set_border_width (GTK_CONTAINER (intf_fileopen), 10); + gtk_window_set_modal (GTK_WINDOW (intf_fileopen), TRUE); fileopen_ok = GTK_FILE_SELECTION (intf_fileopen)->ok_button; gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_ok", fileopen_ok); @@ -989,6 +1070,7 @@ create_intf_disc (void) intf_disc = gtk_dialog_new (); gtk_object_set_data (GTK_OBJECT (intf_disc), "intf_disc", intf_disc); gtk_window_set_title (GTK_WINDOW (intf_disc), _("Open Disc")); + gtk_window_set_modal (GTK_WINDOW (intf_disc), TRUE); gtk_window_set_policy (GTK_WINDOW (intf_disc), FALSE, FALSE, FALSE); dialog_vbox2 = GTK_DIALOG (intf_disc)->vbox; @@ -1323,3 +1405,196 @@ create_intf_playlist (void) return intf_playlist; } +GtkWidget* +create_intf_network (void) +{ + GtkWidget *intf_network; + GtkWidget *vbox7; + GtkWidget *vbox8; + GtkWidget *hbox6; + GtkWidget *frame4; + GtkWidget *vbox9; + GSList *network_group = NULL; + GtkWidget *network_ts; + GtkWidget *network_rtp; + GtkWidget *network_http; + GtkWidget *frame5; + GtkWidget *table2; + GtkObject *network_port_adj; + GtkWidget *network_port; + GtkWidget *label24; + GtkWidget *label25; + GtkWidget *network_server; + GtkWidget *hbox4; + GtkWidget *hbox5; + GtkWidget *network_ok; + GtkWidget *network_cancel; + + intf_network = gtk_dialog_new (); + gtk_object_set_data (GTK_OBJECT (intf_network), "intf_network", intf_network); + gtk_window_set_title (GTK_WINDOW (intf_network), _("Open Disc")); + gtk_window_set_modal (GTK_WINDOW (intf_network), TRUE); + gtk_window_set_policy (GTK_WINDOW (intf_network), FALSE, FALSE, FALSE); + + vbox7 = GTK_DIALOG (intf_network)->vbox; + gtk_object_set_data (GTK_OBJECT (intf_network), "vbox7", vbox7); + gtk_widget_show (vbox7); + gtk_container_set_border_width (GTK_CONTAINER (vbox7), 5); + + vbox8 = gtk_vbox_new (FALSE, 5); + gtk_widget_ref (vbox8); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "vbox8", vbox8, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox8); + gtk_box_pack_start (GTK_BOX (vbox7), vbox8, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (vbox8), 5); + + hbox6 = gtk_hbox_new (FALSE, 5); + gtk_widget_ref (hbox6); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox6", hbox6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox6); + gtk_box_pack_start (GTK_BOX (vbox8), hbox6, TRUE, TRUE, 0); + + frame4 = gtk_frame_new (_("Protocol")); + gtk_widget_ref (frame4); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame4", frame4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame4); + gtk_box_pack_start (GTK_BOX (hbox6), frame4, TRUE, TRUE, 0); + + vbox9 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox9); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "vbox9", vbox9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox9); + gtk_container_add (GTK_CONTAINER (frame4), vbox9); + + network_ts = gtk_radio_button_new_with_label (network_group, _("TS")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_ts)); + gtk_widget_ref (network_ts); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_ts", network_ts, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_ts); + gtk_box_pack_start (GTK_BOX (vbox9), network_ts, FALSE, FALSE, 0); + + network_rtp = gtk_radio_button_new_with_label (network_group, _("RTP")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_rtp)); + gtk_widget_ref (network_rtp); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_rtp", network_rtp, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_rtp); + gtk_box_pack_start (GTK_BOX (vbox9), network_rtp, FALSE, FALSE, 0); + gtk_widget_set_sensitive (network_rtp, FALSE); + + network_http = gtk_radio_button_new_with_label (network_group, _("HTTP")); + network_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network_http)); + gtk_widget_ref (network_http); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_http", network_http, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_http); + gtk_box_pack_start (GTK_BOX (vbox9), network_http, FALSE, FALSE, 0); + gtk_widget_set_sensitive (network_http, FALSE); + + frame5 = gtk_frame_new (_("Server")); + gtk_widget_ref (frame5); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "frame5", frame5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (frame5); + gtk_box_pack_start (GTK_BOX (hbox6), frame5, TRUE, TRUE, 0); + + table2 = gtk_table_new (2, 2, FALSE); + gtk_widget_ref (table2); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "table2", table2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table2); + gtk_container_add (GTK_CONTAINER (frame5), table2); + gtk_container_set_border_width (GTK_CONTAINER (table2), 5); + gtk_table_set_row_spacings (GTK_TABLE (table2), 5); + gtk_table_set_col_spacings (GTK_TABLE (table2), 5); + + network_port_adj = gtk_adjustment_new (1234, 0, 65535, 1, 10, 10); + network_port = gtk_spin_button_new (GTK_ADJUSTMENT (network_port_adj), 1, 0); + gtk_widget_ref (network_port); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_port", network_port, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_port); + gtk_table_attach (GTK_TABLE (table2), network_port, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + + label24 = gtk_label_new (_("Port")); + gtk_widget_ref (label24); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "label24", label24, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label24); + gtk_table_attach (GTK_TABLE (table2), label24, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label24), 0, 0.5); + + label25 = gtk_label_new (_("Address")); + gtk_widget_ref (label25); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "label25", label25, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label25); + gtk_table_attach (GTK_TABLE (table2), label25, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label25), 0, 0.5); + + network_server = gtk_entry_new (); + gtk_widget_ref (network_server); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_server", network_server, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_server); + gtk_table_attach (GTK_TABLE (table2), network_server, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_entry_set_text (GTK_ENTRY (network_server), _("vls")); + + hbox4 = GTK_DIALOG (intf_network)->action_area; + gtk_object_set_data (GTK_OBJECT (intf_network), "hbox4", hbox4); + gtk_widget_show (hbox4); + gtk_container_set_border_width (GTK_CONTAINER (hbox4), 5); + + hbox5 = gtk_hbox_new (TRUE, 5); + gtk_widget_ref (hbox5); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "hbox5", hbox5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox5); + gtk_box_pack_end (GTK_BOX (hbox4), hbox5, FALSE, TRUE, 0); + + network_ok = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (network_ok); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_ok", network_ok, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_ok); + gtk_box_pack_start (GTK_BOX (hbox5), network_ok, FALSE, TRUE, 0); + + network_cancel = gtk_button_new_with_label (_("Cancel")); + gtk_widget_ref (network_cancel); + gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_cancel", network_cancel, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (network_cancel); + gtk_box_pack_start (GTK_BOX (hbox5), network_cancel, FALSE, TRUE, 0); + + gtk_signal_connect (GTK_OBJECT (intf_network), "destroy", + GTK_SIGNAL_FUNC (on_intf_network_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (network_ts), "toggled", + GTK_SIGNAL_FUNC (on_disc_dvd_toggled), + NULL); + gtk_signal_connect (GTK_OBJECT (network_rtp), "toggled", + GTK_SIGNAL_FUNC (on_disc_vcd_toggled), + NULL); + gtk_signal_connect (GTK_OBJECT (network_ok), "clicked", + GTK_SIGNAL_FUNC (on_network_ok_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (network_cancel), "clicked", + GTK_SIGNAL_FUNC (on_network_cancel_clicked), + NULL); + + return intf_network; +} + diff --git a/plugins/gtk/gtk_interface.h b/plugins/gtk/gtk_interface.h index a3e05d915c..1a13837c8e 100644 --- a/plugins/gtk/gtk_interface.h +++ b/plugins/gtk/gtk_interface.h @@ -8,3 +8,4 @@ GtkWidget* create_intf_about (void); GtkWidget* create_intf_fileopen (void); GtkWidget* create_intf_disc (void); GtkWidget* create_intf_playlist (void); +GtkWidget* create_intf_network (void); diff --git a/plugins/gtk/gtk_playlist.c b/plugins/gtk/gtk_playlist.c index 7bed04ec21..381e2505ed 100644 --- a/plugins/gtk/gtk_playlist.c +++ b/plugins/gtk/gtk_playlist.c @@ -1,9 +1,9 @@ /***************************************************************************** - * playlist_interface.c : Interface for the playlist dialog + * gtk_playlist.c : Interface for the playlist dialog ***************************************************************************** - * Copyright (C) 2000, 2001 VideoLAN + * Copyright (C) 2001 VideoLAN * - * Authors: .Pierre Baillet + * Authors: Pierre Baillet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,14 +48,14 @@ #include "input_ext-intf.h" #include "interface.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "intf_msg.h" #include "intf_urldecode.h" #include "gtk_callbacks.h" #include "gtk_interface.h" #include "gtk_support.h" -#include "gtk_sys.h" +#include "intf_gtk.h" #include "main.h" @@ -142,7 +142,7 @@ void deleteGListItem(gpointer data, gpointer param) int curRow = ( int )data; intf_thread_t * p_intf = param; - intf_PlstDelete( p_main->p_playlist, curRow ); + intf_PlaylistDelete( p_main->p_playlist, curRow ); /* are we deleting the current played stream */ if( p_intf->p_sys->i_playing == curRow ) @@ -205,7 +205,7 @@ on_invertselection_clicked (GtkMenuItem *item, gpointer user_data) playlist_p = p_main->p_playlist; /* lock the struct */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); + vlc_mutex_lock( &p_intf->change_lock ); clist = GTK_CLIST( lookup_widget(p_intf->p_sys->p_playlist,"playlist_clist") ); /* have to copy the selection to an int * @@ -228,7 +228,7 @@ on_invertselection_clicked (GtkMenuItem *item, gpointer user_data) } free( selected ); gtk_clist_thaw( clist ); - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); } void @@ -257,7 +257,7 @@ on_delete_clicked (GtkMenuItem *item, playlist_p = p_main->p_playlist; /* lock the struct */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); + vlc_mutex_lock( &p_intf->change_lock ); clist = GTK_CLIST( lookup_widget(p_intf->p_sys->p_playlist,"playlist_clist") ); /* I use UNDOCUMENTED features to retrieve the selection... */ @@ -276,7 +276,7 @@ on_delete_clicked (GtkMenuItem *item, rebuildCList( clist, playlist_p ); } - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); } gboolean @@ -406,7 +406,7 @@ void on_generic_drop_data_received( intf_thread_t * p_intf, if(files != NULL) { /* lock the interface */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); + vlc_mutex_lock( &p_intf->change_lock ); intf_WarnMsg( 1, "List has %d elements",g_list_length( files ) ); intf_AppendList( p_playlist, position, files ); @@ -417,7 +417,7 @@ void on_generic_drop_data_received( intf_thread_t * p_intf, rebuildCList( clist , p_playlist ); /* unlock the interface */ - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); } } @@ -514,7 +514,7 @@ int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list ) length = g_list_length( list ); for( dummy=0; dummyp_input->b_eof = 1; } - intf_PlstJumpto( p_main->p_playlist, row-1 ); + intf_PlaylistJumpto( p_main->p_playlist, row-1 ); } return TRUE; } @@ -564,12 +564,13 @@ on_playlist_clist_event (GtkWidget *widget, void GtkPlayListManage( gpointer p_data ) { /* this thing really sucks for now :( */ - /* TODO speak more with interface/intf_plst.c */ + + /* TODO speak more with interface/intf_playlist.c */ intf_thread_t *p_intf = (void *)p_data; playlist_t * p_playlist = p_main->p_playlist ; - vlc_mutex_lock( &p_intf->p_sys->change_lock ); + vlc_mutex_lock( &p_intf->change_lock ); if( p_intf->p_sys->i_playing != p_playlist->i_index ) { @@ -597,6 +598,6 @@ void GtkPlayListManage( gpointer p_data ) } p_intf->p_sys->i_playing = p_playlist->i_index; } - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); } diff --git a/plugins/gtk/intf_gtk.c b/plugins/gtk/intf_gtk.c index 619d204feb..04b40ecd67 100644 --- a/plugins/gtk/intf_gtk.c +++ b/plugins/gtk/intf_gtk.c @@ -2,7 +2,7 @@ * intf_gtk.c: Gtk+ interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: intf_gtk.c,v 1.9 2001/03/09 19:38:47 octplane Exp $ + * $Id: intf_gtk.c,v 1.10 2001/03/15 01:42:20 sam Exp $ * * Authors: Samuel Hocevar * Stéphane Borel @@ -53,7 +53,7 @@ #include "gtk_callbacks.h" #include "gtk_interface.h" #include "gtk_support.h" -#include "gtk_sys.h" +#include "intf_gtk.h" #include "main.h" @@ -72,8 +72,9 @@ static gint GtkChapterMenu ( gpointer, GtkWidget *, void (*pf_activate)(GtkMenuItem *, gpointer) ); static gint GtkTitleMenu ( gpointer, GtkWidget *, void (*pf_activate)(GtkMenuItem *, gpointer) ); -void GtkPlayListManage( gpointer p_data ); +static void GtkDisplayDate ( GtkAdjustment *p_adj ); +void GtkPlayListManage( gpointer p_data ); /***************************************************************************** * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit @@ -146,7 +147,7 @@ static int intf_Open( intf_thread_t *p_intf ) p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_menus_update = 1; - p_intf->p_sys->b_scale_isfree = 1; + p_intf->p_sys->b_slider_free = 1; p_intf->p_sys->i_playing = -1; @@ -154,9 +155,6 @@ static int intf_Open( intf_thread_t *p_intf ) p_intf->p_sys->pf_gtk_callback = NULL; p_intf->p_sys->pf_gdk_callback = NULL; - /* Initialize lock */ - vlc_mutex_init( &p_intf->p_sys->change_lock ); - return( 0 ); } @@ -165,9 +163,6 @@ static int intf_Open( intf_thread_t *p_intf ) *****************************************************************************/ static void intf_Close( intf_thread_t *p_intf ) { - /* Destroy lock */ - vlc_mutex_destroy( &p_intf->p_sys->change_lock ); - /* Destroy structure */ free( p_intf->p_sys ); } @@ -184,10 +179,9 @@ static void intf_Run( intf_thread_t *p_intf ) { /* gtk_init needs to know the command line. We don't care, so we * give it an empty one */ - char *p_args[] = { "" }; - char **pp_args = p_args; - int i_args = 1; - GtkWidget * temp; + char *p_args[] = { "" }; + char **pp_args = p_args; + int i_args = 1; /* The data types we are allowed to receive */ static GtkTargetEntry target_table[] = @@ -196,12 +190,17 @@ static void intf_Run( intf_thread_t *p_intf ) { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN } }; + /* intf_Manage callback timeout */ + int i_timeout; + /* Initialize Gtk+ */ gtk_init( &i_args, &pp_args ); /* Create some useful widgets that will certainly be used */ p_intf->p_sys->p_window = create_intf_window( ); p_intf->p_sys->p_popup = create_intf_popup( ); + p_intf->p_sys->p_disc = create_intf_disc( ); + p_intf->p_sys->p_network = create_intf_network( ); p_intf->p_sys->p_playlist = create_intf_playlist( ); @@ -215,18 +214,32 @@ static void intf_Run( intf_thread_t *p_intf ) 1, GDK_ACTION_COPY ); /* Accept file drops on the playlist window */ - temp = lookup_widget(p_intf->p_sys->p_playlist, "playlist_clist"); - - - gtk_drag_dest_set( GTK_WIDGET( temp ), + gtk_drag_dest_set( GTK_WIDGET( lookup_widget( p_intf->p_sys->p_playlist, + "playlist_clist") ), GTK_DEST_DEFAULT_ALL, target_table, 1, GDK_ACTION_COPY ); + /* Get the interface labels */ + #define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \ + GTK_OBJECT( p_intf->p_sys->p_window ), name ) ) + p_intf->p_sys->p_label_date = P_LABEL( "label_date" ); + p_intf->p_sys->p_label_status = P_LABEL( "label_status" ); + #undef P_LABEL + + /* Connect the date display to the slider */ + #define P_SLIDER GTK_RANGE( gtk_object_get_data( \ + GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) ) + p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER ); + + gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed", + GTK_SIGNAL_FUNC( GtkDisplayDate ), NULL ); + p_intf->p_sys->f_adj_oldvalue = 0; + #undef P_SLIDER + /* We don't create these ones yet because we perhaps won't need them */ p_intf->p_sys->p_about = NULL; p_intf->p_sys->p_modules = NULL; p_intf->p_sys->p_fileopen = NULL; - p_intf->p_sys->p_disc = NULL; /* Store p_intf to keep an eye on it */ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), @@ -238,22 +251,29 @@ static void intf_Run( intf_thread_t *p_intf ) gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist), "p_intf", p_intf ); - + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_disc), + "p_intf", p_intf ); + + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_network), + "p_intf", p_intf ); + + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj), + "p_intf", p_intf ); /* Show the control window */ gtk_widget_show( p_intf->p_sys->p_window ); - /* Sleep to avoid using all CPU - since some interfaces needs to access * keyboard events, a 100ms delay is a good compromise */ - p_intf->p_sys->i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, - GtkManage, p_intf ); - + i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GtkManage, p_intf ); /* Enter Gtk mode */ gtk_main(); - /* launch stored callbacks */ + /* Remove the timeout */ + gtk_timeout_remove( i_timeout ); + + /* Launch stored callbacks */ if( p_intf->p_sys->pf_gtk_callback != NULL ) { p_intf->p_sys->pf_gtk_callback(); @@ -276,12 +296,11 @@ static void intf_Run( intf_thread_t *p_intf ) static gint GtkManage( gpointer p_data ) { - intf_thread_t *p_intf = (void *)p_data; +#define p_intf ((intf_thread_t *)p_data) GtkPlayListManage( p_data ); - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - + vlc_mutex_lock( &p_intf->change_lock ); /* If the "display popup" flag has changed */ if( p_intf->b_menu_change ) @@ -372,47 +391,55 @@ static gint GtkManage( gpointer p_data ) } /* Manage the slider */ - if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL - && p_intf->p_sys->b_scale_isfree ) + if( p_intf->p_input != NULL ) { - GtkWidget *p_scale; - GtkAdjustment *p_adj; - - p_scale = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( - p_intf->p_sys->p_window ), "hscale" ) ); - p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) ); - - /* Update the value */ - p_adj->value = ( 100. * - p_intf->p_input->stream.p_selected_area->i_tell ) / - p_intf->p_input->stream.p_selected_area->i_size; - - /* Gtv does it this way. Why not. */ - gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj ); - gtk_range_slider_update ( GTK_RANGE( p_scale ) ); - gtk_range_clear_background ( GTK_RANGE( p_scale ) ); - gtk_range_draw_background ( GTK_RANGE( p_scale ) ); - } + float newvalue = p_intf->p_sys->p_adj->value; +#define p_area p_intf->p_input->stream.p_selected_area + /* If the user hasn't touched the slider since the last time, + * then the input can safely change it */ + if( newvalue == p_intf->p_sys->f_adj_oldvalue ) + { + /* Update the value */ + p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = + ( 100. * p_area->i_tell ) / p_area->i_size; + + gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ), + "value_changed" ); + } + /* Otherwise, send message to the input if the user has + * finished dragging the slider */ + else if( p_intf->p_sys->b_slider_free ) + { + off_t i_seek = ( newvalue * p_area->i_size ) / 100; + + input_Seek( p_intf->p_input, i_seek ); + + /* Update the old value */ + p_intf->p_sys->f_adj_oldvalue = newvalue; + } +#undef p_area + } /* Manage core vlc functions through the callback */ p_intf->pf_manage( p_intf ); if( p_intf->b_die ) { - /* Make sure we won't be called again */ - gtk_timeout_remove( p_intf->p_sys->i_timeout ); - - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); /* Prepare to die, young Skywalker */ gtk_main_quit(); + + /* Just in case */ return( FALSE ); } - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + vlc_mutex_unlock( &p_intf->change_lock ); return( TRUE ); + +#undef p_intf } /***************************************************************************** @@ -701,3 +728,27 @@ static gint GtkTitleMenu( gpointer p_data, return TRUE; } + +void GtkDisplayDate( GtkAdjustment *p_adj ) +{ + intf_thread_t *p_intf; + + p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" ); + + if( p_intf->p_input != NULL ) + { +#define p_area p_intf->p_input->stream.p_selected_area + char psz_time[ OFFSETTOTIME_MAX_SIZE ]; + + vlc_mutex_lock( &p_intf->p_input->stream.stream_lock ); + + gtk_label_set_text( p_intf->p_sys->p_label_date, + input_OffsetToTime( p_intf->p_input, psz_time, + ( p_area->i_size * p_adj->value ) / 100 ) ); + + vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock ); +#undef p_area + } +} + + diff --git a/plugins/gtk/intf_gtk.glade b/plugins/gtk/intf_gtk.glade index 4478da0649..096880317e 100644 --- a/plugins/gtk/intf_gtk.glade +++ b/plugins/gtk/intf_gtk.glade @@ -97,6 +97,11 @@ GtkMenuItem menubar_disc Open a DVD or VCD + + 0 + GDK_F4 + activate + activate on_menubar_disc_activate @@ -106,6 +111,24 @@ False + + GtkMenuItem + menubar_network + Select a Network Stream + + 0 + GDK_F5 + activate + + + activate + on_menubar_network_activate + Mon, 12 Mar 2001 21:55:15 GMT + + + False + + GtkMenuItem separator4 @@ -326,6 +349,19 @@ + + GtkButton + Toolbar:button + toolbar_network + Select a Network Stream + + clicked + on_toolbar_network_clicked + Sun, 04 Mar 2001 02:55:35 GMT + + + + GtkButton Toolbar:button @@ -454,55 +490,86 @@ - GtkEntry - entry1 - True - True - True - 0 - Tired of boring stub messages ? Write your own exciting message here !! + GtkHBox + hbox7 + True + 0 0 - False + True True - - - GtkLabel - label6 - - GTK_JUSTIFY_LEFT - False - 0 - 0.5 - 5 - 0 - - 0 - False - True - + + GtkLabel + label_date + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label_status + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label_bar + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + GtkHScale - hscale + slider True button_release_event - on_hscale_button_release_event - Tue, 13 Feb 2001 01:15:41 GMT + on_slider_button_release_event + Wed, 14 Mar 2001 15:58:36 GMT button_press_event - on_hscale_button_press_event - Tue, 13 Feb 2001 02:55:04 GMT + on_slider_button_press_event + Wed, 14 Mar 2001 15:58:42 GMT - True - GTK_POS_BOTTOM + False + GTK_POS_TOP 1 - GTK_UPDATE_DELAYED + GTK_UPDATE_CONTINUOUS 0 0 100 @@ -511,36 +578,18 @@ 0 0 - False - True - - - - - GtkLabel - label13 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 5 - - 0 - False + True True GtkStatusbar - statusbar1 + intf_statusbar 0 False - True - GTK_PACK_END + False @@ -606,27 +655,13 @@ GtkMenuItem - popup_open - Open a File - - activate - on_popup_open_activate - Sun, 04 Mar 2001 21:00:48 GMT - - - False - - - - GtkMenuItem - popup_disc - Open a DVD or VCD + main_window_toggle activate - on_popup_disc_activate - Sun, 04 Mar 2001 03:04:11 GMT + on_main_window_toggle + Thu, 08 Mar 2001 10:37:08 GMT - + False @@ -640,13 +675,7 @@ GtkMenuItem popup_navigation False - - False - - - - GtkMenuItem - separator10 + False @@ -654,7 +683,7 @@ GtkMenuItem popup_audio False - + False @@ -662,37 +691,82 @@ GtkMenuItem popup_subpictures False - + False GtkMenuItem - separator9 + popup_file + False - - - GtkMenuItem - main_window_toggle - - activate - on_main_window_toggle - Thu, 08 Mar 2001 10:37:08 GMT - - - False + + GtkMenu + popup_file_menu + + + GtkMenuItem + popup_open + Open a File + + activate + on_popup_open_activate + Sun, 04 Mar 2001 21:00:48 GMT + + + False + + + + GtkMenuItem + popup_disc + Open a DVD or VCD + + activate + on_popup_disc_activate + Sun, 04 Mar 2001 03:04:11 GMT + + + False + + + + GtkMenuItem + popup_network + Select a Network Stream + + activate + on_popup_network_activate + Mon, 12 Mar 2001 21:57:31 GMT + + + False + + + + GtkMenuItem + separator12 + False + + + + GtkMenuItem + popup_about + + activate + on_popup_about_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + GtkMenuItem - popup_about - - activate - on_popup_about_activate - Wed, 21 Feb 2001 08:41:04 GMT - - + separator9 False @@ -882,7 +956,7 @@ Henri Fallon <henri@via.ecp.fr> Select File GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - False + True False True False @@ -925,7 +999,7 @@ Henri Fallon <henri@via.ecp.fr> Open Disc GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE - False + True False False False @@ -1440,4 +1514,328 @@ Henri Fallon <henri@via.ecp.fr> + + GtkDialog + intf_network + + destroy + on_intf_network_destroy + Mon, 12 Mar 2001 21:45:22 GMT + + Open Disc + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + False + + + GtkVBox + Dialog:vbox + vbox7 + 5 + False + 0 + + + GtkHBox + Dialog:action_area + hbox4 + 5 + True + 5 + + 0 + False + True + GTK_PACK_END + + + + GtkHBox + hbox5 + True + 5 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + network_ok + True + + clicked + on_network_ok_clicked + Mon, 12 Mar 2001 21:45:01 GMT + + + GTK_RELIEF_NORMAL + + 0 + False + True + + + + + GtkButton + network_cancel + True + + clicked + on_network_cancel_clicked + Mon, 12 Mar 2001 21:44:52 GMT + + + GTK_RELIEF_NORMAL + + 0 + False + True + + + + + + + GtkVBox + vbox8 + 5 + False + 5 + + 0 + True + True + + + + GtkHBox + hbox6 + False + 5 + + 0 + True + True + + + + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox9 + False + 0 + + + GtkRadioButton + network_ts + True + + toggled + on_disc_dvd_toggled + Sun, 04 Mar 2001 02:50:56 GMT + + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_rtp + False + True + + toggled + on_disc_vcd_toggled + Sun, 04 Mar 2001 02:51:00 GMT + + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_http + False + True + + False + True + network + + 0 + False + False + + + + + + + GtkFrame + frame5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table2 + 5 + 2 + 2 + False + 5 + 5 + + + GtkSpinButton + network_port + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1234 + 0 + 65535 + 1 + 10 + 10 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label24 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label25 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + network_server + True + True + True + 0 + vls + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + + + + + diff --git a/plugins/gtk/gtk_sys.h b/plugins/gtk/intf_gtk.h similarity index 83% rename from plugins/gtk/gtk_sys.h rename to plugins/gtk/intf_gtk.h index e358f14003..30f9f9ae5e 100644 --- a/plugins/gtk/gtk_sys.h +++ b/plugins/gtk/intf_gtk.h @@ -1,8 +1,8 @@ /***************************************************************************** - * gtk_sys.h: private Gtk+ interface description + * intf_gtk.h: private Gtk+ interface description ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: gtk_sys.h,v 1.5 2001/03/09 19:38:47 octplane Exp $ + * $Id: intf_gtk.h,v 1.1 2001/03/15 01:42:20 sam Exp $ * * Authors: Samuel Hocevar * @@ -36,25 +36,18 @@ static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) "p_intf" ) ); } - - - /***************************************************************************** * intf_sys_t: description and status of Gtk+ interface *****************************************************************************/ typedef struct intf_sys_s { /* special actions */ - vlc_mutex_t change_lock; /* the change lock */ - boolean_t b_popup_changed; /* display menu ? */ boolean_t b_window_changed; /* window display toggled ? */ boolean_t b_playlist_changed; /* playlist display toggled ? */ boolean_t b_menus_update; /* menus have changed ? */ - boolean_t b_scale_isfree; /* user isn't dragging scale ? */ + boolean_t b_slider_free; /* slider status */ - /* intf_Manage callback timeout */ - int i_timeout; int i_list_timeout; /* Playlist selected item */ @@ -68,8 +61,17 @@ typedef struct intf_sys_s GtkWidget * p_about; /* about window */ GtkWidget * p_fileopen; /* file open window */ GtkWidget * p_disc; /* disc selection window */ + GtkWidget * p_network; /* network stream window */ + + /* The slider */ + GtkAdjustment * p_adj; /* slider adjustment object */ + float f_adj_oldvalue; /* previous value */ + + /* The window labels */ + GtkLabel * p_label_date; + GtkLabel * p_label_status; - /* XXX: ugly kludge */ + /* XXX: Ugly kludge, see intf_gnome.c */ void ( *pf_gtk_callback ) ( void ); void ( *pf_gdk_callback ) ( void ); diff --git a/plugins/mpeg/input_ps.c b/plugins/mpeg/input_ps.c index 8da1618fd3..b9190e360d 100644 --- a/plugins/mpeg/input_ps.c +++ b/plugins/mpeg/input_ps.c @@ -2,7 +2,7 @@ * input_ps.c: PS demux and packet management ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: input_ps.c,v 1.10 2001/03/02 15:51:22 massiot Exp $ + * $Id: input_ps.c,v 1.11 2001/03/15 01:42:20 sam Exp $ * * Authors: Christophe Massiot * @@ -371,7 +371,7 @@ static int PSRead( input_thread_t * p_input, /* It is common for MPEG-1 streams to pad with zeros * (although it is forbidden by the recommendation), so * don't bother everybody in this case. */ - intf_WarnMsg( 1, "Garbage at input (%x)", i_startcode ); + intf_WarnMsg( 1, "Garbage at input (%.8x)", i_startcode ); } while( (i_startcode & 0xFFFFFF00) != 0x100L ) diff --git a/plugins/qt/.cvsignore b/plugins/qt/.cvsignore new file mode 100644 index 0000000000..e978b1085b --- /dev/null +++ b/plugins/qt/.cvsignore @@ -0,0 +1 @@ +*.moc diff --git a/plugins/qt/intf_qt.cpp b/plugins/qt/intf_qt.cpp new file mode 100644 index 0000000000..5aeff867ae --- /dev/null +++ b/plugins/qt/intf_qt.cpp @@ -0,0 +1,618 @@ +/***************************************************************************** + * intf_qt.cpp: Qt interface + ***************************************************************************** + * Copyright (C) 1999, 2000 VideoLAN + * $Id: intf_qt.cpp,v 1.1 2001/03/15 01:42:20 sam Exp $ + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +extern "C" +{ + +#define MODULE_NAME qt +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include /* ENOMEM */ +#include /* free() */ +#include /* strerror() */ +#include + +#include "config.h" +#include "common.h" +#include "threads.h" +#include "mtime.h" +#include "tests.h" +#include "modules.h" + +#include "stream_control.h" +#include "input_ext-intf.h" + +#include "intf_msg.h" +#include "intf_playlist.h" +#include "interface.h" + +#include "main.h" + +} /* extern "C" */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/***************************************************************************** + * Local Qt slider class + *****************************************************************************/ +class IntfSlider : public QSlider +{ + Q_OBJECT + +public: + IntfSlider( intf_thread_t *, QWidget * ); /* Constructor and destructor */ + ~IntfSlider(); + + bool b_free; /* Is the slider free ? */ + + int oldvalue ( void ) { return i_oldvalue; }; + void setOldValue( int i_value ) { i_oldvalue = i_value; }; + +private slots: + void SlideStart ( void ) { b_free = FALSE; }; + void SlideStop ( void ) { b_free = TRUE; }; + +private: + intf_thread_t *p_intf; + int i_oldvalue; +}; + +/***************************************************************************** + * Local Qt interface window class + *****************************************************************************/ +class IntfWindow : public QMainWindow +{ + Q_OBJECT + +public: + IntfWindow( intf_thread_t * ); + ~IntfWindow(); + +private slots: + void Manage( void ); + + void FileOpen ( void ); + void FileQuit ( void ) { p_intf->b_die = 1; }; + + void PlaybackPlay ( void ); + void PlaybackPause ( void ); + void PlaybackSlow ( void ); + void PlaybackFast ( void ); + + void PlaylistPrev ( void ); + void PlaylistNext ( void ); + + void DateDisplay ( int ); + void About ( void ); + + void Unimplemented( void ) { intf_WarnMsg( 3, "intf warning: " + "unimplemented function" ); }; + +private: + intf_thread_t *p_intf; + + IntfSlider *p_slider; + + QToolBar *p_toolbar; + QPopupMenu *p_popup; + QLabel *p_date; +}; + +#include "intf_qt.moc" + +#define SLIDER_MIN 0x00000 +#define SLIDER_MAX 0x10000 +#define SLIDER_STEP (SLIDER_MAX >> 4) + +/***************************************************************************** + * intf_sys_t: description and status of Qt interface + *****************************************************************************/ +typedef struct intf_sys_s +{ + QApplication *p_app; + IntfWindow *p_window; + +} intf_sys_t; + +/***************************************************************************** + * Local prototypes. + *****************************************************************************/ +static int intf_Probe ( probedata_t *p_data ); +static int intf_Open ( intf_thread_t *p_intf ); +static void intf_Close ( intf_thread_t *p_intf ); +static void intf_Run ( intf_thread_t *p_intf ); + +/***************************************************************************** + * Functions exported as capabilities. They are declared as static so that + * we don't pollute the namespace too much. + *****************************************************************************/ +extern "C" +{ + +void _M( intf_getfunctions )( function_list_t * p_function_list ) +{ + p_function_list->pf_probe = intf_Probe; + p_function_list->functions.intf.pf_open = intf_Open; + p_function_list->functions.intf.pf_close = intf_Close; + p_function_list->functions.intf.pf_run = intf_Run; +} + +} + +/***************************************************************************** + * intf_Probe: probe the interface and return a score + ***************************************************************************** + * This function tries to initialize Qt and returns a score to the + * plugin manager so that it can select the best plugin. + *****************************************************************************/ +static int intf_Probe( probedata_t *p_data ) +{ + if( TestMethod( INTF_METHOD_VAR, "qt" ) ) + { + return( 999 ); + } + + if( TestProgram( "qvlc" ) ) + { + return( 180 ); + } + + return( 80 ); +} + +/***************************************************************************** + * intf_Open: initialize and create window + *****************************************************************************/ +static int intf_Open( intf_thread_t *p_intf ) +{ + char *pp_argv[] = { "" }; + int i_argc = 1; + + /* Allocate instance and initialize some members */ + p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) ); + if( p_intf->p_sys == NULL ) + { + intf_ErrMsg( "intf error: %s", strerror(ENOMEM) ); + return( 1 ); + } + + /* Create the C++ objects */ + p_intf->p_sys->p_app = new QApplication( i_argc, pp_argv ); + p_intf->p_sys->p_window = new IntfWindow( p_intf ); + + /* Tell the world we are here */ + p_intf->p_sys->p_window->setCaption( VOUT_TITLE " (Qt interface)" ); + + return( 0 ); +} + +/***************************************************************************** + * intf_Close: destroy interface window + *****************************************************************************/ +static void intf_Close( intf_thread_t *p_intf ) +{ + /* Get rid of the C++ objects */ + delete p_intf->p_sys->p_window; + delete p_intf->p_sys->p_app; + + /* Destroy structure */ + free( p_intf->p_sys ); +} + +/***************************************************************************** + * intf_Run: Qt thread + ***************************************************************************** + * This part of the interface is in a separate thread so that we can call + * exec() from within it without annoying the rest of the program. + *****************************************************************************/ +static void intf_Run( intf_thread_t *p_intf ) +{ + p_intf->p_sys->p_window->show(); + + p_intf->p_sys->p_app->exec(); +} + +/* following functions are local */ + +/***************************************************************************** + * IntfWindow: interface window creator + ***************************************************************************** + * This function creates the interface window, and populates it with a + * menu bar, a toolbar and a slider. + *****************************************************************************/ +IntfWindow::IntfWindow( intf_thread_t *p_intf ) + :QMainWindow( 0 ) +{ + setUsesTextLabel( TRUE ); + + this->p_intf = p_intf; + + /* + * Create the toolbar + */ + + p_toolbar = new QToolBar( this, "toolbar" ); + p_toolbar->setHorizontalStretchable( TRUE ); + + QPixmap pixmap = QPixmap( 0, 0 ); + +#define addbut( l, t, s ) new QToolButton( pixmap, l, t, this, s, p_toolbar ); + addbut( "Open", "Open a File", SLOT(FileOpen()) ); + addbut( "Disc", "Open a DVD or VCD", SLOT(Unimplemented()) ); + addbut( "Net", "Select a Network Stream", SLOT(Unimplemented()) ); + p_toolbar->addSeparator(); + addbut( "Back", "Rewind Stream", SLOT(Unimplemented()) ); + addbut( "Stop", "Stop Stream", SLOT(Unimplemented()) ); + addbut( "Play", "Play Stream", SLOT(PlaybackPlay()) ); + addbut( "Pause", "Pause Stream", SLOT(PlaybackPause()) ); + addbut( "Slow", "Play Slower", SLOT(PlaybackSlow()) ); + addbut( "Fast", "Play Faster", SLOT(PlaybackFast()) ); + p_toolbar->addSeparator(); + addbut( "Playlist", "Open Playlist", SLOT(Unimplemented()) ); + addbut( "Prev", "Previous File", SLOT(PlaylistPrev()) ); + addbut( "Next", "Next File", SLOT(PlaylistNext()) ); +#undef addbut + + /* + * Create the menubar + */ + + QPopupMenu * p_tmpmenu = new QPopupMenu( this ); + +#define instmp( x, y... ) p_tmpmenu->insertItem( x, this, ## y ) + menuBar()->insertItem( "&File", p_tmpmenu ); + instmp( "&Open File...", SLOT(FileOpen()), Key_F3 ); + instmp( "Open &Disc...", SLOT(Unimplemented()), Key_F4 ); + instmp( "&Network Stream...", SLOT(Unimplemented()), Key_F5 ); + p_tmpmenu->insertSeparator(); + instmp( "&Exit", SLOT(FileQuit()), CTRL+Key_Q ); + + p_tmpmenu = new QPopupMenu( this ); + menuBar()->insertItem( "&View", p_tmpmenu ); + instmp( "&Playlist...", SLOT(Unimplemented()) ); + instmp( "&Modules...", SLOT(Unimplemented()) ); + + p_tmpmenu = new QPopupMenu( this ); + menuBar()->insertItem( "&Settings", p_tmpmenu ); + instmp( "&Preferences...", SLOT(Unimplemented()) ); + + p_tmpmenu = new QPopupMenu( this ); + menuBar()->insertItem( "&Help", p_tmpmenu ); + instmp( "&About...", SLOT(About()) ); +#undef instmp + + /* + * Create the popup menu + */ + + p_popup = new QPopupMenu( /* floating menu */ ); + +#define inspop( x, y... ) p_popup->insertItem( x, this, ## y ) + inspop( "&Play", SLOT(PlaybackPlay()) ); + inspop( "Pause", SLOT(PlaybackPause()) ); + inspop( "&Slow", SLOT(PlaybackSlow()) ); + inspop( "&Fast", SLOT(PlaybackFast()) ); + p_popup->insertSeparator(); + inspop( "&Open File...", SLOT(FileOpen()), Key_F3 ); + inspop( "Open &Disc...", SLOT(Unimplemented()), Key_F4 ); + inspop( "&Network Stream...", SLOT(Unimplemented()), Key_F5 ); + p_popup->insertSeparator(); + inspop( "&About...", SLOT(About()) ); + inspop( "&Exit", SLOT(FileQuit()) ); +#undef inspop + + /* Activate the statusbar */ + statusBar(); + + /* Add the vertical box */ + QVBox * p_vbox = new QVBox( this ); + setCentralWidget( p_vbox ); + + /* The horizontal box */ + QHBox * p_hbox = new QHBox( p_vbox ); + + /* The date label */ + p_date = new QLabel( p_hbox ); + p_date->setAlignment( AlignHCenter | AlignVCenter ); + p_date->setText( "-:--:--" ); + + /* The status label */ + QLabel *p_label = new QLabel( p_hbox ); + p_label->setAlignment( AlignHCenter | AlignVCenter ); + p_label->setText( "Status: foo" ); + + /* The bar label */ + p_label = new QLabel( p_hbox ); + p_label->setAlignment( AlignHCenter | AlignVCenter ); + p_label->setText( "Bar: baz quux" ); + + /* Create the slider and connect it to the date label */ + p_slider = new IntfSlider( p_intf, p_vbox ); + + connect( p_slider, SIGNAL(valueChanged(int)), + this, SLOT(DateDisplay(int)) ); + + /* The timer */ + QTimer *p_timer = new QTimer( this ); + connect( p_timer, SIGNAL(timeout()), this, SLOT(Manage()) ); + p_timer->start( INTF_IDLE_SLEEP / 1000 ); + + /* Everything worked fine */ + resize( 620, 30 ); +} + +/***************************************************************************** + * ~IntfWindow: interface window destructor + ***************************************************************************** + * This function is called when the interface window is destroyed. + *****************************************************************************/ +IntfWindow::~IntfWindow( void ) +{ + /* FIXME: remove everything cleanly */ +} + +/***************************************************************************** + * DateDisplay: display date + ***************************************************************************** + * This function displays the current date in the date label. + *****************************************************************************/ +void IntfWindow::DateDisplay( int i_range ) +{ + if( p_intf->p_input != NULL ) + { + char psz_time[ OFFSETTOTIME_MAX_SIZE ]; + + vlc_mutex_lock( &p_intf->p_input->stream.stream_lock ); + p_date->setText( input_OffsetToTime( p_intf->p_input, psz_time, + ( p_intf->p_input->stream.p_selected_area->i_size * i_range ) + / SLIDER_MAX ) ); + vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock ); + } +} + +/***************************************************************************** + * FileOpen: open a file + ***************************************************************************** + * This function opens a file requester and adds the selected file to + * the playlist. + *****************************************************************************/ +void IntfWindow::FileOpen( void ) +{ + QString file = QFileDialog::getOpenFileName( QString::null, + QString::null, this ); + + if( file.isEmpty() ) + { + statusBar()->message( "No file loaded", 2000 ); + } + else + { + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, file.latin1() ); + } +} + +/***************************************************************************** + * About: display the "about" box + ***************************************************************************** + * This function displays a simple "about" box with copyright information. + *****************************************************************************/ +void IntfWindow::About( void ) +{ + QMessageBox::about( this, "About", + "VideoLAN Client\n" + "(C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team\n" + "\n" + "This is the VideoLAN client, a DVD and MPEG player.\n" + "It can play MPEG and MPEG 2 files from a file " + "or from a network source.\n" + "\n" + "More information: http://www.videolan.org/" ); +} + +/***************************************************************************** + * Manage: manage main thread messages + ***************************************************************************** + * In this function, called approx. 10 times a second, we check what the + * main program wanted to tell us. + *****************************************************************************/ +void IntfWindow::Manage( void ) +{ + /* Manage the slider */ + if( p_intf->p_input != NULL ) + { + int i_value = p_slider->value(); + +#define p_area p_intf->p_input->stream.p_selected_area + /* If the user hasn't touched the slider since the last time, + * then the input can safely change it */ + if( i_value == p_slider->oldvalue() ) + { + i_value = ( SLIDER_MAX * p_area->i_tell ) / p_area->i_size; + + p_slider->setValue( i_value ); + p_slider->setOldValue( i_value ); + } + /* Otherwise, send message to the input if the user has + * finished dragging the slider */ + else if( p_slider->b_free ) + { + off_t i_seek = ( i_value * p_area->i_size ) / SLIDER_MAX; + + input_Seek( p_intf->p_input, i_seek ); + + /* Update the old value */ + p_slider->setOldValue( i_value ); + } +#undef p_area + } + + /* If the "display popup" flag has changed */ + if( p_intf->b_menu_change ) + { + /* FIXME: find a way to display this menu right under the mouse */ + p_popup->popup( QPoint( + p_intf->p_sys->p_app->desktop()->width() / 2, + p_intf->p_sys->p_app->desktop()->height() / 2 ), 0 ); + p_intf->b_menu_change = 0; + } + + /* Manage core vlc functions through the callback */ + p_intf->pf_manage( p_intf ); + + if( p_intf->b_die ) + { + /* Prepare to die, young Skywalker */ + qApp->quit(); + + /* Just in case */ + return; + } +} + +/***************************************************************************** + * PlaybackPlay: play + *****************************************************************************/ +void IntfWindow::PlaybackPlay( void ) +{ + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); + } +} + +/***************************************************************************** + * PlaybackPause: pause + *****************************************************************************/ +void IntfWindow::PlaybackPause( void ) +{ + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE ); + } +} + +/***************************************************************************** + * PlaybackSlow: slow + *****************************************************************************/ +void IntfWindow::PlaybackSlow( void ) +{ + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); + } +} + +/***************************************************************************** + * PlaybackFast: fast + *****************************************************************************/ +void IntfWindow::PlaybackFast( void ) +{ + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + } +} + +/***************************************************************************** + * PlaylistPrev: previous playlist entry + *****************************************************************************/ +void IntfWindow::PlaylistPrev( void ) +{ + if( p_intf->p_input != NULL ) + { + /* FIXME: temporary hack */ + intf_PlaylistPrev( p_main->p_playlist ); + intf_PlaylistPrev( p_main->p_playlist ); + p_intf->p_input->b_eof = 1; + } +} + +/***************************************************************************** + * PlaylistNext: next playlist entry + *****************************************************************************/ +void IntfWindow::PlaylistNext( void ) +{ + if( p_intf->p_input != NULL ) + { + /* FIXME: temporary hack */ + p_intf->p_input->b_eof = 1; + } +} + +/***************************************************************************** + * IntfSlider: slider creator + ***************************************************************************** + * This function creates the slider, sets its default values, and connects + * the interesting signals. + *****************************************************************************/ +IntfSlider::IntfSlider( intf_thread_t *p_intf, QWidget *p_parent ) + :QSlider( Horizontal, p_parent ) +{ + this->p_intf = p_intf; + + setRange( SLIDER_MIN, SLIDER_MAX ); + setPageStep( SLIDER_STEP ); + + setValue( SLIDER_MIN ); + setOldValue( SLIDER_MIN ); + + setTracking( TRUE ); + b_free = TRUE; + + connect( this, SIGNAL(sliderMoved(int)), this, SLOT(SlideStart()) ); + connect( this, SIGNAL(sliderPressed()), this, SLOT(SlideStart()) ); + connect( this, SIGNAL(sliderReleased()), this, SLOT(SlideStop()) ); +} + +/***************************************************************************** + * ~IntfSlider: slider destructor + ***************************************************************************** + * This function is called when the interface slider is destroyed. + *****************************************************************************/ +IntfSlider::~IntfSlider( void ) +{ + /* We don't need to remove anything */ +} + + diff --git a/plugins/qt/qt.cpp b/plugins/qt/qt.cpp new file mode 100644 index 0000000000..154205908c --- /dev/null +++ b/plugins/qt/qt.cpp @@ -0,0 +1,113 @@ +/***************************************************************************** + * qt.cpp : Qt plugin for vlc + ***************************************************************************** + * Copyright (C) 2001 VideoLAN + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#define MODULE_NAME qt +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include /* malloc(), free() */ + +extern "C" +{ +#include "config.h" +#include "common.h" /* boolean_t, byte_t */ +#include "threads.h" +#include "mtime.h" + +#include "modules.h" + +/***************************************************************************** + * Build configuration tree. + *****************************************************************************/ +MODULE_CONFIG_START +ADD_WINDOW( "Configuration for Qt module" ) + ADD_COMMENT( "Ha, ha -- nothing to configure yet" ) +MODULE_CONFIG_END + +/***************************************************************************** + * Capabilities defined in the other files. + *****************************************************************************/ +void _M( intf_getfunctions )( function_list_t * p_function_list ); + +/***************************************************************************** + * InitModule: get the module structure and configuration. + ***************************************************************************** + * We have to fill psz_name, psz_longname and psz_version. These variables + * will be strdup()ed later by the main application because the module can + * be unloaded later to save memory, and we want to be able to access this + * data even after the module has been unloaded. + *****************************************************************************/ +MODULE_INIT +{ + p_module->psz_name = MODULE_STRING; + p_module->psz_longname = "Qt interface module"; + p_module->psz_version = VERSION; + + p_module->i_capabilities = MODULE_CAPABILITY_NULL + | MODULE_CAPABILITY_INTF; + + return( 0 ); +} + +/***************************************************************************** + * ActivateModule: set the module to an usable state. + ***************************************************************************** + * This function fills the capability functions and the configuration + * structure. Once ActivateModule() has been called, the i_usage can + * be set to 0 and calls to NeedModule() be made to increment it. To unload + * the module, one has to wait until i_usage == 0 and call DeactivateModule(). + *****************************************************************************/ +MODULE_ACTIVATE +{ + p_module->p_functions = + ( module_functions_t * )malloc( sizeof( module_functions_t ) ); + if( p_module->p_functions == NULL ) + { + return( -1 ); + } + + _M( intf_getfunctions )( &p_module->p_functions->intf ); + + p_module->p_config = p_config; + + return( 0 ); +} + +/***************************************************************************** + * DeactivateModule: make sure the module can be unloaded. + ***************************************************************************** + * This function must only be called when i_usage == 0. If it successfully + * returns, i_usage can be set to -1 and the module unloaded. Be careful to + * lock usage_lock during the whole process. + *****************************************************************************/ +MODULE_DEACTIVATE +{ + free( p_module->p_functions ); + + return( 0 ); +} + +} /* extern "C" */ diff --git a/src/input/input.c b/src/input/input.c index c01615b679..802b19c245 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -4,7 +4,7 @@ * decoders. ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: input.c,v 1.92 2001/03/11 19:00:18 henri Exp $ + * $Id: input.c,v 1.93 2001/03/15 01:42:20 sam Exp $ * * Authors: Christophe Massiot * @@ -55,10 +55,11 @@ #include "common.h" #include "threads.h" #include "mtime.h" +#include "netutils.h" #include "modules.h" #include "intf_msg.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "stream_control.h" #include "input_ext-intf.h" @@ -312,7 +313,8 @@ static int InitThread( input_thread_t * p_input ) if( p_input->p_input_module == NULL ) { - intf_ErrMsg( "input error: no suitable input module" ); + intf_ErrMsg( "input error: no suitable input module for `%s'", + p_input->p_source ); return( -1 ); } @@ -574,7 +576,7 @@ void input_NetworkOpen( input_thread_t * p_input ) /* TODO : here deal with channel stufs */ /* Build the local socket */ - if ( input_BuildLocalAddr( &s_socket, i_port, b_broadcast ) + if ( network_BuildLocalAddr( &s_socket, i_port, b_broadcast ) == -1 ) { close( p_input->i_handle ); @@ -593,7 +595,7 @@ void input_NetworkOpen( input_thread_t * p_input ) } /* Build socket for remote connection */ - if ( input_BuildRemoteAddr( &s_socket, p_input->p_source ) + if ( network_BuildRemoteAddr( &s_socket, p_input->p_source ) == -1 ) { close( p_input->i_handle ); diff --git a/src/input/input_ext-intf.c b/src/input/input_ext-intf.c index b4921ae6d0..061fe27317 100644 --- a/src/input/input_ext-intf.c +++ b/src/input/input_ext-intf.c @@ -177,7 +177,7 @@ char * input_OffsetToTime( input_thread_t * p_input, char * psz_buffer, else { /* Divide by zero is not my friend. */ - sprintf( psz_buffer, "NA" ); + sprintf( psz_buffer, "-:--:--" ); return( psz_buffer ); } } diff --git a/src/input/input_programs.c b/src/input/input_programs.c index e9e84471c3..2f40558427 100644 --- a/src/input/input_programs.c +++ b/src/input/input_programs.c @@ -2,7 +2,7 @@ * input_programs.c: es_descriptor_t, pgrm_descriptor_t management ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_programs.c,v 1.40 2001/03/07 10:31:10 stef Exp $ + * $Id: input_programs.c,v 1.41 2001/03/15 01:42:20 sam Exp $ * * Authors: Christophe Massiot * @@ -597,7 +597,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es ) if( p_es->p_decoder_fifo != NULL ) { - intf_ErrMsg( "ES %d is already selected", p_es->i_id ); + intf_ErrMsg( "ES 0x%x is already selected", p_es->i_id ); return( -1 ); } @@ -662,7 +662,7 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es ) break; default: - intf_ErrMsg( "Unknown stream type %d", p_es->i_type ); + intf_ErrMsg( "Unknown stream type 0x%x", p_es->i_type ); return( -1 ); break; } @@ -689,7 +689,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es ) if( p_es->p_decoder_fifo == NULL ) { - intf_ErrMsg( "ES %d is not selected", p_es->i_id ); + intf_ErrMsg( "ES 0x%x is not selected", p_es->i_id ); return( -1 ); } diff --git a/src/input/mpeg_system.c b/src/input/mpeg_system.c index 6e41ec2a4e..73b463e10c 100644 --- a/src/input/mpeg_system.c +++ b/src/input/mpeg_system.c @@ -2,7 +2,7 @@ * mpeg_system.c: TS, PS and PES management ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: mpeg_system.c,v 1.44 2001/03/15 00:37:04 stef Exp $ + * $Id: mpeg_system.c,v 1.45 2001/03/15 01:42:20 sam Exp $ * * Authors: Christophe Massiot * Michel Lespinasse @@ -877,7 +877,7 @@ void input_DemuxPS( input_thread_t * p_input, data_packet_t * p_data ) default: /* This should not happen */ b_trash = 1; - intf_WarnMsg( 1, "Unwanted packet received with start code %x", + intf_WarnMsg( 1, "Unwanted packet received with start code 0x%.8x", i_code ); } } diff --git a/src/interface/interface.c b/src/interface/interface.c index 233ca5fbb8..31ef1d5a16 100644 --- a/src/interface/interface.c +++ b/src/interface/interface.c @@ -46,7 +46,7 @@ #include "intf_msg.h" #include "interface.h" #include "intf_cmd.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "intf_channels.h" #include "keystrokes.h" @@ -155,7 +155,7 @@ static void intf_Manage( intf_thread_t *p_intf ) if( p_intf->p_input == NULL && !p_intf->b_die ) { /* Select the next playlist item */ - intf_PlstNext( p_main->p_playlist ); + intf_PlaylistNext( p_main->p_playlist ); if( p_main->p_playlist->i_index == -1 ) { diff --git a/src/interface/intf_plst.c b/src/interface/intf_playlist.c similarity index 90% rename from src/interface/intf_plst.c rename to src/interface/intf_playlist.c index ce7b9a6882..baf999b414 100644 --- a/src/interface/intf_plst.c +++ b/src/interface/intf_playlist.c @@ -1,5 +1,5 @@ /***************************************************************************** - * intf_plst.c : Playlist management functions + * intf_playlist.c : Playlist management functions ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN * @@ -32,7 +32,7 @@ #include "threads.h" #include "intf_msg.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "main.h" @@ -42,11 +42,11 @@ static void NextItem( playlist_t * p_playlist ); /***************************************************************************** - * intf_PlstCreate: create playlist + * intf_PlaylistCreate: create playlist ***************************************************************************** * Create a playlist structure. *****************************************************************************/ -playlist_t * intf_PlstCreate ( void ) +playlist_t * intf_PlaylistCreate ( void ) { playlist_t *p_playlist; @@ -63,11 +63,11 @@ playlist_t * intf_PlstCreate ( void ) } /***************************************************************************** - * intf_PlstInit: initialize playlist + * intf_PlaylistInit: initialize playlist ***************************************************************************** * Initialize a playlist structure. *****************************************************************************/ -void intf_PlstInit ( playlist_t * p_playlist ) +void intf_PlaylistInit ( playlist_t * p_playlist ) { vlc_mutex_init( &p_playlist->change_lock ); @@ -89,12 +89,13 @@ void intf_PlstInit ( playlist_t * p_playlist ) } /***************************************************************************** - * intf_PlstAdd: add an item to the playlist + * intf_PlaylistAdd: add an item to the playlist ***************************************************************************** * Add an item to the playlist at position i_pos. If i_pos is PLAYLIST_END, * add it at the end regardless of the playlist current size. *****************************************************************************/ -int intf_PlstAdd( playlist_t * p_playlist, int i_pos, char * psz_item ) +int intf_PlaylistAdd( playlist_t * p_playlist, int i_pos, + const char * psz_item ) { int i_index; playlist_item_t * p_item; @@ -130,7 +131,7 @@ int intf_PlstAdd( playlist_t * p_playlist, int i_pos, char * psz_item ) p_item->i_status = 0; p_item->psz_name = strdup( psz_item ); - intf_WarnMsg( 1, "intf: added %s to playlist", psz_item ); + intf_WarnMsg( 1, "intf: added `%s' to playlist", psz_item ); vlc_mutex_unlock( &p_playlist->change_lock ); @@ -138,12 +139,12 @@ int intf_PlstAdd( playlist_t * p_playlist, int i_pos, char * psz_item ) } /***************************************************************************** - * intf_PlstNext: switch to next playlist item + * intf_PlaylistNext: switch to next playlist item ***************************************************************************** * Switch to the next item of the playlist. If there is no next item, the * position of the resulting item is set to -1. *****************************************************************************/ -void intf_PlstNext( playlist_t * p_playlist ) +void intf_PlaylistNext( playlist_t * p_playlist ) { vlc_mutex_lock( &p_playlist->change_lock ); @@ -153,12 +154,12 @@ void intf_PlstNext( playlist_t * p_playlist ) } /***************************************************************************** - * intf_PlstPrev: switch to previous playlist item + * intf_PlaylistPrev: switch to previous playlist item ***************************************************************************** * Switch to the previous item of the playlist. If there is no previous * item, the position of the resulting item is set to -1. *****************************************************************************/ -void intf_PlstPrev( playlist_t * p_playlist ) +void intf_PlaylistPrev( playlist_t * p_playlist ) { vlc_mutex_lock( &p_playlist->change_lock ); p_playlist->i_mode = -p_playlist->i_mode; @@ -170,11 +171,11 @@ void intf_PlstPrev( playlist_t * p_playlist ) } /***************************************************************************** - * intf_PlstDelete: delete an item from the playlist + * intf_PlaylistDelete: delete an item from the playlist ***************************************************************************** * Delete the item in the playlist with position i_pos. *****************************************************************************/ -int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) +int intf_PlaylistDelete( playlist_t * p_playlist, int i_pos ) { int i_index; char * psz_name; @@ -206,7 +207,7 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) p_playlist->p_item = realloc( p_playlist->p_item, p_playlist->i_size * sizeof( playlist_item_t ) ); - intf_WarnMsg( 1, "intf: removed %s from playlist", psz_name ); + intf_WarnMsg( 1, "intf: removed `%s' from playlist", psz_name ); /* Delete the item */ @@ -218,17 +219,17 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) } /***************************************************************************** - * intf_PlstDestroy: destroy the playlist + * intf_PlaylistDestroy: destroy the playlist ***************************************************************************** * Delete all items in the playlist and free the playlist structure. *****************************************************************************/ -void intf_PlstDestroy( playlist_t * p_playlist ) +void intf_PlaylistDestroy( playlist_t * p_playlist ) { int i_index; for( i_index = p_playlist->i_size - 1; p_playlist->i_size; i_index-- ) { - intf_PlstDelete( p_playlist, i_index ); + intf_PlaylistDelete( p_playlist, i_index ); } vlc_mutex_destroy( &p_playlist->change_lock ); @@ -242,7 +243,7 @@ void intf_PlstDestroy( playlist_t * p_playlist ) intf_WarnMsg( 1, "intf: playlist destroyed" ); } -void intf_PlstJumpto( playlist_t * p_playlist , int i_pos) +void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos) { vlc_mutex_lock( &p_playlist->change_lock ); diff --git a/src/interface/main.c b/src/interface/main.c index 8621c4c5b1..6636831b40 100644 --- a/src/interface/main.c +++ b/src/interface/main.c @@ -50,7 +50,7 @@ #include "input_ext-intf.h" #include "intf_msg.h" -#include "intf_plst.h" +#include "intf_playlist.h" #include "interface.h" #include "audio_output.h" @@ -88,13 +88,10 @@ #define OPT_PORT 172 #define OPT_BROADCAST 173 -#define OPT_AOUT 180 -#define OPT_VOUT 181 -#define OPT_INTF 182 -#define OPT_MOTION 183 -#define OPT_IDCT 184 -#define OPT_YUV 185 -#define OPT_INPUT 186 +#define OPT_INPUT 180 +#define OPT_MOTION 181 +#define OPT_IDCT 182 +#define OPT_YUV 183 #define OPT_SYNCHRO 190 #define OPT_WARNING 191 @@ -116,18 +113,18 @@ static const struct option longopts[] = { "version", 0, 0, 'v' }, /* Interface options */ - { "intf", 1, 0, OPT_INTF }, + { "intf", 1, 0, 'I' }, { "warning", 1, 0, OPT_WARNING }, /* Audio options */ { "noaudio", 0, 0, OPT_NOAUDIO }, - { "aout", 1, 0, OPT_AOUT }, + { "aout", 1, 0, 'A' }, { "stereo", 0, 0, OPT_STEREO }, { "mono", 0, 0, OPT_MONO }, /* Video options */ { "novideo", 0, 0, OPT_NOVIDEO }, - { "vout", 1, 0, OPT_VOUT }, + { "vout", 1, 0, 'V' }, { "display", 1, 0, OPT_DISPLAY }, { "width", 1, 0, OPT_WIDTH }, { "height", 1, 0, OPT_HEIGHT }, @@ -159,7 +156,7 @@ static const struct option longopts[] = }; /* Short options */ -static const char *psz_shortopts = "hHvgt:T:a:s:c:"; +static const char *psz_shortopts = "hHvgt:T:a:s:c:I:A:V:"; #endif @@ -256,14 +253,14 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) /* * Initialize playlist and get commandline files */ - p_main->p_playlist = intf_PlstCreate( ); + p_main->p_playlist = intf_PlaylistCreate( ); if( !p_main->p_playlist ) { intf_ErrMsg( "playlist error: playlist initialization failed" ); intf_MsgDestroy(); return( errno ); } - intf_PlstInit( p_main->p_playlist ); + intf_PlaylistInit( p_main->p_playlist ); /* * Get input filenames given as commandline arguments @@ -277,7 +274,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) if( !p_main->p_bank ) { intf_ErrMsg( "module error: module bank initialization failed" ); - intf_PlstDestroy( p_main->p_playlist ); + intf_PlaylistDestroy( p_main->p_playlist ); intf_MsgDestroy(); return( errno ); } @@ -305,7 +302,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) { intf_ErrMsg( "intf error: interface initialization failed" ); module_DestroyBank( p_main->p_bank ); - intf_PlstDestroy( p_main->p_playlist ); + intf_PlaylistDestroy( p_main->p_playlist ); intf_MsgDestroy(); return( errno ); } @@ -390,7 +387,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) /* * Free playlist */ - intf_PlstDestroy( p_main->p_playlist ); + intf_PlaylistDestroy( p_main->p_playlist ); #ifdef SYS_BEOS /* @@ -566,7 +563,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) break; /* Interface warning messages level */ - case OPT_INTF: /* --intf */ + case 'I': /* -I, --intf */ main_PutPszVariable( INTF_METHOD_VAR, optarg ); break; case OPT_WARNING: /* --warning */ @@ -577,7 +574,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) case OPT_NOAUDIO: /* --noaudio */ p_main->b_audio = 0; break; - case OPT_AOUT: /* --aout */ + case 'A': /* -A, --aout */ main_PutPszVariable( AOUT_METHOD_VAR, optarg ); break; case OPT_STEREO: /* --stereo */ @@ -591,7 +588,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) case OPT_NOVIDEO: /* --novideo */ p_main->b_video = 0; break; - case OPT_VOUT: /* --vout */ + case 'V': /* -V, --vout */ main_PutPszVariable( VOUT_METHOD_VAR, optarg ); break; case OPT_DISPLAY: /* --display */ @@ -696,7 +693,8 @@ static int GetFilenames( int i_argc, char *ppsz_argv[] ) /* We assume that the remaining parameters are filenames */ for( i_opt = optind; i_opt < i_argc; i_opt++ ) { - intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, ppsz_argv[ i_opt ] ); + intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, + ppsz_argv[ i_opt ] ); } return( 0 ); @@ -722,15 +720,15 @@ static void Usage( int i_fashion ) /* Options */ intf_MsgImm( "\nOptions:" - "\n --intf \tinterface method" + "\n -I, --intf \tinterface method" "\n --warning \tdisplay warning messages" "\n" "\n --noaudio \tdisable audio" - "\n --aout \taudio output method" + "\n -A, --aout \taudio output method" "\n --stereo, --mono \tstereo/mono audio" "\n" "\n --novideo \tdisable video" - "\n --vout \tvideo output method" + "\n -V, --vout \tvideo output method" "\n --display \tdisplay string" "\n --width , --height \tdisplay dimensions" "\n -g, --grayscale \tgrayscale output" diff --git a/src/misc/netutils.c b/src/misc/netutils.c index f352ff80f9..4889bdbdfb 100644 --- a/src/misc/netutils.c +++ b/src/misc/netutils.c @@ -1,7 +1,7 @@ /***************************************************************************** * netutils.c: various network functions ***************************************************************************** - * Copyright (C) 1999, 2000 VideoLAN + * Copyright (C) 1999, 2000, 2001 VideoLAN * * Authors: Vincent Seguin * Benoit Steiner @@ -31,6 +31,7 @@ #include /* free(), realloc(), atoi() */ #include /* errno() */ #include /* bzero(), bcopy() */ +#include /* gethostname() */ #include /* BSD: struct in_addr */ #include /* BSD: struct sockaddr */ @@ -53,15 +54,15 @@ #include "intf_msg.h" -#include "netutils.h" +#ifndef SYS_BEOS /* I need help for the BeOS portage */ +#include "netutils.h" -#ifndef SYS_BEOS /* I need help for the BeOS portage */ /***************************************************************************** * input_BuildLocalAddr : fill a sockaddr_in structure for local binding *****************************************************************************/ -int input_BuildLocalAddr( struct sockaddr_in * p_socket, int i_port, - boolean_t b_broadcast ) +int network_BuildLocalAddr( struct sockaddr_in * p_socket, int i_port, + boolean_t b_broadcast ) { char psz_hostname[INPUT_MAX_SOURCE_LENGTH]; struct hostent * p_hostent; @@ -113,10 +114,10 @@ int input_BuildLocalAddr( struct sockaddr_in * p_socket, int i_port, /***************************************************************************** * input_BuildRemoteAddr : fill a sockaddr_in structure for remote host *****************************************************************************/ -int input_BuildRemoteAddr( struct sockaddr_in * p_socket, char * psz_server ) +int network_BuildRemoteAddr( struct sockaddr_in * p_socket, char * psz_server ) { struct hostent * p_hostent; -printf("BuildRemoteAddr : psz_server = %s\n",psz_server ); + /* Reset structure */ memset( p_socket, 0, sizeof( struct sockaddr_in ) ); p_socket->sin_family = AF_INET; /* family */ @@ -146,3 +147,4 @@ printf("BuildRemoteAddr : psz_server = %s\n",psz_server ); return( 0 ); } #endif + -- 2.39.2