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
561a759a
Commit
561a759a
authored
Apr 28, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert code to ARC
parent
897e2791
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
43 additions
and
100 deletions
+43
-100
AspenProject.xcodeproj/project.pbxproj
AspenProject.xcodeproj/project.pbxproj
+2
-0
AspenProject/VLCAboutViewController.h
AspenProject/VLCAboutViewController.h
+4
-4
AspenProject/VLCAboutViewController.m
AspenProject/VLCAboutViewController.m
+0
-8
AspenProject/VLCAppDelegate.h
AspenProject/VLCAppDelegate.h
+2
-2
AspenProject/VLCAppDelegate.m
AspenProject/VLCAppDelegate.m
+2
-9
AspenProject/VLCMovieViewController.h
AspenProject/VLCMovieViewController.h
+17
-17
AspenProject/VLCMovieViewController.m
AspenProject/VLCMovieViewController.m
+4
-28
AspenProject/VLCPlaylistGridViewCell.m
AspenProject/VLCPlaylistGridViewCell.m
+0
-7
AspenProject/VLCPlaylistTableViewCell.h
AspenProject/VLCPlaylistTableViewCell.h
+3
-3
AspenProject/VLCPlaylistTableViewCell.m
AspenProject/VLCPlaylistTableViewCell.m
+0
-2
AspenProject/VLCPlaylistViewController.h
AspenProject/VLCPlaylistViewController.h
+4
-4
AspenProject/VLCPlaylistViewController.m
AspenProject/VLCPlaylistViewController.m
+5
-16
No files found.
AspenProject.xcodeproj/project.pbxproj
View file @
561a759a
...
...
@@ -526,6 +526,7 @@
7D94FD0B16DE7D1100F2623B
/* Debug */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
CLANG_ENABLE_OBJC_ARC
=
YES
;
COPY_PHASE_STRIP
=
NO
;
DEAD_CODE_STRIPPING
=
NO
;
GCC_C_LANGUAGE_STANDARD
=
c99
;
...
...
@@ -554,6 +555,7 @@
7D94FD0C16DE7D1100F2623B
/* Release */
=
{
isa
=
XCBuildConfiguration
;
buildSettings
=
{
CLANG_ENABLE_OBJC_ARC
=
YES
;
COPY_PHASE_STRIP
=
NO
;
DEAD_CODE_STRIPPING
=
NO
;
GCC_C_LANGUAGE_STANDARD
=
c99
;
...
...
AspenProject/VLCAboutViewController.h
View file @
561a759a
...
...
@@ -10,10 +10,10 @@
@interface
VLCAboutViewController
:
UIViewController
@property
(
nonatomic
,
retain
)
IBOutlet
UITextView
*
textContents
;
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
aspenVersion
;
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
vlckitVersion
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIBarButtonItem
*
dismissButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UITextView
*
textContents
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
aspenVersion
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
vlckitVersion
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIBarButtonItem
*
dismissButton
;
-
(
IBAction
)
dismiss
:(
id
)
sender
;
...
...
AspenProject/VLCAboutViewController.m
View file @
561a759a
...
...
@@ -20,14 +20,6 @@
return
self
;
}
-
(
void
)
dealloc
{
[
_textContents
release
];
[
_aspenVersion
release
];
[
_vlckitVersion
release
];
[
_dismissButton
release
];
[
super
dealloc
];
}
-
(
void
)
viewDidLoad
{
...
...
AspenProject/VLCAppDelegate.h
View file @
561a759a
...
...
@@ -14,8 +14,8 @@
VLCPlaylistViewController
*
_playlistViewController
;
}
@property
(
nonatomic
,
retain
)
UIWindow
*
window
;
@property
(
nonatomic
,
strong
)
UIWindow
*
window
;
@property
(
nonatomic
,
retain
)
UINavigationController
*
navigationController
;
@property
(
nonatomic
,
strong
)
UINavigationController
*
navigationController
;
@end
AspenProject/VLCAppDelegate.m
View file @
561a759a
...
...
@@ -14,21 +14,14 @@
@implementation
VLCAppDelegate
-
(
void
)
dealloc
{
[
_playlistViewController
release
];
[
_window
release
];
[
_navigationController
release
];
[
super
dealloc
];
}
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
self
.
window
=
[[
[
UIWindow
alloc
]
initWithFrame
:[[
UIScreen
mainScreen
]
bounds
]]
autorelease
]
;
self
.
window
=
[[
UIWindow
alloc
]
initWithFrame
:[[
UIScreen
mainScreen
]
bounds
]];
_playlistViewController
=
[[
VLCPlaylistViewController
alloc
]
initWithNibName
:
@"VLCPlaylistViewController"
bundle
:
nil
];
self
.
navigationController
=
[[
[
UINavigationController
alloc
]
initWithRootViewController
:
_playlistViewController
]
autorelease
]
;
self
.
navigationController
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
_playlistViewController
];
self
.
window
.
rootViewController
=
self
.
navigationController
;
self
.
navigationController
.
navigationBar
.
barStyle
=
UIBarStyleBlack
;
...
...
AspenProject/VLCMovieViewController.h
View file @
561a759a
...
...
@@ -18,23 +18,23 @@
UIActionSheet
*
_audiotrackActionSheet
;
}
@property
(
nonatomic
,
retain
)
IBOutlet
UIView
*
movieView
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIBarButtonItem
*
backButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UISlider
*
positionSlider
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIBarButtonItem
*
timeDisplay
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIButton
*
playPauseButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIButton
*
bwdButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIButton
*
fwdButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIButton
*
subtitleSwitcherButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIButton
*
audioSwitcherButton
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIToolbar
*
toolbar
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIView
*
controllerPanel
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIView
*
playingExternallyView
;
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
playingExternallyTitle
;
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
playingExternallyDescription
;
@property
(
nonatomic
,
retain
)
MLFile
*
mediaItem
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIView
*
movieView
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIBarButtonItem
*
backButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UISlider
*
positionSlider
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIBarButtonItem
*
timeDisplay
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIButton
*
playPauseButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIButton
*
bwdButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIButton
*
fwdButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIButton
*
subtitleSwitcherButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIButton
*
audioSwitcherButton
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIToolbar
*
toolbar
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIView
*
controllerPanel
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIView
*
playingExternallyView
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
playingExternallyTitle
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
playingExternallyDescription
;
@property
(
nonatomic
,
strong
)
MLFile
*
mediaItem
;
-
(
IBAction
)
closePlayback
:(
id
)
sender
;
-
(
IBAction
)
positionSliderAction
:(
id
)
sender
;
...
...
AspenProject/VLCMovieViewController.m
View file @
561a759a
...
...
@@ -10,36 +10,17 @@
#import "VLCExternalDisplayController.h"
@interface
VLCMovieViewController
()
<
UIGestureRecognizerDelegate
>
@property
(
nonatomic
,
retain
)
UIPopoverController
*
masterPopoverController
;
@property
(
nonatomic
,
retain
)
UIWindow
*
externalWindow
;
@property
(
nonatomic
,
strong
)
UIPopoverController
*
masterPopoverController
;
@property
(
nonatomic
,
strong
)
UIWindow
*
externalWindow
;
@end
@implementation
VLCMovieViewController
-
(
void
)
dealloc
{
[
_mediaItem
release
];
[
_masterPopoverController
release
];
[
_externalWindow
release
];
[
_toolbar
release
];
[
_movieView
release
];
[
_backButton
release
];
[
_positionSlider
release
];
[
_timeDisplay
release
];
[
_playPauseButton
release
];
[
_bwdButton
release
];
[
_fwdButton
release
];
[
_subtitleActionSheet
release
];
[
_audioSwitcherButton
release
];
[
_controllerPanel
release
];
[
_playingExternallyView
release
];
[
_playingExternallyTitle
release
];
[
_playingExternallyDescription
release
];
[
_mediaPlayer
stop
];
[
_mediaPlayer
release
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
[
super
dealloc
];
}
#pragma mark - Managing the media item
...
...
@@ -47,8 +28,7 @@
-
(
void
)
setMediaItem
:(
id
)
newMediaItem
{
if
(
_mediaItem
!=
newMediaItem
)
{
[
_mediaItem
release
];
_mediaItem
=
[
newMediaItem
retain
];
_mediaItem
=
newMediaItem
;
}
if
(
self
.
masterPopoverController
!=
nil
)
...
...
@@ -81,7 +61,6 @@
UITapGestureRecognizer
*
recognizer
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
toogleControlsVisible
)];
recognizer
.
delegate
=
self
;
[
self
.
view
addGestureRecognizer
:
recognizer
];
[
recognizer
release
];
}
-
(
void
)
viewWillAppear
:(
BOOL
)
animated
...
...
@@ -241,7 +220,6 @@
indexArray
=
_mediaPlayer
.
videoSubTitlesIndexes
;
_mediaPlayer
.
currentVideoSubTitleIndex
=
[[
indexArray
objectAtIndex
:
arrayIndex
]
intValue
];
}
[
_subtitleActionSheet
release
];
}
else
{
namesArray
=
_mediaPlayer
.
audioTrackNames
;
arrayIndex
=
[
namesArray
indexOfObject
:[
actionSheet
buttonTitleAtIndex
:
buttonIndex
]];
...
...
@@ -249,7 +227,6 @@
indexArray
=
_mediaPlayer
.
audioTrackIndexes
;
_mediaPlayer
.
currentAudioTrackIndex
=
[[
indexArray
objectAtIndex
:
arrayIndex
]
intValue
];
}
[
_audiotrackActionSheet
release
];
}
}
...
...
@@ -272,14 +249,13 @@
UIScreen
*
screen
=
[[
UIScreen
screens
]
objectAtIndex
:
1
];
screen
.
overscanCompensation
=
UIScreenOverscanCompensationInsetApplicationFrame
;
self
.
externalWindow
=
[[
[
UIWindow
alloc
]
initWithFrame
:
screen
.
bounds
]
autorelease
]
;
self
.
externalWindow
=
[[
UIWindow
alloc
]
initWithFrame
:
screen
.
bounds
];
UIViewController
*
controller
=
[[
VLCExternalDisplayController
alloc
]
init
];
self
.
externalWindow
.
rootViewController
=
controller
;
[
controller
.
view
addSubview
:
_movieView
];
controller
.
view
.
frame
=
screen
.
bounds
;
_movieView
.
frame
=
screen
.
bounds
;
[
controller
release
];
self
.
playingExternallyView
.
hidden
=
NO
;
self
.
externalWindow
.
screen
=
screen
;
...
...
AspenProject/VLCPlaylistGridViewCell.m
View file @
561a759a
...
...
@@ -14,13 +14,6 @@
@implementation
VLCPlaylistGridViewCell
-
(
void
)
dealloc
{
[
_thumbnailView
release
];
[
_titleLabel
release
];
[
_subtitleLabel
release
];
[
super
dealloc
];
}
-
(
id
)
initWithFrame
:(
CGRect
)
frame
reuseIdentifier
:(
NSString
*
)
reuseIdentifier
{
...
...
AspenProject/VLCPlaylistTableViewCell.h
View file @
561a759a
...
...
@@ -10,9 +10,9 @@
@interface
VLCPlaylistTableViewCell
:
UITableViewCell
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
titleLabel
;
@property
(
nonatomic
,
retain
)
IBOutlet
UILabel
*
subtitleLabel
;
@property
(
nonatomic
,
retain
)
IBOutlet
UIImageView
*
thumbnailView
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
titleLabel
;
@property
(
nonatomic
,
strong
)
IBOutlet
UILabel
*
subtitleLabel
;
@property
(
nonatomic
,
strong
)
IBOutlet
UIImageView
*
thumbnailView
;
+
(
VLCPlaylistTableViewCell
*
)
cellWithReuseIdentifier
:(
NSString
*
)
ident
;
+
(
CGFloat
)
heightOfCell
;
...
...
AspenProject/VLCPlaylistTableViewCell.m
View file @
561a759a
...
...
@@ -20,11 +20,9 @@
UIView
*
background
=
[[
UIView
alloc
]
initWithFrame
:
frame
];
background
.
backgroundColor
=
[
UIColor
colorWithWhite
:.
05
alpha
:
1
.];
cell
.
backgroundView
=
background
;
[
background
autorelease
];
UIView
*
highlightedBackground
=
[[
UIView
alloc
]
initWithFrame
:
frame
];
highlightedBackground
.
backgroundColor
=
[
UIColor
colorWithWhite
:.
2
alpha
:
1
.];
cell
.
selectedBackgroundView
=
highlightedBackground
;
[
highlightedBackground
autorelease
];
return
cell
;
}
...
...
AspenProject/VLCPlaylistViewController.h
View file @
561a759a
...
...
@@ -15,11 +15,11 @@
@interface
VLCPlaylistViewController
:
UIViewController
<
AQGridViewDataSource
,
AQGridViewDelegate
,
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
retain
)
VLCMovieViewController
*
movieViewController
;
@property
(
nonatomic
,
retain
)
VLCAboutViewController
*
aboutViewController
;
@property
(
nonatomic
,
strong
)
VLCMovieViewController
*
movieViewController
;
@property
(
nonatomic
,
strong
)
VLCAboutViewController
*
aboutViewController
;
@property
(
nonatomic
,
retain
)
IBOutlet
UITableView
*
tableView
;
@property
(
nonatomic
,
retain
)
IBOutlet
AQGridView
*
gridView
;
@property
(
nonatomic
,
strong
)
IBOutlet
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
IBOutlet
AQGridView
*
gridView
;
-
(
void
)
updateViewContents
;
...
...
AspenProject/VLCPlaylistViewController.m
View file @
561a759a
...
...
@@ -28,15 +28,6 @@
return
self
;
}
-
(
void
)
dealloc
{
[
_tableView
release
];
[
_gridView
release
];
[
_aboutViewController
release
];
[
_movieViewController
release
];
[
_foundMedia
release
];
[
super
dealloc
];
}
-
(
void
)
viewDidLoad
{
...
...
@@ -44,7 +35,7 @@
self
.
tableView
.
separatorColor
=
[
UIColor
colorWithWhite
:.
2
alpha
:
1
.];
[
super
viewDidLoad
];
UIBarButtonItem
*
addButton
=
[[
[
UIBarButtonItem
alloc
]
initWithTitle
:
@"About"
style
:
UIBarButtonItemStyleBordered
target
:
self
action
:
@selector
(
showAboutView
:
)]
autorelease
]
;
UIBarButtonItem
*
addButton
=
[[
UIBarButtonItem
alloc
]
initWithTitle
:
@"About"
style
:
UIBarButtonItemStyleBordered
target
:
self
action
:
@selector
(
showAboutView
:
)];
self
.
navigationItem
.
leftBarButtonItem
=
addButton
;
self
.
navigationItem
.
rightBarButtonItem
=
self
.
editButtonItem
;
...
...
@@ -65,10 +56,8 @@
{
[[
MLMediaLibrary
sharedMediaLibrary
]
updateMediaDatabase
];
if
(
_foundMedia
)
[
_foundMedia
release
];
_foundMedia
=
[
[
NSMutableArray
arrayWithArray
:[
MLFile
allFiles
]]
retain
]
;
_foundMedia
=
[
NSMutableArray
arrayWithArray
:[
MLFile
allFiles
]];
if
([[
UIDevice
currentDevice
]
userInterfaceIdiom
]
==
UIUserInterfaceIdiomPhone
)
[
self
.
tableView
reloadData
];
...
...
@@ -121,7 +110,7 @@
{
MLFile
*
mediaObject
=
_foundMedia
[
indexPath
.
row
];
if
(
!
self
.
movieViewController
)
{
self
.
movieViewController
=
[[
[
VLCMovieViewController
alloc
]
initWithNibName
:
@"VLCMovieViewController"
bundle
:
nil
]
autorelease
]
;
self
.
movieViewController
=
[[
VLCMovieViewController
alloc
]
initWithNibName
:
@"VLCMovieViewController"
bundle
:
nil
];
}
self
.
movieViewController
.
mediaItem
=
mediaObject
;
[
self
.
navigationController
pushViewController
:
self
.
movieViewController
animated
:
YES
];
...
...
@@ -161,7 +150,7 @@
{
MLFile
*
mediaObject
=
_foundMedia
[
index
];
if
(
!
self
.
movieViewController
)
{
self
.
movieViewController
=
[[
[
VLCMovieViewController
alloc
]
initWithNibName
:
@"VLCMovieViewController"
bundle
:
nil
]
autorelease
]
;
self
.
movieViewController
=
[[
VLCMovieViewController
alloc
]
initWithNibName
:
@"VLCMovieViewController"
bundle
:
nil
];
}
self
.
movieViewController
.
mediaItem
=
mediaObject
;
[
self
.
navigationController
pushViewController
:
self
.
movieViewController
animated
:
YES
];
...
...
@@ -172,7 +161,7 @@
{
if
([[
UIDevice
currentDevice
]
userInterfaceIdiom
]
==
UIUserInterfaceIdiomPhone
)
{
if
(
!
self
.
aboutViewController
)
{
self
.
aboutViewController
=
[[
[
VLCAboutViewController
alloc
]
initWithNibName
:
@"VLCAboutViewController"
bundle
:
nil
]
autorelease
]
;
self
.
aboutViewController
=
[[
VLCAboutViewController
alloc
]
initWithNibName
:
@"VLCAboutViewController"
bundle
:
nil
];
}
[
self
.
navigationController
pushViewController
:
self
.
aboutViewController
animated
:
YES
];
}
else
...
...
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