Skip to content

Commit

Permalink
Merge pull request #135 from jcorporation/tagtypes_reset
Browse files Browse the repository at this point in the history
Support "tagtypes reset" command (MPD 0.24)
  • Loading branch information
jcorporation authored Nov 3, 2024
2 parents 9aa0f9c + 4fcf27b commit dc9fb20
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/mpd/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,31 @@ mpd_send_all_tag_types(struct mpd_connection *connection);
bool
mpd_run_all_tag_types(struct mpd_connection *connection);

/**
* Clear the list of tag types and re-enable one or more tags from
* the list of tag types for this client. These will no longer be
* hidden from responses to this client.
*
* @param connection the connection to MPD
* @param types an array of tag types to enable
* @param n the number of tag types in the array
* @return true on success, false on error
*
* @since libmpdclient 2.23, MPD 0.24
*/
bool
mpd_send_reset_tag_types(struct mpd_connection *connection,
const enum mpd_tag_type *types, unsigned n);

/**
* Shortcut for mpd_send_reset_tag_types() and mpd_response_finish().
*
* @since libmpdclient 2.23, MPD 0.24
*/
bool
mpd_run_reset_tag_types(struct mpd_connection *connection,
const enum mpd_tag_type *types, unsigned n);

/**
* Requests a list of enabled protocol features.
* Use mpd_recv_protocol_feature_pair() to obtain the list of
Expand Down
2 changes: 2 additions & 0 deletions libmpdclient.ld
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ global:
mpd_run_clear_tag_types;
mpd_send_all_tag_types;
mpd_run_all_tag_types;
mpd_send_reset_tag_types;
mpd_run_reset_tag_types;
mpd_send_list_protocol_features;
mpd_send_list_protocol_features_available;
mpd_recv_protocol_feature_pair;
Expand Down
15 changes: 15 additions & 0 deletions src/capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,21 @@ mpd_run_all_tag_types(struct mpd_connection *connection)
mpd_response_finish(connection);
}

bool
mpd_send_reset_tag_types(struct mpd_connection *connection,
const enum mpd_tag_type *types, unsigned n)
{
return mpd_send_tag_types_v(connection, "reset", types, n);
}

bool
mpd_run_reset_tag_types(struct mpd_connection *connection,
const enum mpd_tag_type *types, unsigned n)
{
return mpd_send_reset_tag_types(connection, types, n) &&
mpd_response_finish(connection);
}

bool
mpd_send_list_protocol_features(struct mpd_connection *connection)
{
Expand Down

0 comments on commit dc9fb20

Please sign in to comment.