Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
0450faad
Commit
0450faad
authored
Jan 02, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework/VLCTime: Code cleanup and use Objective-C 2.0 @property. (Patch by Enrique Osuna).
parent
a5015dec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
extras/MacOSX/Framework/Headers/Public/VLCTime.h
extras/MacOSX/Framework/Headers/Public/VLCTime.h
+11
-3
extras/MacOSX/Framework/Sources/VLCTime.m
extras/MacOSX/Framework/Sources/VLCTime.m
+4
-5
No files found.
extras/MacOSX/Framework/Headers/Public/VLCTime.h
View file @
0450faad
...
...
@@ -24,19 +24,27 @@
#import <Cocoa/Cocoa.h>
/**
* Provides an object to define VLCMedia's ti me.
*/
@interface
VLCTime
:
NSObject
{
NSNumber
*
value
;
NSNumber
*
value
;
//< Holds, in seconds, the VLCTime value
}
/* Factories */
+
(
VLCTime
*
)
nullTime
;
+
(
VLCTime
*
)
timeWithNumber
:(
NSNumber
*
)
aNumber
;
//+ (VLCTime *)timeWithString:(NSString *)aString;
/* Initializers */
-
(
id
)
initWithNumber
:(
NSNumber
*
)
aNumber
;
//- (id)initWithString:(NSString *)aString;
-
(
NSNumber
*
)
numberValue
;
-
(
NSString
*
)
stringValue
;
/* Properties */
@property
(
readonly
)
NSNumber
*
numberValue
;
@property
(
readonly
)
NSString
*
stringValue
;
/* Comparitors */
-
(
NSComparisonResult
)
compare
:(
VLCTime
*
)
aTime
;
@end
extras/MacOSX/Framework/Sources/VLCTime.m
View file @
0450faad
...
...
@@ -24,11 +24,10 @@
#import <VLCTime.h>
static
VLCTime
*
nullTime
=
nil
;
@implementation
VLCTime
+
(
VLCTime
*
)
nullTime
{
static
VLCTime
*
nullTime
=
nil
;
if
(
!
nullTime
)
nullTime
=
[[
VLCTime
timeWithNumber
:
nil
]
retain
];
return
nullTime
;
...
...
@@ -76,7 +75,7 @@ static VLCTime *nullTime = nil;
-
(
NSNumber
*
)
numberValue
{
return
value
?
[
value
copy
]
:
nil
;
return
value
?
[
[
value
copy
]
autorelease
]
:
nil
;
}
-
(
NSString
*
)
stringValue
...
...
@@ -103,11 +102,11 @@ static VLCTime *nullTime = nil;
else
if
(
!
aTime
)
return
NSOrderedDescending
;
else
return
[
value
compare
:
[
aTime
numberValue
]
];
return
[
value
compare
:
aTime
.
numberValue
];
}
-
(
NSString
*
)
description
{
return
[
self
stringValue
]
;
return
self
.
stringValue
;
}
@end
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