Commit 85762c9e authored by Christophe Massiot's avatar Christophe Massiot

New interface for MacOS X, courtesy of Florian G. Pflug.

parent 19d2ac07
......@@ -133,6 +133,7 @@ clean: libdvdcss-clean plugins-clean vlc-clean
rm -f src/*/*.o extras/*/*.o
rm -f lib/*.so* lib/*.a
rm -f plugins/*.so plugins/*.a
rm -rf extras/MacOSX/build
libdvdcss-clean:
-cd extras/libdvdcss && $(MAKE) clean
......@@ -279,7 +280,7 @@ snapshot-nocss: snapshot-common
libdvdcss-snapshot: snapshot-common
# Remove vlc sources and icons, doc, debian directory...
rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX_app
rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX
rm -Rf tmp/vlc/debian
# Remove useless headers
rm -f tmp/vlc/include/*
......@@ -321,13 +322,11 @@ gnome-vlc gvlc kvlc qvlc: vlc
vlc.app: Makefile.opts
ifneq (,$(findstring darwin,$(SYS)))
rm -Rf vlc.app
mkdir -p vlc.app/Contents/Resources
mkdir -p vlc.app/Contents/MacOS/lib
mkdir -p vlc.app/Contents/MacOS/share
$(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist vlc.app/Contents/
$(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo vlc.app/Contents/
cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t'
cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
$(INSTALL) -d vlc vlc.app/Contents/MacOS/share
$(INSTALL) -d vlc vlc.app/Contents/MacOS/plugins
$(INSTALL) vlc vlc.app/Contents/MacOS/
$(INSTALL) share/vlc.icns vlc.app/Contents/Resources/
ifneq (,$(PLUGINS))
$(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
endif
......
This diff is collapsed.
......@@ -761,16 +761,14 @@ AC_ARG_ENABLE(macosx,
[ --enable-macosx MacOS X support (default enabled on MacOS X)],
[if test x$enable_macosx = xyes
then
BUILTINS="${BUILTINS} macosx macosx_qt"
LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL -framework QuickTime"
LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
BUILTINS="${BUILTINS} macosx"
LIB_MACOSX="-framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime"
LIB="${LIB} -ObjC"
fi],
[AC_CHECK_HEADERS(Carbon/Carbon.h,
BUILTINS="${BUILTINS} macosx macosx_qt"
LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL -framework QuickTime"
LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
[AC_CHECK_HEADERS(Cocoa/Cocoa.h,
BUILTINS="${BUILTINS} macosx"
LIB_MACOSX="-framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime"
LIB="${LIB} -ObjC"
)])
dnl
......
B/* Localized versions of Info.plist keys */
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
fullscreen_toggle = id;
pause = id;
play = id;
speedslider_update = id;
timeslider_update = id;
};
CLASS = Intf_Controller;
LANGUAGE = ObjC;
OUTLETS = {
o_currenttime = id;
o_menu_fullscreen = id;
o_outputpanel = id;
o_pause = id;
o_play = id;
o_playlistds = id;
o_qdview = id;
o_stepf = id;
o_stepr = id;
o_stop = id;
o_timeslider = id;
};
SUPERCLASS = NSObject;
},
{
CLASS = Intf_PlaylistDS;
LANGUAGE = ObjC;
OUTLETS = {o_table = id; };
SUPERCLASS = NSObject;
},
{CLASS = VlcQuickDrawView; LANGUAGE = ObjC; SUPERCLASS = NSQuickDrawView; }
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>87 157 428 240 0 0 1280 938 </string>
<key>IBFramework Version</key>
<string>219.0</string>
<key>IBMainMenuLocation</key>
<string>420 524 257 44 0 0 1280 938 </string>
<key>IBSystem Version</key>
<string>5L14</string>
<key>IBUserGuides</key>
<dict/>
</dict>
</plist>
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
fullscreen_toggle = id;
pause = id;
play = id;
speedslider_update = id;
timeslider_update = id;
};
CLASS = Intf_Controller;
LANGUAGE = ObjC;
OUTLETS = {
o_currenttime = id;
o_menu_fullscreen = id;
o_outputpanel = id;
o_pause = id;
o_play = id;
o_playlistds = id;
o_qdview = id;
o_stepf = id;
o_stepr = id;
o_stop = id;
o_timeslider = id;
};
SUPERCLASS = NSObject;
},
{
CLASS = Intf_PlaylistDS;
LANGUAGE = ObjC;
OUTLETS = {o_table = id; };
SUPERCLASS = NSObject;
},
{CLASS = VlcQuickDrawView; LANGUAGE = ObjC; SUPERCLASS = NSQuickDrawView; }
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>87 157 428 240 0 0 1280 938 </string>
<key>IBFramework Version</key>
<string>219.0</string>
<key>IBMainMenuLocation</key>
<string>420 524 257 44 0 0 1280 938 </string>
<key>IBSystem Version</key>
<string>5L14</string>
<key>IBUserGuides</key>
<dict/>
</dict>
</plist>
// !$*UTF8*$!
{
F510A6CD01738ED001A80A1F = {
uiCtxt = {
sepNavWindowFrame = "{{15, 431}, {750, 502}}";
};
};
F511306E0170620B01A80A1F = {
activeBuildStyle = F51130710170620B01A80A1F;
activeTarget = F52EEB23017E3F0701A80A1F;
addToTargets = (
F52EEB23017E3F0701A80A1F,
);
breakpoints = (
);
perUserDictionary = {
PBXWorkspaceConfiguration = {
ContentSize = "{1280, 819}";
LeftSlideOut = {
ActiveTab = 0;
Frame = "{{0, 23}, {1280, 796}}";
Split0 = {
ActiveTab = 2;
Frame = "{{323, 0}, {957, 796}}";
Split0 = {
Frame = "{{0, 75}, {957, 721}}";
};
SplitCount = 1;
Tab0 = {
Debugger = {
Frame = "{{0, 0}, {484, 208}}";
Split0 = {
Frame = "{{0, 25}, {484, 183}}";
Split0 = {
Frame = "{{0, 0}, {236, 183}}";
};
Split1 = {
Frame = "{{245, 0}, {239, 183}}";
};
SplitCount = 2;
};
SplitCount = 1;
Tab0 = {
Frame = "{{0, 0}, {100, 50}}";
};
Tab1 = {
Frame = "{{0, 0}, {100, 50}}";
};
TabCount = 2;
};
Frame = "{{0, 0}, {484, 208}}";
LauncherConfigVersion = 4;
};
Tab1 = {
Frame = "{{0, 0}, {484, 208}}";
LauncherConfigVersion = 3;
Runner = {
Frame = "{{0, 0}, {484, 208}}";
};
};
Tab2 = {
BuildMessageFrame = "{{0, 0}, {959, 43}}";
BuildTranscriptFrame = "{{0, 52}, {959, 0}}";
Frame = "{{0, 0}, {957, 50}}";
};
Tab3 = {
Frame = "{{0, 0}, {612, 295}}";
};
TabCount = 4;
};
SplitCount = 1;
Tab0 = {
Frame = "{{0, 0}, {298, 796}}";
};
Tab1 = {
ClassesFrame = "{{0, 0}, {202, 56}}";
Frame = "{{0, 0}, {200, 100}}";
MembersFrame = "{{0, 65}, {202, 35}}";
OptionsSetName = "Hierarchy, all classes";
};
Tab2 = {
Frame = "{{0, 0}, {200, 100}}";
};
Tab3 = {
Frame = "{{0, 0}, {200, 718}}";
Split0 = {
Frame = "{{0, 0}, {200, 349}}";
};
Split1 = {
Frame = "{{0, 358}, {200, 360}}";
};
SplitCount = 2;
};
Tab4 = {
Frame = "{{0, 0}, {250, 781}}";
};
TabCount = 5;
};
};
};
wantsIndex = 1;
wantsSCM = 0;
};
F52EEB23017E3F0701A80A1F = {
activeExec = 0;
customExecs = {
};
};
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 34;
objects = {
F510A6CC01738ED001A80A1F = {
isa = PBXFileReference;
name = intf_vlc_wrapper.h;
path = plugins/macosx/intf_vlc_wrapper.h;
refType = 4;
};
F510A6CD01738ED001A80A1F = {
isa = PBXFileReference;
name = intf_vlc_wrapper.c;
path = plugins/macosx/intf_vlc_wrapper.c;
refType = 4;
};
F511306E0170620B01A80A1F = {
buildStyles = (
F51130710170620B01A80A1F,
);
isa = PBXProject;
mainGroup = F511306F0170620B01A80A1F;
productRefGroup = F511306F0170620B01A80A1F;
projectDirPath = "";
targets = (
F52EEB23017E3F0701A80A1F,
);
};
F511306F0170620B01A80A1F = {
children = (
F5121224017062C501A80A1F,
F5121225017062C501A80A1F,
F52EEB22017E3F0701A80A1F,
);
isa = PBXGroup;
refType = 4;
};
F51130710170620B01A80A1F = {
buildRules = (
);
buildSettings = {
COPY_PHASE_STRIP = YES;
};
isa = PBXBuildStyle;
name = Deployment;
};
F51212220170627901A80A1F = {
children = (
F51212230170627901A80A1F,
);
isa = PBXVariantGroup;
name = MainMenu.nib;
path = "";
refType = 4;
};
F51212230170627901A80A1F = {
isa = PBXFileReference;
name = English;
path = English.lproj/MainMenu.nib;
refType = 4;
};
F5121224017062C501A80A1F = {
children = (
F512122B0170635601A80A1F,
F512122C0170635601A80A1F,
F512122D0170635601A80A1F,
F512122F0170635601A80A1F,
F51212300170635601A80A1F,
F51212310170635601A80A1F,
F51212320170635601A80A1F,
F510A6CC01738ED001A80A1F,
F510A6CD01738ED001A80A1F,
F53A3B49018DECF201A80A1F,
F53A3B4A018DECF201A80A1F,
);
isa = PBXGroup;
name = Files;
path = ../..;
refType = 2;
};
F5121225017062C501A80A1F = {
children = (
F51212220170627901A80A1F,
F51352740170655D01A80A1F,
F513527F0170659801A80A1F,
F51352800170659801A80A1F,
F51352810170659801A80A1F,
F51352820170659801A80A1F,
F52EEB2F017E3F8C01A80A1F,
);
isa = PBXGroup;
path = Resources;
refType = 2;
};
F512122B0170635601A80A1F = {
isa = PBXFileReference;
name = aout_macosx.c;
path = plugins/macosx/aout_macosx.c;
refType = 4;
};
F512122C0170635601A80A1F = {
isa = PBXFileReference;
name = intf_controller.c;
path = plugins/macosx/intf_controller.c;
refType = 4;
};
F512122D0170635601A80A1F = {
isa = PBXFileReference;
name = intf_controller.h;
path = plugins/macosx/intf_controller.h;
refType = 4;
};
F512122F0170635601A80A1F = {
isa = PBXFileReference;
name = intf_main.c;
path = plugins/macosx/intf_main.c;
refType = 4;
};
F51212300170635601A80A1F = {
isa = PBXFileReference;
name = macosx.c;
path = plugins/macosx/macosx.c;
refType = 4;
};
F51212310170635601A80A1F = {
isa = PBXFileReference;
name = macosx.h;
path = plugins/macosx/macosx.h;
refType = 4;
};
F51212320170635601A80A1F = {
isa = PBXFileReference;
name = vout_macosx.c;
path = plugins/macosx/vout_macosx.c;
refType = 4;
};
F51352740170655D01A80A1F = {
isa = PBXFileReference;
path = pause.png;
refType = 4;
};
F513527F0170659801A80A1F = {
isa = PBXFileReference;
path = play.png;
refType = 4;
};
F51352800170659801A80A1F = {
isa = PBXFileReference;
path = stepf.png;
refType = 4;
};
F51352810170659801A80A1F = {
isa = PBXFileReference;
path = stepr.png;
refType = 4;
};
F51352820170659801A80A1F = {
isa = PBXFileReference;
path = stop.png;
refType = 4;
};
F52EEB22017E3F0701A80A1F = {
isa = PBXBundleReference;
path = vlc.bundle;
refType = 3;
};
F52EEB23017E3F0701A80A1F = {
buildPhases = (
F52EEB24017E3F0701A80A1F,
F52EEB25017E3F0701A80A1F,
F52EEB2C017E3F0701A80A1F,
F52EEB2D017E3F0701A80A1F,
F52EEB2E017E3F0701A80A1F,
);
buildSettings = {
DEBUGGING_SYMBOLS = NO;
OPTIMIZATION_CFLAGS = "-O3";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "-bundle -undefined suppress";
OTHER_REZFLAGS = "";
PRODUCT_NAME = vlc;
SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
WRAPPER_EXTENSION = bundle;
};
dependencies = (
);
isa = PBXBundleTarget;
name = vlc;
productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
productName = vlc.app;
productReference = F52EEB22017E3F0701A80A1F;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">
<plist version=\"0.9\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>VOB</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>vlc.icns</string>
<key>CFBundleTypeName</key>
<string>VOB File (DVD)</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>vlc</string>
<key>CFBundleGetInfoString</key>
<string>VideoLan Client</string>
<key>CFBundleIconFile</key>
<string>vlc.icns</string>
<key>CFBundleIdentifier</key>
<string>org.videolan.vlc</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>vlc</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>vlc 0.2.90</string>
<key>CFBundleVersion</key>
<string>0.2.90</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
";
shouldUseHeadermap = 0;
};
F52EEB24017E3F0701A80A1F = {
buildActionMask = 2147483647;
files = (
);
isa = PBXHeadersBuildPhase;
name = Headers;
};
F52EEB25017E3F0701A80A1F = {
buildActionMask = 2147483647;
files = (
F52EEB26017E3F0701A80A1F,
F52EEB27017E3F0701A80A1F,
F52EEB28017E3F0701A80A1F,
F52EEB29017E3F0701A80A1F,
F52EEB2A017E3F0701A80A1F,
F52EEB2B017E3F0701A80A1F,
F52EEB30017E3F8C01A80A1F,
);
isa = PBXResourcesBuildPhase;
name = "Bundle Resources";
};
F52EEB26017E3F0701A80A1F = {
fileRef = F51212220170627901A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB27017E3F0701A80A1F = {
fileRef = F51352740170655D01A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB28017E3F0701A80A1F = {
fileRef = F513527F0170659801A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB29017E3F0701A80A1F = {
fileRef = F51352800170659801A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB2A017E3F0701A80A1F = {
fileRef = F51352810170659801A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB2B017E3F0701A80A1F = {
fileRef = F51352820170659801A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F52EEB2C017E3F0701A80A1F = {
buildActionMask = 2147483647;
files = (
);
isa = PBXSourcesBuildPhase;
name = Sources;
};
F52EEB2D017E3F0701A80A1F = {
buildActionMask = 2147483647;
files = (
);
isa = PBXFrameworksBuildPhase;
name = "Frameworks & Libraries";
};
F52EEB2E017E3F0701A80A1F = {
buildActionMask = 2147483647;
files = (
);
isa = PBXRezBuildPhase;
name = "ResourceManager Resources";
};
F52EEB2F017E3F8C01A80A1F = {
isa = PBXFileReference;
path = vlc.icns;
refType = 4;
};
F52EEB30017E3F8C01A80A1F = {
fileRef = F52EEB2F017E3F8C01A80A1F;
isa = PBXBuildFile;
settings = {
};
};
F53A3B49018DECF201A80A1F = {
isa = PBXFileReference;
name = intf_qdview.h;
path = plugins/macosx/intf_qdview.h;
refType = 4;
};
F53A3B4A018DECF201A80A1F = {
isa = PBXFileReference;
name = intf_qdview.c;
path = plugins/macosx/intf_qdview.c;
refType = 4;
};
};
rootObject = F511306E0170620B01A80A1F;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>vlc</string>
<key>CFBundleIconFile</key>
<string>vlc.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
APPL????
\ No newline at end of file
......@@ -7,16 +7,10 @@
# Objects
#
PLUGIN_MACOSX = macosx.o intf_macosx.o vout_macosx.o
PLUGIN_MACOSXQT = macosx_qt.o intf_macosx_qt.o vout_macosx_qt.o
PLUGIN_MACOSXCOMMON = aout_macosx.o
PLUGIN_MACOSX = macosx.o intf_main.o intf_controller.o aout_macosx.o vout_macosx.o intf_vlc_wrapper.o intf_qdview.o
BUILTIN_MACOSX = $(PLUGIN_MACOSX:%.o=BUILTIN_%.o)
BUILTIN_MACOSX = $(PLUGIN_MACOSX:%.o=BUILTIN_MACOSX_%.o) \
$(PLUGIN_MACOSXCOMMON:%.o=BUILTIN_MACOSX_%.o)
BUILTIN_MACOSXQT = $(PLUGIN_MACOSXQT:%.o=BUILTIN_MACOSXQT_%.o) \
$(PLUGIN_MACOSXCOMMON:%.o=BUILTIN_MACOSXQT_%.o)
ALL_OBJ = $(PLUGIN_MACOSX) $(BUILTIN_MACOSX) $(PLUGIN_MACOSXQT) $(BUILTIN_MACOSXQT) $(PLUGIN_MACOSXCOMMON)
ALL_OBJ = $(PLUGIN_MACOSX) $(BUILTIN_MACOSX)
#
# Virtual targets
......@@ -24,33 +18,22 @@ ALL_OBJ = $(PLUGIN_MACOSX) $(BUILTIN_MACOSX) $(PLUGIN_MACOSXQT) $(BUILTIN_MACOSX
include ../../Makefile.modules
$(PLUGIN_MACOSX) $(PLUGIN_MACOSXQT) $(PLUGIN_MACOSXCOMMON): %.o: .dep/%.d
$(PLUGIN_MACOSX): %.o: .dep/%.d
$(PLUGIN_MACOSX): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -fpascal-strings -c -o $@ $<
$(BUILTIN_MACOSX): BUILTIN_MACOSX_%.o: .dep/%.d
$(BUILTIN_MACOSX): BUILTIN_MACOSX_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=macosx -fpascal-strings -c -o $@ $<
$(CC) $(CFLAGS) $(PCFLAGS) -ObjC -c -o $@ $<
$(BUILTIN_MACOSXQT): BUILTIN_MACOSXQT_%.o: .dep/%.d
$(BUILTIN_MACOSXQT): BUILTIN_MACOSXQT_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=macosx_qt -fpascal-strings -c -o $@ $<
$(BUILTIN_MACOSX): BUILTIN_%.o: .dep/%.d
$(BUILTIN_MACOSX): BUILTIN_%.o: %.c
$(CC) $(CFLAGS) -DBUILTIN -ObjC -c -o $@ $<
#
# Real targets
#
../macosx.so: $(PLUGIN_MACOSX) $(PLUGIN_MACOSXCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_MACOSX)
../macosx.so: $(PLUGIN_MACOSX)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_MACOSX) -lobjc
../macosx.a: $(BUILTIN_MACOSX)
ar r $@ $^
$(RANLIB) $@
../macosx_qt.so: $(PLUGIN_MACOSXQT) $(PLUGIN_MACOSXCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_MACOSX)
../macosx_qt.a: $(BUILTIN_MACOSXQT)
ar r $@ $^
$(RANLIB) $@
/*****************************************************************************
* intf_controller.c : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $$
*
* Authors: Florian G. Pflug <fgp@phlo.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
* 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.
*****************************************************************************/
/* Remark:
I need to subclass NSQuickDrawView, and post a notification when its display
method is called. This is necessary because GetPortBound and similar functions
return the actual on-screen size of the QDPort, which isn't updated immidiately
after calling e.g. setFrame
*/
#include <QuickTime/QuickTime.h>
#include <ApplicationServices/ApplicationServices.h>
#import "intf_controller.h"
#import "intf_vlc_wrapper.h"
@implementation Intf_Controller
//Initialization & Event-Management
- (void) awakeFromNib {
o_vlc = [Intf_VlcWrapper instance] ;
b_window_is_fullscreen = FALSE ;
[NSTimer scheduledTimerWithTimeInterval: 0.5
target: self
selector: @selector(manage:)
userInfo: nil
repeats:TRUE
] ;
[o_vlc initWithDelegate:self] ;
}
- (void) manage:(NSTimer *)timer {
if ([o_vlc manage])
[NSApp terminate: self] ;
[o_currenttime setStringValue: [o_vlc getTimeAsString]] ;
[o_timeslider setFloatValue: [o_vlc getTimeAsFloat]] ;
}
- (void)applicationDidBecomeActive:(NSNotification*)aNotification {
if (b_window_is_fullscreen) {
[o_window orderFront:self] ;
[o_vlc play] ;
}
}
- (void)applicationDidResignActive:(NSNotification*)aNotification {
if (b_window_is_fullscreen) {
[o_vlc pause] ;
[o_window orderOut:self] ;
}
}
//Functions attached to user interface
- (IBAction) pause:(id)sender {
[o_vlc pause] ;
}
- (IBAction) play:(id)sender {
[o_vlc play] ;
}
- (IBAction) timeslider_update:(id)slider {
[o_vlc setTimeAsFloat: [o_timeslider floatValue]] ;
}
- (IBAction) speedslider_update:(id)slider {
[o_vlc setSpeed: (intf_speed_t) [slider intValue]] ;
}
- (IBAction) fullscreen_toggle:(id)sender {
[self requestQDPortFullscreen:!b_window_is_fullscreen] ;
}
//Callbacks - we are the delegate for the VlcWrapper
- (void) requestQDPortFullscreen:(bool)b_fullscreen {
NSRect s_rect ;
VlcQuickDrawView *o_qdview ;
s_rect.origin.x = s_rect.origin.y = 0 ;
[self releaseQDPort] ;
o_window = [NSWindow alloc] ;
if (b_fullscreen) {
[o_window
initWithContentRect: [[NSScreen mainScreen] frame]
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer:NO screen:[NSScreen mainScreen]
] ;
[o_window setLevel:CGShieldingWindowLevel()] ;
b_window_is_fullscreen = TRUE ;
}
else {
s_rect.size = [o_vlc videoSize] ;
[o_window
initWithContentRect: s_rect
styleMask: (NSTitledWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)
backing: NSBackingStoreBuffered
defer:NO screen:[NSScreen mainScreen]
] ;
[o_window setAspectRatio:[o_vlc videoSize]] ;
[o_window center] ;
[o_window setDelegate:self] ;
b_window_is_fullscreen = FALSE ;
}
o_qdview = [[VlcQuickDrawView alloc] init] ;
[o_qdview setPostsFrameChangedNotifications:YES] ;
[[NSNotificationCenter defaultCenter]
addObserver: o_vlc
selector: @selector(sizeChangeQDPort)
name: VlcQuickDrawViewDidResize
object: o_qdview
] ;
[o_window setContentView:o_qdview] ;
[o_window orderFront:self] ;
[o_vlc setQDPort:[o_qdview qdPort]] ;
[o_menu_fullscreen setState:(b_window_is_fullscreen ? NSOnState : NSOffState)] ;
}
- (void) releaseQDPort {
[[NSNotificationCenter defaultCenter]
removeObserver: nil
name: nil
object: [o_window contentView]
] ;
[o_vlc setQDPort:nil] ;
if (o_window) {
[o_window close] ;
o_window = nil ;
}
}
- (void) resizeQDPortFullscreen:(bool)b_fullscreen {
if (b_window_is_fullscreen != b_fullscreen) {
[self requestQDPortFullscreen:b_fullscreen] ;
}
else if (!b_window_is_fullscreen && !b_fullscreen) {
[o_window setAspectRatio:[o_vlc videoSize]] ;
}
}
@end
@implementation Intf_PlaylistDS
- (void ) awakeFromNib {
o_vlc = [Intf_VlcWrapper instance] ;
o_playlist = [[NSMutableArray arrayWithCapacity:10] retain] ;
}
- (void) readPlaylist {
static unsigned int i_length_old = 0;
unsigned int i ;
if (i_length_old == [o_vlc getPlaylistLength])
return ;
[o_playlist removeAllObjects] ;
[o_vlc lockPlaylist] ;
for(i=0; i < [o_vlc getPlaylistLength]; i++)
[o_playlist addObject:[o_vlc getPlaylistItem:i]] ;
[o_vlc unlockPlaylist] ;
}
- (int) numberOfRowsInTableView:(NSTableView*)o_table {
[self readPlaylist] ;
return [o_playlist count] ;
}
- (id) tableView:(NSTableView*)o_table objectValueForTableColumn:(NSTableColumn*)o_column row:(int)i_row {
return [o_playlist objectAtIndex:i_row] ;
}
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex {
}
@end
/*****************************************************************************
* macosx.c : MacOS X plugin for vlc
* intf_controller.h : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx_qt_common.h,v 1.1 2001/10/08 23:10:28 massiot Exp $
* $$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Authors: Florian G. Pflug <fgp@phlo.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
......@@ -21,59 +21,53 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Constants & more
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import "intf_vlc_wrapper.h"
#import "intf_qdview.h"
#ifndef __CARBONPREFIX__
#define __CARBONPREFIX__
@interface Intf_PlaylistDS : NSObject {
Intf_VlcWrapper* o_vlc ;
NSMutableArray* o_playlist ;
// Needed for carbonization
#define TARGET_API_MAC_CARBON 1
IBOutlet NSTableView *o_table ;
}
// For the pascal to C or C to pascal string conversions in carbon
#define OLDP2C 1
#endif
- (void ) awakeFromNib ;
- (void) readPlaylist ;
#include <Carbon/Carbon.h>
#include <QuickTime/QuickTime.h>
#include <CoreServices/CoreServices.h>
#include <QuickTime/QuickTime.h>
#include <ApplicationServices/ApplicationServices.h>
- (int) numberOfRowsInTableView:(NSTableView*)o_table ;
- (id) tableView:(NSTableView*)o_table objectValueForTableColumn:(NSTableColumn*)o_column row:(int)i_row ;
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex ;
@end
@interface Intf_Controller : NSObject <VlcWrapper_Delegate> {
Intf_VlcWrapper* o_vlc ;
/*****************************************************************************
* Type declarations that unfortunately need to be known to both
* ...
* Kind of a hack due to the fact that on Mac OS, there is little difference
* between the interface and the video output, and hence little separation
* between those elements.
*****************************************************************************/
extern main_t *p_main;
/*****************************************************************************
* vout_sys_t: MacOS X video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the MacOS X specific properties of an output thread.
*****************************************************************************/
typedef struct vout_sys_s
{
ImageDescriptionHandle h_img_descr ;
ImageSequence i_seq ;
unsigned int i_img_size ;
unsigned char *p_img ;
} vout_sys_t;
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
typedef struct intf_sys_s
{
Ptr before_fullscreen ;
WindowRef p_window;
EventLoopTimerRef r_timer ;
NSWindow *o_window ;
bool b_window_is_fullscreen ;
IBOutlet NSButton *o_play ;
IBOutlet NSButton *o_pause ;
IBOutlet NSButton *o_stop ;
IBOutlet NSButton *o_stepr ;
IBOutlet NSButton *o_stepf ;
IBOutlet NSSlider *o_timeslider ;
IBOutlet NSTextField *o_currenttime ;
IBOutlet NSMenuItem *o_menu_fullscreen ;
unsigned int b_active ;
} intf_sys_t;
IBOutlet Intf_PlaylistDS *o_playlistds ;
}
//Initialization & Event-Management
- (void) awakeFromNib ;
- (void) manage:(NSTimer *)timer ;
- (void)applicationDidBecomeActive:(NSNotification*)aNotification ;
- (void)applicationDidResignActive:(NSNotification*)aNotification ;
//Functions atteched to user interface
- (IBAction) pause:(id)sender ;
- (IBAction) play:(id)sender ;
- (IBAction) timeslider_update:(id)slider ;
- (IBAction) speedslider_update:(id)slider ;
- (IBAction) fullscreen_toggle:(id)sender ;
@end
This diff is collapsed.
/*****************************************************************************
* intf_macosx.c: MacOS X interface plugin
* intf_main.c: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
*
* Authors: Colin Delacroix <colin@zoy.org>
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.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
......@@ -20,6 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME macosx
#include "modules_inner.h"
/*****************************************************************************
......@@ -38,14 +40,21 @@
#include "interface.h"
#include "intf_msg.h"
#include "intf_playlist.h"
#include "main.h"
#include "modules.h"
#include "modules_export.h"
#include "macosx_qt_common.h"
/* OS specific */
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
typedef struct intf_sys_s
{
NSAutoreleasePool *o_pool ;
} intf_sys_t;
/*****************************************************************************
......@@ -56,12 +65,6 @@ 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 );
/* OS specific */
#define kMainLoopFrequency (kEventDurationSecond) //45 for good measure
static pascal OSStatus FS_suspend_resume_handler(EventHandlerCallRef ref, EventRef event, void *dummy) ;
static pascal void APP_timer_handler(EventLoopTimerRef timer, void *dummy) ;
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
......@@ -82,13 +85,13 @@ void _M( intf_getfunctions )( function_list_t * p_function_list )
*****************************************************************************/
static int intf_Probe( probedata_t *p_data )
{
if( TestMethod( INTF_METHOD_VAR, "macosx_qt" ) )
if( TestMethod( INTF_METHOD_VAR, "macosx" ) )
{
return( 999 );
}
/* Under MacOS X, this plugin always works */
return( 90 );
return( 100 );
}
/*****************************************************************************
......@@ -102,6 +105,11 @@ static int intf_Open( intf_thread_t *p_intf )
return( 1 );
};
p_intf->p_sys->o_pool =[[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
return( 0 );
}
......@@ -111,6 +119,8 @@ static int intf_Open( intf_thread_t *p_intf )
static void intf_Close( intf_thread_t *p_intf )
{
/* Destroy structure */
[NSApp terminate:NSApp] ;
[p_intf->p_sys->o_pool release] ;
free( p_intf->p_sys );
}
......@@ -119,41 +129,5 @@ static void intf_Close( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
{
static EventTypeSpec suspendResumeEvent[2] = {{kEventClassApplication,kEventAppActivated}, {kEventClassApplication,kEventAppDeactivated}} ;
BeginFullScreen(&p_intf->p_sys->before_fullscreen, nil, 0, 0, &p_intf->p_sys->p_window, 0, fullScreenAllowEvents) ;
InstallStandardEventHandler(GetApplicationEventTarget()) ;
InstallApplicationEventHandler(NewEventHandlerUPP(FS_suspend_resume_handler), 2, suspendResumeEvent, &p_intf->p_sys->p_window, NULL) ;
InstallEventLoopTimer(GetMainEventLoop(), 0, kMainLoopFrequency, NewEventLoopTimerUPP(APP_timer_handler), NULL, &p_intf->p_sys->r_timer) ;
ShowWindow(p_intf->p_sys->p_window );
p_intf->p_sys->b_active = 1 ;
RunApplicationEventLoop() ;
p_intf->p_sys->b_active = 0 ;
EndFullScreen(p_intf->p_sys->before_fullscreen, nil) ;
[NSApp run] ;
}
static pascal void APP_timer_handler(EventLoopTimerRef timer, void *dummy)
{
p_main->p_intf->pf_manage(p_main->p_intf) ;
if (p_main->p_intf->b_die) QuitApplicationEventLoop() ;
}
static pascal OSStatus FS_suspend_resume_handler(EventHandlerCallRef ref, EventRef event, void *dummy)
{
switch (GetEventKind(event))
{
case kEventAppActivated: ShowWindow(p_main->p_intf->p_sys->p_window) ;
SetPortWindowPort(p_main->p_intf->p_sys->p_window) ;
intf_WarnMsg(1, "Application is on foreground") ;
break ;
case kEventAppDeactivated: HideWindow(p_main->p_intf->p_sys->p_window) ;
intf_WarnMsg(1, "Application sent to background") ;
break ;
}
return noErr ;
}
//
// intf_qdview.c
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import "intf_qdview.h"
NSString *VlcQuickDrawViewDidResize = @"VlcQuickDrawViewDidDraw" ;
@implementation VlcQuickDrawView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
return self;
}
- (void)drawRect:(NSRect)rect {
[super drawRect:rect] ;
[[NSNotificationCenter defaultCenter] postNotificationName:VlcQuickDrawViewDidResize object:self] ;
}
@end
//
// intf_qdview.h
// vlc
//
// Created by fgp on Mon Oct 29 2001.
// Copyright (c) 2001 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
extern NSString *VlcQuickDrawViewDidResize ;
@interface VlcQuickDrawView : NSQuickDrawView {
}
@end
/*****************************************************************************
* intf_vlc_wrapper.c : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $$
*
* Authors: Florian G. Pflug <fgp@phlo.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
* 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.
*****************************************************************************/
#include "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include <sys/param.h> /* for MAXPATHLEN */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "interface.h"
#include "intf_msg.h"
#include "intf_playlist.h"
#include "main.h"
#include "modules.h"
#include "modules_export.h"
#define OSX_COM_STRUCT vout_sys_s
#define OSX_COM_TYPE vout_sys_t
#include "macosx.h"
#include "video.h"
#include "video_output.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#import "intf_vlc_wrapper.h"
#define p_area p_main->p_intf->p_input->stream.p_selected_area
@implementation Intf_VlcWrapper
//Initialization,.....
+ (Intf_VlcWrapper*) instance {
static bool b_initialized = 0;
static Intf_VlcWrapper* o_vlc = nil ;
if (!b_initialized) {
o_vlc = [[Intf_VlcWrapper alloc] init] ;
b_initialized = TRUE ;
}
return o_vlc ;
}
- (Intf_VlcWrapper*) initWithDelegate:(id)_o_delegate {
e_speed = SPEED_NORMAL ;
o_delegate = _o_delegate ;
return self ;
}
- (bool) manage {
vout_thread_t *p_vout ;
bool b_resize=FALSE, b_request=FALSE, b_release=FALSE;
bool b_fullscreen=FALSE ;
p_main->p_intf->pf_manage( p_main->p_intf ) ;
if ((p_vout = [self lockVout])) {
i_width = p_vout->i_width ;
i_height = p_vout->i_height ;
b_fullscreen = !!p_vout->b_fullscreen ;
//Also mange the notifications for the output.
if (p_vout->i_changes & (VOUT_SIZE_CHANGE | VOUT_FULLSCREEN_CHANGE)) b_resize = TRUE ;
if (p_vout->p_sys->i_changes & OSX_VOUT_INTF_REQUEST_QDPORT) b_request = TRUE ;
if (p_vout->p_sys->i_changes & OSX_VOUT_INTF_RELEASE_QDPORT) b_release = TRUE ;
p_vout->i_changes &= ~(VOUT_SIZE_CHANGE | VOUT_FULLSCREEN_CHANGE) ;
p_vout->p_sys->i_changes &= ~(OSX_VOUT_INTF_REQUEST_QDPORT | OSX_VOUT_INTF_RELEASE_QDPORT) ;
[self unlockVout] ;
}
if (b_resize) [o_delegate resizeQDPortFullscreen:b_fullscreen] ;
if (b_release) [o_delegate releaseQDPort] ;
if (b_request) [o_delegate requestQDPortFullscreen:b_fullscreen] ;
return p_main->p_intf->b_die ;
}
//Function for the GUI.
- (void) setQDPort:(CGrafPtr)p_qdport {
vout_thread_t *p_vout;
if ((p_vout = [self lockVout])) {
p_vout->p_sys->p_qdport = p_qdport ;
p_vout->p_sys->i_changes |= OSX_INTF_VOUT_QDPORT_CHANGE ;
[self unlockVout] ;
}
}
- (void) sizeChangeQDPort {
vout_thread_t *p_vout;
if ((p_vout = [self lockVout])) {
p_vout->p_sys->i_changes |= OSX_INTF_VOUT_SIZE_CHANGE ;
[self unlockVout] ;
}
}
- (NSSize) videoSize {
return NSMakeSize(i_width, i_height) ;
}
//Playback control
- (void) play {
if (![self hasInput]) return ;
switch (e_speed)
{
case SPEED_SLOW:
input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_SLOWER) ;
break ;
case SPEED_NORMAL:
input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_PLAY) ;
break ;
case SPEED_FAST:
input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_FASTER) ;
break ;
}
}
- (void) pause {
if (![self hasInput]) return ;
input_SetStatus(p_main->p_intf->p_input, INPUT_STATUS_PAUSE) ;
}
- (void) stop {
return ;
}
- (void) stepf {
return ;
}
- (void) stepr {
return ;
}
- (void) setSpeed:(intf_speed_t) _e_speed {
e_speed = _e_speed ;
[self play] ;
}
- (NSString *) getTimeAsString {
static char psz_currenttime[ OFFSETTOTIME_MAX_SIZE ] ;
if (![self hasInput]) return [NSString stringWithCString:"00:00:00"] ;
input_OffsetToTime( p_main->p_intf->p_input, psz_currenttime, p_area->i_tell ) ;
return [NSString stringWithCString:psz_currenttime] ;
}
- (float) getTimeAsFloat {
if (![self hasInput]) return 0.0 ;
return (float)p_area->i_tell / (float)p_area->i_size ;
}
- (void) setTimeAsFloat:(float) f_position {
if (![self hasInput]) return ;
input_Seek(p_main->p_intf->p_input, p_area->i_size * f_position) ;
}
//Playlist control
- (void) lockPlaylist {
vlc_mutex_lock(&p_main->p_playlist->change_lock) ;
}
- (void) unlockPlaylist {
vlc_mutex_unlock(&p_main->p_playlist->change_lock) ;
}
- (int) getPlaylistLength {
return p_main->p_playlist->i_size ;
}
- (NSString*) getPlaylistItem:(int) i_pos {
if (i_pos >= p_main->p_playlist->i_size)
return nil ;
return [NSString stringWithCString:p_main->p_playlist->p_item[i_pos].psz_name] ;
}
- (void) playNextPlaylistItem {
intf_PlaylistNext(p_main->p_playlist) ;
}
- (void) playPrevPlaylistItem {
intf_PlaylistPrev(p_main->p_playlist) ;
}
- (void) addPlaylistItem:(NSString*)o_filename {
intf_PlaylistAdd(p_main->p_playlist, PLAYLIST_END, [o_filename lossyCString]) ;
}
// Private Functions. This are just some utilities for other functions
- (bool) hasInput {
return (p_main->p_intf->p_input != NULL) ? TRUE : FALSE ;
}
- (struct vout_thread_s*) lockVout {
vlc_mutex_lock(&p_vout_bank->lock) ;
if (p_vout_bank->i_count) {
vlc_mutex_lock(&p_vout_bank->pp_vout[0]->change_lock) ;
vlc_mutex_lock(&p_vout_bank->pp_vout[0]->p_sys->lock) ;
return p_vout_bank->pp_vout[0] ;
}
else
{
vlc_mutex_unlock(&p_vout_bank->lock) ;
return NULL ;
}
}
- (void) unlockVout {
vlc_mutex_lock(&p_vout_bank->pp_vout[0]->p_sys->lock) ;
vlc_mutex_unlock(&p_vout_bank->pp_vout[0]->change_lock) ;
vlc_mutex_unlock(&p_vout_bank->lock) ;
}
@end
/*****************************************************************************
* macosx.c : MacOS X plugin for vlc
* intf_vlc_wrapper.h : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx_qt.c,v 1.1 2001/10/08 23:10:28 massiot Exp $
* $$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Authors: Florian G. Pflug <fgp@phlo.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
......@@ -22,51 +21,59 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "modules_inner.h"
#import <Cocoa/Cocoa.h>
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
struct vlc_thread_s ;
typedef enum intf_speed_e {SPEED_SLOW=0, SPEED_NORMAL, SPEED_FAST} intf_speed_t ;
@protocol VlcWrapper_Delegate
- (void) requestQDPortFullscreen:(bool)b_fullscreen ;
- (void) releaseQDPort ;
- (void) resizeQDPortFullscreen:(bool)b_fullscreen ;
@end
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
// Intf_VlcWrapper is a singleton class (there is only one instance at any time)
@interface Intf_VlcWrapper : NSObject {
id<VlcWrapper_Delegate> o_delegate ;
intf_speed_t e_speed ;
unsigned int i_width, i_height ;
}
#include "modules.h"
// Initialization,....
+ (Intf_VlcWrapper*) instance ;
- (Intf_VlcWrapper*) initWithDelegate:(id)o_delegate ;
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
- (bool) manage ;
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for MacOS X QuickTime module" )
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
MODULE_CONFIG_STOP
//Function for the GUI.
- (void) setQDPort:(CGrafPtr)p_qdport ;
- (void) sizeChangeQDPort ;
- (NSSize) videoSize ;
MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_VOUT
| MODULE_CAPABILITY_AOUT
| MODULE_CAPABILITY_INTF;
p_module->psz_longname = "MacOS X QuickTime output";
MODULE_INIT_STOP
// Playback control
- (void) play ;
- (void) pause ;
- (void) stop ;
- (void) stepf ;
- (void) stepr ;
- (void) setSpeed:(intf_speed_t)e_speed ;
- (NSString*) getTimeAsString ;
- (float) getTimeAsFloat ;
- (void) setTimeAsFloat:(float)i_offset ;
MODULE_ACTIVATE_START
_M( vout_getfunctions )( &p_module->p_functions->vout );
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( intf_getfunctions )( &p_module->p_functions->intf );
MODULE_ACTIVATE_STOP
// Playlist control
- (void) lockPlaylist ;
- (void) unlockPlaylist ;
- (int) getPlaylistLength ;
- (NSString*) getPlaylistItem:(int)i_pos ;
- (void) playNextPlaylistItem ;
- (void) playPrevPlaylistItem ;
- (void) addPlaylistItem:(NSString*)o_filename ;
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
//private
- (bool) hasInput ;
- (struct vout_thread_s*) lockVout ;
- (void) unlockVout ;
@end
......@@ -2,10 +2,11 @@
* macosx.c : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx.c,v 1.6 2001/10/08 16:20:25 massiot Exp $
* $Id: macosx.c,v 1.7 2001/10/30 10:48:14 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
* Florian G. Pflug <fgp@phlo.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
......@@ -22,6 +23,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME macosx
#include "modules_inner.h"
/*****************************************************************************
......
/*****************************************************************************
* macosx.c : MacOS X plugin for vlc
* macosx.h : MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx_common.h,v 1.3 2001/10/08 16:20:25 massiot Exp $
* $$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Authors: Florian G. Pflug <fgp@phlo.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
......@@ -22,51 +22,25 @@
*****************************************************************************/
/*****************************************************************************
* Constants & more
* The vout struct as access from both, the output and the interface module
*****************************************************************************/
#ifndef __CARBONPREFIX__
#define __CARBONPREFIX__
// Needed for carbonization
#define TARGET_API_MAC_CARBON 1
// For the pascal to C or C to pascal string conversions in carbon
#define OLDP2C 1
#include <QuickTime/QuickTime.h>
#define OSX_INTF_VOUT_QDPORT_CHANGE 0x0001
#define OSX_INTF_VOUT_SIZE_CHANGE 0x0002
#define OSX_VOUT_INTF_REQUEST_QDPORT 0x0004
#define OSX_VOUT_INTF_RELEASE_QDPORT 0x0008
/* This struct is included as the _FIRST_ member in vout_sys_t */
/* That way the interface can cast the vout_sys_t to osx_com_t */
/* and doesn't need the definition of vout_sys_t */
#ifndef OSX_COM_TYPE
#define OSX_COM_TYPE osx_com_t
#define OSX_COM_STRUCT osx_com_s
#endif
#include <Carbon/Carbon.h>
#define PLAYING 0
#define PAUSED 1
#define STOPPED 2
/*****************************************************************************
* Type declarations that unfortunately need to be known to both
* ...
* Kind of a hack due to the fact that on Mac OS, there is little difference
* between the interface and the video output, and hence little separation
* between those elements.
*****************************************************************************/
/*****************************************************************************
* vout_sys_t: MacOS X video output method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the MacOS X specific properties of an output thread.
*****************************************************************************/
typedef struct vout_sys_s
{
Rect wrect;
WindowRef p_window;
short gwLocOffscreen;
GWorldPtr p_gw[ 2 ];
Boolean gNewNewGWorld; /* can we allocate in VRAm or AGP memory ? */
typedef struct OSX_COM_STRUCT {
vlc_mutex_t lock ;
unsigned int i_changes ;
GDHandle theGDList;
Ptr theBase;
int theRow;
int theDepth;
} vout_sys_t;
CGrafPtr p_qdport ;
} OSX_COM_TYPE ;
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.145 2001/10/23 03:06:50 jobi Exp $
* $Id: input.c,v 1.146 2001/10/30 10:48:14 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -592,8 +592,8 @@ static void FileOpen( input_thread_t * p_input )
psz_name += 4;
i_stat = stat( psz_name, &stat_info );
}
else if( ( i_size > 4 )
&& !strncasecmp( psz_name, "vcd:", 4 ) )
else if( ( i_size > 4 )
&& !strncasecmp( psz_name, "vcd:", 4 ) )
{
/* get rid of the 'vcd:' stuff and try again */
psz_name += 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment