macosx: rename to VLCTrackSynchronizationWindowController
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Mon, 8 Aug 2016 15:49:56 +0000 (17:49 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Mon, 8 Aug 2016 16:47:29 +0000 (18:47 +0200)
12 files changed:
extras/package/macosx/Resources/English.lproj/SyncTracks.xib
extras/package/macosx/vlc.xcodeproj/project.pbxproj
modules/gui/macosx/InputManager.m
modules/gui/macosx/MainMenu.m
modules/gui/macosx/Makefile.am
modules/gui/macosx/TrackSynchronization.h [deleted file]
modules/gui/macosx/TrackSynchronization.m [deleted file]
modules/gui/macosx/VLCTrackSynchronizationWindowController.h [new file with mode: 0644]
modules/gui/macosx/VLCTrackSynchronizationWindowController.m [new file with mode: 0644]
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index abf45e8..2c7d543 100644 (file)
@@ -1,13 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
-        <deployment identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
         <capability name="box content view" minToolsVersion="7.0"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="VLCTrackSynchronization">
+        <customObject id="-2" userLabel="File's Owner" customClass="VLCTrackSynchronizationWindowController">
             <connections>
                 <outlet property="avLabel" destination="39" id="134"/>
                 <outlet property="avStepper" destination="10" id="115"/>
                     </textField>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="41">
                         <rect key="frame" x="16" y="12" width="39" height="17"/>
-                        <buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" image="92D21617-8D17-4241-AC95-8B9E3346C39B" imagePosition="overlaps" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="42" customClass="BGHUDButtonCell">
+                        <buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" image="FF2862BF-B9A1-44D3-96B5-AA87003226E8" imagePosition="overlaps" alignment="center" controlSize="mini" borderStyle="border" inset="2" id="42" customClass="BGHUDButtonCell">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                             <font key="font" metaFont="miniSystem"/>
                             <userDefinedRuntimeAttributes>
         </window>
     </objects>
     <resources>
-        <image name="92D21617-8D17-4241-AC95-8B9E3346C39B" width="1" height="1">
+        <image name="FF2862BF-B9A1-44D3-96B5-AA87003226E8" width="1" height="1">
             <mutableData key="keyedArchiveRepresentation">
 YnBsaXN0MDDUAQIDBAUGPT5YJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoK4HCBMU
 GR4fIyQrLjE3OlUkbnVsbNUJCgsMDQ4PEBESVk5TU2l6ZVYkY2xhc3NcTlNJbWFnZUZsYWdzVk5TUmVw
index 9b78999..6312904 100644 (file)
                1CCB5F881A62A724004C3E90 /* simple_prefs.m in Sources */ = {isa = PBXBuildFile; fileRef = CCB24D5D0D54BBAE004D780C /* simple_prefs.m */; };
                1CCB5F891A62A724004C3E90 /* StringUtility.h in Sources */ = {isa = PBXBuildFile; fileRef = CC269A4615E7947F00F2FDC9 /* StringUtility.h */; };
                1CCB5F8A1A62A724004C3E90 /* StringUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = CC269A4715E7947F00F2FDC9 /* StringUtility.m */; };
