Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2bde17e1
Commit
2bde17e1
authored
Sep 18, 2008
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add URI column to Qt4 playlist. Add sorting by URI in playlist core.
parent
db6404e5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
41 deletions
+39
-41
include/vlc_playlist.h
include/vlc_playlist.h
+1
-0
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+12
-21
modules/gui/qt4/components/playlist/sorting.h
modules/gui/qt4/components/playlist/sorting.h
+6
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+10
-18
src/playlist/sort.c
src/playlist/sort.c
+10
-1
No files found.
include/vlc_playlist.h
View file @
2bde17e1
...
...
@@ -244,6 +244,7 @@ struct playlist_add_t
#define SORT_TRACK_NUMBER 9
#define SORT_DESCRIPTION 10
#define SORT_RATING 11
#define SORT_URI 12
#define ORDER_NORMAL 0
#define ORDER_REVERSE 1
...
...
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
2bde17e1
...
...
@@ -745,27 +745,18 @@ void PLModel::sort( int column, Qt::SortOrder order )
return
;
}
#define CHECK_COLUMN( meta ) \
{ \
if( ( shownFlags() & meta ) ) \
i_index++; \
if( column == i_index ) \
{ \
i_flag = meta; \
goto next; \
} \
}
CHECK_COLUMN
(
COLUMN_NUMBER
);
CHECK_COLUMN
(
COLUMN_TITLE
);
CHECK_COLUMN
(
COLUMN_DURATION
);
CHECK_COLUMN
(
COLUMN_ARTIST
);
CHECK_COLUMN
(
COLUMN_GENRE
);
CHECK_COLUMN
(
COLUMN_ALBUM
);
CHECK_COLUMN
(
COLUMN_TRACK_NUMBER
);
CHECK_COLUMN
(
COLUMN_DESCRIPTION
);
#undef CHECK_COLUMN
int
i_column
=
1
;
for
(
i_column
=
1
;
i_column
!=
COLUMN_END
;
i_column
<<=
1
)
{
if
(
(
shownFlags
()
&
i_column
)
)
i_index
++
;
if
(
column
==
i_index
)
{
i_flag
=
i_column
;
goto
next
;
}
}
next:
PL_LOCK
;
...
...
modules/gui/qt4/components/playlist/sorting.h
View file @
2bde17e1
...
...
@@ -32,10 +32,11 @@ enum
COLUMN_ALBUM
=
0x0020
,
COLUMN_TRACK_NUMBER
=
0x0040
,
COLUMN_DESCRIPTION
=
0x0080
,
COLUMN_URI
=
0x0100
,
/* Add new entries here and update the COLUMN_END value*/
COLUMN_END
=
0x0
1
00
COLUMN_END
=
0x0
2
00
};
/* Return the title of a column */
...
...
@@ -51,6 +52,7 @@ static const char * psz_column_title( uint32_t i_column )
case
COLUMN_ALBUM
:
return
VLC_META_ALBUM
;
case
COLUMN_TRACK_NUMBER
:
return
VLC_META_TRACK_NUMBER
;
case
COLUMN_DESCRIPTION
:
return
VLC_META_DESCRIPTION
;
case
COLUMN_URI
:
return
_
(
"URI"
);
default:
abort
();
}
}
...
...
@@ -85,6 +87,8 @@ static char * psz_column_meta( input_item_t *p_item, uint32_t i_column )
return
input_item_GetTrackNum
(
p_item
);
case
COLUMN_DESCRIPTION
:
return
input_item_GetDescription
(
p_item
);
case
COLUMN_URI
:
return
input_item_GetURI
(
p_item
);
default:
abort
();
}
...
...
@@ -103,6 +107,7 @@ static inline int i_column_sorting( uint32_t i_column )
case
COLUMN_ALBUM
:
return
SORT_ALBUM
;
case
COLUMN_TRACK_NUMBER
:
return
SORT_TRACK_NUMBER
;
case
COLUMN_DESCRIPTION
:
return
SORT_DESCRIPTION
;
case
COLUMN_URI
:
return
SORT_URI
;
default:
abort
();
}
}
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
2bde17e1
...
...
@@ -274,26 +274,18 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
QMenu
selectColMenu
;
#define ADD_META_ACTION( meta ) { \
QAction* option = selectColMenu.addAction( qfu( psz_column_title( meta ) ) ); \
option->setCheckable( true ); \
option->setChecked( model->shownFlags() & meta ); \
ContextUpdateMapper->setMapping( option, meta ); \
CONNECT( option, triggered(), ContextUpdateMapper, map() ); \
}
CONNECT
(
ContextUpdateMapper
,
mapped
(
int
),
model
,
viewchanged
(
int
)
);
ADD_META_ACTION
(
COLUMN_NUMBER
)
;
ADD_META_ACTION
(
COLUMN_TITLE
);
ADD_META_ACTION
(
COLUMN_DURATION
);
ADD_META_ACTION
(
COLUMN_ARTIST
);
ADD_META_ACTION
(
COLUMN_GENRE
);
ADD_META_ACTION
(
COLUMN_ALBUM
);
ADD_META_ACTION
(
COLUMN_TRACK_NUMBER
);
ADD_META_ACTION
(
COLUMN_DESCRIPTION
);
#undef ADD_META_ACTION
int
i_column
=
1
;
for
(
i_column
=
1
;
i_column
!=
COLUMN_END
;
i_column
<<=
1
)
{
QAction
*
option
=
selectColMenu
.
addAction
(
qfu
(
psz_column_title
(
i_column
)
)
);
option
->
setCheckable
(
true
);
option
->
setChecked
(
model
->
shownFlags
()
&
i_column
);
ContextUpdateMapper
->
setMapping
(
option
,
i_column
);
CONNECT
(
option
,
triggered
(),
ContextUpdateMapper
,
map
()
);
}
selectColMenu
.
exec
(
QCursor
::
pos
()
);
}
...
...
src/playlist/sort.c
View file @
2bde17e1
...
...
@@ -236,6 +236,15 @@ static int playlist_cmp(const void *first, const void *second)
(
*
(
playlist_item_t
**
)
second
)
->
p_input
->
psz_name
);
}
}
else
if
(
sort_mode
==
SORT_URI
)
{
char
*
psz_i
=
input_item_GetURI
(
(
*
(
playlist_item_t
**
)
first
)
->
p_input
);
char
*
psz_ismall
=
input_item_GetURI
(
(
*
(
playlist_item_t
**
)
second
)
->
p_input
);
i_test
=
strcasecmp
(
psz_i
,
psz_ismall
);
free
(
psz_i
);
free
(
psz_ismall
);
}
if
(
sort_type
==
ORDER_REVERSE
)
i_test
=
i_test
*
-
1
;
...
...
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