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
3f2086d3
Commit
3f2086d3
authored
Jan 02, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: cleanup pl data source, do not show file size for directories
parent
813cc63a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
85 deletions
+66
-85
modules/gui/macosx/PLModel.h
modules/gui/macosx/PLModel.h
+14
-0
modules/gui/macosx/PLModel.m
modules/gui/macosx/PLModel.m
+52
-72
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.h
+0
-13
No files found.
modules/gui/macosx/PLModel.h
View file @
3f2086d3
...
...
@@ -27,6 +27,20 @@
#define VLCPLItemPasteboadType @"VLCPlaylistItemPboardType"
/* playlist column definitions */
#define STATUS_COLUMN @"status"
#define TRACKNUM_COLUMN @"tracknumber"
#define TITLE_COLUMN @"name"
#define ARTIST_COLUMN @"artist"
#define DURATION_COLUMN @"duration"
#define GENRE_COLUMN @"genre"
#define ALBUM_COLUMN @"album"
#define DESCRIPTION_COLUMN @"description"
#define DATE_COLUMN @"date"
#define LANGUAGE_COLUMN @"language"
#define URI_COLUMN @"uri"
#define FILESIZE_COLUMN @"file-size"
@class
VLCPlaylist
;
@interface
PLModel
:
NSObject
<
NSOutlineViewDataSource
>
...
...
modules/gui/macosx/PLModel.m
View file @
3f2086d3
...
...
@@ -36,18 +36,6 @@
#include <vlc_input.h>
#include <vlc_url.h>
#define TRACKNUM_COLUMN @"tracknumber"
#define TITLE_COLUMN @"name"
#define ARTIST_COLUMN @"artist"
#define DURATION_COLUMN @"duration"
#define GENRE_COLUMN @"genre"
#define ALBUM_COLUMN @"album"
#define DESCRIPTION_COLUMN @"description"
#define DATE_COLUMN @"date"
#define LANGUAGE_COLUMN @"language"
#define URI_COLUMN @"uri"
#define FILESIZE_COLUMN @"file-size"
#pragma mark -
@implementation
PLModel
...
...
@@ -288,7 +276,7 @@
-
(
id
)
outlineView
:(
NSOutlineView
*
)
outlineView
objectValueForTableColumn
:(
NSTableColumn
*
)
tableColumn
byItem
:(
id
)
item
{
id
o_value
=
nil
;
char
*
psz_value
;
char
*
psz_value
;
input_item_t
*
p_input
=
[
item
input
];
...
...
@@ -296,88 +284,80 @@
if
([
o_identifier
isEqualToString
:
TRACKNUM_COLUMN
])
{
psz_value
=
input_item_GetTrackNumber
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
TITLE_COLUMN
])
{
/* sanity check to prevent the NSString class from crashing */
char
*
psz_title
=
input_item_GetTitleFbName
(
p_input
);
if
(
psz_title
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_title
];
free
(
psz_title
);
}
psz_value
=
input_item_GetTitleFbName
(
p_input
);
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
ARTIST_COLUMN
])
{
psz_value
=
input_item_GetArtist
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
}
else
if
([
o_identifier
isEqualToString
:
@"duration"
])
{
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
DURATION_COLUMN
])
{
char
psz_duration
[
MSTRTIME_MAX_SIZE
];
mtime_t
dur
=
input_item_GetDuration
(
p_input
);
if
(
dur
!=
-
1
)
{
secstotimestr
(
psz_duration
,
dur
/
1000000
);
o_value
=
[
NSString
stringWithUTF8String
:
psz_duration
]
;
o_value
=
toNSStr
(
psz_duration
)
;
}
else
o_value
=
@"--:--"
;
}
else
if
([
o_identifier
isEqualToString
:
GENRE_COLUMN
])
{
psz_value
=
input_item_GetGenre
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
ALBUM_COLUMN
])
{
psz_value
=
input_item_GetAlbum
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
DESCRIPTION_COLUMN
])
{
psz_value
=
input_item_GetDescription
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
DATE_COLUMN
])
{
psz_value
=
input_item_GetDate
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
LANGUAGE_COLUMN
])
{
psz_value
=
input_item_GetLanguage
(
p_input
);
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
}
else
if
([
o_identifier
isEqualToString
:
URI_COLUMN
])
{
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
URI_COLUMN
])
{
psz_value
=
decode_URI
(
input_item_GetURI
(
p_input
));
if
(
psz_value
)
{
o_value
=
[
NSString
stringWithUTF8String
:
psz_value
];
free
(
psz_value
);
}
}
else
if
([
o_identifier
isEqualToString
:
FILESIZE_COLUMN
])
{
o_value
=
toNSStr
(
psz_value
);
free
(
psz_value
);
}
else
if
([
o_identifier
isEqualToString
:
FILESIZE_COLUMN
])
{
psz_value
=
input_item_GetURI
(
p_input
);
o_value
=
@""
;
if
(
psz_value
)
{
NSURL
*
url
=
[
NSURL
URLWithString
:[
NSString
stringWithUTF8String
:
psz_value
]];
if
([
url
isFileURL
])
{
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
if
([
fileManager
fileExistsAtPath
:[
url
path
]])
{
NSError
*
error
;
NSDictionary
*
attributes
=
[
fileManager
attributesOfItemAtPath
:[
url
path
]
error
:
&
error
];
o_value
=
[
VLCByteCountFormatter
stringFromByteCount
:[
attributes
fileSize
]
countStyle
:
NSByteCountFormatterCountStyleDecimal
];
}
}
free
(
psz_value
);
}
if
(
!
psz_value
)
return
@""
;
NSURL
*
url
=
[
NSURL
URLWithString
:
toNSStr
(
psz_value
)];
free
(
psz_value
);
if
(
!
[
url
isFileURL
])
return
@""
;
}
else
if
([
o_identifier
isEqualToString
:
@"status"
])
{
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
BOOL
b_isDir
;
if
(
!
[
fileManager
fileExistsAtPath
:[
url
path
]
isDirectory
:
&
b_isDir
]
||
b_isDir
)
return
@""
;
NSDictionary
*
attributes
=
[
fileManager
attributesOfItemAtPath
:[
url
path
]
error
:
nil
];
if
(
!
attributes
)
return
@""
;
o_value
=
[
VLCByteCountFormatter
stringFromByteCount
:[
attributes
fileSize
]
countStyle
:
NSByteCountFormatterCountStyleDecimal
];
}
else
if
([
o_identifier
isEqualToString
:
STATUS_COLUMN
])
{
if
(
input_item_HasErrorWhenReading
(
p_input
))
{
o_value
=
[[
NSWorkspace
sharedWorkspace
]
iconForFileType
:
NSFileTypeForHFSTypeCode
(
kAlertCautionIcon
)];
[
o_value
setSize
:
NSMakeSize
(
16
,
16
)];
...
...
modules/gui/macosx/playlist.h
View file @
3f2086d3
...
...
@@ -25,19 +25,6 @@
#import "PXSourceList.h"
/* playlist column definitions */
#define TRACKNUM_COLUMN @"tracknumber"
#define TITLE_COLUMN @"name"
#define ARTIST_COLUMN @"artist"
#define DURATION_COLUMN @"duration"
#define GENRE_COLUMN @"genre"
#define ALBUM_COLUMN @"album"
#define DESCRIPTION_COLUMN @"description"
#define DATE_COLUMN @"date"
#define LANGUAGE_COLUMN @"language"
#define URI_COLUMN @"uri"
#define FILESIZE_COLUMN @"file-size"
/*****************************************************************************
* VLCPlaylistView interface
*****************************************************************************/
...
...
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