-               1CCB5F8B1A62A724004C3E90 /* TrackSynchronization.h in Sources */ = {isa = PBXBuildFile; fileRef = CC707EC3137464CD0003010A /* TrackSynchronization.h */; };
-               1CCB5F8C1A62A724004C3E90 /* TrackSynchronization.m in Sources */ = {isa = PBXBuildFile; fileRef = CC707EC4137464CD0003010A /* TrackSynchronization.m */; };
+               1CCB5F8B1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.h in Sources */ = {isa = PBXBuildFile; fileRef = CC707EC3137464CD0003010A /* VLCTrackSynchronizationWindowController.h */; };
+               1CCB5F8C1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CC707EC4137464CD0003010A /* VLCTrackSynchronizationWindowController.m */; };
                1CCB5F8D1A62A724004C3E90 /* VLCVideoEffectsWindowController.h in Sources */ = {isa = PBXBuildFile; fileRef = CCCE366D13817E4500694F2A /* VLCVideoEffectsWindowController.h */; };
                1CCB5F8E1A62A724004C3E90 /* VLCVideoEffectsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CCCE366E13817E4500694F2A /* VLCVideoEffectsWindowController.m */; };
                1CCB5F8F1A62A724004C3E90 /* VideoView.h in Sources */ = {isa = PBXBuildFile; fileRef = CCCCDCA01413E1C000FE3DE1 /* VideoView.h */; };
                CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = ../../../modules/gui/macosx/AppleRemote.m; sourceTree = SOURCE_ROOT; };
                CC6EDD4F0B9CA2140096068A /* VLCEyeTvController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCEyeTvController.h; path = ../../../modules/gui/macosx/VLCEyeTvController.h; sourceTree = SOURCE_ROOT; };
                CC6EDD500B9CA2140096068A /* VLCEyeTvController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCEyeTvController.m; path = ../../../modules/gui/macosx/VLCEyeTvController.m; sourceTree = SOURCE_ROOT; };
-               CC707EC3137464CD0003010A /* TrackSynchronization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TrackSynchronization.h; path = ../../../modules/gui/macosx/TrackSynchronization.h; sourceTree = SOURCE_ROOT; };
-               CC707EC4137464CD0003010A /* TrackSynchronization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TrackSynchronization.m; path = ../../../modules/gui/macosx/TrackSynchronization.m; sourceTree = SOURCE_ROOT; };
+               CC707EC3137464CD0003010A /* VLCTrackSynchronizationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCTrackSynchronizationWindowController.h; path = ../../../modules/gui/macosx/VLCTrackSynchronizationWindowController.h; sourceTree = SOURCE_ROOT; };
+               CC707EC4137464CD0003010A /* VLCTrackSynchronizationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCTrackSynchronizationWindowController.m; path = ../../../modules/gui/macosx/VLCTrackSynchronizationWindowController.m; sourceTree = SOURCE_ROOT; };
                CC772DAC10E621C100675C9B /* VLCProgressPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCProgressPanel.h; path = ../../../modules/gui/macosx_dialog_provider/VLCProgressPanel.h; sourceTree = SOURCE_ROOT; };
                CC772DAD10E621C100675C9B /* VLCProgressPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCProgressPanel.m; path = ../../../modules/gui/macosx_dialog_provider/VLCProgressPanel.m; sourceTree = SOURCE_ROOT; };
                CC79F66614014FC30015D89E /* opengl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = opengl.h; path = ../../../modules/video_output/opengl.h; sourceTree = "<group>"; };
                                CCB24D5D0D54BBAE004D780C /* simple_prefs.m */,
                                CC269A4615E7947F00F2FDC9 /* StringUtility.h */,
                                CC269A4715E7947F00F2FDC9 /* StringUtility.m */,
-                               CC707EC3137464CD0003010A /* TrackSynchronization.h */,
-                               CC707EC4137464CD0003010A /* TrackSynchronization.m */,
+                               CC707EC3137464CD0003010A /* VLCTrackSynchronizationWindowController.h */,
+                               CC707EC4137464CD0003010A /* VLCTrackSynchronizationWindowController.m */,
                                CCCE366D13817E4500694F2A /* VLCVideoEffectsWindowController.h */,
                                CCCE366E13817E4500694F2A /* VLCVideoEffectsWindowController.m */,
                                CCCCDCA01413E1C000FE3DE1 /* VideoView.h */,
                                1CCB5F881A62A724004C3E90 /* simple_prefs.m in Sources */,
                                1CCB5F891A62A724004C3E90 /* StringUtility.h in Sources */,
                                1CCB5F8A1A62A724004C3E90 /* StringUtility.m in Sources */,
-                               1CCB5F8B1A62A724004C3E90 /* TrackSynchronization.h in Sources */,
-                               1CCB5F8C1A62A724004C3E90 /* TrackSynchronization.m in Sources */,
+                               1CCB5F8B1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.h in Sources */,
+                               1CCB5F8C1A62A724004C3E90 /* VLCTrackSynchronizationWindowController.m in Sources */,
                                6BBBB8B71D114628001BD9BA /* VLCRendererDiscovery.m in Sources */,
                                1CCB5F8D1A62A724004C3E90 /* VLCVideoEffectsWindowController.h in Sources */,
                                1CCB5F8E1A62A724004C3E90 /* VLCVideoEffectsWindowController.m in Sources */,
