Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
4d4d1ea6
Commit
4d4d1ea6
authored
Jul 15, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/trackSync: remove object instance from xib file
parent
abbd1552
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
211 additions
and
657 deletions
+211
-657
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/English.lproj/MainMenu.xib
+16
-80
extras/package/macosx/Resources/English.lproj/SyncTracks.xib
extras/package/macosx/Resources/English.lproj/SyncTracks.xib
+110
-472
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+1
-1
modules/gui/macosx/TrackSynchronization.h
modules/gui/macosx/TrackSynchronization.h
+21
-25
modules/gui/macosx/TrackSynchronization.m
modules/gui/macosx/TrackSynchronization.m
+63
-79
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.xib
View file @
4d4d1ea6
This diff is collapsed.
Click to expand it.
extras/package/macosx/Resources/English.lproj/SyncTracks.xib
View file @
4d4d1ea6
This diff is collapsed.
Click to expand it.
modules/gui/macosx/MainMenu.m
View file @
4d4d1ea6
...
...
@@ -1142,7 +1142,7 @@
o_trackSynchronization
=
[[
VLCTrackSynchronization
alloc
]
init
];
if
(
!
b_nib_tracksynchro_loaded
)
b_nib_tracksynchro_loaded
=
[
NSBundle
loadNibNamed
:
@"SyncTracks"
owner
:
NSApp
];
b_nib_tracksynchro_loaded
=
[
NSBundle
loadNibNamed
:
@"SyncTracks"
owner
:
o_trackSynchronization
];
[
o_trackSynchronization
toggleWindow
:
sender
];
}
...
...
modules/gui/macosx/TrackSynchronization.h
View file @
4d4d1ea6
...
...
@@ -2,7 +2,7 @@
* TrackSynchronization.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011-2012 VLC authors and VideoLAN
* Copyright (C) 2011-201
2
Felix Paul Kühne
* Copyright (C) 2011-201
5
Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
...
...
@@ -24,32 +24,30 @@
#import <Cocoa/Cocoa.h>
@interface
VLCTrackSynchronization
:
NSObject
@interface
VLCTrackSynchronization
:
NSObject
{
/* generic */
IBOutlet
id
o_window
;
IBOutlet
id
o_reset_btn
;
/* generic */
@property
(
readwrite
,
weak
)
IBOutlet
NSWindow
*
window
;
@property
(
readwrite
,
weak
)
IBOutlet
NSButton
*
resetButton
;
/* Audio / Video */
IBOutlet
id
o_av_lb
l
;
IBOutlet
id
o_av_advance_lb
l
;
IBOutlet
id
o_av_value_f
ld
;
IBOutlet
id
o_av_stp
;
/* Audio / Video */
@property
(
readwrite
,
weak
)
IBOutlet
NSTextField
*
avLabe
l
;
@property
(
readwrite
,
weak
)
IBOutlet
NSTextField
*
av_advanceLabe
l
;
@property
(
readwrite
,
weak
)
IBOutlet
NSTextField
*
av_advanceTextFie
ld
;
@property
(
readwrite
,
weak
)
IBOutlet
NSStepper
*
avStepper
;
/* Subtitles / Video */
IBOutlet
id
o_sv_lbl
;
IBOutlet
id
o_sv_advance_lbl
;
IBOutlet
id
o_sv_advance_value_fld
;
IBOutlet
id
o_sv_advance_stp
;
IBOutlet
id
o_sv_speed_lbl
;
IBOutlet
id
o_sv_speed_value_fld
;
IBOutlet
id
o_sv_speed_stp
;
IBOutlet
id
o_sv_dur_lbl
;
IBOutlet
id
o_sv_dur_value_fld
;
IBOutlet
id
o_sv_dur_stp
;
}
/* 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
;
/* generic */
+
(
VLCTrackSynchronization
*
)
sharedInstance
;
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
;
...
...
@@ -57,10 +55,8 @@
-
(
IBAction
)
resetValues
:(
id
)
sender
;
-
(
void
)
updateValues
;
/* Audio / Video */
-
(
IBAction
)
avValueChanged
:(
id
)
sender
;
/* Subtitles / Video */
-
(
IBAction
)
svAdvanceValueChanged
:(
id
)
sender
;
-
(
IBAction
)
svSpeedValueChanged
:(
id
)
sender
;
-
(
IBAction
)
svDurationValueChanged
:(
id
)
sender
;
...
...
modules/gui/macosx/TrackSynchronization.m
View file @
4d4d1ea6
...
...
@@ -2,7 +2,7 @@
* TrackSynchronization.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011-2014 VLC authors and VideoLAN
* Copyright (C) 2011-201
4
Felix Paul Kühne
* Copyright (C) 2011-201
5
Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
...
...
@@ -34,12 +34,6 @@
#define SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY 1
#define SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT 2
@interface
VLCTrackSynchronization
()
{
intf_thread_t
*
p_intf
;
}
@end
@implementation
VLCTrackSynchronization
+
(
VLCTrackSynchronization
*
)
sharedInstance
...
...
@@ -54,30 +48,23 @@
return
sharedInstance
;
}
-
(
id
)
init
{
self
=
[
super
init
];
p_intf
=
VLCIntf
;
return
self
;
}
-
(
void
)
awakeFromNib
{
[
o
_window
setTitle
:
_NS
(
"Track Synchronization"
)];
[
o_reset_bt
n
setTitle
:
_NS
(
"Reset"
)];
[
o_av_lb
l
setStringValue
:
_NS
(
"Audio/Video"
)];
[
o_av_advance_lb
l
setStringValue
:
_NS
(
"Audio track synchronization:"
)];
[[
o_av_value_f
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"s"
)]];
[
o_av_value_f
ld
setToolTip
:
_NS
(
"A positive value means that the audio is ahead of the video"
)];
[
o_sv_lb
l
setStringValue
:
_NS
(
"Subtitles/Video"
)];
[
o_sv_advance_lb
l
setStringValue
:
_NS
(
"Subtitle track synchronization:"
)];
[[
o_sv_advance_value_f
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"s"
)]];
[
o_sv_advance_value_f
ld
setToolTip
:
_NS
(
"A positive value means that the subtitles are ahead of the video"
)];
[
o_sv_speed_lb
l
setStringValue
:
_NS
(
"Subtitle speed:"
)];
[[
o_sv_speed_value_f
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"fps"
)]];
[
o_sv_dur_lb
l
setStringValue
:
_NS
(
"Subtitle duration factor:"
)];
int
i_mode
=
var_InheritInteger
(
p_i
ntf
,
SUBSDELAY_CFG_MODE
);
[
_window
setTitle
:
_NS
(
"Track Synchronization"
)];
[
_resetButto
n
setTitle
:
_NS
(
"Reset"
)];
[
_avLabe
l
setStringValue
:
_NS
(
"Audio/Video"
)];
[
_av_advanceLabe
l
setStringValue
:
_NS
(
"Audio track synchronization:"
)];
[[
_av_advanceTextFie
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"s"
)]];
[
_av_advanceTextFie
ld
setToolTip
:
_NS
(
"A positive value means that the audio is ahead of the video"
)];
[
_svLabe
l
setStringValue
:
_NS
(
"Subtitles/Video"
)];
[
_sv_advanceLabe
l
setStringValue
:
_NS
(
"Subtitle track synchronization:"
)];
[[
_sv_advanceTextFie
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"s"
)]];
[
_sv_advanceTextFie
ld
setToolTip
:
_NS
(
"A positive value means that the subtitles are ahead of the video"
)];
[
_sv_speedLabe
l
setStringValue
:
_NS
(
"Subtitle speed:"
)];
[[
_sv_speedTextFie
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000 %@"
,
_NS
(
"fps"
)]];
[
_sv_durLabe
l
setStringValue
:
_NS
(
"Subtitle duration factor:"
)];
int
i_mode
=
var_InheritInteger
(
VLCI
ntf
,
SUBSDELAY_CFG_MODE
);
NSString
*
o_toolTip
,
*
o_suffix
;
switch
(
i_mode
)
{
...
...
@@ -96,43 +83,43 @@
break
;
}
[[
o_sv_dur_value_f
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000%@"
,
o_suffix
]];
[
o_sv_dur_value_f
ld
setToolTip
:
o_toolTip
];
[[
_sv_durTextFie
ld
formatter
]
setFormat
:[
NSString
stringWithFormat
:
@"#,##0.000%@"
,
o_suffix
]];
[
_sv_durTextFie
ld
setToolTip
:
o_toolTip
];
if
(
!
OSX_SNOW_LEOPARD
)
[
o
_window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
_window
setCollectionBehavior
:
NSWindowCollectionBehaviorFullScreenAuxiliary
];
[
self
resetValues
:
self
];
}
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
{
if
(
o_window
&&
[
o_window
isVisible
]
&&
[
o
_window
level
]
!=
i_level
)
[
o
_window
setLevel
:
i_level
];
if
(
_window
&&
[
_window
isVisible
]
&&
[
_window
level
]
!=
i_level
)
[
_window
setLevel
:
i_level
];
}
-
(
IBAction
)
toggleWindow
:(
id
)
sender
{
if
([
o
_window
isVisible
])
[
o
_window
orderOut
:
sender
];
if
([
_window
isVisible
])
[
_window
orderOut
:
sender
];
else
{
[
o
_window
setLevel
:
[[[
VLCMain
sharedInstance
]
voutController
]
currentStatusWindowLevel
]];
[
o
_window
makeKeyAndOrderFront
:
sender
];
[
_window
setLevel
:
[[[
VLCMain
sharedInstance
]
voutController
]
currentStatusWindowLevel
]];
[
_window
makeKeyAndOrderFront
:
sender
];
}
}
-
(
IBAction
)
resetValues
:(
id
)
sender
{
[
o_av_value_f
ld
setFloatValue
:
0
.
0
];
[
o_sv_advance_value_f
ld
setFloatValue
:
0
.
0
];
[
o_sv_speed_value_f
ld
setFloatValue
:
1
.
0
];
[
o_sv_dur_value_f
ld
setFloatValue
:
0
.
0
];
[
o_av_stp
setFloatValue
:
0
.
0
];
[
o_sv_advance_stp
setFloatValue
:
0
.
0
];
[
o_sv_speed_stp
setFloatValue
:
1
.
0
];
[
o_sv_dur_stp
setFloatValue
:
0
.
0
];
[
_av_advanceTextFie
ld
setFloatValue
:
0
.
0
];
[
_sv_advanceTextFie
ld
setFloatValue
:
0
.
0
];
[
_sv_speedTextFie
ld
setFloatValue
:
1
.
0
];
[
_sv_durTextFie
ld
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
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
var_SetInteger
(
p_input
,
"audio-delay"
,
0
.
0
);
...
...
@@ -145,82 +132,79 @@
-
(
void
)
updateValues
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
[
o_av_value_f
ld
setDoubleValue
:
var_GetInteger
(
p_input
,
"audio-delay"
)
/
1000000
.];
[
o_sv_advance_value_f
ld
setDoubleValue
:
var_GetInteger
(
p_input
,
"spu-delay"
)
/
1000000
.];
[
o_sv_speed_value_f
ld
setFloatValue
:
var_GetFloat
(
p_input
,
"sub-fps"
)];
[
_av_advanceTextFie
ld
setDoubleValue
:
var_GetInteger
(
p_input
,
"audio-delay"
)
/
1000000
.];
[
_sv_advanceTextFie
ld
setDoubleValue
:
var_GetInteger
(
p_input
,
"spu-delay"
)
/
1000000
.];
[
_sv_speedTextFie
ld
setFloatValue
:
var_GetFloat
(
p_input
,
"sub-fps"
)];
vlc_object_release
(
p_input
);
}
[
o_av_stp
setDoubleValue
:
[
o_av_value_f
ld
doubleValue
]];
[
o_sv_advance_stp
setDoubleValue
:
[
o_sv_advance_value_f
ld
doubleValue
]];
[
o_sv_speed_stp
setDoubleValue
:
[
o_sv_speed_value_f
ld
doubleValue
]];
[
_avStepper
setDoubleValue
:
[
_av_advanceTextFie
ld
doubleValue
]];
[
_sv_advanceStepper
setDoubleValue
:
[
_sv_advanceTextFie
ld
doubleValue
]];
[
_sv_speedStepper
setDoubleValue
:
[
_sv_speedTextFie
ld
doubleValue
]];
}
-
(
IBAction
)
avValueChanged
:(
id
)
sender
{
if
(
sender
==
o_av_stp
)
[
o_av_value_fld
setDoubleValue
:
[
o_av_stp
doubleValue
]];
if
(
sender
==
_avStepper
)
[
_av_advanceTextField
setDoubleValue
:
[
_avStepper
doubleValue
]];
else
[
o_av_stp
setDoubleValue
:
[
o_av_value_f
ld
doubleValue
]];
[
_avStepper
setDoubleValue
:
[
_av_advanceTextFie
ld
doubleValue
]];
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
var_SetInteger
(
p_input
,
"audio-delay"
,
[
o_av_value_fld
doubleValue
]
*
1000000
.);
var_SetInteger
(
p_input
,
"audio-delay"
,
[
_av_advanceTextField
doubleValue
]
*
1000000
.);
vlc_object_release
(
p_input
);
}
}
-
(
IBAction
)
svAdvanceValueChanged
:(
id
)
sender
{
if
(
sender
==
o_sv_advance_stp
)
[
o_sv_advance_value_fld
setDoubleValue
:
[
o_sv_advance_stp
doubleValue
]];
if
(
sender
==
_sv_advanceStepper
)
[
_sv_advanceTextField
setDoubleValue
:
[
_sv_advanceStepper
doubleValue
]];
else
[
o_sv_advance_stp
setDoubleValue
:
[
o_sv_advance_value_f
ld
doubleValue
]];
[
_sv_advanceStepper
setDoubleValue
:
[
_sv_advanceTextFie
ld
doubleValue
]];
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
var_SetInteger
(
p_input
,
"spu-delay"
,
[
o_sv_advance_value_fld
doubleValue
]
*
1000000
.);
var_SetInteger
(
p_input
,
"spu-delay"
,
[
_sv_advanceTextField
doubleValue
]
*
1000000
.);
vlc_object_release
(
p_input
);
}
}
-
(
IBAction
)
svSpeedValueChanged
:(
id
)
sender
{
if
(
sender
==
o_sv_speed_stp
)
[
o_sv_speed_value_fld
setFloatValue
:
[
o_sv_speed_stp
floatValue
]];
if
(
sender
==
_sv_speedStepper
)
[
_sv_speedTextField
setFloatValue
:
[
_sv_speedStepper
floatValue
]];
else
[
o_sv_speed_stp
setFloatValue
:
[
o_sv_speed_value_f
ld
floatValue
]];
[
_sv_speedStepper
setFloatValue
:
[
_sv_speedTextFie
ld
floatValue
]];
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
var_SetFloat
(
p_input
,
"sub-fps"
,
[
o_sv_speed_value_fld
floatValue
]);
var_SetFloat
(
p_input
,
"sub-fps"
,
[
_sv_speedTextField
floatValue
]);
vlc_object_release
(
p_input
);
}
}
-
(
IBAction
)
svDurationValueChanged
:(
id
)
sender
{
if
(
sender
==
o_sv_dur_stp
)
[
o_sv_dur_value_fld
setFloatValue
:
[
o_sv_dur_stp
floatValue
]];
if
(
sender
==
_sv_durStepper
)
[
_sv_durTextField
setFloatValue
:
[
_sv_durStepper
floatValue
]];
else
[
o_sv_dur_stp
setFloatValue
:
[
o_sv_dur_value_f
ld
floatValue
]];
[
_sv_durStepper
setFloatValue
:
[
_sv_durTextFie
ld
floatValue
]];
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_i
ntf
);
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCI
ntf
);
if
(
p_input
)
{
float
f_factor
=
[
o_sv_dur_value_f
ld
floatValue
];
config_PutFloat
(
p_i
ntf
,
SUBSDELAY_CFG_FACTOR
,
f_factor
);
float
f_factor
=
[
_sv_durTextFie
ld
floatValue
];
config_PutFloat
(
VLCI
ntf
,
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
(
p_i
ntf
->
p_libvlc
,
"subsdelay"
);
vlc_object_t
*
p_obj
=
(
vlc_object_t
*
)
vlc_object_find_name
(
VLCI
ntf
->
p_libvlc
,
"subsdelay"
);
if
(
p_obj
)
{
var_SetFloat
(
p_obj
,
SUBSDELAY_CFG_FACTOR
,
f_factor
);
vlc_object_release
(
p_obj
);
...
...
Write
Preview
Markdown
is supported
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