Skip to content

Commit

Permalink
Add presenter mode
Browse files Browse the repository at this point in the history
Presenter display is one slide ahead of the audience display
  • Loading branch information
mpflanzer committed Sep 25, 2018
1 parent 2b38039 commit 5862b6e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
15 changes: 9 additions & 6 deletions SplitShow/Base.lproj/Main.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<plugIn identifier="com.apple.pdfkit.ibplugin" version="11762"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
<plugIn identifier="com.apple.pdfkit.ibplugin" version="14313.18"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -23,13 +23,13 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="1091" height="488"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="1091" height="488"/>
<autoresizingMask key="autoresizingMask"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<pdfView autoresizesSubviews="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4el-I3-jqN" customClass="SlideView">
<rect key="frame" x="0.0" y="0.0" width="546" height="488"/>
Expand Down Expand Up @@ -101,7 +101,10 @@
<menuItem title="Mirror" tag="4" id="Lzl-UZ-rzt">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Custom" tag="5" id="4eC-YF-X0Q">
<menuItem title="Presenter" tag="5" id="gJ3-KA-R7J">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Custom" tag="6" id="4eC-YF-X0Q">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
Expand Down
1 change: 1 addition & 0 deletions SplitShow/PreviewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ typedef enum : NSInteger
SplitShowPresentationModeSplit,
SplitShowPresentationModeInverseSplit,
SplitShowPresentationModeMirror,
SplitShowPresentationModePresenter,
SplitShowPresentationModeCustom,
} SplitShowPresentationMode;

Expand Down
10 changes: 10 additions & 0 deletions SplitShow/PreviewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ - (void)updatePreviewLayouts
self.helperScreen.document = [self.splitShowDocument createMirroredDocument];
break;

case SplitShowPresentationModePresenter:
self.mainScreen.document = [self.splitShowDocument createMirroredDocument];
self.helperScreen.document = [self.splitShowDocument createPresenterDocument];
break;

case SplitShowPresentationModeCustom:
{
NSDictionary *info;
Expand Down Expand Up @@ -278,6 +283,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
self.helperDisplayItem.label = NSLocalizedString(@"Second display", @"Second display");
break;

case SplitShowPresentationModePresenter:
self.mainDisplayItem.label = NSLocalizedString(@"Audience display", @"Audience display");
self.helperDisplayItem.label = NSLocalizedString(@"Presenter display", @"Presenter display");
break;

case SplitShowPresentationModeCustom:
self.mainDisplayItem.label = @"";
self.helperDisplayItem.label = @"";
Expand Down
1 change: 1 addition & 0 deletions SplitShow/SplitShowDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef enum : NSInteger {
@property SplitShowSlideMode customLayoutMode;

- (PDFDocument*)createMirroredDocument;
- (PDFDocument*)createPresenterDocument;
- (PDFDocument*)createInterleavedDocumentForGroup:(SplitShowInterleaveGroup)mode inMode:(SplitShowInterleaveMode)mode;
- (PDFDocument*)createSplitDocumentForMode:(SplitShowSplitMode)mode;
- (PDFDocument*)createDocumentFromIndices:(NSArray*)indices forMode:(SplitShowSlideMode)mode;
Expand Down
7 changes: 7 additions & 0 deletions SplitShow/SplitShowDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ - (PDFDocument*)createMirroredDocument
return [self.pdfDocument copy];
}

- (PDFDocument*)createPresenterDocument
{
PDFDocument *doc = [self.pdfDocument copy];
[doc removePageAtIndex:0];
return doc;
}

- (PDFDocument*)createInterleavedDocumentForGroup:(SplitShowInterleaveGroup)group inMode:(SplitShowInterleaveMode)mode
{
// TODO: Add caching
Expand Down

0 comments on commit 5862b6e

Please sign in to comment.