Commit 77308285 authored by twinaphex's avatar twinaphex
Browse files

Start implementing dropdown list for resolution - Win32 right now at first -...

Start implementing dropdown list for resolution - Win32 right now at first - now need to make OK button do something
parent ab8e0261
......@@ -282,38 +282,43 @@ static bool win32_display_server_set_resolution(void *data,
return true;
}
unsigned win32_display_server_get_resolution_list(void *data,
struct video_display_config **conf)
void *win32_display_server_get_resolution_list(void *data,
unsigned *len)
{
unsigned i;
unsigned len = 0;
unsigned i, count = 0;
struct video_display_config *conf = NULL;
for (i = 0;; i++)
{
void *optr = NULL;
DEVMODE dm;
if (!win32_get_video_output(&dm, i, sizeof(dm)))
continue;
break;
count++;
}
*len = count;
conf = (struct video_display_config*)calloc(*len, sizeof(struct video_display_config));
if (!conf)
return NULL;
for (i = 0;; i++)
{
DEVMODE dm;
if (!win32_get_video_output(&dm, i, sizeof(dm)))
break;
len++;
if (*conf)
optr = realloc(*conf, len);
else
optr = malloc(len);
if (optr)
*conf = optr;
conf[i]->width = dm.dmPelsWidth;
conf[i]->height = dm.dmPelsHeight;
conf[i]->bpp = dm.dmBitsPerPel;
conf[i]->refreshrate = dm.dmDisplayFrequency;
conf[i]->idx = i;
conf[i].width = dm.dmPelsWidth;
conf[i].height = dm.dmPelsHeight;
conf[i].bpp = dm.dmBitsPerPel;
conf[i].refreshrate = dm.dmDisplayFrequency;
conf[i].idx = i;
}
return len;
return conf;
}
const video_display_server_t dispserv_win32 = {
......
......@@ -98,11 +98,11 @@ bool video_display_server_switch_resolution(unsigned width, unsigned height,
return false;
}
unsigned video_display_server_get_resolution_list(struct video_display_config **list)
void *video_display_server_get_resolution_list(unsigned *size)
{
if (current_display_server && current_display_server->get_resolution_list)
return current_display_server->get_resolution_list(current_display_server_data, list);
return 0;
return current_display_server->get_resolution_list(current_display_server_data, size);
return NULL;
}
const char *video_display_server_get_output_options(void)
......
......@@ -42,8 +42,8 @@ typedef struct video_display_server
bool (*set_window_decorations)(void *data, bool on);
bool (*switch_resolution)(void *data, unsigned width,
unsigned height, int int_hz, float hz, int center);
unsigned (*get_resolution_list)(void *data,
struct video_display_config **conf);
void *(*get_resolution_list)(void *data,
unsigned *size);
const char *(*get_output_options)(void *data);
const char *ident;
} video_display_server_t;
......@@ -62,8 +62,7 @@ bool video_display_server_switch_resolution(
unsigned width, unsigned height,
int int_hz, float hz, int center);
unsigned video_display_server_get_resolution_list(
struct video_display_config **list);
void *video_display_server_get_resolution_list(unsigned *size);
const char *video_display_server_get_output_options(void);
......
......@@ -1491,15 +1491,6 @@ void video_driver_menu_settings(void **list_data, void *list_info_data,
(void)subgroup_info;
(void)global;
#if defined(GEKKO) || defined(__CELLOS_LV2__)
CONFIG_ACTION(
list, list_info,
MENU_ENUM_LABEL_SCREEN_RESOLUTION,
MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION,
group_info,
subgroup_info,
parent_group);
#endif
#if defined(__CELLOS_LV2__)
CONFIG_BOOL(
list, list_info,
......
......@@ -259,6 +259,8 @@ MSG_HASH(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST,
"deferred_dropdown_box_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SPECIAL,
"deferred_dropdown_box_list_special")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION,
"deferred_dropdown_box_list_resolution")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_CONFIGURATIONS_LIST,
"deferred_configurations_list")
MSG_HASH(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_LIST,
......
......@@ -613,6 +613,7 @@ generic_deferred_push_clear_general(deferred_image_history_list, PUSH_DEFAULT, D
generic_deferred_push_clear_general(deferred_video_history_list, PUSH_DEFAULT, DISPLAYLIST_VIDEO_HISTORY)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_special, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_SPECIAL)
generic_deferred_push_clear_general(deferred_push_dropdown_box_list_resolution, PUSH_DEFAULT, DISPLAYLIST_DROPDOWN_LIST_RESOLUTION)
static int menu_cbs_init_bind_deferred_push_compare_label(
menu_file_list_cbs_t *cbs,
......@@ -633,6 +634,11 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_dropdown_box_list_special);
return 0;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_dropdown_box_list_resolution);
return 0;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_browse_url_list);
......
......@@ -150,6 +150,8 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_SPECIAL:
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SPECIAL;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_RESOLUTION:
return MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION;
case ACTION_OK_DL_MIXER_STREAM_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_MIXER_STREAM_SETTINGS_LIST;
case ACTION_OK_DL_ACCOUNTS_LIST:
......@@ -323,6 +325,15 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SPECIAL;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_DROPDOWN_BOX_LIST_RESOLUTION:
info.type = type;
info.directory_ptr = idx;
info_path = path;
info_label = msg_hash_to_str(
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_USER_BINDS_LIST:
info.type = type;
info.directory_ptr = idx;
......@@ -4449,6 +4460,18 @@ static int action_ok_push_dropdown_item(const char *path,
return 0;
}
static int action_ok_push_dropdown_item_resolution(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
RARCH_LOG("dropdown: \n");
RARCH_LOG("path: %s \n", path);
RARCH_LOG("label: %s \n", label);
RARCH_LOG("type: %d \n", type);
RARCH_LOG("idx: %d \n", idx);
RARCH_LOG("entry_idx: %d \n", entry_idx);
return 0;
}
static int action_ok_push_default(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
......@@ -4587,6 +4610,7 @@ default_action_ok_help(action_ok_help_load_content, MENU_ENUM_LABEL_HELP_LOADING
static int action_ok_video_resolution(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
#if defined(__CELLOS_LV2__) || defined(GEKKO)
unsigned width = 0;
unsigned height = 0;
......@@ -4610,6 +4634,12 @@ static int action_ok_video_resolution(const char *path,
width, height);
runloop_msg_queue_push(msg, 1, 100, true);
}
#else
generic_action_ok_displaylist_push(
NULL,
NULL, NULL, 0, 0, 0,
ACTION_OK_DL_DROPDOWN_BOX_LIST_RESOLUTION);
#endif
return 0;
}
......@@ -5555,6 +5585,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case MENU_SETTING_DROPDOWN_ITEM:
BIND_ACTION_OK(cbs, action_ok_push_dropdown_item);
break;
case MENU_SETTING_DROPDOWN_ITEM_RESOLUTION:
BIND_ACTION_OK(cbs, action_ok_push_dropdown_item_resolution);
break;
case MENU_SETTING_ACTION_CORE_DISK_OPTIONS:
BIND_ACTION_OK(cbs, action_ok_push_default);
break;
......
......@@ -1251,6 +1251,12 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
BIND_ACTION_GET_TITLE(cbs, action_get_title_dropdown_item);
return 0;
}
if (string_is_equal(label,
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_title_dropdown_item);
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_quick_menu_views_settings_list);
......
......@@ -45,6 +45,7 @@ enum
ACTION_OK_DL_DEFAULT = 0,
ACTION_OK_DL_DROPDOWN_BOX_LIST,
ACTION_OK_DL_DROPDOWN_BOX_LIST_SPECIAL,
ACTION_OK_DL_DROPDOWN_BOX_LIST_RESOLUTION,
ACTION_OK_DL_OPEN_ARCHIVE,
ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE,
ACTION_OK_DL_MUSIC,
......
This diff is collapsed.
......@@ -56,6 +56,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_NONE = 0,
DISPLAYLIST_DROPDOWN_LIST,
DISPLAYLIST_DROPDOWN_LIST_SPECIAL,
DISPLAYLIST_DROPDOWN_LIST_RESOLUTION,
DISPLAYLIST_INFO,
DISPLAYLIST_HELP,
DISPLAYLIST_HELP_SCREEN_LIST,
......
......@@ -143,6 +143,7 @@ enum menu_settings_type
MENU_ADD_TAB,
MENU_PLAYLISTS_TAB,
MENU_SETTING_DROPDOWN_ITEM,
MENU_SETTING_DROPDOWN_ITEM_RESOLUTION,
MENU_SETTING_DROPDOWN_SETTING_CORE_OPTIONS_ITEM,
MENU_SETTING_DROPDOWN_SETTING_STRING_OPTIONS_ITEM,
MENU_SETTING_DROPDOWN_SETTING_FLOAT_ITEM,
......
......@@ -5381,6 +5381,14 @@ static bool setting_append_list(
CMD_EVENT_VIDEO_APPLY_STATE_CHANGES);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_ACTION(
list, list_info,
MENU_ENUM_LABEL_SCREEN_RESOLUTION,
MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION,
&group_info,
&subgroup_info,
parent_group);
CONFIG_UINT(
list, list_info,
&custom_vp->width,
......
......@@ -1015,6 +1015,7 @@ enum msg_hash_enums
/* Deferred */
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST,
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_SPECIAL,
MENU_ENUM_LABEL_DEFERRED_DROPDOWN_BOX_LIST_RESOLUTION,
MENU_ENUM_LABEL_DEFERRED_MIXER_STREAM_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_CONFIGURATIONS_LIST,
MENU_ENUM_LABEL_DEFERRED_FAVORITES_LIST,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment