Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
bcb8a9bb
Commit
bcb8a9bb
authored
May 21, 2013
by
Gleb Pinigin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use boolean literals for settings options
parent
51658bd1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
AspenProject/VLCAppDelegate.m
AspenProject/VLCAppDelegate.m
+1
-1
AspenProject/VLCMovieViewController.m
AspenProject/VLCMovieViewController.m
+1
-1
AspenProject/VLCSettingsViewController.m
AspenProject/VLCSettingsViewController.m
+4
-4
No files found.
AspenProject/VLCAppDelegate.m
View file @
bcb8a9bb
...
...
@@ -24,7 +24,7 @@
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSDictionary
*
appDefaults
=
@{
kVLCSettingPasscodeKey
:
@""
,
kVLCSettingPasscodeOnKey
:
@
0
,
kVLCSettingContinueAudioInBackgroundKey
:
@
1
,
kVLCSettingStretchAudio
:
kVLCSettingStretchAudioDefaultValue
,
kVLCSettingVerboseOutput
:
kVLCSettingVerboseOutputDefaultValue
,
kVLCSettingTextEncoding
:
kVLCSettingTextEncodingDefaultValue
};
NSDictionary
*
appDefaults
=
@{
kVLCSettingPasscodeKey
:
@""
,
kVLCSettingPasscodeOnKey
:
@
(
NO
)
,
kVLCSettingContinueAudioInBackgroundKey
:
@
(
YES
)
,
kVLCSettingStretchAudio
:
kVLCSettingStretchAudioDefaultValue
,
kVLCSettingVerboseOutput
:
kVLCSettingVerboseOutputDefaultValue
,
kVLCSettingTextEncoding
:
kVLCSettingTextEncodingDefaultValue
};
[
defaults
registerDefaults
:
appDefaults
];
}
...
...
AspenProject/VLCMovieViewController.m
View file @
bcb8a9bb
...
...
@@ -540,7 +540,7 @@
if
(
self
.
mediaItem
)
self
.
mediaItem
.
lastPosition
=
@
([
_mediaPlayer
position
]);
if
(
!
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
kVLCSettingContinueAudioInBackgroundKey
]
int
Value
])
{
if
(
!
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
kVLCSettingContinueAudioInBackgroundKey
]
bool
Value
])
{
[
_mediaPlayer
pause
];
_shouldResumePlaying
=
YES
;
}
else
...
...
AspenProject/VLCSettingsViewController.m
View file @
bcb8a9bb
...
...
@@ -48,8 +48,8 @@
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
self
.
passcodeLockSwitch
.
on
=
[[
defaults
objectForKey
:
kVLCSettingPasscodeOnKey
]
int
Value
];
self
.
audioPlaybackInBackgroundSwitch
.
on
=
[[
defaults
objectForKey
:
kVLCSettingContinueAudioInBackgroundKey
]
int
Value
];
self
.
passcodeLockSwitch
.
on
=
[[
defaults
objectForKey
:
kVLCSettingPasscodeOnKey
]
bool
Value
];
self
.
audioPlaybackInBackgroundSwitch
.
on
=
[[
defaults
objectForKey
:
kVLCSettingContinueAudioInBackgroundKey
]
bool
Value
];
self
.
audioStretchingSwitch
.
on
=
!
[[
defaults
objectForKey
:
kVLCSettingStretchAudio
]
isEqualToString
:
kVLCSettingStretchAudioDefaultValue
];
self
.
debugOutputSwitch
.
on
=
[[
defaults
objectForKey
:
kVLCSettingVerboseOutput
]
isEqualToString
:
kVLCSettingVerboseOutputDefaultValue
];
...
...
@@ -71,7 +71,7 @@
passcodeLockController
.
delegate
=
self
;
[
self
presentModalViewController
:
passcodeLockController
animated
:
YES
];
}
else
{
[
defaults
setObject
:
@
0
forKey
:
kVLCSettingPasscodeOnKey
];
[
defaults
setObject
:
@
(
NO
)
forKey
:
kVLCSettingPasscodeOnKey
];
}
}
else
if
(
sender
==
self
.
audioPlaybackInBackgroundSwitch
)
{
[
defaults
setObject
:
@
(
self
.
audioPlaybackInBackgroundSwitch
.
on
)
forKey
:
kVLCSettingContinueAudioInBackgroundKey
];
...
...
@@ -131,7 +131,7 @@
-
(
void
)
PAPasscodeViewControllerDidSetPasscode
:(
PAPasscodeViewController
*
)
controller
{
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
[
defaults
setObject
:
@
(
1
)
forKey
:
kVLCSettingPasscodeOnKey
];
[
defaults
setObject
:
@
(
YES
)
forKey
:
kVLCSettingPasscodeOnKey
];
[
defaults
setObject
:
controller
.
passcode
forKey
:
kVLCSettingPasscodeKey
];
[
defaults
synchronize
];
VLCAppDelegate
*
appDelegate
=
[
UIApplication
sharedApplication
].
delegate
;
...
...
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