diff options
author | Christoph Heinrich <christoph.heinrich@student.tugraz.at> | 2023-02-20 06:53:09 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-02-21 17:15:17 +0000 |
commit | 17d91b9d4d2d208f4a847395198cdbbcad18de93 (patch) | |
tree | e87e6f96d1b9f29a268a43a7d16ad4bed2e8b857 /player | |
parent | 4ebfe9851c63c8aa55292c01f23fedd9313ed191 (diff) | |
download | mpv-17d91b9d4d2d208f4a847395198cdbbcad18de93.tar.bz2 mpv-17d91b9d4d2d208f4a847395198cdbbcad18de93.tar.xz |
options: transition properties from flag to bool
Diffstat (limited to 'player')
-rw-r--r-- | player/client.c | 2 | ||||
-rw-r--r-- | player/command.c | 64 |
2 files changed, 33 insertions, 33 deletions
diff --git a/player/client.c b/player/client.c index 9b4c83b861..cf2483b4c2 100644 --- a/player/client.c +++ b/player/client.c @@ -970,7 +970,7 @@ void mpv_wakeup(mpv_handle *ctx) // map client API types to internal types static const struct m_option type_conv[] = { [MPV_FORMAT_STRING] = { .type = CONF_TYPE_STRING }, - [MPV_FORMAT_FLAG] = { .type = CONF_TYPE_FLAG }, + [MPV_FORMAT_FLAG] = { .type = CONF_TYPE_BOOL }, [MPV_FORMAT_INT64] = { .type = CONF_TYPE_INT64 }, [MPV_FORMAT_DOUBLE] = { .type = CONF_TYPE_DOUBLE }, [MPV_FORMAT_NODE] = { .type = CONF_TYPE_NODE }, diff --git a/player/command.c b/player/command.c index 79be7aeae2..9d6ef4fa54 100644 --- a/player/command.c +++ b/player/command.c @@ -428,7 +428,7 @@ static int mp_property_display_sync_active(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, mpctx->display_sync_active); + return m_property_bool_ro(action, arg, mpctx->display_sync_active); } static int mp_property_pid(void *ctx, struct m_property *prop, @@ -1103,7 +1103,7 @@ static int get_edition_entry(int item, int action, void *arg, void *ctx) {"id", SUB_PROP_INT(item)}, {"title", SUB_PROP_STR(title), .unavailable = !title}, - {"default", SUB_PROP_FLAG(ed->default_edition)}, + {"default", SUB_PROP_BOOL(ed->default_edition)}, {0} }; @@ -1338,14 +1338,14 @@ static int mp_property_core_idle(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, !mpctx->playback_active); + return m_property_bool_ro(action, arg, !mpctx->playback_active); } static int mp_property_idle(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, mpctx->stop_play == PT_STOP); + return m_property_bool_ro(action, arg, mpctx->stop_play == PT_STOP); } static int mp_property_window_id(void *ctx, struct m_property *prop, @@ -1367,7 +1367,7 @@ static int mp_property_eof_reached(void *ctx, struct m_property *prop, return M_PROPERTY_UNAVAILABLE; bool eof = mpctx->video_status == STATUS_EOF && mpctx->audio_status == STATUS_EOF; - return m_property_flag_ro(action, arg, eof); + return m_property_bool_ro(action, arg, eof); } static int mp_property_seeking(void *ctx, struct m_property *prop, @@ -1376,14 +1376,14 @@ static int mp_property_seeking(void *ctx, struct m_property *prop, MPContext *mpctx = ctx; if (!mpctx->playback_initialized) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, !mpctx->restart_complete); + return m_property_bool_ro(action, arg, !mpctx->restart_complete); } static int mp_property_playback_abort(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, !mpctx->playing || mpctx->stop_play); + return m_property_bool_ro(action, arg, !mpctx->playing || mpctx->stop_play); } static int mp_property_cache_speed(void *ctx, struct m_property *prop, @@ -1447,7 +1447,7 @@ static int mp_property_demuxer_cache_idle(void *ctx, struct m_property *prop, struct demux_reader_state s; demux_get_reader_state(mpctx->demuxer, &s); - return m_property_flag_ro(action, arg, s.idle); + return m_property_bool_ro(action, arg, s.idle); } static int mp_property_demuxer_cache_state(void *ctx, struct m_property *prop, @@ -1526,7 +1526,7 @@ static int mp_property_paused_for_cache(void *ctx, struct m_property *prop, MPContext *mpctx = ctx; if (!mpctx->playback_initialized) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, mpctx->paused_for_cache); + return m_property_bool_ro(action, arg, mpctx->paused_for_cache); } static int mp_property_cache_buffering(void *ctx, struct m_property *prop, @@ -1546,7 +1546,7 @@ static int mp_property_demuxer_is_network(void *ctx, struct m_property *prop, if (!mpctx->demuxer) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, mpctx->demuxer->is_network); + return m_property_bool_ro(action, arg, mpctx->demuxer->is_network); } @@ -1568,7 +1568,7 @@ static int mp_property_seekable(void *ctx, struct m_property *prop, MPContext *mpctx = ctx; if (!mpctx->demuxer) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, mpctx->demuxer->seekable); + return m_property_bool_ro(action, arg, mpctx->demuxer->seekable); } static int mp_property_partially_seekable(void *ctx, struct m_property *prop, @@ -1577,14 +1577,14 @@ static int mp_property_partially_seekable(void *ctx, struct m_property *prop, MPContext *mpctx = ctx; if (!mpctx->demuxer) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, mpctx->demuxer->partially_seekable); + return m_property_bool_ro(action, arg, mpctx->demuxer->partially_seekable); } static int mp_property_mixer_active(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, !!mpctx->ao); + return m_property_bool_ro(action, arg, !!mpctx->ao); } /// Volume (RW) @@ -1672,7 +1672,7 @@ static int mp_property_ao_mute(void *ctx, struct m_property *prop, return M_PROPERTY_OK; } case M_PROPERTY_GET_TYPE: - *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_FLAG}; + *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_BOOL}; return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; @@ -1961,15 +1961,15 @@ static int get_track_entry(int item, int action, void *arg, void *ctx) .unavailable = !track->lang}, {"audio-channels", SUB_PROP_INT(track_channels(track)), .unavailable = track_channels(track) <= 0}, - {"image", SUB_PROP_FLAG(track->image)}, - {"albumart", SUB_PROP_FLAG(track->attached_picture)}, - {"default", SUB_PROP_FLAG(track->default_track)}, - {"forced", SUB_PROP_FLAG(track->forced_track)}, - {"dependent", SUB_PROP_FLAG(track->dependent_track)}, - {"visual-impaired", SUB_PROP_FLAG(track->visual_impaired_track)}, - {"hearing-impaired", SUB_PROP_FLAG(track->hearing_impaired_track)}, - {"external", SUB_PROP_FLAG(track->is_external)}, - {"selected", SUB_PROP_FLAG(track->selected)}, + {"image", SUB_PROP_BOOL(track->image)}, + {"albumart", SUB_PROP_BOOL(track->attached_picture)}, + {"default", SUB_PROP_BOOL(track->default_track)}, + {"forced", SUB_PROP_BOOL(track->forced_track)}, + {"dependent", SUB_PROP_BOOL(track->dependent_track)}, + {"visual-impaired", SUB_PROP_BOOL(track->visual_impaired_track)}, + {"hearing-impaired", SUB_PROP_BOOL(track->hearing_impaired_track)}, + {"external", SUB_PROP_BOOL(track->is_external)}, + {"selected", SUB_PROP_BOOL(track->selected)}, {"main-selection", SUB_PROP_INT(order), .unavailable = order < 0}, {"external-filename", SUB_PROP_STR(track->external_filename), .unavailable = !track->external_filename}, @@ -2329,9 +2329,9 @@ static int mp_property_video_frame_info(void *ctx, struct m_property *prop, struct m_sub_property props[] = { {"picture-type", SUB_PROP_STR(pict_type), .unavailable = !pict_type}, - {"interlaced", SUB_PROP_FLAG(!!(f->fields & MP_IMGFIELD_INTERLACED))}, - {"tff", SUB_PROP_FLAG(!!(f->fields & MP_IMGFIELD_TOP_FIRST))}, - {"repeat", SUB_PROP_FLAG(!!(f->fields & MP_IMGFIELD_REPEAT_FIRST))}, + {"interlaced", SUB_PROP_BOOL(!!(f->fields & MP_IMGFIELD_INTERLACED))}, + {"tff", SUB_PROP_BOOL(!!(f->fields & MP_IMGFIELD_TOP_FIRST))}, + {"repeat", SUB_PROP_BOOL(!!(f->fields & MP_IMGFIELD_REPEAT_FIRST))}, {0} }; @@ -2491,7 +2491,7 @@ static int mp_property_focused(void *ctx, struct m_property *prop, if (vo_control(vo, VOCTRL_GET_FOCUSED, &focused) < 1) return M_PROPERTY_UNAVAILABLE; - return m_property_flag_ro(action, arg, focused); + return m_property_bool_ro(action, arg, focused); } static int mp_property_display_names(void *ctx, struct m_property *prop, @@ -2522,7 +2522,7 @@ static int mp_property_vo_configured(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - return m_property_flag_ro(action, arg, + return m_property_bool_ro(action, arg, mpctx->video_out && mpctx->video_out->config_ok); } @@ -3027,8 +3027,8 @@ static int get_playlist_entry(int item, int action, void *arg, void *ctx) bool playing = mpctx->playing == e; struct m_sub_property props[] = { {"filename", SUB_PROP_STR(e->filename)}, - {"current", SUB_PROP_FLAG(1), .unavailable = !current}, - {"playing", SUB_PROP_FLAG(1), .unavailable = !playing}, + {"current", SUB_PROP_BOOL(1), .unavailable = !current}, + {"playing", SUB_PROP_BOOL(1), .unavailable = !playing}, {"title", SUB_PROP_STR(e->title), .unavailable = !e->title}, {"id", SUB_PROP_INT64(e->id)}, {0} @@ -3421,8 +3421,8 @@ static int mp_property_option_info(void *ctx, struct m_property *prop, struct m_sub_property props[] = { {"name", SUB_PROP_STR(co->name)}, {"type", SUB_PROP_STR(opt->type->name)}, - {"set-from-commandline", SUB_PROP_FLAG(co->is_set_from_cmdline)}, - {"set-locally", SUB_PROP_FLAG(co->is_set_locally)}, + {"set-from-commandline", SUB_PROP_BOOL(co->is_set_from_cmdline)}, + {"set-locally", SUB_PROP_BOOL(co->is_set_locally)}, {"default-value", *opt, def}, {"min", SUB_PROP_DOUBLE(opt->min), .unavailable = !(has_minmax && opt->min != DBL_MIN)}, |