Commit cb1b9717 authored by Thomas Guillem's avatar Thomas Guillem

player: rename vlc_player_*Track to EsId

In order to clearly identify functions using a vlc_es_id_t*.
And add Track helpers.
parent 1f51e1d2
......@@ -103,7 +103,7 @@ struct vlc_player_program
*/
struct vlc_player_track
{
/** Id used for any player actions, like vlc_player_SelectTrack() */
/** Id used for any player actions, like vlc_player_SelectEsId() */
vlc_es_id_t *es_id;
/** Track name, always valid */
const char *name;
......@@ -1716,7 +1716,18 @@ vlc_player_GetSelectedTrack(vlc_player_t *player, enum es_format_category_e cat)
* vlc_player_GetTrackAt())
*/
VLC_API void
vlc_player_SelectTrack(vlc_player_t *player, vlc_es_id_t *es_id);
vlc_player_SelectEsId(vlc_player_t *player, vlc_es_id_t *es_id);
/**
* Helper to select a track
*/
static inline void
vlc_player_SelectTrack(vlc_player_t *player,
const struct vlc_player_track *track)
{
vlc_player_SelectEsId(player, track->es_id);
}
/**
* Select the next track
......@@ -1761,7 +1772,17 @@ vlc_player_SelectPrevTrack(vlc_player_t *player,
* vlc_player_GetTrackAt())
*/
VLC_API void
vlc_player_UnselectTrack(vlc_player_t *player, vlc_es_id_t *es_id);
vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *es_id);
/**
* Helper to unselect a track
*/
static inline void
vlc_player_UnselectTrack(vlc_player_t *player,
const struct vlc_player_track *track)
{
vlc_player_UnselectEsId(player, track->es_id);
}
/**
* Helper to unselect all tracks from an ES category
......@@ -1777,7 +1798,7 @@ vlc_player_UnselectTrackCategory(vlc_player_t *player,
vlc_player_GetTrackAt(player, cat, i);
assert(track);
if (track->selected)
vlc_player_UnselectTrack(player, track->es_id);
vlc_player_UnselectTrack(player, track);
}
}
......@@ -1792,7 +1813,17 @@ vlc_player_UnselectTrackCategory(vlc_player_t *player,
* vlc_player_GetTrackAt())
*/
VLC_API void
vlc_player_RestartTrack(vlc_player_t *player, vlc_es_id_t *es_id);
vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *es_id);
/**
* Helper to restart a track
*/
static inline void
vlc_player_RestartTrack(vlc_player_t *player,
const struct vlc_player_track *track)
{
vlc_player_RestartEsId(player, track->es_id);
}
/**
* Helper to restart all selected tracks from an ES category
......@@ -1808,7 +1839,7 @@ vlc_player_RestartTrackCategory(vlc_player_t *player,
vlc_player_GetTrackAt(player, cat, i);
assert(track);
if (track->selected)
vlc_player_RestartTrack(player, track->es_id);
vlc_player_RestartTrack(player, track);
}
}
......
......@@ -383,7 +383,7 @@ int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track )
if (i_track == vlc_es_id_GetInputId(track->es_id))
{
/* found */
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
i_ret = 0;
goto end;
}
......
......@@ -325,7 +325,7 @@ int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu )
if (i_spu == vlc_es_id_GetInputId(track->es_id))
{
/* found */
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
i_ret = 0;
goto end;
}
......@@ -496,7 +496,7 @@ int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track )
if (i_track == vlc_es_id_GetInputId(track->es_id))
{
/* found */
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
i_ret = 0;
goto end;
}
......
......@@ -549,7 +549,7 @@ static void Input(intf_thread_t *intf, char const *psz_cmd,
vlc_player_GetTrackAt(player, cat, (size_t)idx);
if (!track)
goto out;
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
}
else
{
......
......@@ -1373,14 +1373,14 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
- (void)selectTrack:(VLCTrackMetaData *)track
{
vlc_player_Lock(_p_player);
vlc_player_SelectTrack(_p_player, track.esID);
vlc_player_SelectEsId(_p_player, track.esID);
vlc_player_Unlock(_p_player);
}
- (void)unselectTrack:(VLCTrackMetaData *)track
{
vlc_player_Lock(_p_player);
vlc_player_UnselectTrack(_p_player, track.esID);
vlc_player_UnselectEsId(_p_player, track.esID);
vlc_player_Unlock(_p_player);
}
......
......@@ -62,9 +62,9 @@ bool TrackListModel::setData(const QModelIndex &index, const QVariant &value, in
vlc_player_locker lock{ m_player };
if (select)
vlc_player_SelectTrack(m_player, m_data[row].m_id.get());
vlc_player_SelectEsId(m_player, m_data[row].m_id.get());
else
vlc_player_UnselectTrack(m_player, m_data[row].m_id.get());
vlc_player_UnselectEsId(m_player, m_data[row].m_id.get());
return true;
}
......
......@@ -370,9 +370,9 @@ static int vlclua_player_toggle_track_(lua_State *L,
const struct vlc_player_track *track = FindTrack(player, cat, id);
if (track) {
if (track->selected)
vlc_player_UnselectTrack(player, track->es_id);
vlc_player_UnselectTrack(player, track);
else
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
}
vlc_player_Unlock(player);
......
......@@ -1371,7 +1371,7 @@ vlc_player_vout_OSDTrack(vlc_player_t *player, vlc_es_id_t *id, bool select)
}
void
vlc_player_SelectTrack(vlc_player_t *player, vlc_es_id_t *id)
vlc_player_SelectEsId(vlc_player_t *player, vlc_es_id_t *id)
{
struct vlc_player_input *input = vlc_player_get_input_locked(player);
if (!input)
......@@ -1427,9 +1427,9 @@ vlc_player_CycleTrack(vlc_player_t *player, enum es_format_category_e cat,
const struct vlc_player_track *track =
vlc_player_GetTrackAt(player, cat, index);
if (selected)
vlc_player_SelectTrack(player, track->es_id);
vlc_player_SelectTrack(player, track);
else
vlc_player_UnselectTrack(player, track->es_id);
vlc_player_UnselectTrack(player, track);
}
void
......@@ -1447,7 +1447,7 @@ vlc_player_SelectPrevTrack(vlc_player_t *player,
}
void
vlc_player_UnselectTrack(vlc_player_t *player, vlc_es_id_t *id)
vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *id)
{
struct vlc_player_input *input = vlc_player_get_input_locked(player);
if (!input)
......@@ -1458,7 +1458,7 @@ vlc_player_UnselectTrack(vlc_player_t *player, vlc_es_id_t *id)
}
void
vlc_player_RestartTrack(vlc_player_t *player, vlc_es_id_t *id)
vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *id)
{
struct vlc_player_input *input = vlc_player_get_input_locked(player);
......@@ -1557,9 +1557,9 @@ vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled)
if (!input || !input->teletext_menu)
return;
if (enabled)
vlc_player_SelectTrack(player, input->teletext_menu->t.es_id);
vlc_player_SelectEsId(player, input->teletext_menu->t.es_id);
else
vlc_player_UnselectTrack(player, input->teletext_menu->t.es_id);
vlc_player_UnselectEsId(player, input->teletext_menu->t.es_id);
}
void
......
......@@ -825,13 +825,14 @@ vlc_player_Pause
vlc_player_program_Delete
vlc_player_program_Dup
vlc_player_RemoveListener
vlc_player_RestartTrack
vlc_player_RestartEsId
vlc_player_Resume
vlc_player_SeekByPos
vlc_player_SeekByTime
vlc_player_SelectCategoryLanguage
vlc_player_SelectChapter
vlc_player_SelectChapterIdx
vlc_player_SelectEsId
vlc_player_SelectNextChapter
vlc_player_SelectNextTitle
vlc_player_SelectNextTrack
......@@ -844,7 +845,6 @@ vlc_player_SelectProgram
vlc_player_SelectTeletextPage
vlc_player_SelectTitle
vlc_player_SelectTitleIdx
vlc_player_SelectTrack
vlc_player_SetAssociatedSubsFPS
vlc_player_SetAtoBLoop
vlc_player_SetCategoryDelay
......@@ -866,7 +866,7 @@ vlc_player_title_list_Release
vlc_player_track_Delete
vlc_player_track_Dup
vlc_player_Unlock
vlc_player_UnselectTrack
vlc_player_UnselectEsId
vlc_player_UpdateViewpoint
vlc_player_vout_AddListener
vlc_player_vout_Hold
......
......@@ -1133,11 +1133,11 @@ player_select_next_unselected_track(struct ctx *ctx,
old_id = old_track ? vlc_es_id_Hold(old_track->es_id) : NULL;
if (new_id)
vlc_player_SelectTrack(player, new_id);
vlc_player_SelectEsId(player, new_id);
else
{
assert(old_id);
vlc_player_UnselectTrack(player, old_id);
vlc_player_UnselectEsId(player, old_id);
}
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment