Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
548807de
Commit
548807de
authored
Aug 02, 2015
by
David
Browse files
macosx: Convert VLCTrackSync to NSWindowController subclass, remove singleton
parent
c95d33f9
Changes
7
Hide whitespace changes
Inline
Side-by-side
modules/gui/macosx/InputManager.m
View file @
548807de
...
...
@@ -419,7 +419,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
-
(
void
)
updateDelays
{
[[
VLC
TrackSynchronization
sharedInstance
]
updateValues
];
[[
[
VLC
Main
sharedInstance
]
trackSyncPanel
]
updateValues
];
}
-
(
void
)
updateMainMenu
...
...
modules/gui/macosx/MainMenu.m
View file @
548807de
...
...
@@ -55,7 +55,6 @@
{
BOOL
b_nib_videoeffects_loaded
;
BOOL
b_nib_audioeffects_loaded
;
BOOL
b_nib_tracksynchrloaded
;
BOOL
b_nib_bookmarks_loaded
;
BOOL
b_nib_convertandsave_loaded
;
...
...
@@ -63,7 +62,6 @@
HelpWindowController
*
_helpWindowController
;
VLCVideoEffects
*
_videoEffectsWindowController
;
VLCAudioEffects
*
_audioEffectsWindowController
;
VLCTrackSynchronization
*
_trackSynchronizationWindowController
;
VLCConvertAndSave
*
_convertAndSaveWindowController
;
AddonsWindowController
*
_addonsController
;
...
...
@@ -1294,13 +1292,7 @@
-
(
IBAction
)
showTrackSynchronization
:(
id
)
sender
{
if
(
!
_trackSynchronizationWindowController
)
_trackSynchronizationWindowController
=
[[
VLCTrackSynchronization
alloc
]
init
];
if
(
!
b_nib_tracksynchrloaded
)
b_nib_tracksynchrloaded
=
[
NSBundle
loadNibNamed
:
@"SyncTracks"
owner
:
_trackSynchronizationWindowController
];
[
_trackSynchronizationWindowController
toggleWindow
:
sender
];
[[[
VLCMain
sharedInstance
]
trackSyncPanel
]
toggleWindow
:
sender
];
}
-
(
IBAction
)
showAudioEffects
:(
id
)
sender
...
...
modules/gui/macosx/TrackSynchronization.h
View file @
548807de
...
...
@@ -24,10 +24,9 @@
#import <Cocoa/Cocoa.h>
@interface
VLCTrackSynchronization
:
NS
Object
@interface
VLCTrackSynchronization
:
NS
WindowController
/* generic */
@property
(
readwrite
,
weak
)
IBOutlet
NSWindow
*
window
;
@property
(
readwrite
,
weak
)
IBOutlet
NSButton
*
resetButton
;
/* Audio / Video */
...
...
@@ -48,7 +47,6 @@
@property
(
readwrite
,
weak
)
IBOutlet
NSTextField
*
sv_durTextField
;
@property
(
readwrite
,
weak
)
IBOutlet
NSStepper
*
sv_durStepper
;
+
(
VLCTrackSynchronization
*
)
sharedInstance
;
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
;
-
(
IBAction
)
toggleWindow
:(
id
)
sender
;
...
...
modules/gui/macosx/TrackSynchronization.m
View file @
548807de
...
...
@@ -36,21 +36,16 @@
@implementation
VLCTrackSynchronization
+
(
VLCTrackSynchronization
*
)
sharedInstance
-
(
id
)
init
{
static
VLCTrackSynchronization
*
sharedInstance
=
nil
;
static
dispatch_once_t
pred
;
self
=
[
super
initWithWindowNibName
:
@"SyncTracks"
];
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCTrackSynchronization
new
];
});
return
sharedInstance
;
return
self
;
}
-
(
void
)
awakeFromNib
-
(
void
)
windowDidLoad
{
[
_
window
setTitle
:
_NS
(
"Track Synchronization"
)];
[
self
.
window
setTitle
:
_NS
(
"Track Synchronization"
)];
[
_resetButton
setTitle
:
_NS
(
"Reset"
)];
[
_avLabel
setStringValue
:
_NS
(
"Audio/Video"
)];
[
_av_advanceLabel
setStringValue
:
_NS
(
"Audio track synchronization:"
)];
...
...
@@ -86,24 +81,26 @@
[[
_sv_durTextField
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000%@"
,
o_suffix
]];
[
_sv_durTextField
setToolTip
:
o_toolTip
];
[
_
window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
self
.
window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
self
resetValues
:
self
];
}
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
{
if
(
_
window
&&
[
_
window
isVisible
]
&&
[
_
window
level
]
!=
i_level
)
[
_
window
setLevel
:
i_level
];
if
(
self
.
window
&&
[
self
.
window
isVisible
]
&&
[
self
.
window
level
]
!=
i_level
)
[
self
.
window
setLevel
:
i_level
];
}
-
(
IBAction
)
toggleWindow
:(
id
)
sender
{
if
([
_
window
isVisible
])
[
_
window
orderOut
:
sender
];
if
([
self
.
window
isVisible
])
[
self
.
window
orderOut
:
sender
];
else
{
[
_window
setLevel
:
[[[
VLCMain
sharedInstance
]
voutController
]
currentStatusWindowLevel
]];
[
_window
makeKeyAndOrderFront
:
sender
];
[
self
.
window
setLevel
:
[[[
VLCMain
sharedInstance
]
voutController
]
currentStatusWindowLevel
]];
[
self
.
window
makeKeyAndOrderFront
:
sender
];
[
self
updateValues
];
}
}
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
548807de
...
...
@@ -593,7 +593,7 @@ void WindowClose(vout_window_t *p_wnd)
[[
VLCAudioEffects
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCInfo
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
main
bookmarks
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCT
rackSync
hronization
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
main
t
rackSync
Panel
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
main
resumeDialog
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
}
...
...
modules/gui/macosx/intf.h
View file @
548807de
...
...
@@ -65,6 +65,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
@class
VLCBookmarks
;
@class
VLCOpen
;
@class
VLCDebugMessageVisualizer
;
@class
VLCTrackSynchronization
;
@interface
VLCMain
:
NSObject
<
NSWindowDelegate
,
NSApplicationDelegate
>
{
...
...
@@ -91,6 +92,8 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
VLCInputManager
*
)
inputManager
;
-
(
VLCDebugMessageVisualizer
*
)
debugMsgPanel
;
-
(
VLCTrackSynchronization
*
)
trackSyncPanel
;
-
(
void
)
setActiveVideoPlayback
:(
BOOL
)
b_value
;
-
(
BOOL
)
activeVideoPlayback
;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
;
...
...
modules/gui/macosx/intf.m
View file @
548807de
...
...
@@ -155,6 +155,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
VLCInputManager
*
_input_manager
;
VLCPlaylist
*
_playlist
;
VLCDebugMessageVisualizer
*
_messagePanelController
;
VLCTrackSynchronization
*
_trackSyncPanel
;
bool
b_intf_terminating
;
/* Makes sure applicationWillTerminate will be called only once */
}
...
...
@@ -526,6 +527,14 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
_messagePanelController
;
}
-
(
VLCTrackSynchronization
*
)
trackSyncPanel
{
if
(
!
_trackSyncPanel
)
_trackSyncPanel
=
[[
VLCTrackSynchronization
alloc
]
init
];
return
_trackSyncPanel
;
}
-
(
VLCBookmarks
*
)
bookmarks
{
if
(
!
_bookmarks
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment