[vlc-commits] playlist: remove phony playlist item pointers
Rémi Denis-Courmont
git at videolan.org
Mon Nov 14 22:52:27 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 14 23:52:04 2016 +0200| [f0573e676b8ba617a3ad3af5575820443035801a] | committer: Rémi Denis-Courmont
playlist: remove phony playlist item pointers
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f0573e676b8ba617a3ad3af5575820443035801a
---
include/vlc_playlist.h | 8 --------
modules/control/oldrc.c | 4 ++--
modules/gui/macosx/VLCMain.m | 4 ++--
modules/gui/macosx/VLCMainMenu.m | 6 +++---
modules/gui/macosx/VLCMainWindow.m | 12 ++++++------
modules/gui/ncurses.c | 12 ++++++------
modules/gui/qt/dialogs/messages.cpp | 2 +-
modules/gui/skins2/commands/cmd_playlist.cpp | 2 +-
modules/gui/skins2/commands/cmd_playtree.cpp | 2 +-
modules/gui/skins2/vars/playtree.cpp | 10 +++++-----
src/playlist/engine.c | 6 ------
11 files changed, 27 insertions(+), 41 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 4363405..c320fe9 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -174,14 +174,6 @@ struct playlist_t
playlist_item_t * p_root;
playlist_item_t * p_playing;
playlist_item_t * p_media_library;
-
- //Phony ones, point to those above;
- playlist_item_t * p_root_category; /**< Root of category tree */
- playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */
- playlist_item_t * p_local_category; /** < "Playlist" in CATEGORY view */
- playlist_item_t * p_ml_category; /** < "Library" in CATEGORY view */
- playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
- playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */
};
/** Helper to add an item */
diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 37f8e16..4dedf15 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1325,14 +1325,14 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
else if( !strcmp( psz_cmd, "playlist" ) )
{
msg_rc( "+----[ Playlist ]" );
- print_playlist( p_intf, p_playlist->p_root_category, 0 );
+ print_playlist( p_intf, p_playlist->p_root, 0 );
msg_rc( "+----[ End of playlist ]" );
}
else if( !strcmp( psz_cmd, "sort" ))
{
PL_LOCK;
- playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root_onelevel,
+ playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root,
SORT_ARTIST, ORDER_NORMAL );
PL_UNLOCK;
}
diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index ccf73fb..6fb71c8 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -279,7 +279,7 @@ static VLCMain *sharedInstance = nil;
playlist_t * p_playlist = pl_Get(getIntf());
PL_LOCK;
- items_at_launch = p_playlist->p_local_category->i_children;
+ items_at_launch = p_playlist->p_playing->i_children;
PL_UNLOCK;
#ifdef HAVE_SPARKLE
@@ -322,7 +322,7 @@ static VLCMain *sharedInstance = nil;
// note that PLAYLIST_PLAY will not stop any playback if already started
playlist_t * p_playlist = pl_Get(getIntf());
PL_LOCK;
- BOOL kidsAround = p_playlist->p_local_category->i_children != 0;
+ BOOL kidsAround = p_playlist->p_playing->i_children != 0;
if (kidsAround && var_GetBool(p_playlist, "playlist-autostart"))
playlist_Control(p_playlist, PLAYLIST_PLAY, true);
PL_UNLOCK;
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index cad6764..28d2f18 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -1133,7 +1133,7 @@
playlist_Export(p_playlist,
[actualFilename fileSystemRepresentation],
- p_playlist->p_local_category, "export-m3u");
+ p_playlist->p_playing, "export-m3u");
} else if ([_playlistSaveAccessoryPopup indexOfSelectedItem] == 1) {
NSString *actualFilename;
NSRange range;
@@ -1147,7 +1147,7 @@
playlist_Export(p_playlist,
[actualFilename fileSystemRepresentation],
- p_playlist->p_local_category, "export-xspf");
+ p_playlist->p_playing, "export-xspf");
} else {
NSString *actualFilename;
NSRange range;
@@ -1161,7 +1161,7 @@
playlist_Export(p_playlist,
[actualFilename fileSystemRepresentation],
- p_playlist->p_local_category, "export-html");
+ p_playlist->p_playing, "export-html");
}
}
}
diff --git a/modules/gui/macosx/VLCMainWindow.m b/modules/gui/macosx/VLCMainWindow.m
index c31d461..ceebbe7 100644
--- a/modules/gui/macosx/VLCMainWindow.m
+++ b/modules/gui/macosx/VLCMainWindow.m
@@ -952,9 +952,9 @@ static const float f_min_window_height = 307.;
PL_LOCK;
if (root == ROOT_TYPE_PLAYLIST)
- [_categoryLabel setStringValue: [_NS("Playlist") stringByAppendingString:[self _playbackDurationOfNode:p_playlist->p_local_category]]];
+ [_categoryLabel setStringValue: [_NS("Playlist") stringByAppendingString:[self _playbackDurationOfNode:p_playlist->p_playing]]];
else if (root == ROOT_TYPE_MEDIALIBRARY)
- [_categoryLabel setStringValue: [_NS("Media Library") stringByAppendingString:[self _playbackDurationOfNode:p_playlist->p_ml_category]]];
+ [_categoryLabel setStringValue: [_NS("Media Library") stringByAppendingString:[self _playbackDurationOfNode:p_playlist->p_playing]]];
PL_UNLOCK;
}
@@ -1051,15 +1051,15 @@ static const float f_min_window_height = 307.;
if ([[item identifier] isEqualToString: @"playlist"]) {
PL_LOCK;
- i_playlist_size = p_playlist->p_local_category->i_children;
+ i_playlist_size = p_playlist->p_playing->i_children;
PL_UNLOCK;
return i_playlist_size;
}
if ([[item identifier] isEqualToString: @"medialibrary"]) {
PL_LOCK;
- if (p_playlist->p_ml_category)
- i_playlist_size = p_playlist->p_ml_category->i_children;
+ if (p_playlist->p_media_library)
+ i_playlist_size = p_playlist->p_media_library->i_children;
PL_UNLOCK;
return i_playlist_size;
@@ -1151,7 +1151,7 @@ static const float f_min_window_height = 307.;
[self _updatePlaylistTitle];
} else if ([[item identifier] isEqualToString:@"medialibrary"]) {
- if (p_playlist->p_ml_category) {
+ if (p_playlist->p_media_library) {
PL_LOCK;
[[[[VLCMain sharedInstance] playlist] model] changeRootItem:p_playlist->p_media_library];
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 73bfbbd..f8337e6 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -420,7 +420,7 @@ static void PlaylistRebuild(intf_thread_t *intf)
playlist_t *p_playlist = pl_Get(intf);
PlaylistDestroy(sys);
- PlaylistAddNode(sys, p_playlist->p_root_onelevel, "");
+ PlaylistAddNode(sys, p_playlist->p_root, "");
}
static int ItemChanged(vlc_object_t *p_this, const char *variable,
@@ -1316,7 +1316,7 @@ static bool HandlePlaylistKey(intf_thread_t *intf, int key)
/* Playlist sort */
case 'o':
case 'O':
- playlist_RecursiveNodeSort(p_playlist, p_playlist->p_root_onelevel,
+ playlist_RecursiveNodeSort(p_playlist, p_playlist->p_root,
SORT_TITLE_NODES_FIRST,
(key == 'o')? ORDER_NORMAL : ORDER_REVERSE);
vlc_mutex_lock(&sys->pl_lock);
@@ -1439,13 +1439,13 @@ static bool HandleBrowseKey(intf_thread_t *intf, int key)
p_parent = item ? item->p_parent : NULL;
PL_UNLOCK;
if (!p_parent)
- p_parent = p_playlist->p_local_onelevel;
+ p_parent = p_playlist->p_playing;
}
while (p_parent->p_parent && p_parent->p_parent->p_parent)
p_parent = p_parent->p_parent;
- input_item_t *p_input = p_playlist->p_local_onelevel->p_input;
+ input_item_t *p_input = p_playlist->p_playing->p_input;
playlist_Add(p_playlist, uri, NULL, PLAYLIST_APPEND,
PLAYLIST_END, p_parent->p_input == p_input, false);
@@ -1475,7 +1475,7 @@ static void OpenSelection(intf_thread_t *intf)
current= playlist_CurrentPlayingItem(p_playlist);
p_parent = current ? current->p_parent : NULL;
if (!p_parent)
- p_parent = p_playlist->p_local_onelevel;
+ p_parent = p_playlist->p_playing;
}
while (p_parent->p_parent && p_parent->p_parent->p_parent)
@@ -1484,7 +1484,7 @@ static void OpenSelection(intf_thread_t *intf)
playlist_Add(p_playlist, uri, NULL,
PLAYLIST_APPEND|PLAYLIST_GO, PLAYLIST_END,
- p_parent->p_input == p_playlist->p_local_onelevel->p_input,
+ p_parent->p_input == p_playlist->p_playing->p_input,
false);
sys->plidx_follow = true;
diff --git a/modules/gui/qt/dialogs/messages.cpp b/modules/gui/qt/dialogs/messages.cpp
index 59f5607..04d3393 100644
--- a/modules/gui/qt/dialogs/messages.cpp
+++ b/modules/gui/qt/dialogs/messages.cpp
@@ -378,7 +378,7 @@ void MessagesDialog::updatePLTree()
{
vlc_playlist_locker pl_lock ( THEPL );
- pldebugTree->addTopLevelItem( PLWalk( p_playlist->p_root_category ) );
+ pldebugTree->addTopLevelItem( PLWalk( p_playlist->p_root ) );
}
pldebugTree->expandAll();
diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp
index ae75162..f87b93b 100644
--- a/modules/gui/skins2/commands/cmd_playlist.cpp
+++ b/modules/gui/skins2/commands/cmd_playlist.cpp
@@ -99,7 +99,7 @@ void CmdPlaylistSave::execute()
}
playlist_Export( pPlaylist, m_file.c_str(),
- pPlaylist->p_local_category, psz_module );
+ pPlaylist->p_playing, psz_module );
}
}
diff --git a/modules/gui/skins2/commands/cmd_playtree.cpp b/modules/gui/skins2/commands/cmd_playtree.cpp
index 6943d70..8f26630 100644
--- a/modules/gui/skins2/commands/cmd_playtree.cpp
+++ b/modules/gui/skins2/commands/cmd_playtree.cpp
@@ -38,7 +38,7 @@ void CmdPlaytreeSort::execute()
/// \todo Choose the correct view
playlist_t *p_playlist = getIntf()->p_sys->p_playlist;
PL_LOCK;
- playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root_onelevel,
+ playlist_RecursiveNodeSort( p_playlist, p_playlist->p_root,
SORT_TITLE, ORDER_NORMAL );
PL_UNLOCK;
diff --git a/modules/gui/skins2/vars/playtree.cpp b/modules/gui/skins2/vars/playtree.cpp
index 8abd634..93ca405 100644
--- a/modules/gui/skins2/vars/playtree.cpp
+++ b/modules/gui/skins2/vars/playtree.cpp
@@ -288,7 +288,7 @@ void Playtree::insertItems( VarTree& elem, const std::list<std::string>& files,
{
for( Iterator it = m_children.begin(); it != m_children.end(); ++it )
{
- if( it->getId() == m_pPlaylist->p_local_category->i_id )
+ if( it->getId() == m_pPlaylist->p_playing->i_id )
{
p_elem = &*it;
break;
@@ -296,15 +296,15 @@ void Playtree::insertItems( VarTree& elem, const std::list<std::string>& files,
}
}
- if( p_elem->getId() == m_pPlaylist->p_local_category->i_id )
+ if( p_elem->getId() == m_pPlaylist->p_playing->i_id )
{
- p_node = m_pPlaylist->p_local_category;
+ p_node = m_pPlaylist->p_playing;
i_pos = 0;
p_elem->setExpanded( true );
}
- else if( p_elem->getId() == m_pPlaylist->p_ml_category->i_id )
+ else if( p_elem->getId() == m_pPlaylist->p_media_library->i_id )
{
- p_node = m_pPlaylist->p_ml_category;
+ p_node = m_pPlaylist->p_media_library;
i_pos = 0;
p_elem->setExpanded( true );
}
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index ea9896d..1f29ee4 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -252,12 +252,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
p_playlist->p_root = root;
p_playlist->p_playing = playing;
p_playlist->p_media_library = ml;
- p_playlist->p_root_category = p_playlist->p_root;
- p_playlist->p_root_onelevel = p_playlist->p_root;
- p_playlist->p_local_category = p_playlist->p_playing;
- p_playlist->p_local_onelevel = p_playlist->p_playing;
- p_playlist->p_ml_category = p_playlist->p_media_library;
- p_playlist->p_ml_onelevel = p_playlist->p_media_library;;
/* Initial status */
pl_priv(p_playlist)->status.p_item = NULL;
More information about the vlc-commits
mailing list