index b526250..397925f 100644 (file)
@@ -30,7 +30,7 @@
 #import "VLCPlaylist.h"
 #import "VLCPlaylistInfo.h"
 #import "VLCResumeDialogController.h"
-#import "TrackSynchronization.h"
+#import "VLCTrackSynchronizationWindowController.h"
 #import "VideoView.h"
 
 #import "iTunes.h"
index c4eaaf5..ad7f64f 100644 (file)
@@ -31,7 +31,7 @@
 #import "AboutWindowController.h"
 #import "open.h"
 #import "VLCAudioEffectsWindowController.h"
-#import "TrackSynchronization.h"
+#import "VLCTrackSynchronizationWindowController.h"
 #import "HelpWindowController.h"
 #import "VLCVideoEffectsWindowController.h"
 #import "VLCBookmarksWindowController.h"
index 3f9a40c..f7577b5 100644 (file)
@@ -64,7 +64,6 @@ libmacosx_plugin_la_SOURCES = \
        SPMediaKeyTap.h SPMediaKeyTap.m \
        Spotify.h \
        StringUtility.h StringUtility.m \
-       TrackSynchronization.h TrackSynchronization.m \
        VideoView.h VideoView.m \
        VLCTimeSelectionPanelController.h VLCTimeSelectionPanelController.m \
        VLCUIWidgets.h VLCUIWidgets.m \
@@ -85,4 +84,5 @@ libmacosx_plugin_la_SOURCES = \
        VLCRendererItem.h VLCRendererItem.m \
        VLCRendererDialog.h VLCRendererDialog.m \
        VLCResumeDialogController.h VLCResumeDialogController.m \
+       VLCTrackSynchronizationWindowController.h VLCTrackSynchronizationWindowController.m \
        VLCVideoEffectsWindowController.h VLCVideoEffectsWindowController.m
