[recording] hook up the options properly

This commit is contained in:
radius 2018-09-17 09:08:54 -05:00
parent eb9e8c97d6
commit ef9258449c
5 changed files with 20 additions and 21 deletions

View File

@ -2170,7 +2170,6 @@ TODO: Add a setting for these tweaks */
break; break;
case CMD_EVENT_RECORD_DEINIT: case CMD_EVENT_RECORD_DEINIT:
{ {
recording_set_state(false);
if (!recording_deinit()) if (!recording_deinit())
return false; return false;
} }

View File

@ -71,6 +71,8 @@
#include "../cheevos/cheevos.h" #include "../cheevos/cheevos.h"
#endif #endif
#include "record/record_driver.h"
enum enum
{ {
ACTION_OK_LOAD_PRESET = 0, ACTION_OK_LOAD_PRESET = 0,
@ -2681,40 +2683,34 @@ static int action_ok_cheat_reload_cheats(const char *path,
static int action_ok_start_recording(const char *path, static int action_ok_start_recording(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
/* TODO/FIXME */ streaming_set_state(false);
#if 0
streaming_set_status(false);
#endif
command_event(CMD_EVENT_RECORD_INIT, NULL); command_event(CMD_EVENT_RECORD_INIT, NULL);
return 0; return 0;
} }
static int action_ok_start_streaming(const char *path, static int action_ok_start_streaming(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
/* TODO/FIXME */ streaming_set_state(true);
#if 0
streaming_set_status(true);
#endif
command_event(CMD_EVENT_RECORD_INIT, NULL); command_event(CMD_EVENT_RECORD_INIT, NULL);
return 0; return 0;
} }
static int action_ok_stop_recording(const char *path, static int action_ok_stop_recording(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
/* TODO/FIXME */ recording_set_state(false);
streaming_set_state(false);
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
return 0; return 0;
} }
static int action_ok_stop_streaming(const char *path, static int action_ok_stop_streaming(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx) const char *label, unsigned type, size_t idx, size_t entry_idx)
{ {
/* TODO/FIXME */ recording_set_state(false);
streaming_set_state(false);
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
return 0; return 0;
} }

View File

@ -2669,16 +2669,16 @@ static int menu_displaylist_parse_load_content_settings(
} }
else else
{ {
menu_entries_append_enum(info->list, if (streaming_is_enabled())
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_STOP_RECORDING),
msg_hash_to_str(MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING),
MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING, MENU_SETTING_ACTION, 0, 0);
if (!streaming_is_enabled())
menu_entries_append_enum(info->list, menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_STOP_STREAMING), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_STOP_STREAMING),
msg_hash_to_str(MENU_ENUM_LABEL_QUICK_MENU_STOP_STREAMING), msg_hash_to_str(MENU_ENUM_LABEL_QUICK_MENU_STOP_STREAMING),
MENU_ENUM_LABEL_QUICK_MENU_STOP_STREAMING, MENU_SETTING_ACTION, 0, 0); MENU_ENUM_LABEL_QUICK_MENU_STOP_STREAMING, MENU_SETTING_ACTION, 0, 0);
else
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QUICK_MENU_STOP_RECORDING),
msg_hash_to_str(MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING),
MENU_ENUM_LABEL_QUICK_MENU_STOP_RECORDING, MENU_SETTING_ACTION, 0, 0);
} }

View File

@ -356,6 +356,8 @@ bool recording_init()
(float)av_info->timing.fps, (float)av_info->timing.fps,
(float)av_info->timing.sample_rate); (float)av_info->timing.sample_rate);
RARCH_LOG("STREAM!!! %d\n", streaming_is_enabled());
if (!string_is_empty(global->record.path)) if (!string_is_empty(global->record.path))
strlcpy(output, global->record.path, sizeof(output)); strlcpy(output, global->record.path, sizeof(output));
else else

View File

@ -164,6 +164,8 @@ bool recording_is_enabled(void);
void recording_set_state(bool state); void recording_set_state(bool state);
void streaming_set_state(bool state);
void recording_push_audio(const int16_t *data, size_t samples); void recording_push_audio(const int16_t *data, size_t samples);
void *recording_driver_get_data_ptr(void); void *recording_driver_get_data_ptr(void);