options: make player-operation-mode readable as a property

Make it readable as a property so that scripts and conditional
autoprofiles can customize behavior depending if player is
launched as pseudo gui mode.
This commit is contained in:
nanahi authored and Kacper Michajłow committed 2026-05-09 15:01:09 +02:00
1 parent 4414547d62
commit ed2e55b941
3 files changed
+15

No files matched your search

@@ -0,0 +1 @@
make `player-operation-mode` readable as a property
+5
View File
@@ -4386,6 +4386,11 @@ Property list
A string containing the currently active clipboard backend.
See ``--clipboard-backends`` option for the list of available backends.
``player-operation-mode``
A read-only string of the current player operation mode, mirroring the
``--player-operation-mode`` option. To set operation mode, set the option
at startup instead.
``clock``
The current local time in hour:minutes format.
+9
View File
@@ -3166,6 +3166,14 @@ static int mp_property_term_size(void *ctx, struct m_property *prop,
return m_property_read_sub(props, action, arg);
}
static int mp_property_player_operation_mode(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
const struct m_opt_choice_alternatives mode_names[] = {{"cplayer", 0}, {"pseudo-gui", 1}};
return m_property_strdup_ro(action, arg, m_opt_choice_str(mode_names, mpctx->opts->operation_mode));
}
static int mp_property_mouse_pos(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -4633,6 +4641,7 @@ static const struct m_property mp_properties_base[] = {
{"idle-active", mp_property_idle},
{"window-id", mp_property_window_id},
{"display-swapchain", mp_property_vo_display_swapchain},
{"player-operation-mode", mp_property_player_operation_mode},
{"chapter-list", mp_property_list_chapters},
{"track-list", mp_property_list_tracks},