<commit_before>// Copyright (c) 2013, <NAME>
/*! 
    \file
    \mainpage AIMP Control RPC functionality
*/
#pragma once

#include "aimp/manager.h"
#include "method.h"
#include "value.h"
#include "utils.h"
#include "utils/sqlite_util.h"

#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/assign/std.hpp>
#include <boost/bind.hpp>

#include "sqlite/sqlite.h"

namespace MultiUserMode { class MultiUserModeManager; }

namespace Rpc { class DelayedResponseSender; }

/*! contains RPC methods definitions.

    #ERROR_CODES \internal This must be mentioned to proper generation links to values of this enum \endinternal
*/
namespace AimpRpcMethods
{

/*!
    \page ids_info Playlist/track identifiers
    \section special_ids_sec Special IDs
    ID -1 is used as currently playing playlist/track.
    \section misc_sec Miscellaneous
    On AIMP3+ playlist ID is not needed because of track ID is unique there.
*/

/*!
    \page non_rpc_features Other features
    \section track_download_sec Downloading track
        Use GET request to URI /downloadTrack/playlist_id/\<playlst_id\>/track_id/\<track_id\>
    \section track_upload_sec Uploading track
        Use POST request with multipart form data content to URI /uploadTrack/playlist_id/\<playlst_id\><BR>
        Multiple file upload in one request is supported.<BR>
        Internet radio URL adding to playlist is also supported by using text input field type. But URL can be added in more convenient way by AddURLToPlaylist.
*/

/*!
    \brief Error codes which RPC functions return.
    \internal Use codes in range [11-1000] for RPC methods errors. Rpc server uses range [1-10] for its errors. \endinternal
*/
enum ERROR_CODES { 
                   WRONG_ARGUMENT = 11, /*!< arguments passed in function can't be processed. Reasons: missing required arg, wrong type & etc. */
                   PLAYBACK_FAILED = 12, /*!< Track does not exist or track source is not available. */ 
                   SHUFFLE_MODE_SET_FAILED = 13, /*!< can't update shuffle mode. */
                   REPEAT_MODE_SET_FAILED = 14, /*!< can't update repeat mode. */
                   VOLUME_OUT_OF_RANGE = 15, /*!< volume level value is out of range [0, 100]. */
                   VOLUME_SET_FAILED = 16, /*!< can't update volume level. */
                   MUTE_SET_FAILED = 17, /*!< can't update mute mode. */<commit_msg>update 'track download/upload' doc page.<commit_after>// Copyright (c) 2013, <NAME>
/*! 
    \file
    \mainpage AIMP Control RPC functionality
*/
#pragma once

#include "aimp/manager.h"
#include "method.h"
#include "value.h"
#include "utils.h"
#include "utils/sqlite_util.h"

#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/assign/std.hpp>
#include <boost/bind.hpp>

#include "sqlite/sqlite.h"

namespace MultiUserMode { class MultiUserModeManager; }

namespace Rpc { class DelayedResponseSender; }

/*! contains RPC methods definitions.

    #ERROR_CODES \internal This must be mentioned to proper generation links to values of this enum \endinternal
*/
namespace AimpRpcMethods
{

/*!
    \page ids_info Playlist/track identifiers
    \section special_ids_sec Special IDs
    ID -1 is used as currently playing playlist/track.
    \section misc_sec Miscellaneous
    On AIMP3+ playlist ID is not needed because of track ID is unique there.
*/

/*!
    \page non_rpc_features Other features
    \section track_download_sec Downloading track
        Use GET request to URI /downloadTrack/playlist_id/\<playlst_id\>/track_id/\<track_id\>
    \section track_upload_sec Uploading track
        Use POST request with multipart form data content to URI /uploadTrack/playlist_id/\<playlst_id\><BR>
        Multiple file upload in one request is supported.<BR>
        Files will be stored at "%TMP%\Control plugin" directory.<BR>
        Internet radio URL adding to playlist is also supported by using text input field type. But URL can be added in more convenient way by AddURLToPlaylist.
*/

/*!
    \brief Error codes which RPC functions return.
    \internal Use codes in range [11-1000] for RPC methods errors. Rpc server uses range [1-10] for its errors. \endinternal
*/
enum ERROR_CODES { 
                   WRONG_ARGUMENT = 11, /*!< arguments passed in function can't be processed. Reasons: missing required arg, wrong type & etc. */
                   PLAYBACK_FAILED = 12, /*!< Track does not exist or track source is not available. */ 
                   SHUFFLE_MODE_SET_FAILED = 13, /*!< can't update shuffle mode. */
                   REPEAT_MODE_SET_FAILED = 14, /*!< can't update repeat mode. */
                   VOLUME_OUT_OF_RANGE = 15, /*!< volume level value is out of range [0, 100]. */
                   VOLUME_SET_FAILED = 16, /*!< can't update volume level. */
                   MUTE_SET_FAILED = 17, /*!< can't update mute mode. */
{'fraction_non_alphanumeric': 0.09589310277068186, 'fraction_numerical': 0.01296914914521517, 'mean_word_length': 3.011032308904649, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1828504', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1462, 'n_words': 520}