Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
38d41736
Commit
38d41736
authored
Sep 29, 2015
by
Felix Paul Kühne
Browse files
playback: give the user full control over the gestures to choose from (close #15449)
parent
a91c79cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Resources/Settings.bundle/Root.inApp.plist
View file @
38d41736
...
...
@@ -96,15 +96,55 @@
<key>
Type
</key>
<string>
PSGroupSpecifier
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURE
_TITLE
</string>
<string>
SETTINGS_GESTURE
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableGesture
sToControlPlayback
</string>
<string>
Enable
Volume
Gesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES
</string>
<string>
SETTINGS_GESTURES_VOLUME
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnablePlayPauseGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_PLAYPAUSE
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableBrightnessGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_BRIGHTNESS
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableSeekGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_SEEK
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableCloseGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_CLOSE
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
...
...
Resources/Settings.bundle/Root.plist
View file @
38d41736
...
...
@@ -86,15 +86,55 @@
<key>
Type
</key>
<string>
PSGroupSpecifier
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURE
_TITLE
</string>
<string>
SETTINGS_GESTURE
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableGesture
sToControlPlayback
</string>
<string>
Enable
Volume
Gesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES
</string>
<string>
SETTINGS_GESTURES_VOLUME
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnablePlayPauseGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_PLAYPAUSE
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableBrightnessGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_BRIGHTNESS
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableCloseGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_CLOSE
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
<dict>
<key>
DefaultValue
</key>
<true/>
<key>
Key
</key>
<string>
EnableSeekGesture
</string>
<key>
Title
</key>
<string>
SETTINGS_GESTURES_SEEK
</string>
<key>
Type
</key>
<string>
PSToggleSwitchSpecifier
</string>
</dict>
...
...
Resources/Settings.bundle/en.lproj/Root.strings
View file @
38d41736
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Sources/VLCAppDelegate.m
View file @
38d41736
...
...
@@ -72,7 +72,12 @@ NSString *const VLCDropboxSessionWasAuthorized = @"VLCDropboxSessionWasAuthorize
kVLCSettingSubtitlesBoldFont:
kVLCSettingSubtitlesBoldFontDefaultValue
,
kVLCSettingDeinterlace
:
kVLCSettingDeinterlaceDefaultValue
,
kVLCSettingNetworkCaching
:
kVLCSettingNetworkCachingDefaultValue
,
kVLCSettingPlaybackGestures
:
@
(
YES
),
kVLCSettingVolumeGesture
:
@
(
YES
),
kVLCSettingPlayPauseGesture
:
@
(
YES
),
kVLCSettingBrightnessGesture
:
@
(
YES
),
kVLCSettingSeekGesture
:
@
(
YES
),
kVLCSettingCloseGesture
:
@
(
YES
),
kVLCSettingVariableJumpDuration
:
@
(
NO
),
kVLCSettingVideoFullscreenPlayback
:
@
(
YES
),
kVLCSettingFTPTextEncoding
:
kVLCSettingFTPTextEncodingDefaultValue
,
kVLCSettingWiFiSharingIPv6
:
kVLCSettingWiFiSharingIPv6DefaultValue
,
...
...
Sources/VLCConstants.h
View file @
38d41736
...
...
@@ -42,7 +42,11 @@
#define kVLCSettingNetworkCaching @"network-caching"
#define kVLCSettingNetworkCachingDefaultValue @(999)
#define kVLCSettingsDecrapifyTitles @"MLDecrapifyTitles"
#define kVLCSettingPlaybackGestures @"EnableGesturesToControlPlayback"
#define kVLCSettingVolumeGesture @"EnableVolumeGesture"
#define kVLCSettingPlayPauseGesture @"EnablePlayPauseGesture"
#define kVLCSettingBrightnessGesture @"EnableBrightnessGesture"
#define kVLCSettingSeekGesture @"EnableSeekGesture"
#define kVLCSettingCloseGesture @"EnableCloseGesture"
#define kVLCSettingVariableJumpDuration @"EnableVariableJumpDuration"
#define kVLCSettingVideoFullscreenPlayback @"AlwaysUseFullscreenForVideo"
#define kVLCSettingFTPTextEncoding @"ftp-text-encoding"
...
...
Sources/VLCMenuTableViewController.m
View file @
38d41736
...
...
@@ -247,17 +247,12 @@ static NSString *WiFiCellIdentifier = @"VLCMenuWiFiCell";
self
.
settingsViewController
.
navigationItem
.
leftBarButtonItem
=
[
UIBarButtonItem
themedRevealMenuButtonWithTarget
:
self
.
settingsController
.
viewController
andSelector
:
@selector
(
dismiss
:
)];
}
_hiddenSettingKeys
=
[[
NSMutableSet
alloc
]
init
];
IASKAppSettingsViewController
*
settingsVC
=
self
.
settingsViewController
;
settingsVC
.
modalPresentationStyle
=
UIModalPresentationFormSheet
;
settingsVC
.
delegate
=
self
.
settingsController
;
settingsVC
.
showDoneButton
=
NO
;
settingsVC
.
showCreditsFooter
=
NO
;
if
(
!
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
kVLCSettingPlaybackGestures
]
boolValue
])
[
_hiddenSettingKeys
addObject
:
@"EnableVariableJumpDuration"
];
[
self
.
settingsController
.
viewController
setHiddenKeys
:
_hiddenSettingKeys
];
viewController
=
settingsVC
;
}
else
if
(
itemIndex
==
1
)
viewController
=
[[
VLCAboutViewController
alloc
]
init
];
...
...
Sources/VLCMovieViewController.m
View file @
38d41736
...
...
@@ -71,7 +71,11 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
BOOL
_switchingTracksNotChapters
;
BOOL
_audioOnly
;
BOOL
_swipeGesturesEnabled
;
BOOL
_volumeGestureEnabled
;
BOOL
_playPauseGestureEnabled
;
BOOL
_brightnessGestureEnabled
;
BOOL
_seekGestureEnabled
;
BOOL
_closeGestureEnabled
;
BOOL
_variableJumpDurationEnabled
;
UIPinchGestureRecognizer
*
_pinchRecognizer
;
VLCPanType
_currentPanType
;
...
...
@@ -217,8 +221,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
_displayRemainingTime
=
[[
defaults
objectForKey
:
kVLCShowRemainingTime
]
boolValue
];
_swipeGesturesEnabled
=
[[
defaults
objectForKey
:
kVLCSettingPlaybackGestures
]
boolValue
];
_variableJumpDurationEnabled
=
[[
defaults
objectForKey
:
kVLCSettingVariableJumpDuration
]
boolValue
];
_pinchRecognizer
=
[[
UIPinchGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
handlePinchGesture
:
)];
_pinchRecognizer
.
delegate
=
self
;
...
...
@@ -399,17 +401,22 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
self
.
artistNameLabel
.
text
=
nil
;
self
.
albumNameLabel
.
text
=
nil
;
_swipeGesturesEnabled
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
kVLCSettingPlaybackGestures
]
boolValue
];
_variableJumpDurationEnabled
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
kVLCSettingVariableJumpDuration
]
boolValue
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
_volumeGestureEnabled
=
[[
defaults
objectForKey
:
kVLCSettingVolumeGesture
]
boolValue
];
_playPauseGestureEnabled
=
[[
defaults
objectForKey
:
kVLCSettingPlayPauseGesture
]
boolValue
];
_brightnessGestureEnabled
=
[[
defaults
objectForKey
:
kVLCSettingBrightnessGesture
]
boolValue
];
_seekGestureEnabled
=
[[
defaults
objectForKey
:
kVLCSettingSeekGesture
]
boolValue
];
_closeGestureEnabled
=
[[
defaults
objectForKey
:
kVLCSettingCloseGesture
]
boolValue
];
_variableJumpDurationEnabled
=
[[
defaults
objectForKey
:
kVLCSettingVariableJumpDuration
]
boolValue
];
[
self
.
navigationController
setNavigationBarHidden
:
YES
animated
:
YES
];
[
self
.
navigationController
setNavigationBarHidden
:
YES
animated
:
animated
];
VLCPlaybackController
*
vpc
=
self
.
playbackController
;
vpc
.
delegate
=
self
;
[
vpc
recoverPlaybackState
];
[
self
screenBrightnessChanged
:
nil
];
[
self
setControlsHidden
:
NO
animated
:
YES
];
[
self
setControlsHidden
:
NO
animated
:
animated
];
}
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
...
...
@@ -497,7 +504,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
{
LOCKCHECK
;
if
(
!
_
swip
eGesture
s
Enabled
)
if
(
!
_
clos
eGestureEnabled
)
return
;
if
(
recognizer
.
velocity
<
0
.)
...
...
@@ -1279,7 +1286,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
{
LOCKCHECK
;
if
(
!
_
swip
eGesture
s
Enabled
)
if
(
!
_
playPaus
eGestureEnabled
)
return
;
VLCPlaybackController
*
vpc
=
self
.
playbackController
;
...
...
@@ -1317,9 +1324,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
{
LOCKCHECK
;
if
(
!
_swipeGesturesEnabled
)
return
;
CGFloat
panDirectionX
=
[
panRecognizer
velocityInView
:
self
.
view
].
x
;
CGFloat
panDirectionY
=
[
panRecognizer
velocityInView
:
self
.
view
].
y
;
...
...
@@ -1327,6 +1331,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
_currentPanType
=
[
self
detectPanTypeForPan
:
panRecognizer
];
if
(
_currentPanType
==
VLCPanTypeSeek
)
{
if
(
!
_seekGestureEnabled
)
return
;
VLCMediaPlayer
*
mediaPlayer
=
self
.
playbackController
.
mediaPlayer
;
double
timeRemainingDouble
=
(
-
mediaPlayer
.
remainingTime
.
intValue
*
0
.
001
);
int
timeRemaining
=
timeRemainingDouble
;
...
...
@@ -1337,6 +1343,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
}
else
[
mediaPlayer
jumpBackward
:
1
];
}
else
if
(
_currentPanType
==
VLCPanTypeVolume
)
{
if
(
!
_volumeGestureEnabled
)
return
;
MPMusicPlayerController
*
musicPlayer
=
[
MPMusicPlayerController
applicationMusicPlayer
];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
...
...
@@ -1348,6 +1356,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
musicPlayer
.
volume
+=
0
.
01
;
#pragma clang diagnostic pop
}
else
if
(
_currentPanType
==
VLCPanTypeBrightness
)
{
if
(
!
_brightnessGestureEnabled
)
return
;
CGFloat
brightness
=
[
UIScreen
mainScreen
].
brightness
;
if
(
panDirectionY
>
0
)
...
...
@@ -1382,7 +1392,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
{
LOCKCHECK
;
if
(
!
_s
wipe
Gesture
s
Enabled
)
if
(
!
_s
eek
GestureEnabled
)
return
;
NSString
*
hudString
=
@" "
;
...
...
Sources/VLCSettingsController.m
View file @
38d41736
...
...
@@ -53,10 +53,6 @@
[
self
didChangePasscodeStatus
:
NO
];
}
}
if
([
notification
.
object
isEqual
:
kVLCSettingPlaybackGestures
])
{
BOOL
enabled
=
(
BOOL
)[[
notification
.
userInfo
objectForKey
:
@"EnableGesturesToControlPlayback"
]
intValue
];
[
self
.
viewController
setHiddenKeys
:
enabled
?
nil
:
[
NSSet
setWithObjects
:
@"EnableVariableJumpDuration"
,
nil
]
animated
:
YES
];
}
}
-
(
void
)
settingsViewControllerDidEnd
:(
IASKAppSettingsViewController
*
)
sender
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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