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
82397876
Commit
82397876
authored
Jul 13, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fix runtime exception and clean-up code
parent
56bc5203
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
95 additions
and
71 deletions
+95
-71
modules/gui/macosx/playlistinfo.h
modules/gui/macosx/playlistinfo.h
+5
-21
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/playlistinfo.m
+90
-50
No files found.
modules/gui/macosx/playlistinfo.h
View file @
82397876
/*****************************************************************************
/*****************************************************************************
* playlistinfo.h: MacOS X interface module
* playlistinfo.h: MacOS X interface module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002-201
2
VLC authors and VideoLAN
* Copyright (C) 2002-201
5
VLC authors and VideoLAN
* $Id$
* $Id$
*
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Authors: Benjamin Pracht <bigben at videolan dot org>
...
@@ -94,15 +94,8 @@
...
@@ -94,15 +94,8 @@
IBOutlet
id
o_video_lbl
;
IBOutlet
id
o_video_lbl
;
IBOutlet
id
o_video_decoded_lbl
;
IBOutlet
id
o_video_decoded_lbl
;
IBOutlet
id
o_video_decoded_txt
;
IBOutlet
id
o_video_decoded_txt
;
VLCInfoTreeItem
*
rootItem
;
input_item_t
*
p_item
;
BOOL
b_awakeFromNib
;
BOOL
b_stats
;
}
}
@property
(
readonly
)
input_item_t
*
item
;
@property
(
readonly
)
input_item_t
*
item
;
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
;
-
(
void
)
updateCocoaWindowLevel
:(
NSInteger
)
i_level
;
-
(
void
)
initPanel
;
-
(
void
)
initPanel
;
...
@@ -112,7 +105,7 @@
...
@@ -112,7 +105,7 @@
-
(
IBAction
)
downloadCoverArt
:(
id
)
sender
;
-
(
IBAction
)
downloadCoverArt
:(
id
)
sender
;
-
(
void
)
initMediaPanelStats
;
-
(
void
)
initMediaPanelStats
;
-
(
void
)
updatePanelWithItem
:(
input_item_t
*
)
_p_item
;
-
(
void
)
updatePanelWithItem
:(
input_item_t
*
)
_p_item
;
-
(
void
)
setMeta
:
(
char
*
)
meta
forLabel
:
(
id
)
theItem
;
-
(
void
)
setMeta
:
(
char
*
)
meta
forLabel
:
(
id
)
theItem
;
-
(
void
)
updateMetadata
;
-
(
void
)
updateMetadata
;
-
(
void
)
updateStatistics
;
-
(
void
)
updateStatistics
;
...
@@ -120,21 +113,12 @@
...
@@ -120,21 +113,12 @@
@end
@end
@interface
VLCInfoTreeItem
:
NSObject
@interface
VLCInfoTreeItem
:
NSObject
{
NSString
*
o_name
;
NSString
*
o_value
;
int
i_object_id
;
input_item_t
*
p_item
;
VLCInfoTreeItem
*
o_parent
;
NSMutableArray
*
o_children
;
}
@property
(
readonly
)
int
numberOfChildren
;
@property
(
readonly
)
int
numberOfChildren
;
@property
(
readonly
)
NSString
*
name
;
@property
(
readonly
)
NSString
*
name
;
@property
(
readonly
)
NSString
*
value
;
@property
(
readonly
)
NSString
*
value
;
-
(
VLCInfoTreeItem
*
)
childAtIndex
:(
NSUInteger
)
i_index
;
-
(
VLCInfoTreeItem
*
)
childAtIndex
:(
NSUInteger
)
i_index
;
-
(
void
)
refresh
;
-
(
void
)
refresh
;
@end
@end
modules/gui/macosx/playlistinfo.m
View file @
82397876
/*****************************************************************************
/*****************************************************************************
r playlistinfo.m: MacOS X interface module
r playlistinfo.m: MacOS X interface module
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002-201
2
VLC authors and VideoLAN
* Copyright (C) 2002-201
5
VLC authors and VideoLAN
* $Id$
* $Id$
*
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Authors: Benjamin Pracht <bigben at videolan dot org>
...
@@ -36,6 +36,17 @@
...
@@ -36,6 +36,17 @@
* VLCPlaylistInfo Implementation
* VLCPlaylistInfo Implementation
*****************************************************************************/
*****************************************************************************/
@interface
VLCInfo
()
{
VLCInfoTreeItem
*
rootItem
;
input_item_t
*
p_item
;
BOOL
b_awakeFromNib
;
BOOL
b_stats
;
}
@end
@implementation
VLCInfo
@implementation
VLCInfo
static
VLCInfo
*
_o_sharedInstance
=
nil
;
static
VLCInfo
*
_o_sharedInstance
=
nil
;
...
@@ -423,24 +434,36 @@ error:
...
@@ -423,24 +434,36 @@ error:
@end
@end
@implementation
VLCInfoTreeItem
@interface
VLCInfoTreeItem
()
{
NSString
*
_name
;
NSString
*
_value
;
int
i_object_id
;
input_item_t
*
p_item
;
VLCInfoTreeItem
*
_parent
;
NSMutableArray
*
_children
;
BOOL
_isALeafNode
;
}
@synthesize
name
=
o_name
,
value
=
o_value
;
@end
@implementation
VLCInfoTreeItem
#define IsALeafNode ((id)-1)
@synthesize
name
=
_name
,
value
=
_value
;
-
(
id
)
initWithName
:
(
NSString
*
)
o_item_name
value
:
(
NSString
*
)
o_item_value
ID
:
(
int
)
i_id
-
(
id
)
initWithName
:(
NSString
*
)
item_name
parent
:(
VLCInfoTreeItem
*
)
o_parent_item
value
:(
NSString
*
)
item_value
ID
:(
int
)
i_id
parent
:(
VLCInfoTreeItem
*
)
parent_item
{
{
self
=
[
super
init
];
self
=
[
super
init
];
if
(
self
!=
nil
)
{
if
(
self
!=
nil
)
{
o_name
=
[
o_
item_name
copy
];
_name
=
[
item_name
copy
];
o_value
=
[
o_
item_value
copy
];
_value
=
[
item_value
copy
];
i_object_id
=
i_id
;
i_object_id
=
i_id
;
o_parent
=
o_
parent_item
;
_parent
=
parent_item
;
p_item
=
[(
VLCInfo
*
)[[
VLCMain
sharedInstance
]
info
]
item
];
p_item
=
[(
VLCInfo
*
)[[
VLCMain
sharedInstance
]
info
]
item
];
o_children
=
nil
;
}
}
return
self
;
return
self
;
}
}
...
@@ -452,48 +475,60 @@ error:
...
@@ -452,48 +475,60 @@ error:
-
(
void
)
dealloc
-
(
void
)
dealloc
{
{
if
(
o_children
!=
IsALeafNode
)
[
o_children
release
];
if
(
_children
)
[
o_name
release
];
[
_children
release
];
[
o_value
release
];
[
_name
release
];
if
(
p_item
)
vlc_gc_decref
(
p_item
);
[
_value
release
];
if
(
p_item
)
vlc_gc_decref
(
p_item
);
[
super
dealloc
];
[
super
dealloc
];
}
}
/* Creates and returns the array of children
/* Creates and returns the array of children
* Loads children incrementally */
* Loads children incrementally */
-
(
NSArray
*
)
c
hildren
-
(
void
)
_updateC
hildren
{
{
if
(
!
p_item
)
if
(
!
p_item
)
return
nil
;
return
;
if
(
o_children
==
NULL
)
{
if
(
_children
!=
nil
)
o_children
=
[[
NSMutableArray
alloc
]
init
];
return
;
if
(
i_object_id
==
-
1
)
{
vlc_mutex_lock
(
&
p_item
->
lock
);
_children
=
[[
NSMutableArray
alloc
]
init
];
for
(
int
i
=
0
;
i
<
p_item
->
i_categories
;
i
++
)
{
if
(
i_object_id
==
-
1
)
{
NSString
*
name
=
[
NSString
stringWithUTF8String
:
p_item
->
pp_categories
[
i
]
->
psz_name
];
vlc_mutex_lock
(
&
p_item
->
lock
);
VLCInfoTreeItem
*
item
=
[[
VLCInfoTreeItem
alloc
]
initWithName
:
name
value
:
@""
ID
:
i
parent
:
self
];
for
(
int
i
=
0
;
i
<
p_item
->
i_categories
;
i
++
)
{
[
item
autorelease
];
NSString
*
name
=
[
NSString
stringWithUTF8String
:
p_item
->
pp_categories
[
i
]
->
psz_name
];
[
o_children
addObject
:
item
];
VLCInfoTreeItem
*
item
=
[[
VLCInfoTreeItem
alloc
]
}
initWithName:
name
vlc_mutex_unlock
(
&
p_item
->
lock
);
value:
@""
ID:
i
parent:
self
];
[
item
autorelease
];
[
_children
addObject
:
item
];
}
}
else
if
(
o_parent
->
i_object_id
==
-
1
)
{
vlc_mutex_unlock
(
&
p_item
->
lock
);
vlc_mutex_lock
(
&
p_item
->
lock
);
_isALeafNode
=
NO
;
info_category_t
*
cat
=
p_item
->
pp_categories
[
i_object_id
];
}
for
(
int
i
=
0
;
i
<
cat
->
i_infos
;
i
++
)
{
else
if
(
_parent
->
i_object_id
==
-
1
)
{
NSString
*
name
=
[
NSString
stringWithUTF8String
:
cat
->
pp_infos
[
i
]
->
psz_name
];
vlc_mutex_lock
(
&
p_item
->
lock
);
NSString
*
value
=
[
NSString
stringWithUTF8String
:
cat
->
pp_infos
[
i
]
->
psz_value
?
:
""
];
info_category_t
*
cat
=
p_item
->
pp_categories
[
i_object_id
];
VLCInfoTreeItem
*
item
=
[[
VLCInfoTreeItem
alloc
]
initWithName
:
name
value
:
value
ID
:
i
parent
:
self
];
for
(
int
i
=
0
;
i
<
cat
->
i_infos
;
i
++
)
{
[
item
autorelease
];
NSString
*
name
=
[
NSString
stringWithUTF8String
:
cat
->
pp_infos
[
i
]
->
psz_name
];
[
o_children
addObject
:
item
];
NSString
*
value
=
[
NSString
stringWithUTF8String
:
cat
->
pp_infos
[
i
]
->
psz_value
?
:
""
];
}
VLCInfoTreeItem
*
item
=
[[
VLCInfoTreeItem
alloc
]
vlc_mutex_unlock
(
&
p_item
->
lock
);
initWithName:
name
value:
value
ID:
i
parent:
self
];
[
item
autorelease
];
[
_children
addObject
:
item
];
}
}
else
vlc_mutex_unlock
(
&
p_item
->
lock
);
o_children
=
IsALeafNode
;
_isALeafNode
=
NO
;
}
}
return
o_children
;
else
_isALeafNode
=
YES
;
}
}
-
(
void
)
refresh
-
(
void
)
refresh
...
@@ -501,20 +536,25 @@ error:
...
@@ -501,20 +536,25 @@ error:
if
(
p_item
)
if
(
p_item
)
vlc_gc_decref
(
p_item
);
vlc_gc_decref
(
p_item
);
p_item
=
[
(
VLCInfo
*
)[[
VLCMain
sharedInstance
]
info
]
item
];
p_item
=
[
[
VLCInfo
sharedInstance
]
item
];
[
o
_children
release
];
[
_children
release
];
o
_children
=
nil
;
_children
=
nil
;
}
}
-
(
VLCInfoTreeItem
*
)
childAtIndex
:(
NSUInteger
)
i_index
{
-
(
VLCInfoTreeItem
*
)
childAtIndex
:(
NSUInteger
)
i_index
return
[[
self
children
]
objectAtIndex
:
i_index
];
{
return
[
_children
objectAtIndex
:
i_index
];
}
}
-
(
int
)
numberOfChildren
{
-
(
int
)
numberOfChildren
{
[
self
_updateChildren
];
if
(
_isALeafNode
)
return
-
1
;
id
i_tmp
=
[
self
children
];
return
[
_children
count
];
return
(
i_tmp
==
IsALeafNode
)
?
(
-
1
)
:
(
int
)[
i_tmp
count
];
}
}
@end
@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