diff --git a/modules/gui/macosx/TrackSynchronization.h b/modules/gui/macosx/TrackSynchronization.h
deleted file mode 100644 (file)
index 4cb32e4..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * TrackSynchronization.h: MacOS X interface module
- *****************************************************************************
- * Copyright (C) 2011-2012 VLC authors and VideoLAN
- * Copyright (C) 2011-2015 Felix Paul Kühne
- * $Id$
- *
- * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#import <Cocoa/Cocoa.h>
-
-@interface VLCTrackSynchronization : NSWindowController
-
-/* generic */
-@property (readwrite, weak) IBOutlet NSButton *resetButton;
-
-/* Audio / Video */
-@property (readwrite, weak) IBOutlet NSTextField *avLabel;
-@property (readwrite, weak) IBOutlet NSTextField *av_advanceLabel;
-@property (readwrite, weak) IBOutlet NSTextField *av_advanceTextField;
-@property (readwrite, weak) IBOutlet NSStepper *avStepper;
-
-/* Subtitles / Video */
-@property (readwrite, weak) IBOutlet NSTextField *svLabel;
-@property (readwrite, weak) IBOutlet NSTextField *sv_advanceLabel;
-@property (readwrite, weak) IBOutlet NSTextField *sv_advanceTextField;
-@property (readwrite, weak) IBOutlet NSStepper *sv_advanceStepper;
-@property (readwrite, weak) IBOutlet NSTextField *sv_speedLabel;
-@property (readwrite, weak) IBOutlet NSTextField *sv_speedTextField;
-@property (readwrite, weak) IBOutlet NSStepper *sv_speedStepper;
-@property (readwrite, weak) IBOutlet NSTextField *sv_durLabel;
-@property (readwrite, weak) IBOutlet NSTextField *sv_durTextField;
-@property (readwrite, weak) IBOutlet NSStepper *sv_durStepper;
-
-
-- (void)updateCocoaWindowLevel:(NSInteger)i_level;
-- (IBAction)toggleWindow:(id)sender;
-- (IBAction)resetValues:(id)sender;
-- (void)updateValues;
-
-- (IBAction)avValueChanged:(id)sender;
-
-- (IBAction)svAdvanceValueChanged:(id)sender;
-- (IBAction)svSpeedValueChanged:(id)sender;
-- (IBAction)svDurationValueChanged:(id)sender;
-@end
diff --git a/modules/gui/macosx/TrackSynchronization.m b/modules/gui/macosx/TrackSynchronization.m
deleted file mode 100644 (file)
index 96973da..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*****************************************************************************
- * TrackSynchronization.m: MacOS X interface module
- *****************************************************************************
- * Copyright (C) 2011-2014 VLC authors and VideoLAN
- * Copyright (C) 2011-2015 Felix Paul Kühne
- * $Id$
- *
- * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#import "CompatibilityFixes.h"
-#import "intf.h"
-#import <vlc_common.h>
-#import "TrackSynchronization.h"
-#import "CoreInteraction.h"
-
-#define SUBSDELAY_CFG_MODE                     "subsdelay-mode"
-#define SUBSDELAY_CFG_FACTOR                   "subsdelay-factor"
-#define SUBSDELAY_MODE_ABSOLUTE                0
-#define SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY   1
-#define SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT 2
-
-@implementation VLCTrackSynchronization
-
-- (id)init
-{
-    self = [super initWithWindowNibName:@"SyncTracks"];
-
-    return self;
-}
-
-- (void)windowDidLoad
-{
-    [self.window setTitle:_NS("Track Synchronization")];
-    [_resetButton setTitle:_NS("Reset")];
-    [_avLabel setStringValue:_NS("Audio/Video")];
-    [_av_advanceLabel setStringValue: _NS("Audio track synchronization:")];
-    [[_av_advanceTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
-    [_av_advanceTextField setToolTip: _NS("A positive value means that the audio is ahead of the video")];
-    [_svLabel setStringValue: _NS("Subtitles/Video")];
-    [_sv_advanceLabel setStringValue: _NS("Subtitle track synchronization:")];
-    [[_sv_advanceTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
-    [_sv_advanceTextField setToolTip: _NS("A positive value means that the subtitles are ahead of the video")];
-    [_sv_speedLabel setStringValue: _NS("Subtitle speed:")];
-    [[_sv_speedTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
-    [_sv_durLabel setStringValue: _NS("Subtitle duration factor:")];
-
-    int i_mode = var_InheritInteger(getIntf(), SUBSDELAY_CFG_MODE);
-    NSString * o_toolTip, * o_suffix;
-
-    switch (i_mode) {
-        default:
-        case SUBSDELAY_MODE_ABSOLUTE:
-            o_toolTip = _NS("Extend subtitle duration by this value.\nSet 0 to disable.");
-            o_suffix = @" s";
-            break;
-        case SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY:
-            o_toolTip = _NS("Multiply subtitle duration by this value.\nSet 0 to disable.");
-            o_suffix = @"";
-            break;
-        case SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT:
-            o_toolTip = _NS("Recalculate subtitle duration according\nto their content and this value.\nSet 0 to disable.");
-            o_suffix = @"";
-            break;
-    }
-
-    [[_sv_durTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000%@", o_suffix]];
-    [_sv_durTextField setToolTip: o_toolTip];
-
-    [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
-
-    [self resetValues:self];
-}
-
-- (void)updateCocoaWindowLevel:(NSInteger)i_level
-{
-    if (self.isWindowLoaded && [self.window isVisible] && [self.window level] != i_level)
-        [self.window setLevel: i_level];
-}
-
-- (IBAction)toggleWindow:(id)sender
-{
-    if ([self.window isVisible])
-        [self.window orderOut:sender];
-    else {
-        [self.window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
-        [self.window makeKeyAndOrderFront:sender];
-
-        [self updateValues];
-    }
-}
-
-- (IBAction)resetValues:(id)sender
-{
-    [_av_advanceTextField setFloatValue:0.0];
-    [_sv_advanceTextField setFloatValue:0.0];
-    [_sv_speedTextField setFloatValue:1.0];
-    [_sv_durTextField setFloatValue:0.0];
-    [_avStepper setFloatValue:0.0];
-    [_sv_advanceStepper setFloatValue:0.0];
-    [_sv_speedStepper setFloatValue:1.0];
-    [_sv_durStepper setFloatValue:0.0];
-
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        var_SetInteger(p_input, "audio-delay", 0.0);
-        var_SetInteger(p_input, "spu-delay", 0.0);
-        var_SetFloat(p_input, "sub-fps", 1.0);
-        [self svDurationValueChanged:nil];
-        vlc_object_release(p_input);
-    }
-}
-
-- (void)updateValues
-{
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        [_av_advanceTextField setDoubleValue: var_GetInteger(p_input, "audio-delay") / 1000000.];
-        [_sv_advanceTextField setDoubleValue: var_GetInteger(p_input, "spu-delay") / 1000000.];
-        [_sv_speedTextField setFloatValue: var_GetFloat(p_input, "sub-fps")];
-        vlc_object_release(p_input);
-    }
-    [_avStepper setDoubleValue: [_av_advanceTextField doubleValue]];
-    [_sv_advanceStepper setDoubleValue: [_sv_advanceTextField doubleValue]];
-    [_sv_speedStepper setDoubleValue: [_sv_speedTextField doubleValue]];
-}
-
-- (IBAction)avValueChanged:(id)sender
-{
-    if (sender == _avStepper)
-        [_av_advanceTextField setDoubleValue: [_avStepper doubleValue]];
-    else
-        [_avStepper setDoubleValue: [_av_advanceTextField doubleValue]];
-
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        var_SetInteger(p_input, "audio-delay", [_av_advanceTextField doubleValue] * 1000000.);
-        vlc_object_release(p_input);
-    }
-}
-
-- (IBAction)svAdvanceValueChanged:(id)sender
-{
-    if (sender == _sv_advanceStepper)
-        [_sv_advanceTextField setDoubleValue: [_sv_advanceStepper doubleValue]];
-    else
-        [_sv_advanceStepper setDoubleValue: [_sv_advanceTextField doubleValue]];
-
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        var_SetInteger(p_input, "spu-delay", [_sv_advanceTextField doubleValue] * 1000000.);
-        vlc_object_release(p_input);
-    }
-}
-
-- (IBAction)svSpeedValueChanged:(id)sender
-{
-    if (sender == _sv_speedStepper)
-        [_sv_speedTextField setFloatValue: [_sv_speedStepper floatValue]];
-    else
-        [_sv_speedStepper setFloatValue: [_sv_speedTextField floatValue]];
-
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        var_SetFloat(p_input, "sub-fps", [_sv_speedTextField floatValue]);
-        vlc_object_release(p_input);
-    }
-}
-
-- (IBAction)svDurationValueChanged:(id)sender
-{
-    if (sender == _sv_durStepper)
-        [_sv_durTextField setFloatValue: [_sv_durStepper floatValue]];
-    else
-        [_sv_durStepper setFloatValue: [_sv_durTextField floatValue]];
-
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (p_input) {
-        float f_factor = [_sv_durTextField floatValue];
-        config_PutFloat(getIntf(), SUBSDELAY_CFG_FACTOR, f_factor);
-
-        /* Try to find an instance of subsdelay, and set its factor */
-        vlc_object_t *p_obj = (vlc_object_t *) vlc_object_find_name(getIntf()->obj.libvlc, "subsdelay");
-        if (p_obj) {
-            var_SetFloat(p_obj, SUBSDELAY_CFG_FACTOR, f_factor);
-            vlc_object_release(p_obj);
-        }
-        [[VLCCoreInteraction sharedInstance] setVideoFilter: "subsdelay" on: f_factor > 0];
-
-        vlc_object_release(p_input);
-    }
-}
-
-@end
diff --git a/modules/gui/macosx/VLCTrackSynchronizationWindowController.h b/modules/gui/macosx/VLCTrackSynchronizationWindowController.h
new file mode 100644 (file)
index 0000000..d892b8b
--- /dev/null
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * VLCTrackSynchronizationWindowController.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2011-2012 VLC authors and VideoLAN
+ * Copyright (C) 2011-2015 Felix Paul Kühne
+ * $Id$
+ *
+ * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+@interface VLCTrackSynchronizationWindowController : NSWindowController
+
+/* generic */
+@property (readwrite, weak) IBOutlet NSButton *resetButton;
+
+/* Audio / Video */
+@property (readwrite, weak) IBOutlet NSTextField *avLabel;
+@property (readwrite, weak) IBOutlet NSTextField *av_advanceLabel;
+@property (readwrite, weak) IBOutlet NSTextField *av_advanceTextField;
+@property (readwrite, weak) IBOutlet NSStepper *avStepper;
+
+/* Subtitles / Video */
+@property (readwrite, weak) IBOutlet NSTextField *svLabel;
+@property (readwrite, weak) IBOutlet NSTextField *sv_advanceLabel;
+@property (readwrite, weak) IBOutlet NSTextField *sv_advanceTextField;
+@property (readwrite, weak) IBOutlet NSStepper *sv_advanceStepper;
+@property (readwrite, weak) IBOutlet NSTextField *sv_speedLabel;
+@property (readwrite, weak) IBOutlet NSTextField *sv_speedTextField;
+@property (readwrite, weak) IBOutlet NSStepper *sv_speedStepper;
+@property (readwrite, weak) IBOutlet NSTextField *sv_durLabel;
+@property (readwrite, weak) IBOutlet NSTextField *sv_durTextField;
+@property (readwrite, weak) IBOutlet NSStepper *sv_durStepper;
+
+
+- (void)updateCocoaWindowLevel:(NSInteger)i_level;
+- (IBAction)toggleWindow:(id)sender;
+- (IBAction)resetValues:(id)sender;
+- (void)updateValues;
+
+- (IBAction)avValueChanged:(id)sender;
+
+- (IBAction)svAdvanceValueChanged:(id)sender;
+- (IBAction)svSpeedValueChanged:(id)sender;
+- (IBAction)svDurationValueChanged:(id)sender;
+@end
diff --git a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
new file mode 100644 (file)
index 0000000..28aa594
--- /dev/null
@@ -0,0 +1,214 @@
+/*****************************************************************************
+ * VLCTrackSynchronizationWindowController.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2011-2014 VLC authors and VideoLAN
+ * Copyright (C) 2011-2015 Felix Paul Kühne
+ * $Id$
+ *
+ * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "CompatibilityFixes.h"
+#import "intf.h"
+#import <vlc_common.h>
+#import "VLCTrackSynchronizationWindowController.h"
+#import "CoreInteraction.h"
+
+#define SUBSDELAY_CFG_MODE                     "subsdelay-mode"
+#define SUBSDELAY_CFG_FACTOR                   "subsdelay-factor"
+#define SUBSDELAY_MODE_ABSOLUTE                0
+#define SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY   1
+#define SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT 2
+
+@implementation VLCTrackSynchronizationWindowController
+
+- (id)init
+{
+    self = [super initWithWindowNibName:@"SyncTracks"];
+
+    return self;
+}
+
+- (void)windowDidLoad
+{
+    [self.window setTitle:_NS("Track Synchronization")];
+    [_resetButton setTitle:_NS("Reset")];
+    [_avLabel setStringValue:_NS("Audio/Video")];
+    [_av_advanceLabel setStringValue: _NS("Audio track synchronization:")];
+    [[_av_advanceTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
+    [_av_advanceTextField setToolTip: _NS("A positive value means that the audio is ahead of the video")];
+    [_svLabel setStringValue: _NS("Subtitles/Video")];
+    [_sv_advanceLabel setStringValue: _NS("Subtitle track synchronization:")];
+    [[_sv_advanceTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
+    [_sv_advanceTextField setToolTip: _NS("A positive value means that the subtitles are ahead of the video")];
+    [_sv_speedLabel setStringValue: _NS("Subtitle speed:")];
+    [[_sv_speedTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
+    [_sv_durLabel setStringValue: _NS("Subtitle duration factor:")];
+
+    int i_mode = var_InheritInteger(getIntf(), SUBSDELAY_CFG_MODE);
+    NSString * o_toolTip, * o_suffix;
+
+    switch (i_mode) {
+        default:
+        case SUBSDELAY_MODE_ABSOLUTE:
+            o_toolTip = _NS("Extend subtitle duration by this value.\nSet 0 to disable.");
+            o_suffix = @" s";
+            break;
+        case SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY:
+            o_toolTip = _NS("Multiply subtitle duration by this value.\nSet 0 to disable.");
+            o_suffix = @"";
+            break;
+        case SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT:
+            o_toolTip = _NS("Recalculate subtitle duration according\nto their content and this value.\nSet 0 to disable.");
+            o_suffix = @"";
+            break;
+    }
+
+    [[_sv_durTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000%@", o_suffix]];
+    [_sv_durTextField setToolTip: o_toolTip];
+
+    [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
+
+    [self resetValues:self];
+}
+
+- (void)updateCocoaWindowLevel:(NSInteger)i_level
+{
+    if (self.isWindowLoaded && [self.window isVisible] && [self.window level] != i_level)
+        [self.window setLevel: i_level];
+}
+
+- (IBAction)toggleWindow:(id)sender
+{
+    if ([self.window isVisible])
+        [self.window orderOut:sender];
+    else {
+        [self.window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
+        [self.window makeKeyAndOrderFront:sender];
+
+        [self updateValues];
+    }
+}
+
+- (IBAction)resetValues:(id)sender
+{
+    [_av_advanceTextField setFloatValue:0.0];
+    [_sv_advanceTextField setFloatValue:0.0];
+    [_sv_speedTextField setFloatValue:1.0];
+    [_sv_durTextField setFloatValue:0.0];
+    [_avStepper setFloatValue:0.0];
+    [_sv_advanceStepper setFloatValue:0.0];
+    [_sv_speedStepper setFloatValue:1.0];
+    [_sv_durStepper setFloatValue:0.0];
+
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        var_SetInteger(p_input, "audio-delay", 0.0);
+        var_SetInteger(p_input, "spu-delay", 0.0);
+        var_SetFloat(p_input, "sub-fps", 1.0);
+        [self svDurationValueChanged:nil];
+        vlc_object_release(p_input);
+    }
+}
+
+- (void)updateValues
+{
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        [_av_advanceTextField setDoubleValue: var_GetInteger(p_input, "audio-delay") / 1000000.];
+        [_sv_advanceTextField setDoubleValue: var_GetInteger(p_input, "spu-delay") / 1000000.];
+        [_sv_speedTextField setFloatValue: var_GetFloat(p_input, "sub-fps")];
+        vlc_object_release(p_input);
+    }
+    [_avStepper setDoubleValue: [_av_advanceTextField doubleValue]];
+    [_sv_advanceStepper setDoubleValue: [_sv_advanceTextField doubleValue]];
+    [_sv_speedStepper setDoubleValue: [_sv_speedTextField doubleValue]];
+}
+
+- (IBAction)avValueChanged:(id)sender
+{
+    if (sender == _avStepper)
+        [_av_advanceTextField setDoubleValue: [_avStepper doubleValue]];
+    else
+        [_avStepper setDoubleValue: [_av_advanceTextField doubleValue]];
+
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        var_SetInteger(p_input, "audio-delay", [_av_advanceTextField doubleValue] * 1000000.);
+        vlc_object_release(p_input);
+    }
+}
+
+- (IBAction)svAdvanceValueChanged:(id)sender
+{
+    if (sender == _sv_advanceStepper)
+        [_sv_advanceTextField setDoubleValue: [_sv_advanceStepper doubleValue]];
+    else
+        [_sv_advanceStepper setDoubleValue: [_sv_advanceTextField doubleValue]];
+
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        var_SetInteger(p_input, "spu-delay", [_sv_advanceTextField doubleValue] * 1000000.);
+        vlc_object_release(p_input);
+    }
+}
+
+- (IBAction)svSpeedValueChanged:(id)sender
+{
+    if (sender == _sv_speedStepper)
+        [_sv_speedTextField setFloatValue: [_sv_speedStepper floatValue]];
+    else
+        [_sv_speedStepper setFloatValue: [_sv_speedTextField floatValue]];
+
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        var_SetFloat(p_input, "sub-fps", [_sv_speedTextField floatValue]);
+        vlc_object_release(p_input);
+    }
+}
+
+- (IBAction)svDurationValueChanged:(id)sender
+{
+    if (sender == _sv_durStepper)
+        [_sv_durTextField setFloatValue: [_sv_durStepper floatValue]];
+    else
+        [_sv_durStepper setFloatValue: [_sv_durTextField floatValue]];
+
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (p_input) {
+        float f_factor = [_sv_durTextField floatValue];
+        config_PutFloat(getIntf(), SUBSDELAY_CFG_FACTOR, f_factor);
+
+        /* Try to find an instance of subsdelay, and set its factor */
+        vlc_object_t *p_obj = (vlc_object_t *) vlc_object_find_name(getIntf()->obj.libvlc, "subsdelay");
+        if (p_obj) {
+            var_SetFloat(p_obj, SUBSDELAY_CFG_FACTOR, f_factor);
+            vlc_object_release(p_obj);
+        }
+        [[VLCCoreInteraction sharedInstance] setVideoFilter: "subsdelay" on: f_factor > 0];
+
+        vlc_object_release(p_input);
+    }
+}
+
+@end
index 6f1c76b..4b7c428 100644 (file)
@@ -34,7 +34,7 @@
 #import "VLCAudioEffectsWindowController.h"
 #import "VLCPlaylistInfo.h"
 #import "VLCBookmarksWindowController.h"
-#import "TrackSynchronization.h"
+#import "VLCTrackSynchronizationWindowController.h"
 #import "VLCResumeDialogController.h"
 #import "VLCPlaylist.h"
 
index b805662..42ecb48 100644 (file)
@@ -67,7 +67,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 @class VLCBookmarksWindowController;
 @class VLCOpen;
 @class VLCDebugMessageVisualizer;
-@class VLCTrackSynchronization;
+@class VLCTrackSynchronizationWindowController;
 @class VLCAudioEffectsWindowController;
 @class VLCVideoEffectsWindowController;
 @class VLCConvertAndSave;
@@ -99,7 +99,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 
 - (VLCDebugMessageVisualizer *)debugMsgPanel;
 
-- (VLCTrackSynchronization *)trackSyncPanel;
+- (VLCTrackSynchronizationWindowController *)trackSyncPanel;
 - (VLCAudioEffectsWindowController *)audioEffectsPanel;
 - (VLCVideoEffectsWindowController *)videoEffectsPanel;
 
index 1ae5591..02b38c7 100644 (file)
@@ -55,7 +55,7 @@
 #import "VLCCoreDialogProvider.h"
 #import "simple_prefs.h"
 #import "CoreInteraction.h"
-#import "TrackSynchronization.h"
+#import "VLCTrackSynchronizationWindowController.h"
 #import "ExtensionsManager.h"
 #import "BWQuincyManager.h"
 #import "VLCResumeDialogController.h"
@@ -176,7 +176,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     VLCPlaylist *_playlist;
     VLCDebugMessageVisualizer *_messagePanelController;
     VLCStatusBarIcon *_statusBarIcon;
-    VLCTrackSynchronization *_trackSyncPanel;
+    VLCTrackSynchronizationWindowController *_trackSyncPanel;
     VLCAudioEffectsWindowController *_audioEffectsPanel;
     VLCVideoEffectsWindowController *_videoEffectsPanel;
     VLCConvertAndSave *_convertAndSaveWindow;
@@ -544,10 +544,10 @@ static VLCMain *sharedInstance = nil;
     return _messagePanelController;
 }
 
-- (VLCTrackSynchronization *)trackSyncPanel
+- (VLCTrackSynchronizationWindowController *)trackSyncPanel
 {
     if (!_trackSyncPanel)
-        _trackSyncPanel = [[VLCTrackSynchronization alloc] init];
+        _trackSyncPanel = [[VLCTrackSynchronizationWindowController alloc] init];
 
     return _trackSyncPanel;
 }