diff --git a/Makefile b/Makefile index 80e1194110..dfbf156455 100644 --- a/Makefile +++ b/Makefile @@ -191,7 +191,7 @@ C_OBJ += src/misc/win32_specific.o RESOURCE_OBJ := share/vlc_win32_rc.o endif -VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ) +VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ) # # Generated header @@ -344,8 +344,8 @@ dist: rm -Rf tmp/vlc/tmp find debian -mindepth 1 -maxdepth 1 -type d | \ while read i ; do rm -Rf tmp/vlc/$$i ; done - # Copy .c .h .in .cpp and .glade files - find include src plugins -type f -name '*.[bcdhigrst]*' | while read i ; \ + # Copy .c .h .in .cpp .m and .glade files + find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \ do cp $$i tmp/vlc/$$i ; done # Grmbl... special case... for i in API BUGS DESIGN TODO ; \ @@ -531,6 +531,12 @@ $(CPP_OBJ): %.o: .dep/%.dpp $(CPP_OBJ): %.o: %.cpp $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $< +$(M_OBJ): %.o: Makefile.opts Makefile.dep Makefile +$(M_OBJ): %.o: $(H_OBJ) +$(M_OBJ): %.o: .dep/%.dm +$(M_OBJ): %.o: %.m + $(CC) $(CFLAGS) $(vlc_CFLAGS) -c -o $@ $< + $(RESOURCE_OBJ): %.o: Makefile.dep Makefile ifneq (,(findstring mingw32,$(SYS))) $(RESOURCE_OBJ): %.o: %.rc diff --git a/Makefile.dep b/Makefile.dep index e56e57c62d..1853c564ba 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -57,9 +57,17 @@ $(C_DEP): .dep/%.d: %.c $(CPP_DEP): .dep/%.dpp: %.cpp @test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*) - #@echo "regenerating dependencies for $*.c" + #@echo "regenerating dependencies for $*.cpp" @$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \ | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ .dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' +$(M_DEP): .dep/%.dm: %.m + @test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*) + #@echo "regenerating dependencies for $*.m" + @$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \ + | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ + .dep\/$(subst /,\/,$*).dm : /g'\'' > $@; \ + [ -s $@ ] || rm -f $@' + diff --git a/Makefile.modules b/Makefile.modules index 9fc3070d51..d6c33f1641 100644 --- a/Makefile.modules +++ b/Makefile.modules @@ -21,6 +21,7 @@ suff := $(shell echo $(MAKECMDGOALS) | sed 's@.*\.@@' | tr so/a lo/o) # SRC_C := $(filter %.c,$($(module_name)_SOURCES)) SRC_CPP := $(filter %.cpp,$($(module_name)_SOURCES)) +SRC_M := $(filter %.m,$($(module_name)_SOURCES)) ifeq (lo,$(suff)) extra_CFLAGS := $(plugins_CFLAGS) $($(module_name)_CFLAGS) \ @@ -31,7 +32,8 @@ else extra_CFLAGS := $(builtins_CFLAGS) $($(module_name)_CFLAGS) \ -DMODULE_NAME=$(module_name) -DMODULE_NAME_IS_$(module_name) \ $($(module_name)_a_CFLAGS) -OBJ_ALL := $(SRC_C:%.c=%.o.$(module_name)) $(SRC_CPP:%.cpp=%.o.$(module_name)) +OBJ_ALL := $(SRC_C:%.c=%.o.$(module_name)) $(SRC_CPP:%.cpp=%.o.$(module_name)) \ + $(SRC_M:%.m=%.o.$(module_name)) endif # @@ -39,6 +41,7 @@ endif # C_DEP := $(SRC_C:%.c=.dep/%.d) CPP_DEP := $(SRC_CPP:%.cpp=.dep/%.dpp) +M_DEP := $(SRC_M:%.m=.dep/%.dm) export @@ -63,6 +66,9 @@ $(C_DEP): %.d: FORCE $(CPP_DEP): %.dpp: FORCE @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)" +$(M_DEP): %.dm: FORCE + @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)" + $(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.d $(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.c $(CC) $(CFLAGS) $(extra_CFLAGS) -c $< -o $@ @@ -71,6 +77,10 @@ $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.dpp $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.cpp $(CC) $(CFLAGS) $(extra_CFLAGS) -c $< -o $@ +$(SRC_M:%.m=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.dm +$(SRC_M:%.m=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.m + $(CC) $(CFLAGS) $(extra_CFLAGS) -c $< -o $@ + # foo_CUSTOM lets us override all target rules for foo.so and foo.a ifeq (,$($(module_name)_CUSTOM)) ../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL) diff --git a/Makefile.opts.in b/Makefile.opts.in index 878fd6ccb5..4598d2797e 100644 --- a/Makefile.opts.in +++ b/Makefile.opts.in @@ -83,7 +83,6 @@ gnome_CFLAGS = @gnome_CFLAGS@ gtk_CFLAGS = @gtk_CFLAGS@ kde_CFLAGS = @kde_CFLAGS@ idctaltivec_CFLAGS = @idctaltivec_CFLAGS@ -macosx_CFLAGS = @macosx_CFLAGS@ mad_CFLAGS = @mad_CFLAGS@ memcpyaltivec_CFLAGS = @memcpyaltivec_CFLAGS@ motionaltivec_CFLAGS = @motionaltivec_CFLAGS@ diff --git a/configure b/configure index 2463d8c5fc..c4b16a07f2 100755 --- a/configure +++ b/configure @@ -7835,26 +7835,24 @@ if test "${enable_macosx+set}" = set; then if test x$enable_macosx = xyes then BUILTINS="${BUILTINS} macosx" - macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc" - macosx_CFLAGS="${macosx_CFLAGS} -ObjC" - LDFLAGS="${LDFLAGS} -ObjC" + macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC" fi else for ac_hdr in Cocoa/Cocoa.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7848: checking for $ac_hdr" >&5 +echo "configure:7846: 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:7858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7856: \"$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* @@ -7875,9 +7873,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then #define $ac_tr_hdr 1 EOF BUILTINS="${BUILTINS} macosx" - macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc" - macosx_CFLAGS="${macosx_CFLAGS} -ObjC" - LDFLAGS="${LDFLAGS} -ObjC" + macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC" else echo "$ac_t""no" 1>&6 @@ -7899,17 +7895,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7903: checking for $ac_hdr" >&5 +echo "configure:7899: 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:7913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7909: \"$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* @@ -7980,17 +7976,17 @@ if test x$enable_lirc = xyes then ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6 -echo "configure:7984: checking for lirc/lirc_client.h" >&5 +echo "configure:7980: checking for lirc/lirc_client.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:7994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7990: \"$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* @@ -8007,7 +8003,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6 -echo "configure:8011: checking for lirc_init in -llirc_client" >&5 +echo "configure:8007: checking for lirc_init in -llirc_client" >&5 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8015,7 +8011,7 @@ else ac_save_LIBS="$LIBS" LIBS="-llirc_client $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8026: \"$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 @@ -8081,7 +8077,7 @@ fi ;; *) echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6 -echo "configure:8085: checking whether the byte order is big-endian" >&5 +echo "configure:8081: checking whether the byte order is big-endian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8155,7 +8151,7 @@ if test "${enable_pth+set}" = set; then enableval="$enable_pth" if test "x$enable_pth" = "xyes"; then echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6 -echo "configure:8159: checking for pth_init in -lpth" >&5 +echo "configure:8155: checking for pth_init in -lpth" >&5 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8163,7 +8159,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpth $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8174: \"$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 @@ -8202,7 +8198,7 @@ else fi cat > conftest.$ac_ext < EOF @@ -8228,7 +8224,7 @@ if test "${enable_st+set}" = set; then enableval="$enable_st" if test "x$enable_st" = "xyes"; then echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6 -echo "configure:8232: checking for st_init in -lst" >&5 +echo "configure:8228: checking for st_init in -lst" >&5 ac_lib_var=`echo st'_'st_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8236,7 +8232,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lst $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8247: \"$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 @@ -8275,7 +8271,7 @@ else fi cat > conftest.$ac_ext < EOF diff --git a/configure.in b/configure.in index b32890e222..4df1657bf5 100644 --- a/configure.in +++ b/configure.in @@ -1355,15 +1355,11 @@ AC_ARG_ENABLE(macosx, [if test x$enable_macosx = xyes then BUILTINS="${BUILTINS} macosx" - macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc" - macosx_CFLAGS="${macosx_CFLAGS} -ObjC" - LDFLAGS="${LDFLAGS} -ObjC" + macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC" fi], [AC_CHECK_HEADERS(Cocoa/Cocoa.h, BUILTINS="${BUILTINS} macosx" - macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc" - macosx_CFLAGS="${macosx_CFLAGS} -ObjC" - LDFLAGS="${LDFLAGS} -ObjC" + macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC" )]) dnl diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 9526066dc1..f21223aecf 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -19,15 +19,15 @@ CLASS = Intf_Controller; LANGUAGE = ObjC; OUTLETS = { - o_pause = id; - o_play = id; - o_playlistds = id; - o_stepf = id; - o_stepr = id; - o_stop = id; - o_time = id; - o_timeslider = id; - o_window = id; + o_pause = NSButton; + o_play = NSButton; + o_playlistds = Intf_PlaylistDS; + o_stepf = NSButton; + o_stepr = NSButton; + o_stop = NSButton; + o_time = NSTextField; + o_timeslider = NSSlider; + o_window = NSWindow; }; SUPERCLASS = NSObject; }, @@ -70,7 +70,7 @@ { CLASS = Intf_PlaylistDS; LANGUAGE = ObjC; - OUTLETS = {o_table = id; }; + OUTLETS = {o_table = NSTableView; }; SUPERCLASS = NSObject; } ); diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index ebcee69361..25bab50930 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -9,7 +9,7 @@ 235 401 417 350 182 0 0 1152 746 29 - 804 409 205 44 0 0 1152 746 + 804 409 262 44 0 0 1152 746 445 347 561 370 117 0 0 1152 746 460 @@ -19,8 +19,8 @@ 248.0 IBOpenObjects - 29 21 + 29 IBSystem Version 5Q125 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib index 7103ef6766..9d97749e7b 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ diff --git a/extras/MacOSX/vlc.pbproj/project.pbxproj b/extras/MacOSX/vlc.pbproj/project.pbxproj index 86d74ce954..5c93cef913 100644 --- a/extras/MacOSX/vlc.pbproj/project.pbxproj +++ b/extras/MacOSX/vlc.pbproj/project.pbxproj @@ -13,8 +13,8 @@ }; F510A6CD01738ED001A80A1F = { isa = PBXFileReference; - name = intf_vlc_wrapper.c; - path = plugins/macosx/intf_vlc_wrapper.c; + name = intf_vlc_wrapper.m; + path = plugins/macosx/intf_vlc_wrapper.m; refType = 4; }; F511306E0170620B01A80A1F = { @@ -103,14 +103,14 @@ }; F512122B0170635601A80A1F = { isa = PBXFileReference; - name = aout_macosx.c; - path = plugins/macosx/aout_macosx.c; + name = aout_macosx.m; + path = plugins/macosx/aout_macosx.m; refType = 4; }; F512122C0170635601A80A1F = { isa = PBXFileReference; - name = intf_controller.c; - path = plugins/macosx/intf_controller.c; + name = intf_controller.m; + path = plugins/macosx/intf_controller.m; refType = 4; }; F512122D0170635601A80A1F = { @@ -121,8 +121,8 @@ }; F51212300170635601A80A1F = { isa = PBXFileReference; - name = macosx.c; - path = plugins/macosx/macosx.c; + name = macosx.m; + path = plugins/macosx/macosx.m; refType = 4; }; F51212310170635601A80A1F = { @@ -133,8 +133,8 @@ }; F51212320170635601A80A1F = { isa = PBXFileReference; - name = vout_macosx.c; - path = plugins/macosx/vout_macosx.c; + name = vout_macosx.m; + path = plugins/macosx/vout_macosx.m; refType = 4; }; F51352740170655D01A80A1F = { @@ -243,7 +243,7 @@ CFBundleExecutable vlc CFBundleGetInfoString - VideoLAN Client + VideoLAN Client, © 1996-2002 VideoLAN project CFBundleIconFile vlc.icns CFBundleIdentifier @@ -255,7 +255,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - vlc 0.3.1 + 0.3.1 CFBundleSignature VLC# CFBundleVersion @@ -370,8 +370,8 @@ //F64 F66B34EC0271A5AF01A80112 = { isa = PBXFileReference; - name = intf_open.c; - path = plugins/macosx/intf_open.c; + name = intf_open.m; + path = plugins/macosx/intf_open.m; refType = 4; }; F66B34ED0271A5AF01A80112 = { @@ -382,14 +382,14 @@ }; F6799746020DCC2A01A80112 = { isa = PBXFileReference; - name = intf_macosx.c; - path = plugins/macosx/intf_macosx.c; + name = intf_macosx.m; + path = plugins/macosx/intf_macosx.m; refType = 4; }; F6799747020DCC2A01A80112 = { isa = PBXFileReference; - name = vout_qdview.c; - path = plugins/macosx/vout_qdview.c; + name = vout_qdview.m; + path = plugins/macosx/vout_qdview.m; refType = 4; }; F6799748020DCC2A01A80112 = { @@ -400,8 +400,8 @@ }; F6799749020DCC2A01A80112 = { isa = PBXFileReference; - name = vout_window.c; - path = plugins/macosx/vout_window.c; + name = vout_window.m; + path = plugins/macosx/vout_window.m; refType = 4; }; F679974A020DCC2A01A80112 = { @@ -412,8 +412,8 @@ }; F6EA76F5024171E201A80112 = { isa = PBXFileReference; - name = vout_vlc_wrapper.c; - path = plugins/macosx/vout_vlc_wrapper.c; + name = vout_vlc_wrapper.m; + path = plugins/macosx/vout_vlc_wrapper.m; refType = 4; }; F6EA76F6024171E201A80112 = { diff --git a/plugins/macosx/Makefile b/plugins/macosx/Makefile index 7f390b1531..21c41853df 100644 --- a/plugins/macosx/Makefile +++ b/plugins/macosx/Makefile @@ -1 +1 @@ -macosx_SOURCES = macosx.c aout_macosx.c vout_macosx.c vout_window.c vout_qdview.c vout_vlc_wrapper.c intf_macosx.c intf_controller.c intf_vlc_wrapper.c intf_open.c +macosx_SOURCES = macosx.m aout_macosx.m vout_macosx.m vout_window.m vout_qdview.m vout_vlc_wrapper.m intf_macosx.m intf_controller.m intf_vlc_wrapper.m intf_open.m diff --git a/plugins/macosx/aout_macosx.c b/plugins/macosx/aout_macosx.m similarity index 99% rename from plugins/macosx/aout_macosx.c rename to plugins/macosx/aout_macosx.m index 9e749aa3bf..8b4267bbbd 100644 --- a/plugins/macosx/aout_macosx.c +++ b/plugins/macosx/aout_macosx.m @@ -2,7 +2,7 @@ * aout_macosx.c : CoreAudio output plugin ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: aout_macosx.c,v 1.20 2002/05/04 13:48:31 massiot Exp $ + * $Id: aout_macosx.m,v 1.1 2002/05/12 20:56:33 massiot Exp $ * * Authors: Colin Delacroix * Jon Lech Johansen diff --git a/plugins/macosx/intf_controller.c b/plugins/macosx/intf_controller.m similarity index 98% rename from plugins/macosx/intf_controller.c rename to plugins/macosx/intf_controller.m index b30c9257b2..2b6b3c8329 100644 --- a/plugins/macosx/intf_controller.c +++ b/plugins/macosx/intf_controller.m @@ -2,7 +2,7 @@ * intf_controller.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: intf_controller.c,v 1.7 2002/05/06 22:59:46 massiot Exp $ + * $Id: intf_controller.m,v 1.1 2002/05/12 20:56:33 massiot Exp $ * * Authors: Florian G. Pflug * Jon Lech Johansen diff --git a/plugins/macosx/intf_macosx.c b/plugins/macosx/intf_macosx.m similarity index 98% rename from plugins/macosx/intf_macosx.c rename to plugins/macosx/intf_macosx.m index 5f1d0c1ef0..2a897ee6e8 100644 --- a/plugins/macosx/intf_macosx.c +++ b/plugins/macosx/intf_macosx.m @@ -2,7 +2,7 @@ * intf_macosx.c: MacOS X interface plugin ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: intf_macosx.c,v 1.14 2002/05/12 01:39:36 massiot Exp $ + * $Id: intf_macosx.m,v 1.1 2002/05/12 20:56:33 massiot Exp $ * * Authors: Colin Delacroix * Florian G. Pflug diff --git a/plugins/macosx/intf_open.c b/plugins/macosx/intf_open.m similarity index 99% rename from plugins/macosx/intf_open.c rename to plugins/macosx/intf_open.m index 7245e0a34a..5b350bce52 100644 --- a/plugins/macosx/intf_open.c +++ b/plugins/macosx/intf_open.m @@ -2,7 +2,7 @@ * intf_open.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: intf_open.c,v 1.1 2002/04/23 03:21:21 jlj Exp $ + * $Id: intf_open.m,v 1.1 2002/05/12 20:56:33 massiot Exp $ * * Authors: Jon Lech Johansen * diff --git a/plugins/macosx/intf_vlc_wrapper.c b/plugins/macosx/intf_vlc_wrapper.m similarity index 91% rename from plugins/macosx/intf_vlc_wrapper.c rename to plugins/macosx/intf_vlc_wrapper.m index 7a387916fa..09979df0c6 100644 --- a/plugins/macosx/intf_vlc_wrapper.c +++ b/plugins/macosx/intf_vlc_wrapper.m @@ -2,7 +2,7 @@ * intf_vlc_wrapper.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: intf_vlc_wrapper.c,v 1.14 2002/05/12 01:39:36 massiot Exp $ + * $Id: intf_vlc_wrapper.m,v 1.1 2002/05/12 20:56:34 massiot Exp $ * * Authors: Florian G. Pflug * Jon Lech Johansen @@ -555,8 +555,31 @@ static Intf_VLCWrapper *o_intf = nil; int i_es = [o_item tag]; - input_ToggleES( p_input, p_input->stream.pp_es[i_es], - [o_item state] == NSOffState ); + if( [o_item state] == NSOnState ) + { + /* We just have one ES to disable */ + input_ToggleES( p_input, p_input->stream.pp_es[i_es], 0 ); + } + else + { + /* Unselect the selected ES in the same class */ + int i; + vlc_mutex_lock( &p_input->stream.stream_lock ); + for( i = 0; i < p_input->stream.i_selected_es_number; i++ ) + { + if( p_input->stream.pp_selected_es[i]->i_cat == AUDIO_ES ) + { + vlc_mutex_unlock( &p_input->stream.stream_lock ); + input_ToggleES( p_input, p_input->stream.pp_selected_es[i], 0 ); + vlc_mutex_lock( &p_input->stream.stream_lock ); + break; + } + } + vlc_mutex_unlock( &p_input->stream.stream_lock ); + + /* Select the wanted ES */ + input_ToggleES( p_input, p_input->stream.pp_es[i_es], 1 ); + } vlc_mutex_lock( &p_input->stream.stream_lock ); [self setupMenus]; @@ -572,8 +595,31 @@ static Intf_VLCWrapper *o_intf = nil; int i_es = [o_item tag]; - input_ToggleES( p_input, p_input->stream.pp_es[i_es], - [o_item state] == NSOffState ); + if( [o_item state] == NSOnState ) + { + /* We just have one ES to disable */ + input_ToggleES( p_input, p_input->stream.pp_es[i_es], 0 ); + } + else + { + /* Unselect the selected ES in the same class */ + int i; + vlc_mutex_lock( &p_input->stream.stream_lock ); + for( i = 0; i < p_input->stream.i_selected_es_number; i++ ) + { + if( p_input->stream.pp_selected_es[i]->i_cat == SPU_ES ) + { + vlc_mutex_unlock( &p_input->stream.stream_lock ); + input_ToggleES( p_input, p_input->stream.pp_selected_es[i], 0 ); + vlc_mutex_lock( &p_input->stream.stream_lock ); + break; + } + } + vlc_mutex_unlock( &p_input->stream.stream_lock ); + + /* Select the wanted ES */ + input_ToggleES( p_input, p_input->stream.pp_es[i_es], 1 ); + } vlc_mutex_lock( &p_input->stream.stream_lock ); [self setupMenus]; @@ -665,6 +711,8 @@ static Intf_VLCWrapper *o_intf = nil; } } } + vlc_mutex_unlock( &p_input->stream.stream_lock ); + vlc_mutex_lock( &p_input->stream.stream_lock ); /* ----- TITLES ----- */ if( p_input->stream.i_area_nb < 2 ) @@ -708,6 +756,8 @@ static Intf_VLCWrapper *o_intf = nil; } } } + vlc_mutex_unlock( &p_input->stream.stream_lock ); + vlc_mutex_lock( &p_input->stream.stream_lock ); /* ----- CHAPTERS ----- */ if( p_input->stream.p_selected_area->i_part_nb < 2 ) @@ -750,6 +800,8 @@ static Intf_VLCWrapper *o_intf = nil; } } p_main->p_intf->p_sys->i_part = p_input->stream.p_selected_area->i_part; + vlc_mutex_unlock( &p_input->stream.stream_lock ); + vlc_mutex_lock( &p_input->stream.stream_lock ); /* ----- LANGUAGES & SUBTITLES ----- */ o_language = [o_language_item submenu]; diff --git a/plugins/macosx/macosx.c b/plugins/macosx/macosx.m similarity index 97% rename from plugins/macosx/macosx.c rename to plugins/macosx/macosx.m index 7917037c95..783ee99529 100644 --- a/plugins/macosx/macosx.c +++ b/plugins/macosx/macosx.m @@ -2,7 +2,7 @@ * macosx.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: macosx.c,v 1.14 2002/04/19 13:56:11 sam Exp $ + * $Id: macosx.m,v 1.1 2002/05/12 20:56:34 massiot Exp $ * * Authors: Colin Delacroix * Eugenio Jarosiewicz diff --git a/plugins/macosx/vout_macosx.c b/plugins/macosx/vout_macosx.m similarity index 99% rename from plugins/macosx/vout_macosx.c rename to plugins/macosx/vout_macosx.m index 4e04aba86d..910061a3f7 100644 --- a/plugins/macosx/vout_macosx.c +++ b/plugins/macosx/vout_macosx.m @@ -346,6 +346,7 @@ static int vout_Manage( vout_thread_t *p_vout ) CGDisplayShowCursor( kCGDirectMainDisplay ); b_change = 1; } +#if 0 else if( !p_vout->p_sys->b_mouse_moved && mdate() - p_vout->p_sys->i_time_mouse_last_moved > 2000000 && p_vout->p_sys->b_mouse_pointer_visible ) @@ -353,6 +354,7 @@ static int vout_Manage( vout_thread_t *p_vout ) CGDisplayHideCursor( kCGDirectMainDisplay ); b_change = 1; } +#endif if( b_change ) { diff --git a/plugins/macosx/vout_qdview.c b/plugins/macosx/vout_qdview.m similarity index 96% rename from plugins/macosx/vout_qdview.c rename to plugins/macosx/vout_qdview.m index c9a086d580..2986ddf8c8 100644 --- a/plugins/macosx/vout_qdview.c +++ b/plugins/macosx/vout_qdview.m @@ -2,7 +2,7 @@ * vout_qdview.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vout_qdview.c,v 1.4 2002/05/07 20:17:07 massiot Exp $ + * $Id: vout_qdview.m,v 1.1 2002/05/12 20:56:34 massiot Exp $ * * Authors: Florian G. Pflug * Jon Lech Johansen diff --git a/plugins/macosx/vout_vlc_wrapper.h b/plugins/macosx/vout_vlc_wrapper.h index a8234a4207..a1d2a15a59 100644 --- a/plugins/macosx/vout_vlc_wrapper.h +++ b/plugins/macosx/vout_vlc_wrapper.h @@ -2,7 +2,7 @@ * vout_vlc_wrapper.h: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vout_vlc_wrapper.h,v 1.2 2002/05/07 20:17:07 massiot Exp $ + * $Id: vout_vlc_wrapper.h,v 1.3 2002/05/12 20:56:34 massiot Exp $ * * Authors: Jon Lech Johansen * @@ -25,6 +25,7 @@ #define MOUSE_NOT_MOVED 0x00000002 #define MOUSE_LAST_MOVED 0x00000004 #define MOUSE_NOT_LAST_MOVED 0x00000008 +#define MOUSE_DOWN 0x00000010 @interface Vout_VLCWrapper : NSObject { diff --git a/plugins/macosx/vout_vlc_wrapper.c b/plugins/macosx/vout_vlc_wrapper.m similarity index 93% rename from plugins/macosx/vout_vlc_wrapper.c rename to plugins/macosx/vout_vlc_wrapper.m index b6e53555ee..f29ea4b42c 100644 --- a/plugins/macosx/vout_vlc_wrapper.c +++ b/plugins/macosx/vout_vlc_wrapper.m @@ -2,7 +2,7 @@ * vout_vlc_wrapper.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vout_vlc_wrapper.c,v 1.2 2002/05/07 20:17:07 massiot Exp $ + * $Id: vout_vlc_wrapper.m,v 1.1 2002/05/12 20:56:34 massiot Exp $ * * Authors: Jon Lech Johansen * @@ -84,6 +84,18 @@ static Vout_VLCWrapper *o_vout = nil; p_vout->p_sys->i_time_mouse_last_moved = mdate(); if( ui_status & MOUSE_NOT_LAST_MOVED ) p_vout->p_sys->i_time_mouse_last_moved = 0; + if( ui_status & MOUSE_DOWN ) + { + if( p_vout->p_sys->b_mouse_pointer_visible ) + { + CGDisplayHideCursor( kCGDirectMainDisplay ); + } + else + { + CGDisplayShowCursor( kCGDirectMainDisplay ); + } + p_vout->p_sys->b_mouse_pointer_visible = !p_vout->p_sys->b_mouse_pointer_visible; + } } - (BOOL)keyDown:(NSEvent *)o_event forVout:(void *)_p_vout diff --git a/plugins/macosx/vout_window.c b/plugins/macosx/vout_window.m similarity index 92% rename from plugins/macosx/vout_window.c rename to plugins/macosx/vout_window.m index a058ac2192..e77a8e4209 100644 --- a/plugins/macosx/vout_window.c +++ b/plugins/macosx/vout_window.m @@ -2,7 +2,7 @@ * vout_window.c: MacOS X plugin for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: vout_window.c,v 1.2 2002/03/19 03:33:52 jlj Exp $ + * $Id: vout_window.m,v 1.1 2002/05/12 20:56:34 massiot Exp $ * * Authors: Jon Lech Johansen * @@ -47,10 +47,11 @@ - (void)becomeKeyWindow { [super becomeKeyWindow]; - +#if 0 [o_wrapper mouseEvent: (MOUSE_NOT_MOVED | MOUSE_LAST_MOVED) forVout: p_vout]; +#endif } - (void)resignKeyWindow @@ -77,4 +78,11 @@ forVout: p_vout]; } +- (void)mouseDown:(NSEvent *)o_event +{ + [o_wrapper + mouseEvent: MOUSE_DOWN + forVout: p_vout]; +} + @end diff --git a/plugins/spudec/spu_decoder.c b/plugins/spudec/spu_decoder.c index 911dcc14ca..134dc9dbf4 100644 --- a/plugins/spudec/spu_decoder.c +++ b/plugins/spudec/spu_decoder.c @@ -2,7 +2,7 @@ * spu_decoder.c : spu decoder thread ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: spu_decoder.c,v 1.18 2002/05/01 19:18:09 sam Exp $ + * $Id: spu_decoder.c,v 1.19 2002/05/12 20:56:34 massiot Exp $ * * Authors: Samuel Hocevar * Rudolf Cornelissen @@ -151,16 +151,19 @@ static int decoder_Run( decoder_config_t * p_config ) DecoderError( p_spudec->p_fifo ); } - /* End of thread */ - EndThread( p_spudec ); - - if( p_spudec->p_fifo->b_error ) { - return( -1 ); + boolean_t b_error = p_spudec->p_fifo->b_error; + + /* End of thread */ + EndThread( p_spudec ); + + if( b_error ) + { + return( -1 ); + } } return( 0 ); - } /* following functions are local */