#ifndef CONFIG_H_ #define CONFIG_H_ #include #include enum dvd_access_method_t { dvdam_libdvdread, dvdam_libdvdnav }; // Access method for DVD content typedef struct mediapath_s { char *name; // Name by which the location is known in the GUI char *path; // Full pathname to the real location } mediapath_t; typedef struct mediapathlist_s { int count; // Number of path entries in list mediapath_t** list; // List of path entries } mediapathlist_t; // kissdx.h|Options object is used to store "Command Line Options" in order to populate correctly config object // The final configuration of kissdx is stored in config.h|config object // Every action and/or decision inside kissdx should be decided upon config object values // - rules: integer value should not be stored in char* type of variable // - rules: flag value should be stored in short type of variable (only viewconfig translate it to yes(1)/no(0) typedef struct config_settings_s { char config_file[PATH_MAX]; // Location of configuration file parsed char audiopath[PATH_MAX]; char videopath[PATH_MAX]; char picturepath[PATH_MAX]; mediapathlist_t extra_audiopath_list; mediapathlist_t extra_videopath_list; mediapathlist_t extra_picturepath_list; char persistentstoragepath[PATH_MAX]; char kmlfwdurl[PATH_MAX]; char pretrigger[PATH_MAX]; char posttrigger[PATH_MAX]; char directorypretrigger[PATH_MAX]; char directoryposttrigger[PATH_MAX]; char audiofileextensions[255]; char videofileextensions[255]; char picturefileextensions[255]; char isofileextensions[255]; char server_character_set[64]; // Character set of FILENAMES ON SERVER char client_character_set[64]; // Character set of KiSS PLAYER char config_character_set[64]; // Character set of CONFIG FILE CONTENTS char playlist_character_set[64]; // Character set of PLAYLIST FILE CONTENTS char subtitle_catchall_pattern[PATH_MAX]; int picturetargetwidth; int picturetargetheight; int picturemaxzoompercent; int picturecachesize; int picturecachetrimminginterval; struct in_addr listenaddress; int networktimeoutinterval; char enablehiddenfilestext[128]; int enablehiddenfilesminutes; char recentlyusedfoldername[128]; // Free text for (Recently Used) feature int max_recent_files; // admin server configuration short adminserver_port; // Default recommanded is 8003 char serversignature[255]; // Signature of kissdx responding to UDP KiSS player broadcasting short configautoload; // yes(1)/no(0) Default is no enum dvd_access_method_t dvd_access_method; char renamefiletypes[255]; short listhiddenentries; // (do not hide entry starting with '.') char pidfilepath[PATH_MAX]; short displaysequencenumbers; short loglevel; // 1=Error 2=Warning 3=Protocol 4=Information 5=Debug } config_settings_t; // Overriding: // A file named "kissdx.override" in the same directory as the media file can contain config settings // that will override kissdx behaviour for media files in that directory only. // No inheritance: A "kissdx.override" file in a parent directory of the media file HAS NO EFFECT! // In addition to overriding config settings in a config_settings_t, a "kissdx.override" file // can specify settings that are not actual options. These are stored in a config_overrides_t. typedef struct config_overrides_s { // Size that we will use to simulate a bogus file size for all media files in this directory (allowing live playback of growing files). // A value of 0 or a negative value indicates normal processing. A value > 0 causes a bogus file size to be presented to the player. long long bogusfilesize; } config_overrides_t; extern config_settings_t config; // Our (only) set of config settings (some may be overridden in this process) extern config_overrides_t config_overrides; // Our (only) set of non-config overrides (all zero means no overriding) // Rule: Each parameter that could be changed by the Admin interface (Http or CLI) need a constant extern const char *CFG_KISSDX_SRV_VERSION; //= "KISSDX_SRV_VERSION"; extern const char *CFG_KISSDX_SRV_VERSIONDATE; //= "KISSDX_SRV_VERSIONDATE"; extern const char *CFG_KISSDX_LNCH_ARGUMENT; //= "LAUNCH_COMMANDLINE_ARG"; extern const char *CFG_KISSDX_LNCH_CUSTOPTION; //= "LAUNCH_COMMANDLINE_CUSTOPTION"; extern const char *CFG_KISSDX_LNCH_DATETIME; //= "LAUNCH_DATETIME"; extern const char *CFG_VERBOSE_LOG_LEVEL; //= "VERBOSE_LOG_LEVEL"; extern const char *CFG_LIST_HIDDEN_ENTRY; //= "LIST_HIDDEN_ENTRY"; extern const char *CFG_DISPLAY_SEQ_NUMBER; //= "DISPLAY_SEQ_NUMBER"; extern const char *CFG_CONFIG_AUTOLOAD; //= "CONFIG_AUTOLOAD"; //extern const char *CFG_; //= ""; extern const char *CFG_MST_PATH_AUDIO; //= "MST_PATH_AUDIO"; extern const char *CFG_MST_PATH_PICTURE; //= "MST_PATH_PICTURE"; extern const char *CFG_MST_PATH_VIDEO; //= "MST_PATH_VIDEO"; // === Set of default language value for options extern const char *DefLang_recentlyUsedFolderName; //= "[Recently used]" extern const char *Default_serversignature; int parse_config(config_settings_t *config_p, const char *overridingFilePath); void free_config(config_settings_t *config_p); void show_current_config_Verbose(const config_settings_t *config_p); void send_txt_config (int sd_client, const config_settings_t *config_p); #endif /*CONFIG_H_*/