mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
- mc_retvm_if(((subscription_type < MC_SUBSCRIPTION_TYPE_SERVER_STATE) || (subscription_type > MC_SUBSCRIPTION_TYPE_REPEAT_ABILITY)) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type [%d]", subscription_type);
+ mc_retvm_if(!_mc_util_is_valid_subscription_type(subscription_type) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type");
mc_retvm_if(mc_client->updated_cb[subscription_type].callback == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid callback");
ret = mc_ipc_unregister_listener(&mc_client->listeners, MC_DBUS_UPDATE_INTERFACE, cb_event[subscription_type].signal_name);
mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
- mc_retvm_if(((subscription_type < MC_SUBSCRIPTION_TYPE_SERVER_STATE) || (subscription_type > MC_SUBSCRIPTION_TYPE_REPEAT_ABILITY)) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type [%d]", subscription_type);
+ mc_retvm_if(!_mc_util_is_valid_subscription_type(subscription_type) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type");
mc_retvm_if(mc_client->updated_cb[subscription_type].callback == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid callback. No list to unsubscribe [%d]", subscription_type);
mc_retvm_if(mc_client->updated_cb[subscription_type].filter_list == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid filter_list. No list to unsubscribe [%d]", subscription_type);
mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(callback == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "callback is NULL");
- mc_retvm_if(((subscription_type < MC_SUBSCRIPTION_TYPE_SERVER_STATE) || (subscription_type > MC_SUBSCRIPTION_TYPE_REPEAT_ABILITY)) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type [%d]", subscription_type);
+ mc_retvm_if(!_mc_util_is_valid_subscription_type(subscription_type) , MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid subscription_type");
filter_list = mc_client->updated_cb[subscription_type].filter_list;
mc_retvm_if(filter_list == NULL, MEDIA_CONTROLLER_ERROR_NONE, "No filter list for the subscription_type [%d]", subscription_type);
mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
- mc_retvm_if(((action < MC_PLAYBACK_ACTION_PLAY) || (action > MC_PLAYBACK_ACTION_TOGGLE_PLAY_PAUSE)), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
+ mc_retvm_if(!_mc_util_is_valid_playback_action(action), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
message = g_strdup_printf("%s%s%d", mc_client->client_name, MC_STRING_DELIMITER, action);
mc_retvm_if(message == NULL, MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "fail making message [%d]", ret);
mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
mc_retvm_if(!MC_STRING_VALID(playlist_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid playlist_name");
mc_retvm_if(!MC_STRING_VALID(index), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid index");
- mc_retvm_if(((action < MC_PLAYBACK_ACTION_PLAY) || (action > MC_PLAYBACK_ACTION_TOGGLE_PLAY_PAUSE)), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
+ mc_retvm_if(!_mc_util_is_valid_playback_action(action), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
message = g_strdup_printf("%s%s%s%s%s%s%d%s%llu", mc_client->client_name, MC_STRING_DELIMITER, playlist_name, MC_STRING_DELIMITER, index, MC_STRING_DELIMITER, action, MC_STRING_DELIMITER, position);
mc_retvm_if(message == NULL, MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "fail making message [%d]", ret);