Documented TAS Editor classes
This commit is contained in:
parent
2b0fbdf61d
commit
b38fa3e73d
|
@ -321,7 +321,7 @@ static CFGSTRUCT fceuconfig[] = {
|
|||
AC(taseditor_config.combine_consecutive_rec),
|
||||
AC(taseditor_config.use_1p_rec),
|
||||
AC(taseditor_config.columnset_by_keys),
|
||||
AC(taseditor_config.keyboard_for_listview),
|
||||
AC(taseditor_config.keyboard_for_piano_roll),
|
||||
AC(taseditor_config.superimpose_affects_paste),
|
||||
AC(taseditor_config.branch_full_movie),
|
||||
AC(taseditor_config.branch_only_when_rec),
|
||||
|
@ -343,7 +343,7 @@ static CFGSTRUCT fceuconfig[] = {
|
|||
AC(taseditor_config.savecompact_bookmarks),
|
||||
AC(taseditor_config.savecompact_greenzone),
|
||||
AC(taseditor_config.savecompact_history),
|
||||
AC(taseditor_config.savecompact_list),
|
||||
AC(taseditor_config.savecompact_piano_roll),
|
||||
AC(taseditor_config.savecompact_selection),
|
||||
AC(taseditor_config.findnote_matchcase),
|
||||
AC(taseditor_config.findnote_search_up),
|
||||
|
|
|
@ -286,7 +286,7 @@ BEGIN
|
|||
MENUITEM "Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "Use 1P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "Use Input keys for Column Set", ID_CONFIG_USEINPUTKEYSFORCOLUMNSET,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "Allow keyboard controls in Piano Roll", ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "Allow keyboard controls in Piano Roll", ID_CONFIG_KEYBOARDCONTROLSINPIANOROLL,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "Superimpose affects copy/paste", ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM "ColumnSet Pattern skips Lag", ID_CONFIG_COLUMNSETPATTERNSKIPSLAG,MFT_STRING,MFS_ENABLED
|
||||
MENUITEM MFT_SEPARATOR
|
||||
|
@ -1492,7 +1492,7 @@ BEGIN
|
|||
CONTROL " Bookmarks",IDC_CHECK_BOOKMARKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,37,67,10
|
||||
CONTROL " Greenzone",IDC_CHECK_GREENZONE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,52,67,10
|
||||
CONTROL " History",IDC_CHECK_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,67,67,10
|
||||
CONTROL " Piano Roll",IDC_CHECK_LIST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,82,67,10
|
||||
CONTROL " Piano Roll",IDC_CHECK_PIANO_ROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,82,67,10
|
||||
CONTROL " Selection",IDC_CHECK_SELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,97,67,10
|
||||
END
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@
|
|||
#define IDC_CHECK_SELECTION 1208
|
||||
#define IDC_C_RESET 1209
|
||||
#define IDC_CHECK8 1209
|
||||
#define IDC_CHECK_LIST 1209
|
||||
#define IDC_CHECK_PIANO_ROLL 1209
|
||||
#define IDC_C_ELIMINATE 1210
|
||||
#define IDC_LESSTHAN 1211
|
||||
#define IDC_MORETHAN 1212
|
||||
|
@ -960,7 +960,7 @@
|
|||
#define ID_SELECTED_SETMARKER 40498
|
||||
#define ID_SELECTED_CLEARMARKER 40499
|
||||
#define ID_SELECTED_REMOVEMARKER40500 40500
|
||||
#define ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW 40501
|
||||
#define ID_CONFIG_KEYBOARDCONTROLSINPIANOROLL 40501
|
||||
#define ACCEL_CTRL_PGUP 40502
|
||||
#define ACCEL_CTRL_PGDN 40503
|
||||
#define ACCEL_SHIFT_PGUP 40504
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Main TAS Editor file
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Main - Logical center of the program
|
||||
[Singleton]
|
||||
* the point of launching TAS Editor from emulator
|
||||
* the point of quitting from TAS Editor
|
||||
* regularly (at the end of every frame) updates all modules that need regular update
|
||||
* implements operations of the "File" menu: creating New project, opening a file, saving, compact saving, import, export
|
||||
* stores Autofire Patterns data and their loading/generating code
|
||||
* stores resources: patterns filename, id of buttonpresses in patterns
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include <fstream>
|
||||
#include "taseditor/taseditor_project.h"
|
||||
#include "utils/xstring.h"
|
||||
|
@ -24,9 +40,9 @@ GREENZONE greenzone;
|
|||
MARKERS_MANAGER markers_manager;
|
||||
BOOKMARKS bookmarks;
|
||||
POPUP_DISPLAY popup_display;
|
||||
TASEDITOR_LIST list;
|
||||
PIANO_ROLL piano_roll;
|
||||
TASEDITOR_LUA taseditor_lua;
|
||||
TASEDITOR_SELECTION selection;
|
||||
SELECTION selection;
|
||||
SPLICER splicer;
|
||||
|
||||
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
|
||||
|
@ -46,7 +62,212 @@ extern void TaseditorManualFunction();
|
|||
char patternsFilename[] = "\\taseditor_patterns.txt";
|
||||
char autofire_patterns_flagpress = 49; // "1"
|
||||
|
||||
// enterframe function
|
||||
bool EnterTasEditor()
|
||||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_TASEDITOR)) return false;
|
||||
if(!taseditor_window.hwndTasEditor)
|
||||
{
|
||||
// start TAS Editor
|
||||
|
||||
// init/load autofire_patterns
|
||||
int total_patterns = 0;
|
||||
autofire_patterns.resize(total_patterns);
|
||||
autofire_patterns_names.resize(total_patterns);
|
||||
char nameo[2048];
|
||||
strncpy(nameo, FCEU_GetPath(FCEUMKF_TASEDITOR).c_str(), 2047);
|
||||
strncat(nameo, patternsFilename, 2047 - strlen(nameo));
|
||||
EMUFILE_FILE ifs(nameo, "rb");
|
||||
if(!ifs.fail())
|
||||
{
|
||||
std::string tempstr1, tempstr2;
|
||||
while (ReadString(&ifs, tempstr1))
|
||||
{
|
||||
if (ReadString(&ifs, tempstr2))
|
||||
{
|
||||
total_patterns++;
|
||||
// save the name
|
||||
autofire_patterns_names.push_back(tempstr1);
|
||||
// parse 2nd string to sequence of 1s and 0s
|
||||
autofire_patterns.resize(total_patterns);
|
||||
autofire_patterns[total_patterns - 1].resize(tempstr2.size());
|
||||
for (int i = tempstr2.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if (tempstr2[i] == autofire_patterns_flagpress)
|
||||
autofire_patterns[total_patterns - 1][i] = 1;
|
||||
else
|
||||
autofire_patterns[total_patterns - 1][i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
FCEU_printf("Could not load tools\\taseditor_patterns.txt!\n");
|
||||
}
|
||||
if (autofire_patterns.size() == 0)
|
||||
{
|
||||
FCEU_printf("Will be using default set of patterns...\n");
|
||||
autofire_patterns.resize(4);
|
||||
autofire_patterns_names.resize(4);
|
||||
// Default Pattern 0: Alternating (1010...)
|
||||
autofire_patterns_names[0] = "Alternating (1010...)";
|
||||
autofire_patterns[0].resize(2);
|
||||
autofire_patterns[0][0] = 1;
|
||||
autofire_patterns[0][1] = 0;
|
||||
// Default Pattern 1: Alternating at 30FPS (11001100...)
|
||||
autofire_patterns_names[1] = "Alternating at 30FPS (11001100...)";
|
||||
autofire_patterns[1].resize(4);
|
||||
autofire_patterns[1][0] = 1;
|
||||
autofire_patterns[1][1] = 1;
|
||||
autofire_patterns[1][2] = 0;
|
||||
autofire_patterns[1][3] = 0;
|
||||
// Default Pattern 2: One Quarter (10001000...)
|
||||
autofire_patterns_names[2] = "One Quarter (10001000...)";
|
||||
autofire_patterns[2].resize(4);
|
||||
autofire_patterns[2][0] = 1;
|
||||
autofire_patterns[2][1] = 0;
|
||||
autofire_patterns[2][2] = 0;
|
||||
autofire_patterns[2][3] = 0;
|
||||
// Default Pattern 3: Tap'n'Hold (1011111111111111111111111111111111111...)
|
||||
autofire_patterns_names[3] = "Tap'n'Hold (101111111...)";
|
||||
autofire_patterns[3].resize(1000);
|
||||
autofire_patterns[3][0] = 1;
|
||||
autofire_patterns[3][1] = 0;
|
||||
for (int i = 2; i < 1000; ++i)
|
||||
autofire_patterns[3][i] = 1;
|
||||
}
|
||||
// reset current_pattern if it's outside the range
|
||||
if (taseditor_config.current_pattern < 0 || taseditor_config.current_pattern >= (int)autofire_patterns.size())
|
||||
taseditor_config.current_pattern = 0;
|
||||
|
||||
// create window
|
||||
taseditor_window.init();
|
||||
if(taseditor_window.hwndTasEditor)
|
||||
{
|
||||
// save "eoptions"
|
||||
saved_eoptions = eoptions;
|
||||
// set "Run in background"
|
||||
eoptions |= EO_BGRUN;
|
||||
// "Set high-priority thread"
|
||||
eoptions |= EO_HIGHPRIO;
|
||||
DoPriority();
|
||||
// clear "Disable speed throttling"
|
||||
eoptions &= ~EO_NOTHROTTLE;
|
||||
// switch off autosaves
|
||||
saved_EnableAutosave = EnableAutosave;
|
||||
EnableAutosave = 0;
|
||||
UpdateCheckedMenuItems();
|
||||
|
||||
// init modules
|
||||
piano_roll.init();
|
||||
selection.init();
|
||||
splicer.init();
|
||||
playback.init();
|
||||
greenzone.init();
|
||||
recorder.init();
|
||||
markers_manager.init();
|
||||
project.init();
|
||||
bookmarks.init();
|
||||
popup_display.init();
|
||||
history.init();
|
||||
taseditor_lua.init();
|
||||
// either start new movie or use current movie
|
||||
if (FCEUMOV_Mode(MOVIEMODE_INACTIVE))
|
||||
{
|
||||
// create new movie
|
||||
FCEUI_StopMovie();
|
||||
movieMode = MOVIEMODE_TASEDITOR;
|
||||
CreateCleanMovie();
|
||||
playback.StartFromZero();
|
||||
} else
|
||||
{
|
||||
// use current movie to create a new project
|
||||
if (currMovieData.savestate.size() != 0)
|
||||
{
|
||||
FCEUD_PrintError("This version of TAS Editor doesn't work with movies starting from savestate.");
|
||||
// delete savestate, but preserve input anyway
|
||||
currMovieData.savestate.clear();
|
||||
}
|
||||
FCEUI_StopMovie();
|
||||
movieMode = MOVIEMODE_TASEDITOR;
|
||||
currMovieData.emuVersion = FCEU_VERSION_NUMERIC;
|
||||
}
|
||||
// ensure that movie has correct set of ports/fourscore
|
||||
SetInputType(currMovieData, GetInputType(currMovieData));
|
||||
// force the input configuration stored in the movie to apply to FCEUX config
|
||||
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||
// reset some modules that need MovidData info
|
||||
piano_roll.reset();
|
||||
recorder.reset();
|
||||
// create initial snapshot in history
|
||||
history.reset();
|
||||
// reset Taseditor variables
|
||||
must_call_manual_lua_function = false;
|
||||
|
||||
SetFocus(history.hwndHistoryList); // set focus only once, to show selection cursor
|
||||
SetFocus(piano_roll.hwndList);
|
||||
FCEU_DispMessage("TAS Editor engaged", 0);
|
||||
taseditor_window.RedrawTaseditor();
|
||||
return true;
|
||||
} else return false;
|
||||
} else return true;
|
||||
}
|
||||
// returns false if couldn't real a string containing at least one char
|
||||
bool ReadString(EMUFILE *is, std::string& dest)
|
||||
{
|
||||
dest.resize(0);
|
||||
int c;
|
||||
while (true)
|
||||
{
|
||||
c = is->fgetc();
|
||||
if (c < 0) break;
|
||||
if (c == 10 || c == 13) // end of line
|
||||
{
|
||||
if (dest.size())
|
||||
break; // already collected at least one char
|
||||
else
|
||||
continue; // skip the char and continue searching
|
||||
} else
|
||||
{
|
||||
dest.push_back(c);
|
||||
}
|
||||
}
|
||||
return dest.size() != 0;
|
||||
}
|
||||
|
||||
bool ExitTasEditor()
|
||||
{
|
||||
if (!AskSaveProject()) return false;
|
||||
|
||||
// free autofire_patterns
|
||||
autofire_patterns.resize(0);
|
||||
autofire_patterns_names.resize(0);
|
||||
|
||||
// destroy window
|
||||
taseditor_window.exit();
|
||||
// release memory
|
||||
piano_roll.free();
|
||||
markers_manager.free();
|
||||
greenzone.free();
|
||||
bookmarks.free();
|
||||
popup_display.free();
|
||||
history.free();
|
||||
playback.SeekingStop();
|
||||
selection.free();
|
||||
|
||||
// restore "eoptions"
|
||||
eoptions = saved_eoptions;
|
||||
// restore autosaves
|
||||
EnableAutosave = saved_EnableAutosave;
|
||||
DoPriority();
|
||||
UpdateCheckedMenuItems();
|
||||
// switch off taseditor mode
|
||||
movieMode = MOVIEMODE_INACTIVE;
|
||||
FCEU_DispMessage("TAS Editor disengaged", 0);
|
||||
CreateCleanMovie();
|
||||
return true;
|
||||
}
|
||||
|
||||
// everyframe function
|
||||
void UpdateTasEditor()
|
||||
{
|
||||
if(!taseditor_window.hwndTasEditor)
|
||||
|
@ -58,7 +279,7 @@ void UpdateTasEditor()
|
|||
|
||||
// update all modules that need to be updated every frame
|
||||
recorder.update();
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
markers_manager.update();
|
||||
greenzone.update();
|
||||
playback.update();
|
||||
|
@ -187,7 +408,7 @@ void NewProject()
|
|||
playback.StartFromZero();
|
||||
bookmarks.reset();
|
||||
history.reset();
|
||||
list.reset();
|
||||
piano_roll.reset();
|
||||
selection.reset();
|
||||
splicer.reset();
|
||||
recorder.reset();
|
||||
|
@ -303,7 +524,7 @@ void SaveCompact_GetCheckboxes(HWND hwndDlg)
|
|||
taseditor_config.savecompact_bookmarks = (SendDlgItemMessage(hwndDlg, IDC_CHECK_BOOKMARKS, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
taseditor_config.savecompact_greenzone = (SendDlgItemMessage(hwndDlg, IDC_CHECK_GREENZONE, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
taseditor_config.savecompact_history = (SendDlgItemMessage(hwndDlg, IDC_CHECK_HISTORY, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
taseditor_config.savecompact_list = (SendDlgItemMessage(hwndDlg, IDC_CHECK_LIST, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
taseditor_config.savecompact_piano_roll = (SendDlgItemMessage(hwndDlg, IDC_CHECK_PIANO_ROLL, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
taseditor_config.savecompact_selection = (SendDlgItemMessage(hwndDlg, IDC_CHECK_SELECTION, BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
}
|
||||
|
||||
|
@ -337,7 +558,7 @@ BOOL CALLBACK SaveCompactProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
|
|||
CheckDlgButton(hwndDlg, IDC_CHECK_BOOKMARKS, taseditor_config.savecompact_bookmarks?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg, IDC_CHECK_GREENZONE, taseditor_config.savecompact_greenzone?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg, IDC_CHECK_HISTORY, taseditor_config.savecompact_history?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg, IDC_CHECK_LIST, taseditor_config.savecompact_list?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg, IDC_CHECK_PIANO_ROLL, taseditor_config.savecompact_piano_roll?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckDlgButton(hwndDlg, IDC_CHECK_SELECTION, taseditor_config.savecompact_selection?MF_CHECKED : MF_UNCHECKED);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -399,7 +620,7 @@ void SaveCompact()
|
|||
|
||||
if(GetSaveFileName(&ofn)) //If it is a valid filename
|
||||
{
|
||||
project.save_compact(nameo, taseditor_config.savecompact_binary, taseditor_config.savecompact_markers, taseditor_config.savecompact_bookmarks, taseditor_config.savecompact_greenzone, taseditor_config.savecompact_history, taseditor_config.savecompact_list, taseditor_config.savecompact_selection);
|
||||
project.save_compact(nameo, taseditor_config.savecompact_binary, taseditor_config.savecompact_markers, taseditor_config.savecompact_bookmarks, taseditor_config.savecompact_greenzone, taseditor_config.savecompact_history, taseditor_config.savecompact_piano_roll, taseditor_config.savecompact_selection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -568,211 +789,6 @@ void Export()
|
|||
}
|
||||
}
|
||||
|
||||
// returns false if couldn't real a string containing at least one char
|
||||
bool ReadString(EMUFILE *is, std::string& dest)
|
||||
{
|
||||
dest.resize(0);
|
||||
int c;
|
||||
while (true)
|
||||
{
|
||||
c = is->fgetc();
|
||||
if (c < 0) break;
|
||||
if (c == 10 || c == 13) // end of line
|
||||
{
|
||||
if (dest.size())
|
||||
break; // already collected at least one char
|
||||
else
|
||||
continue; // skip the char and continue searching
|
||||
} else
|
||||
{
|
||||
dest.push_back(c);
|
||||
}
|
||||
}
|
||||
return dest.size() != 0;
|
||||
}
|
||||
bool EnterTasEditor()
|
||||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_TASEDITOR)) return false;
|
||||
if(!taseditor_window.hwndTasEditor)
|
||||
{
|
||||
// start TAS Editor
|
||||
|
||||
// init/load autofire_patterns
|
||||
int total_patterns = 0;
|
||||
autofire_patterns.resize(total_patterns);
|
||||
autofire_patterns_names.resize(total_patterns);
|
||||
char nameo[2048];
|
||||
strncpy(nameo, FCEU_GetPath(FCEUMKF_TASEDITOR).c_str(), 2047);
|
||||
strncat(nameo, patternsFilename, 2047 - strlen(nameo));
|
||||
EMUFILE_FILE ifs(nameo, "rb");
|
||||
if(!ifs.fail())
|
||||
{
|
||||
std::string tempstr1, tempstr2;
|
||||
while (ReadString(&ifs, tempstr1))
|
||||
{
|
||||
if (ReadString(&ifs, tempstr2))
|
||||
{
|
||||
total_patterns++;
|
||||
// save the name
|
||||
autofire_patterns_names.push_back(tempstr1);
|
||||
// parse 2nd string to sequence of 1s and 0s
|
||||
autofire_patterns.resize(total_patterns);
|
||||
autofire_patterns[total_patterns - 1].resize(tempstr2.size());
|
||||
for (int i = tempstr2.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if (tempstr2[i] == autofire_patterns_flagpress)
|
||||
autofire_patterns[total_patterns - 1][i] = 1;
|
||||
else
|
||||
autofire_patterns[total_patterns - 1][i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
FCEU_printf("Could not load tools\\taseditor_patterns.txt!\n");
|
||||
}
|
||||
if (autofire_patterns.size() == 0)
|
||||
{
|
||||
FCEU_printf("Will be using default set of patterns...\n");
|
||||
autofire_patterns.resize(4);
|
||||
autofire_patterns_names.resize(4);
|
||||
// Default Pattern 0: Alternating (1010...)
|
||||
autofire_patterns_names[0] = "Alternating (1010...)";
|
||||
autofire_patterns[0].resize(2);
|
||||
autofire_patterns[0][0] = 1;
|
||||
autofire_patterns[0][1] = 0;
|
||||
// Default Pattern 1: Alternating at 30FPS (11001100...)
|
||||
autofire_patterns_names[1] = "Alternating at 30FPS (11001100...)";
|
||||
autofire_patterns[1].resize(4);
|
||||
autofire_patterns[1][0] = 1;
|
||||
autofire_patterns[1][1] = 1;
|
||||
autofire_patterns[1][2] = 0;
|
||||
autofire_patterns[1][3] = 0;
|
||||
// Default Pattern 2: One Quarter (10001000...)
|
||||
autofire_patterns_names[2] = "One Quarter (10001000...)";
|
||||
autofire_patterns[2].resize(4);
|
||||
autofire_patterns[2][0] = 1;
|
||||
autofire_patterns[2][1] = 0;
|
||||
autofire_patterns[2][2] = 0;
|
||||
autofire_patterns[2][3] = 0;
|
||||
// Default Pattern 3: Tap'n'Hold (1011111111111111111111111111111111111...)
|
||||
autofire_patterns_names[3] = "Tap'n'Hold (101111111...)";
|
||||
autofire_patterns[3].resize(1000);
|
||||
autofire_patterns[3][0] = 1;
|
||||
autofire_patterns[3][1] = 0;
|
||||
for (int i = 2; i < 1000; ++i)
|
||||
autofire_patterns[3][i] = 1;
|
||||
}
|
||||
// reset current_pattern if it's outside the range
|
||||
if (taseditor_config.current_pattern < 0 || taseditor_config.current_pattern >= (int)autofire_patterns.size())
|
||||
taseditor_config.current_pattern = 0;
|
||||
|
||||
// create window
|
||||
taseditor_window.init();
|
||||
if(taseditor_window.hwndTasEditor)
|
||||
{
|
||||
// save "eoptions"
|
||||
saved_eoptions = eoptions;
|
||||
// set "Run in background"
|
||||
eoptions |= EO_BGRUN;
|
||||
// "Set high-priority thread"
|
||||
eoptions |= EO_HIGHPRIO;
|
||||
DoPriority();
|
||||
// clear "Disable speed throttling"
|
||||
eoptions &= ~EO_NOTHROTTLE;
|
||||
// switch off autosaves
|
||||
saved_EnableAutosave = EnableAutosave;
|
||||
EnableAutosave = 0;
|
||||
UpdateCheckedMenuItems();
|
||||
|
||||
// init modules
|
||||
list.init();
|
||||
selection.init();
|
||||
splicer.init();
|
||||
playback.init();
|
||||
greenzone.init();
|
||||
recorder.init();
|
||||
markers_manager.init();
|
||||
project.init();
|
||||
bookmarks.init();
|
||||
popup_display.init();
|
||||
history.init();
|
||||
taseditor_lua.init();
|
||||
// either start new movie or use current movie
|
||||
if (FCEUMOV_Mode(MOVIEMODE_INACTIVE))
|
||||
{
|
||||
// create new movie
|
||||
FCEUI_StopMovie();
|
||||
movieMode = MOVIEMODE_TASEDITOR;
|
||||
CreateCleanMovie();
|
||||
playback.StartFromZero();
|
||||
} else
|
||||
{
|
||||
// use current movie to create a new project
|
||||
if (currMovieData.savestate.size() != 0)
|
||||
{
|
||||
FCEUD_PrintError("This version of TAS Editor doesn't work with movies starting from savestate.");
|
||||
// delete savestate, but preserve input anyway
|
||||
currMovieData.savestate.clear();
|
||||
}
|
||||
FCEUI_StopMovie();
|
||||
movieMode = MOVIEMODE_TASEDITOR;
|
||||
currMovieData.emuVersion = FCEU_VERSION_NUMERIC;
|
||||
}
|
||||
// ensure that movie has correct set of ports/fourscore
|
||||
SetInputType(currMovieData, GetInputType(currMovieData));
|
||||
// force the input configuration stored in the movie to apply to FCEUX config
|
||||
FCEUD_SetInput(currMovieData.fourscore, currMovieData.microphone, (ESI)currMovieData.ports[0], (ESI)currMovieData.ports[1], (ESIFC)currMovieData.ports[2]);
|
||||
// reset some modules that need MovidData info
|
||||
list.reset();
|
||||
recorder.reset();
|
||||
// create initial snapshot in history
|
||||
history.reset();
|
||||
// reset Taseditor variables
|
||||
must_call_manual_lua_function = false;
|
||||
|
||||
SetFocus(history.hwndHistoryList); // set focus only once, to show selection cursor
|
||||
SetFocus(list.hwndList);
|
||||
FCEU_DispMessage("TAS Editor engaged", 0);
|
||||
taseditor_window.RedrawTaseditor();
|
||||
return true;
|
||||
} else return false;
|
||||
} else return true;
|
||||
}
|
||||
|
||||
bool ExitTasEditor()
|
||||
{
|
||||
if (!AskSaveProject()) return false;
|
||||
|
||||
// free autofire_patterns
|
||||
autofire_patterns.resize(0);
|
||||
autofire_patterns_names.resize(0);
|
||||
|
||||
// destroy window
|
||||
taseditor_window.exit();
|
||||
// release memory
|
||||
list.free();
|
||||
markers_manager.free();
|
||||
greenzone.free();
|
||||
bookmarks.free();
|
||||
popup_display.free();
|
||||
history.free();
|
||||
playback.SeekingStop();
|
||||
selection.free();
|
||||
|
||||
// restore "eoptions"
|
||||
eoptions = saved_eoptions;
|
||||
// restore autosaves
|
||||
EnableAutosave = saved_EnableAutosave;
|
||||
DoPriority();
|
||||
UpdateCheckedMenuItems();
|
||||
// switch off taseditor mode
|
||||
movieMode = MOVIEMODE_INACTIVE;
|
||||
FCEU_DispMessage("TAS Editor disengaged", 0);
|
||||
CreateCleanMovie();
|
||||
return true;
|
||||
}
|
||||
|
||||
int GetInputType(MovieData& md)
|
||||
{
|
||||
if (md.fourscore)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// main TAS Editor file
|
||||
// Header file for Main TAS Editor file
|
||||
|
||||
struct NewProjectParameters
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ struct NewProjectParameters
|
|||
};
|
||||
|
||||
bool EnterTasEditor();
|
||||
bool ReadString(EMUFILE *is, std::string& dest);
|
||||
bool ExitTasEditor();
|
||||
void UpdateTasEditor();
|
||||
|
||||
|
@ -28,4 +29,3 @@ void SetInputType(MovieData& md, int new_input_type);
|
|||
|
||||
bool TaseditorIsRecording();
|
||||
|
||||
bool ReadString(EMUFILE *is, std::string& dest);
|
|
@ -1,4 +1,16 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Bookmark class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Bookmark - Single Bookmark data
|
||||
* stores all info of one specific Bookmark-Branch: movie snapshot, a savestate of 1 frame, a screenshot of the frame, an info about relations of this Branch, a state of flashing for this Bookmark's row
|
||||
* saves and loads the data from a project file. On error: sends warning to caller
|
||||
* implements procedure of "Bookmark set": creating movie snapshot, setting key frame on current Playback position, copying savestate from Greenzone, making and compressing screenshot, launching flashing animation
|
||||
* launches respective flashings for "Bookmark jump" and "Branch deploy"
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "zlib.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,23 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Bookmarks class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Bookmarks/Branches - Manager of Bookmarks
|
||||
[Singleton]
|
||||
* stores 10 Bookmarks, info about their relations and the position of current Branch
|
||||
* also stores the time of the last modification (see fireball) and the time of the root of Branches Tree (see cloudlet)
|
||||
* implements all operations with Bookmarks: initialization, setting Bookmarks, jumping to Bookmarks, loading Branches
|
||||
* saves and loads the data from a project file. On error: clears all Bookmarks
|
||||
* implements the working of Bookmarks List: creating, redrawing, mouseover, clicks
|
||||
* implements the working of Branches Tree: creating, recalculating relations, animating, redrawing, mouseover
|
||||
* on demand: reacts on project changes and recalculates Branches Tree
|
||||
* regularly updates flashings in Bookmarks List and animations in Branches Tree
|
||||
* on demand: updates colors of rows in Bookmarks List, reflecting conditions of respective Piano Roll rows
|
||||
* stores resources: save id, ids of commands, captions for panel, gradients for flashings, coordinates for building Branches Tree, animation timings, id of default slot
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "utils/xstring.h"
|
||||
#include "zlib.h"
|
||||
|
@ -13,11 +32,11 @@ extern TASEDITOR_CONFIG taseditor_config;
|
|||
extern TASEDITOR_WINDOW taseditor_window;
|
||||
extern POPUP_DISPLAY popup_display;
|
||||
extern PLAYBACK playback;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_PROJECT project;
|
||||
extern HISTORY history;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
|
||||
// resources
|
||||
|
@ -59,7 +78,7 @@ void BOOKMARKS::init()
|
|||
// subclass the listview
|
||||
hwndBookmarksList_oldWndProc = (WNDPROC)SetWindowLong(hwndBookmarksList, GWL_WNDPROC, (LONG)BookmarksListWndProc);
|
||||
// setup same images for the listview
|
||||
ListView_SetImageList(hwndBookmarksList, list.himglist, LVSIL_SMALL);
|
||||
ListView_SetImageList(hwndBookmarksList, piano_roll.himglist, LVSIL_SMALL);
|
||||
// setup columns
|
||||
LVCOLUMN lvc;
|
||||
// icons column
|
||||
|
@ -424,7 +443,7 @@ void BOOKMARKS::set(int slot)
|
|||
// switch current branch to this branch
|
||||
if (slot != current_branch && current_branch >= 0)
|
||||
{
|
||||
list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
piano_roll.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
}
|
||||
if (slot != current_branch || changes_since_current_branch)
|
||||
|
@ -435,10 +454,10 @@ void BOOKMARKS::set(int slot)
|
|||
|
||||
if (previous_frame >= 0 && previous_frame != currFrameCounter)
|
||||
{
|
||||
list.RedrawRow(previous_frame);
|
||||
piano_roll.RedrawRow(previous_frame);
|
||||
RedrawChangedBookmarks(previous_frame);
|
||||
}
|
||||
list.RedrawRow(currFrameCounter);
|
||||
piano_roll.RedrawRow(currFrameCounter);
|
||||
RedrawChangedBookmarks(currFrameCounter);
|
||||
|
||||
FCEU_DispMessage("Branch %d saved.", 0, slot);
|
||||
|
@ -452,7 +471,7 @@ void BOOKMARKS::jump(int slot)
|
|||
int frame = bookmarks_array[slot].snapshot.jump_frame;
|
||||
playback.jump(frame);
|
||||
if (playback.pause_frame)
|
||||
list.FollowPauseframe();
|
||||
piano_roll.FollowPauseframe();
|
||||
bookmarks_array[slot].jumped();
|
||||
}
|
||||
}
|
||||
|
@ -489,7 +508,7 @@ void BOOKMARKS::deploy(int slot)
|
|||
{
|
||||
// restore entire movie
|
||||
bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change);
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot);
|
||||
greenzone.Invalidate(first_change);
|
||||
|
@ -498,7 +517,7 @@ void BOOKMARKS::deploy(int slot)
|
|||
{
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot);
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
bookmarks_array[slot].deployed();
|
||||
} else
|
||||
{
|
||||
|
@ -524,7 +543,7 @@ void BOOKMARKS::deploy(int slot)
|
|||
// restore movie up to and not including bookmarked frame (imitating old TASing method)
|
||||
if (currMovieData.getNumRecords() <= jump_frame) currMovieData.records.resize(jump_frame+1); // but if old movie is shorter, include last frame as blank frame
|
||||
bookmarks_array[slot].snapshot.toMovie(currMovieData, first_change, jump_frame-1);
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
history.RegisterBranching(MODTYPE_BRANCH_0 + slot, first_change, slot);
|
||||
greenzone.Invalidate(first_change);
|
||||
|
@ -533,7 +552,7 @@ void BOOKMARKS::deploy(int slot)
|
|||
{
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
history.RegisterBranching(MODTYPE_BRANCH_MARKERS_0 + slot, first_change, slot);
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
bookmarks_array[slot].deployed();
|
||||
} else
|
||||
{
|
||||
|
@ -562,9 +581,9 @@ void BOOKMARKS::deploy(int slot)
|
|||
// switch current branch to this branch
|
||||
if (slot != current_branch && current_branch >= 0)
|
||||
{
|
||||
list.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
piano_roll.RedrawRow(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
RedrawChangedBookmarks(bookmarks_array[current_branch].snapshot.jump_frame);
|
||||
list.RedrawRow(bookmarks_array[slot].snapshot.jump_frame);
|
||||
piano_roll.RedrawRow(bookmarks_array[slot].snapshot.jump_frame);
|
||||
RedrawChangedBookmarks(bookmarks_array[slot].snapshot.jump_frame);
|
||||
}
|
||||
current_branch = slot;
|
||||
|
@ -982,7 +1001,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
if (bookmarks_array[cell_y].not_empty)
|
||||
{
|
||||
// frame number
|
||||
SelectObject(msg->nmcd.hdc, list.hMainListFont);
|
||||
SelectObject(msg->nmcd.hdc, piano_roll.hMainListFont);
|
||||
int frame = bookmarks_array[cell_y].snapshot.jump_frame;
|
||||
if (frame == currFrameCounter || frame == (playback.GetFlashingPauseFrame() - 1))
|
||||
{
|
||||
|
@ -1013,7 +1032,7 @@ LONG BOOKMARKS::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
if (bookmarks_array[cell_y].not_empty)
|
||||
{
|
||||
// frame number
|
||||
SelectObject(msg->nmcd.hdc, list.hMainListFont);
|
||||
SelectObject(msg->nmcd.hdc, piano_roll.hMainListFont);
|
||||
int frame = bookmarks_array[cell_y].snapshot.jump_frame;
|
||||
if (frame == currFrameCounter || frame == (playback.GetFlashingPauseFrame() - 1))
|
||||
{
|
||||
|
@ -1417,7 +1436,7 @@ LRESULT APIENTRY BookmarksListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
|||
return 0;
|
||||
}
|
||||
case WM_MOUSEWHEEL:
|
||||
return SendMessage(list.hwndList, msg, wParam, lParam);
|
||||
return SendMessage(piano_roll.hwndList, msg, wParam, lParam);
|
||||
|
||||
}
|
||||
return CallWindowProc(hwndBookmarksList_oldWndProc, hWnd, msg, wParam, lParam);
|
||||
|
@ -1459,7 +1478,7 @@ LRESULT APIENTRY BranchesBitmapWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA
|
|||
return 0;
|
||||
}
|
||||
case WM_MOUSEWHEEL:
|
||||
return SendMessage(list.hwndList, msg, wParam, lParam);
|
||||
return SendMessage(piano_roll.hwndList, msg, wParam, lParam);
|
||||
|
||||
}
|
||||
return CallWindowProc(hwndBranchesBitmap_oldWndProc, hWnd, msg, wParam, lParam);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for Bookmarks class
|
||||
|
||||
#include "bookmark.h"
|
||||
|
||||
#define TOTAL_BOOKMARKS 10
|
||||
|
|
|
@ -1,4 +1,20 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Greenzone class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Greenzone - Access zone
|
||||
[Singleton]
|
||||
* stores array of savestates, used for faster movie navigation by Playback cursor
|
||||
* also stores the frame-by-frame log of lag appearance
|
||||
* saves and loads the data from a project file. On error: truncates Greenzone to last successfully read savestate
|
||||
* regularly checks if there's a savestate of current emulation state, if there's no such savestate in array then creates one and updates lag info for previous frame
|
||||
* regularly runs gradual cleaning of the savestates array (for memory saving), deleting oldest savestates
|
||||
* on demand: (when movie input was changed) truncates the size of Greenzone, óäàëÿÿ ñýéâû, deleting savestates that became irrelevant because of new input. After truncating it may also move Playback cursor (which must always reside within Greenzone) and may launch Playback seeking
|
||||
* stores resources: save id, properties of gradual cleaning, timing of cleaning
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "state.h"
|
||||
#include "zlib.h"
|
||||
|
@ -7,7 +23,7 @@ extern TASEDITOR_CONFIG taseditor_config;
|
|||
extern TASEDITOR_PROJECT project;
|
||||
extern PLAYBACK playback;
|
||||
extern BOOKMARKS bookmarks;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
|
||||
extern char lagFlag;
|
||||
|
||||
|
@ -162,7 +178,7 @@ void GREENZONE::GreenzoneCleaning()
|
|||
finish:
|
||||
if (changed)
|
||||
{
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
bookmarks.RedrawBookmarksList();
|
||||
}
|
||||
// shedule next cleaning
|
||||
|
@ -387,8 +403,8 @@ void GREENZONE::InvalidateAndCheck(int after)
|
|||
}
|
||||
}
|
||||
}
|
||||
// redraw list even if greenzone didn't change
|
||||
list.RedrawList();
|
||||
// redraw Piano Roll even if greenzone didn't change
|
||||
piano_roll.RedrawList();
|
||||
bookmarks.RedrawBookmarksList();
|
||||
}
|
||||
// This version doesn't restore playback, may be used only by Branching and Recording functions!
|
||||
|
@ -403,8 +419,8 @@ void GREENZONE::Invalidate(int after)
|
|||
currMovieData.rerecordCount++;
|
||||
}
|
||||
}
|
||||
// redraw list even if greenzone didn't change
|
||||
list.RedrawList();
|
||||
// redraw Piano Roll even if greenzone didn't change
|
||||
piano_roll.RedrawList();
|
||||
bookmarks.RedrawBookmarksList();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,21 @@
|
|||
//Implementation file of History class (Undo feature)
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of History class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
History - History of movie modifications
|
||||
[Singleton]
|
||||
* stores array of snapshots and pointer to current (last) snapshot
|
||||
* saves and loads the data from a project file. On error: clears the array and starts new history by making snapshot of current movie data
|
||||
* on demand: checks the difference between the last snapshot and current movie, and makes a decision to create new point of rollback. In special cases it can create a point of rollback without checking the difference, assuming that caller already checked it
|
||||
* implements all restoring operations: undo, redo, revert to any snapshot from the array
|
||||
* also stores the state of "undo pointer"
|
||||
* regularly updates the state of "undo pointer"
|
||||
* implements the working of History List: creating, redrawing, clicks, auto-scrolling
|
||||
* stores resources: save id, ids and names of all possible types of modification, timings of "undo pointer"
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
|
||||
LRESULT APIENTRY HistoryListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -9,10 +26,10 @@ extern TASEDITOR_WINDOW taseditor_window;
|
|||
extern MARKERS_MANAGER markers_manager;
|
||||
extern BOOKMARKS bookmarks;
|
||||
extern PLAYBACK playback;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_PROJECT project;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern TASEDITOR_LUA taseditor_lua;
|
||||
|
||||
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
|
||||
|
@ -112,7 +129,7 @@ void HISTORY::update()
|
|||
{
|
||||
// update undo_hint
|
||||
if (old_undo_hint_pos != undo_hint_pos && old_undo_hint_pos >= 0)
|
||||
list.RedrawRow(old_undo_hint_pos); // not changing bookmarks list
|
||||
piano_roll.RedrawRow(old_undo_hint_pos); // not changing Bookmarks List
|
||||
old_undo_hint_pos = undo_hint_pos;
|
||||
old_show_undo_hint = show_undo_hint;
|
||||
show_undo_hint = false;
|
||||
|
@ -124,7 +141,7 @@ void HISTORY::update()
|
|||
undo_hint_pos = -1; // finished hinting
|
||||
}
|
||||
if (old_show_undo_hint != show_undo_hint)
|
||||
list.RedrawRow(undo_hint_pos); // not changing bookmarks list
|
||||
piano_roll.RedrawRow(undo_hint_pos); // not changing Bookmarks List
|
||||
}
|
||||
|
||||
// returns frame of first input change (for greenzone invalidation)
|
||||
|
@ -167,18 +184,18 @@ int HISTORY::jump(int new_pos)
|
|||
snapshots[real_pos].toMovie(currMovieData, first_change);
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
bookmarks.ChangesMadeSinceBranch();
|
||||
// list will be redrawn by greenzone invalidation
|
||||
// and Piano Roll will be redrawn by greenzone invalidation
|
||||
} else if (markers_changed)
|
||||
{
|
||||
markers_manager.update();
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
bookmarks.ChangesMadeSinceBranch();
|
||||
list.RedrawList();
|
||||
list.FollowUndo();
|
||||
piano_roll.RedrawList();
|
||||
piano_roll.FollowUndo();
|
||||
} else if (taseditor_config.enable_hot_changes)
|
||||
{
|
||||
// when using Hot Changes, list should be always redrawn, because old changes become less hot
|
||||
list.RedrawList();
|
||||
// when using Hot Changes, Piano Roll should be always redrawn, because old changes become less hot
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
|
||||
return first_change;
|
||||
|
@ -493,7 +510,7 @@ void HISTORY::RegisterImport(MovieData& md, char* filename)
|
|||
}
|
||||
AddSnapshotToHistory(inp);
|
||||
inp.toMovie(currMovieData);
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
bookmarks.ChangesMadeSinceBranch();
|
||||
project.SetProjectChanged();
|
||||
greenzone.InvalidateAndCheck(first_changes);
|
||||
|
@ -688,8 +705,8 @@ void HISTORY::Click(LPNMITEMACTIVATE info)
|
|||
int result = jump(item);
|
||||
if (result >= 0)
|
||||
{
|
||||
list.update();
|
||||
list.FollowUndo();
|
||||
piano_roll.update();
|
||||
piano_roll.FollowUndo();
|
||||
greenzone.InvalidateAndCheck(result);
|
||||
return;
|
||||
}
|
||||
|
@ -758,7 +775,7 @@ LRESULT APIENTRY HistoryListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
|
|||
// Right button/Ctrl/Shift/Alt + wheel -> send the message to Piano Roll
|
||||
// but if just wheel - use default scrolling here
|
||||
if (GET_KEYSTATE_WPARAM(wParam) & (MK_RBUTTON|MK_SHIFT|MK_CONTROL) || (GetKeyState(VK_MENU) < 0))
|
||||
return SendMessage(list.hwndList, msg, wParam, lParam);
|
||||
return SendMessage(piano_roll.hwndList, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
//Specification file for Input History class
|
||||
// Specification file for History class
|
||||
|
||||
#define UNDO_HINT_TIME 200
|
||||
|
||||
enum
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Markers class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Markers - Snapshot of Markers state
|
||||
* stores the data about Markers state: array of distributing Markers among movie frames, and array of Notes
|
||||
* saves and loads the data from a project file. On error: sends warning to caller
|
||||
* stores resources: max length of a Note
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "../common.h"
|
||||
#include "markers.h"
|
||||
#include "zlib.h"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for Markers class
|
||||
|
||||
#define MAX_NOTE_LEN 100
|
||||
|
||||
class MARKERS
|
||||
|
|
|
@ -1,4 +1,22 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Markers_manager class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Markers_manager - Manager of Markers
|
||||
[Singleton]
|
||||
* stores one snapshot of Markers, representing current state of Markers in the project
|
||||
* saves and loads the data from a project file. On error: clears the data
|
||||
* regularly ensures that the size of current Markers array is not less than the number of frames in current input
|
||||
* implements all operations with Markers: setting Marker to a frame, removing Marker, inserting/deleting frames between Markers, truncating Markers array, changing Notes, finding frame for any given Marker, access to the data of Snapshot of Markers state
|
||||
* implements full/partial copying of data between two Snapshots of Markers state, and searching for first difference between two Snapshots of Markers state
|
||||
* also here's the code of searching for "similar" Notes
|
||||
* also here's the code of editing Marker Notes
|
||||
* also here's the code of Find Note dialog
|
||||
* stores resources: save id, properties of searching for similar Notes
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include <Shlwapi.h> // for StrStrI
|
||||
|
||||
|
@ -7,7 +25,7 @@
|
|||
extern TASEDITOR_CONFIG taseditor_config;
|
||||
extern TASEDITOR_WINDOW taseditor_window;
|
||||
extern PLAYBACK playback;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
extern HISTORY history;
|
||||
|
||||
// resources
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for Markers_manager class
|
||||
|
||||
#include "markers.h"
|
||||
|
||||
#define MARKERS_ID_LEN 8
|
||||
|
|
|
@ -1,4 +1,22 @@
|
|||
//Implementation file of TASEDITOR_LIST class
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of PIANO_ROLL class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Piano Roll - Piano Roll interface
|
||||
[Singleton]
|
||||
* implements the working of Piano Roll List: creating, redrawing, scrolling, clicks
|
||||
* on demand: scrolls visible area of the List to any given item: to Playback Cursor, to Selection Cursor, to "undo pointer", to a Marker
|
||||
* saves and loads current position of vertical scrolling from a project file. On error: scrolls the List to the beginning
|
||||
* implements the working of Piano Roll List Header: creating, redrawing, animating, mouseover, clicks
|
||||
* on demand: launches flashes in the List Header
|
||||
* regularly updates the size of the List according to current movie input, also updates lights in the List Header according to button presses data from Recorder and Alt key state
|
||||
* implements the working of mouse wheel: List scrolling, Playback cursor movement, Selection cursor movement
|
||||
* implements context menu on Right-click
|
||||
* stores resources: save id, ids of columns, widths of columns, tables of colors, gradient of Hot Changes, gradient of Header flashings, timings of flashes, all fonts used in TAS Editor, images
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "utils/xstring.h"
|
||||
#include "uxtheme.h"
|
||||
|
@ -19,7 +37,7 @@ extern RECORDER recorder;
|
|||
extern GREENZONE greenzone;
|
||||
extern HISTORY history;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
|
||||
extern int GetInputType(MovieData& md);
|
||||
|
||||
|
@ -28,17 +46,17 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
|||
WNDPROC hwndList_oldWndProc = 0, hwndHeader_oldWndproc = 0;
|
||||
|
||||
// resources
|
||||
char list_save_id[LIST_ID_LEN] = "LIST";
|
||||
char list_skipsave_id[LIST_ID_LEN] = "LISX";
|
||||
char piano_roll_save_id[PIANO_ROLL_ID_LEN] = "PIANO_ROLL";
|
||||
char piano_roll_skipsave_id[PIANO_ROLL_ID_LEN] = "PIANO_ROLX";
|
||||
COLORREF hot_changes_colors[16] = { 0x0, 0x5c4c44, 0x854604, 0xab2500, 0xc20006, 0xd6006f, 0xd40091, 0xba00a4, 0x9500ba, 0x7a00cc, 0x5800d4, 0x0045e2, 0x0063ea, 0x0079f4, 0x0092fa, 0x00aaff };
|
||||
//COLORREF hot_changes_colors[16] = { 0x0, 0x661212, 0x842B4E, 0x652C73, 0x48247D, 0x383596, 0x2947AE, 0x1E53C1, 0x135DD2, 0x116EDA, 0x107EE3, 0x0F8EEB, 0x209FF4, 0x3DB1FD, 0x51C2FF, 0x4DCDFF };
|
||||
COLORREF header_lights_colors[11] = { 0x0, 0x007313, 0x009100, 0x1daf00, 0x42c700, 0x65d900, 0x91e500, 0xb0f000, 0xdaf700, 0xf0fc7c, 0xfcffba };
|
||||
|
||||
TASEDITOR_LIST::TASEDITOR_LIST()
|
||||
PIANO_ROLL::PIANO_ROLL()
|
||||
{
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::init()
|
||||
void PIANO_ROLL::init()
|
||||
{
|
||||
free();
|
||||
// create fonts for main listview
|
||||
|
@ -163,7 +181,7 @@ void TASEDITOR_LIST::init()
|
|||
tme.hwndTrack = hwndHeader;
|
||||
|
||||
}
|
||||
void TASEDITOR_LIST::free()
|
||||
void PIANO_ROLL::free()
|
||||
{
|
||||
if (hMainListFont)
|
||||
{
|
||||
|
@ -197,7 +215,7 @@ void TASEDITOR_LIST::free()
|
|||
}
|
||||
header_colors.resize(0);
|
||||
}
|
||||
void TASEDITOR_LIST::reset()
|
||||
void PIANO_ROLL::reset()
|
||||
{
|
||||
next_header_update_time = header_item_under_mouse = 0;
|
||||
// delete all columns except 0th
|
||||
|
@ -231,7 +249,7 @@ void TASEDITOR_LIST::reset()
|
|||
ListView_InsertColumn(hwndList, num_columns++, &lvc);
|
||||
}
|
||||
}
|
||||
void TASEDITOR_LIST::update()
|
||||
void PIANO_ROLL::update()
|
||||
{
|
||||
//update the number of items in the list
|
||||
int currLVItemCount = ListView_GetItemCount(hwndList);
|
||||
|
@ -286,67 +304,67 @@ void TASEDITOR_LIST::update()
|
|||
}
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::save(EMUFILE *os, bool really_save)
|
||||
void PIANO_ROLL::save(EMUFILE *os, bool really_save)
|
||||
{
|
||||
if (really_save)
|
||||
{
|
||||
update();
|
||||
// write "LIST" string
|
||||
os->fwrite(list_save_id, LIST_ID_LEN);
|
||||
// write "PIANO_ROLL" string
|
||||
os->fwrite(piano_roll_save_id, PIANO_ROLL_ID_LEN);
|
||||
// write current top item
|
||||
int top_item = ListView_GetTopIndex(hwndList);
|
||||
write32le(top_item, os);
|
||||
} else
|
||||
{
|
||||
// write "LISX" string
|
||||
os->fwrite(list_skipsave_id, LIST_ID_LEN);
|
||||
// write "PIANO_ROLX" string
|
||||
os->fwrite(piano_roll_skipsave_id, PIANO_ROLL_ID_LEN);
|
||||
}
|
||||
}
|
||||
// returns true if couldn't load
|
||||
bool TASEDITOR_LIST::load(EMUFILE *is)
|
||||
bool PIANO_ROLL::load(EMUFILE *is)
|
||||
{
|
||||
reset();
|
||||
update();
|
||||
// read "LIST" string
|
||||
char save_id[LIST_ID_LEN];
|
||||
if ((int)is->fread(save_id, LIST_ID_LEN) < LIST_ID_LEN) goto error;
|
||||
if (!strcmp(list_skipsave_id, save_id))
|
||||
// read "PIANO_ROLL" string
|
||||
char save_id[PIANO_ROLL_ID_LEN];
|
||||
if ((int)is->fread(save_id, PIANO_ROLL_ID_LEN) < PIANO_ROLL_ID_LEN) goto error;
|
||||
if (!strcmp(piano_roll_skipsave_id, save_id))
|
||||
{
|
||||
// string says to skip loading List
|
||||
FCEU_printf("No list data in the file\n");
|
||||
// string says to skip loading Piano Roll
|
||||
FCEU_printf("No Piano Roll data in the file\n");
|
||||
// scroll to the beginning
|
||||
ListView_EnsureVisible(hwndList, 0, FALSE);
|
||||
return false;
|
||||
}
|
||||
if (strcmp(list_save_id, save_id)) goto error; // string is not valid
|
||||
// read current top item and scroll list there
|
||||
if (strcmp(piano_roll_save_id, save_id)) goto error; // string is not valid
|
||||
// read current top item and scroll Piano Roll there
|
||||
int top_item;
|
||||
if (!read32le(&top_item, is)) goto error;
|
||||
ListView_EnsureVisible(hwndList, currMovieData.getNumRecords() - 1, FALSE);
|
||||
ListView_EnsureVisible(hwndList, top_item, FALSE);
|
||||
return false;
|
||||
error:
|
||||
FCEU_printf("Error loading list data\n");
|
||||
FCEU_printf("Error loading Piano Roll data\n");
|
||||
// scroll to the beginning
|
||||
ListView_EnsureVisible(hwndList, 0, FALSE);
|
||||
return true;
|
||||
}
|
||||
// ----------------------------------------------------------------------
|
||||
void TASEDITOR_LIST::RedrawList()
|
||||
void PIANO_ROLL::RedrawList()
|
||||
{
|
||||
InvalidateRect(hwndList, 0, FALSE);
|
||||
}
|
||||
void TASEDITOR_LIST::RedrawRow(int index)
|
||||
void PIANO_ROLL::RedrawRow(int index)
|
||||
{
|
||||
ListView_RedrawItems(hwndList, index, index);
|
||||
}
|
||||
void TASEDITOR_LIST::RedrawHeader()
|
||||
void PIANO_ROLL::RedrawHeader()
|
||||
{
|
||||
InvalidateRect(hwndHeader, 0, FALSE);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
bool TASEDITOR_LIST::CheckItemVisible(int frame)
|
||||
bool PIANO_ROLL::CheckItemVisible(int frame)
|
||||
{
|
||||
int top = ListView_GetTopIndex(hwndList);
|
||||
// in fourscore there's horizontal scrollbar which takes one row for itself
|
||||
|
@ -355,7 +373,7 @@ bool TASEDITOR_LIST::CheckItemVisible(int frame)
|
|||
return false;
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::CenterListAt(int frame)
|
||||
void PIANO_ROLL::CenterListAt(int frame)
|
||||
{
|
||||
int list_items = ListView_GetCountPerPage(hwndList);
|
||||
int lower_border = (list_items - 1) / 2;
|
||||
|
@ -370,15 +388,15 @@ void TASEDITOR_LIST::CenterListAt(int frame)
|
|||
ListView_EnsureVisible(hwndList, index, false);
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::FollowPlayback()
|
||||
void PIANO_ROLL::FollowPlayback()
|
||||
{
|
||||
CenterListAt(currFrameCounter);
|
||||
}
|
||||
void TASEDITOR_LIST::FollowPlaybackIfNeeded()
|
||||
void PIANO_ROLL::FollowPlaybackIfNeeded()
|
||||
{
|
||||
if (taseditor_config.follow_playback) ListView_EnsureVisible(hwndList,currFrameCounter,FALSE);
|
||||
}
|
||||
void TASEDITOR_LIST::FollowUndo()
|
||||
void PIANO_ROLL::FollowUndo()
|
||||
{
|
||||
int jump_frame = history.GetUndoHint();
|
||||
if (taseditor_config.jump_to_undo && jump_frame >= 0)
|
||||
|
@ -387,7 +405,7 @@ void TASEDITOR_LIST::FollowUndo()
|
|||
CenterListAt(jump_frame);
|
||||
}
|
||||
}
|
||||
void TASEDITOR_LIST::FollowSelection()
|
||||
void PIANO_ROLL::FollowSelection()
|
||||
{
|
||||
SelectionFrames* current_selection = selection.MakeStrobe();
|
||||
if (current_selection->size() == 0) return;
|
||||
|
@ -417,12 +435,12 @@ void TASEDITOR_LIST::FollowSelection()
|
|||
CenterListAt(selection_start);
|
||||
}
|
||||
}
|
||||
void TASEDITOR_LIST::FollowPauseframe()
|
||||
void PIANO_ROLL::FollowPauseframe()
|
||||
{
|
||||
if (playback.pause_frame > 0)
|
||||
CenterListAt(playback.pause_frame - 1);
|
||||
}
|
||||
void TASEDITOR_LIST::FollowMarker(int marker_id)
|
||||
void PIANO_ROLL::FollowMarker(int marker_id)
|
||||
{
|
||||
if (marker_id > 0)
|
||||
{
|
||||
|
@ -435,7 +453,7 @@ void TASEDITOR_LIST::FollowMarker(int marker_id)
|
|||
}
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::SetHeaderColumnLight(int column, int level)
|
||||
void PIANO_ROLL::SetHeaderColumnLight(int column, int level)
|
||||
{
|
||||
if (column < COLUMN_FRAMENUM || column >= num_columns || level < 0 || level > HEADER_LIGHT_MAX)
|
||||
return;
|
||||
|
@ -448,7 +466,7 @@ void TASEDITOR_LIST::SetHeaderColumnLight(int column, int level)
|
|||
}
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
|
||||
void PIANO_ROLL::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
|
||||
{
|
||||
LVITEM& item = nmlvDispInfo->item;
|
||||
if(item.mask & LVIF_TEXT)
|
||||
|
@ -506,7 +524,7 @@ void TASEDITOR_LIST::GetDispInfo(NMLVDISPINFO* nmlvDispInfo)
|
|||
}
|
||||
}
|
||||
|
||||
LONG TASEDITOR_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
|
||||
LONG PIANO_ROLL::CustomDraw(NMLVCUSTOMDRAW* msg)
|
||||
{
|
||||
int cell_x, cell_y;
|
||||
switch(msg->nmcd.dwDrawStage)
|
||||
|
@ -655,7 +673,7 @@ LONG TASEDITOR_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
}
|
||||
}
|
||||
|
||||
LONG TASEDITOR_LIST::HeaderCustomDraw(NMLVCUSTOMDRAW* msg)
|
||||
LONG PIANO_ROLL::HeaderCustomDraw(NMLVCUSTOMDRAW* msg)
|
||||
{
|
||||
switch(msg->nmcd.dwDrawStage)
|
||||
{
|
||||
|
@ -677,7 +695,7 @@ LONG TASEDITOR_LIST::HeaderCustomDraw(NMLVCUSTOMDRAW* msg)
|
|||
}
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::ToggleJoypadBit(int column_index, int row_index, UINT KeyFlags)
|
||||
void PIANO_ROLL::ToggleJoypadBit(int column_index, int row_index, UINT KeyFlags)
|
||||
{
|
||||
int joy = (column_index - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
|
||||
int bit = (column_index - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
|
||||
|
@ -718,7 +736,7 @@ void TASEDITOR_LIST::ToggleJoypadBit(int column_index, int row_index, UINT KeyFl
|
|||
|
||||
}
|
||||
|
||||
void TASEDITOR_LIST::ColumnSet(int column, bool alt_pressed)
|
||||
void PIANO_ROLL::ColumnSet(int column, bool alt_pressed)
|
||||
{
|
||||
if (column == COLUMN_FRAMENUM || column == COLUMN_FRAMENUM2)
|
||||
{
|
||||
|
@ -749,7 +767,7 @@ void TASEDITOR_LIST::ColumnSet(int column, bool alt_pressed)
|
|||
}
|
||||
}
|
||||
|
||||
bool TASEDITOR_LIST::FrameColumnSetPattern()
|
||||
bool PIANO_ROLL::FrameColumnSetPattern()
|
||||
{
|
||||
SelectionFrames* current_selection = selection.MakeStrobe();
|
||||
if (current_selection->size() == 0) return false;
|
||||
|
@ -794,7 +812,7 @@ bool TASEDITOR_LIST::FrameColumnSetPattern()
|
|||
} else
|
||||
return false;
|
||||
}
|
||||
bool TASEDITOR_LIST::FrameColumnSet()
|
||||
bool PIANO_ROLL::FrameColumnSet()
|
||||
{
|
||||
SelectionFrames* current_selection = selection.MakeStrobe();
|
||||
if (current_selection->size() == 0) return false;
|
||||
|
@ -846,7 +864,7 @@ bool TASEDITOR_LIST::FrameColumnSet()
|
|||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
return changes_made;
|
||||
}
|
||||
bool TASEDITOR_LIST::InputColumnSetPattern(int joy, int button)
|
||||
bool PIANO_ROLL::InputColumnSetPattern(int joy, int button)
|
||||
{
|
||||
if (joy < 0 || joy >= joysticks_per_frame[GetInputType(currMovieData)]) return false;
|
||||
|
||||
|
@ -874,7 +892,7 @@ bool TASEDITOR_LIST::InputColumnSetPattern(int joy, int button)
|
|||
} else
|
||||
return false;
|
||||
}
|
||||
bool TASEDITOR_LIST::InputColumnSet(int joy, int button)
|
||||
bool PIANO_ROLL::InputColumnSet(int joy, int button)
|
||||
{
|
||||
if (joy < 0 || joy >= joysticks_per_frame[GetInputType(currMovieData)]) return false;
|
||||
|
||||
|
@ -913,7 +931,7 @@ bool TASEDITOR_LIST::InputColumnSet(int joy, int button)
|
|||
return false;
|
||||
}
|
||||
// ----------------------------------------------------
|
||||
void TASEDITOR_LIST::RightClick(LVHITTESTINFO& info)
|
||||
void PIANO_ROLL::RightClick(LVHITTESTINFO& info)
|
||||
{
|
||||
int index = info.iItem;
|
||||
if(index == -1)
|
||||
|
@ -921,14 +939,14 @@ void TASEDITOR_LIST::RightClick(LVHITTESTINFO& info)
|
|||
else
|
||||
RightClickMenu(info);
|
||||
}
|
||||
void TASEDITOR_LIST::StrayClickMenu(LVHITTESTINFO& info)
|
||||
void PIANO_ROLL::StrayClickMenu(LVHITTESTINFO& info)
|
||||
{
|
||||
POINT pt = info.pt;
|
||||
ClientToScreen(hwndList, &pt);
|
||||
HMENU sub = GetSubMenu(hrmenu, CONTEXTMENU_STRAY);
|
||||
TrackPopupMenu(sub, 0, pt.x, pt.y, 0, taseditor_window.hwndTasEditor, 0);
|
||||
}
|
||||
void TASEDITOR_LIST::RightClickMenu(LVHITTESTINFO& info)
|
||||
void PIANO_ROLL::RightClickMenu(LVHITTESTINFO& info)
|
||||
{
|
||||
SelectionFrames* current_selection = selection.MakeStrobe();
|
||||
if (current_selection->size() == 0)
|
||||
|
@ -964,7 +982,7 @@ void TASEDITOR_LIST::RightClickMenu(LVHITTESTINFO& info)
|
|||
// -------------------------------------------------------------------------
|
||||
LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
switch(msg)
|
||||
{
|
||||
case WM_SETCURSOR:
|
||||
|
@ -978,14 +996,14 @@ LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
|||
info.pt.x = GET_X_LPARAM(lParam) + HEADER_DX_FIX;
|
||||
info.pt.y = GET_Y_LPARAM(lParam);
|
||||
SendMessage(hWnd, HDM_HITTEST, 0, (LPARAM)&info);
|
||||
list.header_item_under_mouse = info.iItem;
|
||||
piano_roll.header_item_under_mouse = info.iItem;
|
||||
// ensure that WM_MOUSELEAVE will be catched
|
||||
TrackMouseEvent(&list.tme);
|
||||
TrackMouseEvent(&piano_roll.tme);
|
||||
break;
|
||||
}
|
||||
case WM_MOUSELEAVE:
|
||||
{
|
||||
list.header_item_under_mouse = -1;
|
||||
piano_roll.header_item_under_mouse = -1;
|
||||
break;
|
||||
}
|
||||
case WM_LBUTTONDOWN:
|
||||
|
@ -999,7 +1017,7 @@ LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
|||
info.pt.y = GET_Y_LPARAM(lParam);
|
||||
SendMessage(hWnd, HDM_HITTEST, 0, (LPARAM)&info);
|
||||
if(info.iItem >= COLUMN_FRAMENUM && info.iItem <= COLUMN_FRAMENUM2)
|
||||
list.ColumnSet(info.iItem, (GetKeyState(VK_MENU) < 0));
|
||||
piano_roll.ColumnSet(info.iItem, (GetKeyState(VK_MENU) < 0));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -1010,7 +1028,7 @@ LRESULT APIENTRY HeaderWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
|
|||
// The subclass wndproc for the listview
|
||||
LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
switch(msg)
|
||||
{
|
||||
case WM_CHAR:
|
||||
|
@ -1018,7 +1036,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
if (((LPNMHDR)lParam)->hwndFrom == list.hwndHeader)
|
||||
if (((LPNMHDR)lParam)->hwndFrom == piano_roll.hwndHeader)
|
||||
{
|
||||
switch (((LPNMHDR)lParam)->code)
|
||||
{
|
||||
|
@ -1027,14 +1045,14 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
case HDN_TRACK:
|
||||
return true; // no column resizing
|
||||
case NM_CUSTOMDRAW:
|
||||
return list.HeaderCustomDraw((NMLVCUSTOMDRAW*)lParam);
|
||||
return piano_roll.HeaderCustomDraw((NMLVCUSTOMDRAW*)lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
if (!taseditor_config.keyboard_for_listview)
|
||||
if (!taseditor_config.keyboard_for_piano_roll)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
@ -1076,7 +1094,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
history.RegisterMarkersChange(MODTYPE_MARKER_SET, row_index);
|
||||
else
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_UNSET, row_index);
|
||||
list.RedrawRow(row_index);
|
||||
piano_roll.RedrawRow(row_index);
|
||||
}
|
||||
// also select the row
|
||||
CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
|
||||
|
@ -1091,11 +1109,11 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam|MK_SHIFT, lParam);
|
||||
int joy = (column_index - COLUMN_JOYPAD1_A) / NUM_JOYPAD_BUTTONS;
|
||||
int button = (column_index - COLUMN_JOYPAD1_A) % NUM_JOYPAD_BUTTONS;
|
||||
list.InputColumnSetPattern(joy, button);
|
||||
piano_roll.InputColumnSetPattern(joy, button);
|
||||
} else
|
||||
{
|
||||
CallWindowProc(hwndList_oldWndProc, hWnd, msg, wParam, lParam);
|
||||
list.ToggleJoypadBit(column_index, row_index, GET_KEYSTATE_WPARAM(wParam));
|
||||
piano_roll.ToggleJoypadBit(column_index, row_index, GET_KEYSTATE_WPARAM(wParam));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1142,8 +1160,8 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
}
|
||||
case WM_RBUTTONDOWN:
|
||||
if (GetFocus() != list.hwndList)
|
||||
SetFocus(list.hwndList);
|
||||
if (GetFocus() != piano_roll.hwndList)
|
||||
SetFocus(piano_roll.hwndList);
|
||||
return 0;
|
||||
case WM_RBUTTONDBLCLK:
|
||||
return 0;
|
||||
|
@ -1156,7 +1174,7 @@ LRESULT APIENTRY ListWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
ListView_SubItemHitTest(hWnd, (LPARAM)&info);
|
||||
// show context menu
|
||||
if(info.iSubItem <= COLUMN_FRAMENUM || info.iSubItem >= COLUMN_FRAMENUM2)
|
||||
list.RightClick(info);
|
||||
piano_roll.RightClick(info);
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
//Specification file for TASEDITOR_LIST class
|
||||
#define LIST_ID_LEN 5
|
||||
// Specification file for PIANO_ROLL class
|
||||
|
||||
#define PIANO_ROLL_ID_LEN 11
|
||||
|
||||
#define CDDS_SUBITEMPREPAINT (CDDS_SUBITEM | CDDS_ITEMPREPAINT)
|
||||
#define CDDS_SUBITEMPOSTPAINT (CDDS_SUBITEM | CDDS_ITEMPOSTPAINT)
|
||||
|
@ -111,10 +112,10 @@ enum
|
|||
|
||||
#define PLAYBACK_MARKER_COLOR 0xC9AF00
|
||||
|
||||
class TASEDITOR_LIST
|
||||
class PIANO_ROLL
|
||||
{
|
||||
public:
|
||||
TASEDITOR_LIST();
|
||||
PIANO_ROLL();
|
||||
void init();
|
||||
void free();
|
||||
void reset();
|
|
@ -1,4 +1,21 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Playback class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Playback - Player of emulation states
|
||||
[Singleton]
|
||||
* implements the working of movie player: show any frame (jump), run/cancel seekng. pause, rewinding
|
||||
* regularly tracks and controls emulation process, prompts redrawing of Piano Roll List rows, finishes seeking when reaching target frame, animates target frame, makes Piano Roll follow Playback cursor, detects if Playback cursor moved to another Marker and updates Note in the upper text field
|
||||
* implements the working of upper buttons << and >> (jumping on Markers)
|
||||
* implements the working of buttons < and > (frame-by-frame movement)
|
||||
* implements the working of button || (pause) and middle mouse button, also reacts on external changes of emulation pause
|
||||
* implements the working of progressbar: init, reset, set value, click (cancel seeking)
|
||||
* also here's the code of upper text field (for editing Marker Notes)
|
||||
* stores resources: upper text field prefix, timings of target frame animation, response times of GUI buttons, progressbar scale
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
|
||||
#ifdef _S9XLUA_H
|
||||
|
@ -12,7 +29,7 @@ extern TASEDITOR_CONFIG taseditor_config;
|
|||
extern TASEDITOR_WINDOW taseditor_window;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern BOOKMARKS bookmarks;
|
||||
|
||||
LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -34,10 +51,10 @@ void PLAYBACK::init()
|
|||
hwndRewindFull = GetDlgItem(taseditor_window.hwndTasEditor, TASEDITOR_REWIND_FULL);
|
||||
hwndForwardFull = GetDlgItem(taseditor_window.hwndTasEditor, TASEDITOR_FORWARD_FULL);
|
||||
hwndPlaybackMarker = GetDlgItem(taseditor_window.hwndTasEditor, IDC_PLAYBACK_MARKER);
|
||||
SendMessage(hwndPlaybackMarker, WM_SETFONT, (WPARAM)list.hMarkersFont, 0);
|
||||
SendMessage(hwndPlaybackMarker, WM_SETFONT, (WPARAM)piano_roll.hMarkersFont, 0);
|
||||
hwndPlaybackMarkerEdit = GetDlgItem(taseditor_window.hwndTasEditor, IDC_PLAYBACK_MARKER_EDIT);
|
||||
SendMessage(hwndPlaybackMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0);
|
||||
SendMessage(hwndPlaybackMarkerEdit, WM_SETFONT, (WPARAM)list.hMarkersEditFont, 0);
|
||||
SendMessage(hwndPlaybackMarkerEdit, WM_SETFONT, (WPARAM)piano_roll.hMarkersEditFont, 0);
|
||||
// subclass the edit control
|
||||
playbackMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndPlaybackMarkerEdit, GWL_WNDPROC, (LONG)UpperMarkerEditWndProc);
|
||||
|
||||
|
@ -74,7 +91,7 @@ void PLAYBACK::update()
|
|||
if (old_pauseframe != pause_frame && old_pauseframe)
|
||||
{
|
||||
// pause_frame was changed, clear old_pauseframe gfx
|
||||
list.RedrawRow(old_pauseframe-1);
|
||||
piano_roll.RedrawRow(old_pauseframe-1);
|
||||
bookmarks.RedrawChangedBookmarks(old_pauseframe-1);
|
||||
}
|
||||
old_pauseframe = pause_frame;
|
||||
|
@ -89,7 +106,7 @@ void PLAYBACK::update()
|
|||
if (old_show_pauseframe != show_pauseframe)
|
||||
{
|
||||
// update pauseframe gfx
|
||||
list.RedrawRow(pause_frame-1);
|
||||
piano_roll.RedrawRow(pause_frame-1);
|
||||
bookmarks.RedrawChangedBookmarks(pause_frame-1);
|
||||
}
|
||||
|
||||
|
@ -114,16 +131,16 @@ void PLAYBACK::update()
|
|||
// update the playback cursor
|
||||
if(currFrameCounter != lastCursor)
|
||||
{
|
||||
list.FollowPlaybackIfNeeded();
|
||||
piano_roll.FollowPlaybackIfNeeded();
|
||||
// update gfx of the old and new rows
|
||||
list.RedrawRow(lastCursor);
|
||||
piano_roll.RedrawRow(lastCursor);
|
||||
bookmarks.RedrawChangedBookmarks(lastCursor);
|
||||
list.RedrawRow(currFrameCounter);
|
||||
piano_roll.RedrawRow(currFrameCounter);
|
||||
bookmarks.RedrawChangedBookmarks(currFrameCounter);
|
||||
lastCursor = currFrameCounter;
|
||||
if (!turbo)
|
||||
// enforce redrawing now
|
||||
UpdateWindow(list.hwndList);
|
||||
UpdateWindow(piano_roll.hwndList);
|
||||
// lazy update of "Playback's Marker text"
|
||||
int current_marker = markers_manager.GetMarkerUp(currFrameCounter);
|
||||
if (shown_marker != current_marker)
|
||||
|
@ -278,7 +295,7 @@ void PLAYBACK::RewindFrame()
|
|||
jump(currFrameCounter-1);
|
||||
else
|
||||
// cursor is at frame 0 - can't rewind, but still must make cursor visible if needed
|
||||
list.FollowPlaybackIfNeeded();
|
||||
piano_roll.FollowPlaybackIfNeeded();
|
||||
if (!pause_frame) PauseEmulation();
|
||||
}
|
||||
void PLAYBACK::ForwardFrame()
|
||||
|
@ -358,7 +375,7 @@ void PLAYBACK::jump(int frame)
|
|||
if (JumpToFrame(frame))
|
||||
{
|
||||
ForceExecuteLuaFrameFunctions();
|
||||
list.FollowPlaybackIfNeeded();
|
||||
piano_roll.FollowPlaybackIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +435,7 @@ void PLAYBACK::ClickOnProgressbar()
|
|||
{
|
||||
int temp = lost_position_frame - 1;
|
||||
lost_position_frame = 0;
|
||||
list.RedrawRow(temp);
|
||||
piano_roll.RedrawRow(temp);
|
||||
}
|
||||
// and stop seeking
|
||||
if (pause_frame)
|
||||
|
@ -430,7 +447,7 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
|
|||
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_UPPER)
|
||||
{
|
||||
extern PLAYBACK playback;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
switch(msg)
|
||||
{
|
||||
case WM_CHAR:
|
||||
|
@ -440,11 +457,11 @@ LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
|
|||
case VK_ESCAPE:
|
||||
// revert text to original note text
|
||||
SetWindowText(playback.hwndPlaybackMarkerEdit, markers_manager.GetNote(playback.shown_marker).c_str());
|
||||
SetFocus(list.hwndList);
|
||||
SetFocus(piano_roll.hwndList);
|
||||
return 0;
|
||||
case VK_RETURN:
|
||||
// exit and save text changes
|
||||
SetFocus(list.hwndList);
|
||||
SetFocus(piano_roll.hwndList);
|
||||
return 0;
|
||||
case VK_TAB:
|
||||
// switch to lower edit control (also exit and save text changes)
|
||||
|
|
|
@ -1,11 +1,24 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of POPUP_DISPLAY class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Popup display - Manager of popup windows
|
||||
[Singleton]
|
||||
* implements all operations with popup windows: initialization, redrawing, centering, screenshot decompression and conversion
|
||||
* regularly inspects changes of Bookmarks Manager and shows/updates/hides popup windows
|
||||
* on demend: updates contents of popup windows
|
||||
* stores resources: coordinates and appearance of popup windows, timings of fade in/out
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "zlib.h"
|
||||
|
||||
extern TASEDITOR_CONFIG taseditor_config;
|
||||
extern TASEDITOR_WINDOW taseditor_window;
|
||||
extern BOOKMARKS bookmarks;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
|
||||
LRESULT CALLBACK ScrBmpWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -77,7 +90,7 @@ void POPUP_DISPLAY::init()
|
|||
scr_bmi->bmiColors[i].rgbGreen = color_palette[i].peGreen;
|
||||
scr_bmi->bmiColors[i].rgbBlue = color_palette[i].peBlue;
|
||||
}
|
||||
HDC win_hdc = GetWindowDC(list.hwndList);
|
||||
HDC win_hdc = GetWindowDC(piano_roll.hwndList);
|
||||
scr_bmp = CreateDIBSection(win_hdc, scr_bmi, DIB_RGB_COLORS, (void**)&scr_ptr, 0, 0);
|
||||
// calculate coordinates
|
||||
ParentWindowMoved();
|
||||
|
@ -264,7 +277,7 @@ LRESULT APIENTRY MarkerNoteTooltipWndProc(HWND hwnd, UINT message, WPARAM wParam
|
|||
{
|
||||
// create static text field
|
||||
popup_display.marker_note_tooltip = CreateWindow(WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_SUNKEN, 1, 1, MARKER_NOTE_TOOLTIP_WIDTH - 2, MARKER_NOTE_TOOLTIP_HEIGHT - 2, hwnd, NULL, NULL, NULL);
|
||||
SendMessage(popup_display.marker_note_tooltip, WM_SETFONT, (WPARAM)list.hMarkersEditFont, 0);
|
||||
SendMessage(popup_display.marker_note_tooltip, WM_SETFONT, (WPARAM)piano_roll.hMarkersEditFont, 0);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of RECORDER class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Recorder - Tool for input recording
|
||||
[Singleton]
|
||||
* at the moment of recording movie input (at the beginning of a frame) by emulator's call the Recorder intercepts input data and applies its filters (multitracking/etc), then reflects input changes into History and Greenzone
|
||||
* regularly tracks virtual joypad buttonpresses and provides data for Piano Roll List Header lights. Also reacts on external changes of Recording status, and updates GUI (Recorder panel and Bookmarks/Branches caption)
|
||||
* implements input editing in Read-only mode (ColumnSet by pressing buttons on virtual joypad)
|
||||
* stores resources: ids and names of multitracking modes, suffixes for TAS Editor window caption
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
|
||||
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
|
||||
|
@ -14,7 +27,7 @@ extern TASEDITOR_WINDOW taseditor_window;
|
|||
extern BOOKMARKS bookmarks;
|
||||
extern HISTORY history;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
|
||||
// resources
|
||||
const char recordingCheckbox[10] = "Recording";
|
||||
|
@ -144,7 +157,7 @@ void RECORDER::update()
|
|||
old_joy[1] = current_joy[1];
|
||||
old_joy[2] = current_joy[2];
|
||||
old_joy[3] = current_joy[3];
|
||||
// fill current_joy data for listview header lights
|
||||
// fill current_joy data for Piano Roll header lights
|
||||
uint32 joypads = GetGamepadPressedImmediate();
|
||||
current_joy[0] = (joypads & 0xFF);
|
||||
current_joy[1] = ((joypads >> 8) & 0xFF);
|
||||
|
@ -172,7 +185,7 @@ void RECORDER::update()
|
|||
{
|
||||
// if the button was pressed right now
|
||||
if ((current_joy[joy] & (1 << button)) && !(old_joy[joy] & (1 << button)))
|
||||
list.ColumnSet(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, alt_pressed);
|
||||
piano_roll.ColumnSet(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, alt_pressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -241,7 +254,7 @@ void RECORDER::InputChanged()
|
|||
// set lights for changed buttons
|
||||
for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button)
|
||||
if ((new_joy[i] & (1 << button)) && !(old_joy[i] & (1 << button)))
|
||||
list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + i * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_JOYPAD1_A + i * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
@ -264,7 +277,7 @@ void RECORDER::InputChanged()
|
|||
// set lights for changed buttons
|
||||
for (int button = 0; button < NUM_JOYPAD_BUTTONS; ++button)
|
||||
if ((new_joy[joy] & (1 << button)) && !(old_joy[joy] & (1 << button)))
|
||||
list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for RECORDER class
|
||||
|
||||
enum
|
||||
{
|
||||
MULTITRACK_RECORDING_ALL = 0,
|
||||
|
|
|
@ -1,10 +1,29 @@
|
|||
//Implementation file of TASEDITOR_SELECTION class
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of SELECTION class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Selection - Manager of selections
|
||||
[Singleton]
|
||||
* contains definition of the type "Set of selected frames"
|
||||
* stores array of Sets of selected frames (History of selections)
|
||||
* saves and loads the data from a project file. On error: clears the array and starts new history by making empty selection
|
||||
* constantly tracks changes in selected rows of Piano Roll List, and makes a decision to create new point of selection rollback
|
||||
* implements all selection restoring operations: undo, redo
|
||||
* on demand: changes current selection: remove selection, jump to a frame with Selection cursor, select region, select all, select between Markers, reselect clipboard
|
||||
* regularly ensures that selection doesn't go beyond curent Piano Roll limits, detects if selection moved to another Marker and updates Note in the lower text field
|
||||
* implements the working of lower buttons << and >> (jumping on Markers)
|
||||
* also here's the code of lower text field (for editing Marker Notes)
|
||||
* stores resource: save id, lower text field prefix
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
|
||||
extern TASEDITOR_CONFIG taseditor_config;
|
||||
extern TASEDITOR_WINDOW taseditor_window;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern SPLICER splicer;
|
||||
|
||||
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
|
||||
|
@ -17,32 +36,32 @@ char selection_save_id[SELECTION_ID_LEN] = "SELECTION";
|
|||
char selection_skipsave_id[SELECTION_ID_LEN] = "SELECTIOX";
|
||||
char lowerMarkerText[] = "Marker ";
|
||||
|
||||
TASEDITOR_SELECTION::TASEDITOR_SELECTION()
|
||||
SELECTION::SELECTION()
|
||||
{
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::init()
|
||||
void SELECTION::init()
|
||||
{
|
||||
hwndPrevMarker = GetDlgItem(taseditor_window.hwndTasEditor, TASEDITOR_PREV_MARKER);
|
||||
hwndNextMarker = GetDlgItem(taseditor_window.hwndTasEditor, TASEDITOR_NEXT_MARKER);
|
||||
hwndSelectionMarker = GetDlgItem(taseditor_window.hwndTasEditor, IDC_SELECTION_MARKER);
|
||||
SendMessage(hwndSelectionMarker, WM_SETFONT, (WPARAM)list.hMarkersFont, 0);
|
||||
SendMessage(hwndSelectionMarker, WM_SETFONT, (WPARAM)piano_roll.hMarkersFont, 0);
|
||||
hwndSelectionMarkerEdit = GetDlgItem(taseditor_window.hwndTasEditor, IDC_SELECTION_MARKER_EDIT);
|
||||
SendMessage(hwndSelectionMarkerEdit, EM_SETLIMITTEXT, MAX_NOTE_LEN - 1, 0);
|
||||
SendMessage(hwndSelectionMarkerEdit, WM_SETFONT, (WPARAM)list.hMarkersEditFont, 0);
|
||||
SendMessage(hwndSelectionMarkerEdit, WM_SETFONT, (WPARAM)piano_roll.hMarkersEditFont, 0);
|
||||
// subclass the edit control
|
||||
selectionMarkerEdit_oldWndproc = (WNDPROC)SetWindowLong(hwndSelectionMarkerEdit, GWL_WNDPROC, (LONG)LowerMarkerEditWndProc);
|
||||
|
||||
reset();
|
||||
}
|
||||
void TASEDITOR_SELECTION::free()
|
||||
void SELECTION::free()
|
||||
{
|
||||
// clear history
|
||||
selections_history.resize(0);
|
||||
history_total_items = 0;
|
||||
temp_selection.clear();
|
||||
}
|
||||
void TASEDITOR_SELECTION::reset()
|
||||
void SELECTION::reset()
|
||||
{
|
||||
free();
|
||||
// init vars
|
||||
|
@ -57,13 +76,13 @@ void TASEDITOR_SELECTION::reset()
|
|||
track_selection_changes = true;
|
||||
reset_vars();
|
||||
}
|
||||
void TASEDITOR_SELECTION::reset_vars()
|
||||
void SELECTION::reset_vars()
|
||||
{
|
||||
old_prev_marker_button_state = prev_marker_button_state = false;
|
||||
old_next_marker_button_state = next_marker_button_state = false;
|
||||
must_find_current_marker = true;
|
||||
}
|
||||
void TASEDITOR_SELECTION::update()
|
||||
void SELECTION::update()
|
||||
{
|
||||
// keep selection within movie limits
|
||||
if (CurrentSelection().size())
|
||||
|
@ -125,7 +144,7 @@ void TASEDITOR_SELECTION::update()
|
|||
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::RedrawMarker()
|
||||
void SELECTION::RedrawMarker()
|
||||
{
|
||||
// redraw marker num
|
||||
char new_text[MAX_NOTE_LEN] = {0};
|
||||
|
@ -140,7 +159,7 @@ void TASEDITOR_SELECTION::RedrawMarker()
|
|||
SetWindowText(hwndSelectionMarkerEdit, new_text);
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::JumpPrevMarker(int speed)
|
||||
void SELECTION::JumpPrevMarker(int speed)
|
||||
{
|
||||
// if nothing is selected, consider playback cursor as current selection
|
||||
int index = GetCurrentSelectionBeginning();
|
||||
|
@ -157,7 +176,7 @@ void TASEDITOR_SELECTION::JumpPrevMarker(int speed)
|
|||
else
|
||||
JumpToFrame(0);
|
||||
}
|
||||
void TASEDITOR_SELECTION::JumpNextMarker(int speed)
|
||||
void SELECTION::JumpNextMarker(int speed)
|
||||
{
|
||||
// if nothing is selected, consider playback cursor as current selection
|
||||
int index = GetCurrentSelectionBeginning();
|
||||
|
@ -175,14 +194,14 @@ void TASEDITOR_SELECTION::JumpNextMarker(int speed)
|
|||
else
|
||||
JumpToFrame(last_frame);
|
||||
}
|
||||
void TASEDITOR_SELECTION::JumpToFrame(int frame)
|
||||
void SELECTION::JumpToFrame(int frame)
|
||||
{
|
||||
ClearSelection();
|
||||
SetRowSelection(frame);
|
||||
list.FollowSelection();
|
||||
piano_roll.FollowSelection();
|
||||
}
|
||||
// ----------------------------------------------------------
|
||||
void TASEDITOR_SELECTION::save(EMUFILE *os, bool really_save)
|
||||
void SELECTION::save(EMUFILE *os, bool really_save)
|
||||
{
|
||||
if (really_save)
|
||||
{
|
||||
|
@ -205,7 +224,7 @@ void TASEDITOR_SELECTION::save(EMUFILE *os, bool really_save)
|
|||
}
|
||||
}
|
||||
// returns true if couldn't load
|
||||
bool TASEDITOR_SELECTION::load(EMUFILE *is)
|
||||
bool SELECTION::load(EMUFILE *is)
|
||||
{
|
||||
// read "SELECTION" string
|
||||
char save_id[SELECTION_ID_LEN];
|
||||
|
@ -266,7 +285,7 @@ error:
|
|||
return true;
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os)
|
||||
void SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os)
|
||||
{
|
||||
write32le(selection.size(), os);
|
||||
if (selection.size())
|
||||
|
@ -275,7 +294,7 @@ void TASEDITOR_SELECTION::saveSelection(SelectionFrames& selection, EMUFILE *os)
|
|||
write32le(*it, os);
|
||||
}
|
||||
}
|
||||
bool TASEDITOR_SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is)
|
||||
bool SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is)
|
||||
{
|
||||
int temp_int, temp_size;
|
||||
selection.clear();
|
||||
|
@ -288,7 +307,7 @@ bool TASEDITOR_SELECTION::loadSelection(SelectionFrames& selection, EMUFILE *is)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
bool TASEDITOR_SELECTION::skiploadSelection(EMUFILE *is)
|
||||
bool SELECTION::skiploadSelection(EMUFILE *is)
|
||||
{
|
||||
int temp_size;
|
||||
if (!read32le(&temp_size, is)) return true;
|
||||
|
@ -297,7 +316,7 @@ bool TASEDITOR_SELECTION::skiploadSelection(EMUFILE *is)
|
|||
}
|
||||
// ----------------------------------------------------------
|
||||
//used to track selection
|
||||
void TASEDITOR_SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info)
|
||||
void SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info)
|
||||
{
|
||||
bool ON = !(info->uOldState & LVIS_SELECTED) && (info->uNewState & LVIS_SELECTED);
|
||||
bool OFF = (info->uOldState & LVIS_SELECTED) && !(info->uNewState & LVIS_SELECTED);
|
||||
|
@ -311,7 +330,7 @@ void TASEDITOR_SELECTION::ItemRangeChanged(NMLVODSTATECHANGE* info)
|
|||
|
||||
splicer.must_redraw_selection_text = true;
|
||||
}
|
||||
void TASEDITOR_SELECTION::ItemChanged(NMLISTVIEW* info)
|
||||
void SELECTION::ItemChanged(NMLISTVIEW* info)
|
||||
{
|
||||
int item = info->iItem;
|
||||
|
||||
|
@ -345,7 +364,7 @@ void TASEDITOR_SELECTION::ItemChanged(NMLISTVIEW* info)
|
|||
splicer.must_redraw_selection_text = true;
|
||||
}
|
||||
// ----------------------------------------------------------
|
||||
void TASEDITOR_SELECTION::AddNewSelectionToHistory()
|
||||
void SELECTION::AddNewSelectionToHistory()
|
||||
{
|
||||
// create new empty selection
|
||||
SelectionFrames selectionFrames;
|
||||
|
@ -367,61 +386,61 @@ void TASEDITOR_SELECTION::AddNewSelectionToHistory()
|
|||
selections_history[(history_start_pos + history_cursor_pos) % history_size] = selectionFrames;
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::jump(int new_pos)
|
||||
void SELECTION::jump(int new_pos)
|
||||
{
|
||||
if (new_pos < 0) new_pos = 0; else if (new_pos >= history_total_items) new_pos = history_total_items-1;
|
||||
if (new_pos == history_cursor_pos) return;
|
||||
|
||||
// make jump
|
||||
history_cursor_pos = new_pos;
|
||||
// update list items
|
||||
// update Piano Roll items
|
||||
EnforceSelectionToList();
|
||||
// also keep selection within list
|
||||
// also keep selection within Piano Roll
|
||||
update();
|
||||
}
|
||||
void TASEDITOR_SELECTION::undo()
|
||||
void SELECTION::undo()
|
||||
{
|
||||
jump(history_cursor_pos - 1);
|
||||
}
|
||||
void TASEDITOR_SELECTION::redo()
|
||||
void SELECTION::redo()
|
||||
{
|
||||
jump(history_cursor_pos + 1);
|
||||
}
|
||||
// ----------------------------------------------------------
|
||||
void TASEDITOR_SELECTION::ClearSelection()
|
||||
void SELECTION::ClearSelection()
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, -1, 0, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, -1, 0, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
}
|
||||
void TASEDITOR_SELECTION::ClearRowSelection(int index)
|
||||
void SELECTION::ClearRowSelection(int index)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, index, 0, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, index, 0, LVIS_SELECTED);
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::EnforceSelectionToList()
|
||||
void SELECTION::EnforceSelectionToList()
|
||||
{
|
||||
track_selection_changes = false;
|
||||
ClearSelection();
|
||||
for(SelectionFrames::reverse_iterator it(CurrentSelection().rbegin()); it != CurrentSelection().rend(); it++)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, *it, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, *it, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
track_selection_changes = true;
|
||||
}
|
||||
|
||||
void TASEDITOR_SELECTION::SelectAll()
|
||||
void SELECTION::SelectAll()
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, -1, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, -1, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
void TASEDITOR_SELECTION::SetRowSelection(int index)
|
||||
void SELECTION::SetRowSelection(int index)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, index, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, index, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
}
|
||||
void TASEDITOR_SELECTION::SetRegionSelection(int start, int end)
|
||||
void SELECTION::SetRegionSelection(int start, int end)
|
||||
{
|
||||
for (int i = start; i <= end; ++i)
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
|
||||
}
|
||||
void TASEDITOR_SELECTION::SelectBetweenMarkers()
|
||||
void SELECTION::SelectBetweenMarkers()
|
||||
{
|
||||
int center, upper_border, lower_border;
|
||||
int upper_marker, lower_marker;
|
||||
|
@ -443,7 +462,7 @@ void TASEDITOR_SELECTION::SelectBetweenMarkers()
|
|||
if (markers_manager.GetMarker(lower_marker)) break;
|
||||
|
||||
// clear selection without clearing focused, because otherwise there's strange bug when quickly pressing Ctrl+A right after clicking on already selected row
|
||||
ListView_SetItemState(list.hwndList, -1, 0, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, -1, 0, LVIS_SELECTED);
|
||||
|
||||
// special case
|
||||
if (upper_marker == -1 && lower_marker == movie_size)
|
||||
|
@ -458,7 +477,7 @@ void TASEDITOR_SELECTION::SelectBetweenMarkers()
|
|||
// default: select all between markers
|
||||
for (int i = upper_marker+1; i < lower_marker; ++i)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
} else if (upper_border == upper_marker+1 && lower_border == lower_marker-1)
|
||||
{
|
||||
|
@ -467,14 +486,14 @@ void TASEDITOR_SELECTION::SelectBetweenMarkers()
|
|||
if (lower_marker >= movie_size) lower_marker = movie_size - 1;
|
||||
for (int i = upper_marker; i <= lower_marker; ++i)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
} else if (upper_border <= upper_marker && lower_border >= lower_marker)
|
||||
{
|
||||
// selected all between markers and both markers selected too - now deselect lower marker
|
||||
for (int i = upper_marker; i < lower_marker; ++i)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
} else if (upper_border == upper_marker && lower_border == lower_marker-1)
|
||||
{
|
||||
|
@ -482,18 +501,18 @@ void TASEDITOR_SELECTION::SelectBetweenMarkers()
|
|||
if (lower_marker >= movie_size) lower_marker = movie_size - 1;
|
||||
for (int i = upper_marker+1; i <= lower_marker; ++i)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
} else if (upper_border == upper_marker+1 && lower_border == lower_marker)
|
||||
{
|
||||
// selected all between markers and lower marker selected too - now deselect lower marker (return to "selected all between markers")
|
||||
for (int i = upper_marker + 1; i < lower_marker; ++i)
|
||||
{
|
||||
ListView_SetItemState(list.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
ListView_SetItemState(piano_roll.hwndList, i, LVIS_SELECTED, LVIS_SELECTED);
|
||||
}
|
||||
}
|
||||
}
|
||||
void TASEDITOR_SELECTION::ReselectClipboard()
|
||||
void SELECTION::ReselectClipboard()
|
||||
{
|
||||
SelectionFrames clipboard_selection = splicer.GetClipboardSelection();
|
||||
if (clipboard_selection.size() == 0) return;
|
||||
|
@ -501,41 +520,41 @@ void TASEDITOR_SELECTION::ReselectClipboard()
|
|||
ClearSelection();
|
||||
CurrentSelection() = clipboard_selection;
|
||||
EnforceSelectionToList();
|
||||
// also keep selection within list
|
||||
// also keep selection within Piano Roll
|
||||
update();
|
||||
}
|
||||
|
||||
// getters
|
||||
int TASEDITOR_SELECTION::GetCurrentSelectionSize()
|
||||
int SELECTION::GetCurrentSelectionSize()
|
||||
{
|
||||
return selections_history[(history_start_pos + history_cursor_pos) % history_size].size();
|
||||
}
|
||||
int TASEDITOR_SELECTION::GetCurrentSelectionBeginning()
|
||||
int SELECTION::GetCurrentSelectionBeginning()
|
||||
{
|
||||
if (selections_history[(history_start_pos + history_cursor_pos) % history_size].size())
|
||||
return *selections_history[(history_start_pos + history_cursor_pos) % history_size].begin();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
bool TASEDITOR_SELECTION::CheckFrameSelected(int frame)
|
||||
bool SELECTION::CheckFrameSelected(int frame)
|
||||
{
|
||||
if(CurrentSelection().find(frame) == CurrentSelection().end())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
SelectionFrames* TASEDITOR_SELECTION::MakeStrobe()
|
||||
SelectionFrames* SELECTION::MakeStrobe()
|
||||
{
|
||||
// copy current selection to temp_selection
|
||||
temp_selection = selections_history[(history_start_pos + history_cursor_pos) % history_size];
|
||||
return &temp_selection;
|
||||
}
|
||||
SelectionFrames& TASEDITOR_SELECTION::GetStrobedSelection()
|
||||
SelectionFrames& SELECTION::GetStrobedSelection()
|
||||
{
|
||||
return temp_selection;
|
||||
}
|
||||
|
||||
// this getter is private
|
||||
SelectionFrames& TASEDITOR_SELECTION::CurrentSelection()
|
||||
SelectionFrames& SELECTION::CurrentSelection()
|
||||
{
|
||||
return selections_history[(history_start_pos + history_cursor_pos) % history_size];
|
||||
}
|
||||
|
@ -545,7 +564,7 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
|
|||
if (markers_manager.marker_note_edit == MARKER_NOTE_EDIT_LOWER)
|
||||
{
|
||||
extern PLAYBACK playback;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
switch(msg)
|
||||
{
|
||||
case WM_CHAR:
|
||||
|
@ -555,11 +574,11 @@ LRESULT APIENTRY LowerMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
|
|||
case VK_ESCAPE:
|
||||
// revert text to original note text
|
||||
SetWindowText(selection.hwndSelectionMarkerEdit, markers_manager.GetNote(selection.shown_marker).c_str());
|
||||
SetFocus(list.hwndList);
|
||||
SetFocus(piano_roll.hwndList);
|
||||
return 0;
|
||||
case VK_RETURN:
|
||||
// exit and save text changes
|
||||
SetFocus(list.hwndList);
|
||||
SetFocus(piano_roll.hwndList);
|
||||
return 0;
|
||||
case VK_TAB:
|
||||
// switch to upper edit control (also exit and save text changes)
|
|
@ -1,13 +1,14 @@
|
|||
//Specification file for TASEDITOR_SELECTION class
|
||||
// Specification file for SELECTION class
|
||||
|
||||
#include <set>
|
||||
typedef std::set<int> SelectionFrames;
|
||||
|
||||
#define SELECTION_ID_LEN 10
|
||||
|
||||
class TASEDITOR_SELECTION
|
||||
class SELECTION
|
||||
{
|
||||
public:
|
||||
TASEDITOR_SELECTION();
|
||||
SELECTION();
|
||||
void init();
|
||||
void free();
|
||||
void reset();
|
|
@ -1,11 +1,29 @@
|
|||
//Implementation file of Snapshot class (Undo feature)
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of Snapshot class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Snapshot - Snapshot of all edited data
|
||||
* stores the data of specific snapshot of the movie: size, input data (commands and joysticks), Markers at the moment of creating the snapshot, keyframe, type and description of the snapshot (including the time of creation)
|
||||
* also stores info about sequential recording of input
|
||||
* optionally can store map of Hot Changes
|
||||
* implements snapshot creation: copying input, copying Hot Changes, copying Markers, setting time of creation
|
||||
* implements full/partial restoring of data from snapshot: input, Hot Changes, Markers
|
||||
* implements compression and decompression of stored data
|
||||
* saves and loads the data from a project file. On error: sends warning to caller
|
||||
* implements searching of first mismatch comparing two snapshots ot comparing snapshot to a movie
|
||||
* provides interface for reading certain data: reading input of any certain frame, reading value at any point of Hot Changes map
|
||||
* implements all operations with Hot Changes maps: copying (full/partial), updating/fading, setting new hot places by comparing input of two snapshots
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "zlib.h"
|
||||
|
||||
int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES] = {1, 2, 4};
|
||||
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern SELECTION selection;
|
||||
|
||||
extern int GetInputType(MovieData& md);
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
//Specification file for Input Snapshot class
|
||||
// Specification file for Snapshot class
|
||||
|
||||
enum Input_types
|
||||
{
|
||||
INPUT_TYPE_1P,
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of SPLICER class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Splicer - Tool for montage
|
||||
[Singleton]
|
||||
* implements operations of mass-changing input: copy/paste, cloning, clearing region, insertion and deletion of frames, truncating
|
||||
* stores data about the selection used in last "Copy to Clipboard" operation
|
||||
* regularly checks the state of current selection and displays info on GUI, also displays info about input in Clipboard
|
||||
* when launching TAS Editor, it checks Clipboard contents
|
||||
* stores resources: mnemonics of buttons, texts for selection/clipboard info on GUI
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include <sstream>
|
||||
#include "taseditor_project.h"
|
||||
#include "../Win32InputBox.h"
|
||||
|
@ -9,8 +23,8 @@ extern HISTORY history;
|
|||
extern MARKERS_MANAGER markers_manager;
|
||||
extern PLAYBACK playback;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern SELECTION selection;
|
||||
|
||||
extern int joysticks_per_frame[NUM_SUPPORTED_INPUT_TYPES];
|
||||
extern int GetInputType(MovieData& md);
|
||||
|
@ -121,7 +135,7 @@ void SPLICER::CloneFrames()
|
|||
} else if (markers_changed)
|
||||
{
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
if (markers_changed)
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
|
@ -162,7 +176,7 @@ void SPLICER::InsertFrames()
|
|||
} else if (markers_changed)
|
||||
{
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
if (markers_changed)
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
|
@ -195,7 +209,7 @@ void SPLICER::InsertNumFrames()
|
|||
markers_changed = true;
|
||||
}
|
||||
// select inserted rows
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
selection.SetRegionSelection(index, index + frames - 1);
|
||||
int first_changes = history.RegisterChanges(MODTYPE_INSERT, index);
|
||||
if (first_changes >= 0)
|
||||
|
@ -204,7 +218,7 @@ void SPLICER::InsertNumFrames()
|
|||
} else if (markers_changed)
|
||||
{
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, index);
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
if (markers_changed)
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
|
@ -236,8 +250,8 @@ void SPLICER::DeleteFrames()
|
|||
// check if user deleted all frames
|
||||
if (!currMovieData.getNumRecords())
|
||||
playback.StartFromZero();
|
||||
// reduce list
|
||||
list.update();
|
||||
// reduce Piano Roll
|
||||
piano_roll.update();
|
||||
|
||||
int result = history.RegisterChanges(MODTYPE_DELETE, start_index);
|
||||
if (result >= 0)
|
||||
|
@ -249,7 +263,7 @@ void SPLICER::DeleteFrames()
|
|||
if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
|
||||
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
|
||||
else
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
if (markers_changed)
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, start_index);
|
||||
}
|
||||
|
@ -295,7 +309,7 @@ void SPLICER::Truncate()
|
|||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
}
|
||||
}
|
||||
list.update();
|
||||
piano_roll.update();
|
||||
int result = history.RegisterChanges(MODTYPE_TRUNCATE, frame+1);
|
||||
if (result >= 0)
|
||||
{
|
||||
|
@ -306,7 +320,7 @@ void SPLICER::Truncate()
|
|||
if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
|
||||
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
|
||||
else
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
if (markers_changed)
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_UNSET, frame+1, last_frame_was);
|
||||
}
|
||||
|
@ -501,13 +515,13 @@ bool SPLICER::Paste()
|
|||
}
|
||||
|
||||
greenzone.InvalidateAndCheck(history.RegisterChanges(MODTYPE_PASTE, *current_selection_begin));
|
||||
// flash list header columns that were changed during paste
|
||||
// flash Piano Roll header columns that were changed during paste
|
||||
for (int joy = 0; joy < num_joypads; ++joy)
|
||||
{
|
||||
for (int btn = 0; btn < NUM_JOYPAD_BUTTONS; ++btn)
|
||||
{
|
||||
if (flash_joy[joy] & (1 << btn))
|
||||
list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + btn, HEADER_LIGHT_MAX);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + btn, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
result = true;
|
||||
|
@ -614,17 +628,17 @@ bool SPLICER::PasteInsert()
|
|||
} else if (markers_changed)
|
||||
{
|
||||
history.RegisterMarkersChange(MODTYPE_MARKER_MOVE, *current_selection->begin());
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
if (markers_changed)
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
// flash list header columns that were changed during paste
|
||||
// flash Piano Roll header columns that were changed during paste
|
||||
for (int joy = 0; joy < num_joypads; ++joy)
|
||||
{
|
||||
for (int btn = 0; btn < NUM_JOYPAD_BUTTONS; ++btn)
|
||||
{
|
||||
if (flash_joy[joy] & (1 << btn))
|
||||
list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + btn, HEADER_LIGHT_MAX);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + btn, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
result = true;
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of TASEDITOR_CONFIG class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Config - Current settings
|
||||
[Singleton]
|
||||
* stores current state of all TAS Editor settings
|
||||
* all TAS Editor modules can get or set any data within Config
|
||||
* when launching FCEUX, the emulator writes data from fceux.cfg file to the Config, when exiting it reads the data back to fceux.cfg
|
||||
* stores resources: default values of all settings, min/max values of settings
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "../common.h"
|
||||
#include "taseditor_config.h"
|
||||
|
||||
|
@ -30,7 +43,7 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
|
|||
combine_consecutive_rec = true;
|
||||
use_1p_rec = true;
|
||||
columnset_by_keys = false;
|
||||
keyboard_for_listview = true;
|
||||
keyboard_for_piano_roll = true;
|
||||
superimpose = 0; // SUPERIMPOSE_UNCHECKED
|
||||
superimpose_affects_paste = true;
|
||||
branch_full_movie = true;
|
||||
|
@ -48,7 +61,7 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
|
|||
savecompact_bookmarks = true;
|
||||
savecompact_greenzone = false;
|
||||
savecompact_history = false;
|
||||
savecompact_list = true;
|
||||
savecompact_piano_roll = true;
|
||||
savecompact_selection = false;
|
||||
findnote_matchcase = false;
|
||||
findnote_search_up = false;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Specification file for TASEDITOR_CONFIG class
|
||||
// --------------------------------------------------------
|
||||
|
||||
#define GREENZONE_CAPACITY_MIN 1
|
||||
#define GREENZONE_CAPACITY_MAX 50000
|
||||
|
@ -46,7 +45,7 @@ public:
|
|||
bool combine_consecutive_rec;
|
||||
bool use_1p_rec;
|
||||
bool columnset_by_keys;
|
||||
bool keyboard_for_listview;
|
||||
bool keyboard_for_piano_roll;
|
||||
int superimpose;
|
||||
bool superimpose_affects_paste;
|
||||
bool branch_full_movie;
|
||||
|
@ -64,7 +63,7 @@ public:
|
|||
bool savecompact_bookmarks;
|
||||
bool savecompact_greenzone;
|
||||
bool savecompact_history;
|
||||
bool savecompact_list;
|
||||
bool savecompact_piano_roll;
|
||||
bool savecompact_selection;
|
||||
bool findnote_matchcase;
|
||||
bool findnote_search_up;
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of TASEDITOR_LUA class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Lua - Manager of Lua features
|
||||
[Singleton]
|
||||
* implements logic of all functions of "taseditor" Lua library
|
||||
* stores the list of pending input changes
|
||||
* on demend: (from FCEUX Lua engine) updates GUI items on "Lua" panel of TAS Editor window
|
||||
* stores resources: ids of joypads for input changes, max length of a name for applychanges()
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
|
||||
extern TASEDITOR_CONFIG taseditor_config;
|
||||
|
@ -9,8 +22,8 @@ extern BOOKMARKS bookmarks;
|
|||
extern RECORDER recorder;
|
||||
extern PLAYBACK playback;
|
||||
extern GREENZONE greenzone;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern SELECTION selection;
|
||||
|
||||
extern void TaseditorUpdateManualFunctionStatus();
|
||||
|
||||
|
@ -116,8 +129,8 @@ int TASEDITOR_LUA::setmarker(int frame)
|
|||
// new marker was created - register changes in TAS Editor
|
||||
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_SET, frame);
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
list.RedrawRow(frame);
|
||||
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
piano_roll.RedrawRow(frame);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
return marker_id;
|
||||
|
@ -136,8 +149,8 @@ void TASEDITOR_LUA::clearmarker(int frame)
|
|||
// marker was deleted - register changes in TAS Editor
|
||||
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_UNSET, frame);
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
list.RedrawRow(frame);
|
||||
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
piano_roll.RedrawRow(frame);
|
||||
piano_roll.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -409,8 +422,8 @@ int TASEDITOR_LUA::applyinputchanges(const char* name)
|
|||
// check if user deleted all frames
|
||||
if (!currMovieData.getNumRecords())
|
||||
playback.StartFromZero();
|
||||
// reduce list
|
||||
list.update();
|
||||
// reduce Piano Roll
|
||||
piano_roll.update();
|
||||
// check actual changes
|
||||
int result = history.RegisterLuaChanges(name, start_index, InsertionDeletion_was_made);
|
||||
if (result >= 0)
|
||||
|
@ -419,7 +432,7 @@ int TASEDITOR_LUA::applyinputchanges(const char* name)
|
|||
} else if (greenzone.greenZoneCount >= currMovieData.getNumRecords())
|
||||
{
|
||||
greenzone.InvalidateAndCheck(currMovieData.getNumRecords()-1);
|
||||
} else list.RedrawList();
|
||||
} else piano_roll.RedrawList();
|
||||
|
||||
pending_changes.resize(0);
|
||||
return result;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for TASEDITOR_LUA class
|
||||
|
||||
#define LUACHANGES_NAME_MAX_LEN 70 // custom name of operation should not be longer than 70 letters
|
||||
|
||||
struct PENDING_CHANGES
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of TASEDITOR_PROJECT class
|
||||
// (C) 2011-2012 AnS
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Project - Header of working project
|
||||
[Singleton]
|
||||
* stores the info about current project filename and about having unsaved changes
|
||||
* implements saving and loading project files from filesystem
|
||||
* implements autosave function
|
||||
* stores resources: autosave period scale, default filename
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "utils/xstring.h"
|
||||
#include "version.h"
|
||||
|
@ -12,8 +25,8 @@ extern GREENZONE greenzone;
|
|||
extern PLAYBACK playback;
|
||||
extern RECORDER recorder;
|
||||
extern HISTORY history;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern SELECTION selection;
|
||||
extern SPLICER splicer;
|
||||
|
||||
extern void FCEU_PrintError(char *format, ...);
|
||||
|
@ -69,7 +82,7 @@ bool TASEDITOR_PROJECT::save()
|
|||
bookmarks.save(ofs);
|
||||
greenzone.save(ofs);
|
||||
history.save(ofs);
|
||||
list.save(ofs);
|
||||
piano_roll.save(ofs);
|
||||
selection.save(ofs);
|
||||
|
||||
delete ofs;
|
||||
|
@ -78,7 +91,7 @@ bool TASEDITOR_PROJECT::save()
|
|||
this->reset();
|
||||
return true;
|
||||
}
|
||||
bool TASEDITOR_PROJECT::save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_list, bool save_selection)
|
||||
bool TASEDITOR_PROJECT::save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_piano_roll, bool save_selection)
|
||||
{
|
||||
EMUFILE_FILE* ofs = FCEUD_UTF8_fstream(filename, "wb");
|
||||
|
||||
|
@ -91,14 +104,14 @@ bool TASEDITOR_PROJECT::save_compact(char* filename, bool save_binary, bool save
|
|||
if (save_bookmarks) saved_stuff |= BOOKMARKS_SAVED;
|
||||
if (save_greenzone) saved_stuff |= GREENZONE_SAVED;
|
||||
if (save_history) saved_stuff |= HISTORY_SAVED;
|
||||
if (save_list) saved_stuff |= LIST_SAVED;
|
||||
if (save_piano_roll) saved_stuff |= PIANO_ROLL_SAVED;
|
||||
if (save_selection) saved_stuff |= SELECTION_SAVED;
|
||||
write32le(saved_stuff, ofs);
|
||||
markers_manager.save(ofs, save_markers);
|
||||
bookmarks.save(ofs, save_bookmarks);
|
||||
greenzone.save(ofs, save_greenzone);
|
||||
history.save(ofs, save_history);
|
||||
list.save(ofs, save_list);
|
||||
piano_roll.save(ofs, save_piano_roll);
|
||||
selection.save(ofs, save_selection);
|
||||
|
||||
delete ofs;
|
||||
|
@ -142,7 +155,7 @@ bool TASEDITOR_PROJECT::load(char* fullname)
|
|||
bookmarks.load(&ifs);
|
||||
greenzone.load(&ifs);
|
||||
history.load(&ifs);
|
||||
list.load(&ifs);
|
||||
piano_roll.load(&ifs);
|
||||
selection.load(&ifs);
|
||||
|
||||
// reset other modules
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
// Specification file for the TASEDITOR_PROJECT class
|
||||
|
||||
#include <time.h>
|
||||
#include "movie.h"
|
||||
#include "../common.h"
|
||||
#include "taseditor_config.h"
|
||||
#include "taseditor_window.h"
|
||||
#include "taseditor_sel.h"
|
||||
#include "selection.h"
|
||||
#include "markers_manager.h"
|
||||
#include "snapshot.h"
|
||||
#include "history.h"
|
||||
|
@ -12,7 +13,7 @@
|
|||
#include "recorder.h"
|
||||
#include "greenzone.h"
|
||||
#include "bookmarks.h"
|
||||
#include "taseditor_list.h"
|
||||
#include "piano_roll.h"
|
||||
#include "taseditor_lua.h"
|
||||
#include "splicer.h"
|
||||
#include "popup_display.h"
|
||||
|
@ -23,9 +24,9 @@
|
|||
#define BOOKMARKS_SAVED 2
|
||||
#define GREENZONE_SAVED 4
|
||||
#define HISTORY_SAVED 8
|
||||
#define LIST_SAVED 16
|
||||
#define PIANO_ROLL_SAVED 16
|
||||
#define SELECTION_SAVED 32
|
||||
#define ALL_SAVED MARKERS_SAVED|BOOKMARKS_SAVED|GREENZONE_SAVED|HISTORY_SAVED|LIST_SAVED|SELECTION_SAVED
|
||||
#define ALL_SAVED MARKERS_SAVED|BOOKMARKS_SAVED|GREENZONE_SAVED|HISTORY_SAVED|PIANO_ROLL_SAVED|SELECTION_SAVED
|
||||
|
||||
class TASEDITOR_PROJECT
|
||||
{
|
||||
|
@ -36,7 +37,7 @@ public:
|
|||
void update();
|
||||
|
||||
bool save();
|
||||
bool save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_list, bool save_selection);
|
||||
bool save_compact(char* filename, bool save_binary, bool save_markers, bool save_bookmarks, bool save_greenzone, bool save_history, bool save_piano_roll, bool save_selection);
|
||||
bool load(char* fullname);
|
||||
|
||||
void RenameProject(char* new_fullname);
|
||||
|
|
|
@ -1,4 +1,19 @@
|
|||
// ---------------------------------------------------------------------------------
|
||||
// Implementation file of TASEDITOR_WINDOW class
|
||||
// ---------------------------------------------------------------------------------
|
||||
/*
|
||||
Window - User Interface
|
||||
[Singleton]
|
||||
* implements all operations with TAS Editor window: creating, redrawing, resizing, moving, tooltips, clicks
|
||||
* processes OS messages and sends signals from user to TAS Editor modules (also implements some minor commands on-site, like Greenzone capacity dialog and such)
|
||||
* switches off/on emulator's keyboard input when the window loses/gains focus
|
||||
* on demand: updates the window caption
|
||||
* updates all checkboxes and menu items when some settings change
|
||||
* stores info about 10 last projects (File->Recent) and updates it when saving/loading files
|
||||
* stores resources: window caption, help filename, size and other properties of all GUI items
|
||||
*/
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
#include "taseditor_project.h"
|
||||
#include "../main.h"
|
||||
#include "../Win32InputBox.h"
|
||||
|
@ -13,8 +28,8 @@ extern PLAYBACK playback;
|
|||
extern GREENZONE greenzone;
|
||||
extern RECORDER recorder;
|
||||
extern TASEDITOR_PROJECT project;
|
||||
extern TASEDITOR_LIST list;
|
||||
extern TASEDITOR_SELECTION selection;
|
||||
extern PIANO_ROLL piano_roll;
|
||||
extern SELECTION selection;
|
||||
extern SPLICER splicer;
|
||||
extern MARKERS_MANAGER markers_manager;
|
||||
extern BOOKMARKS bookmarks;
|
||||
|
@ -430,7 +445,7 @@ void TASEDITOR_WINDOW::UpdateCheckedItems()
|
|||
CheckMenuItem(hmenu, ID_CONFIG_COMBINECONSECUTIVERECORDINGS, taseditor_config.combine_consecutive_rec?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_USE1PFORRECORDING, taseditor_config.use_1p_rec?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_USEINPUTKEYSFORCOLUMNSET, taseditor_config.columnset_by_keys?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW, taseditor_config.keyboard_for_listview?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_KEYBOARDCONTROLSINPIANOROLL, taseditor_config.keyboard_for_piano_roll?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE, taseditor_config.superimpose_affects_paste?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_COLUMNSETPATTERNSKIPSLAG, taseditor_config.pattern_skips_lag?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_SILENTAUTOSAVE, taseditor_config.silent_autosave?MF_CHECKED : MF_UNCHECKED);
|
||||
|
@ -668,10 +683,10 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
switch(((LPNMHDR)lParam)->code)
|
||||
{
|
||||
case NM_CUSTOMDRAW:
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, list.CustomDraw((NMLVCUSTOMDRAW*)lParam));
|
||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, piano_roll.CustomDraw((NMLVCUSTOMDRAW*)lParam));
|
||||
return TRUE;
|
||||
case LVN_GETDISPINFO:
|
||||
list.GetDispInfo((NMLVDISPINFO*)lParam);
|
||||
piano_roll.GetDispInfo((NMLVDISPINFO*)lParam);
|
||||
break;
|
||||
case LVN_ITEMCHANGED:
|
||||
selection.ItemChanged((LPNMLISTVIEW) lParam);
|
||||
|
@ -679,15 +694,6 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case LVN_ODSTATECHANGED:
|
||||
selection.ItemRangeChanged((LPNMLVODSTATECHANGE) lParam);
|
||||
break;
|
||||
/*
|
||||
case LVN_ENDSCROLL:
|
||||
// redraw upper and lower list rows (fix for known WinXP bug)
|
||||
int start = ListView_GetTopIndex(hwndList);
|
||||
ListView_RedrawItems(hwndList,start,start);
|
||||
int end = start + listItems - 1;
|
||||
ListView_RedrawItems(hwndList,end,end);
|
||||
break;
|
||||
*/
|
||||
}
|
||||
break;
|
||||
case IDC_BOOKMARKSLIST:
|
||||
|
@ -754,12 +760,12 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
{
|
||||
SetTextColor((HDC)wParam, PLAYBACK_MARKER_COLOR);
|
||||
SetBkMode((HDC)wParam, TRANSPARENT);
|
||||
return (BOOL)(list.bg_brush);
|
||||
return (BOOL)(piano_roll.bg_brush);
|
||||
} else if ((HWND)lParam == selection.hwndSelectionMarker)
|
||||
{
|
||||
SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHT));
|
||||
SetBkMode((HDC)wParam, TRANSPARENT);
|
||||
return (BOOL)list.bg_brush;
|
||||
return (BOOL)piano_roll.bg_brush;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -795,7 +801,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
// disable FCEUX keyboard
|
||||
taseditor_window.ClearTaseditorInput();
|
||||
if (taseditor_config.follow_note_context)
|
||||
list.FollowMarker(playback.shown_marker);
|
||||
piano_roll.FollowMarker(playback.shown_marker);
|
||||
break;
|
||||
}
|
||||
case EN_KILLFOCUS:
|
||||
|
@ -827,7 +833,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
// disable FCEUX keyboard
|
||||
taseditor_window.ClearTaseditorInput();
|
||||
if (taseditor_config.follow_note_context)
|
||||
list.FollowMarker(selection.shown_marker);
|
||||
piano_roll.FollowMarker(selection.shown_marker);
|
||||
break;
|
||||
}
|
||||
case EN_KILLFOCUS:
|
||||
|
@ -986,7 +992,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
taseditor_window.UpdateCheckedItems();
|
||||
// if switched off then maybe jump to target frame
|
||||
if (!taseditor_config.follow_playback && playback.pause_frame)
|
||||
list.FollowPauseframe();
|
||||
piano_roll.FollowPauseframe();
|
||||
break;
|
||||
case CHECK_TURBO_SEEK:
|
||||
//switch "Turbo seek" flag
|
||||
|
@ -999,13 +1005,13 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case ID_VIEW_SHOW_LAG_FRAMES:
|
||||
taseditor_config.show_lag_frames ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
bookmarks.RedrawBookmarksList();
|
||||
break;
|
||||
case ID_VIEW_SHOW_MARKERS:
|
||||
taseditor_config.show_markers ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
list.RedrawList(); // no need to redraw Bookmarks, as Markers are only shown in main list
|
||||
piano_roll.RedrawList(); // no need to redraw Bookmarks, as Markers are only shown in Piano Roll
|
||||
break;
|
||||
case ID_VIEW_SHOWBRANCHSCREENSHOTS:
|
||||
//switch "Show Branch Screenshots" flag
|
||||
|
@ -1020,7 +1026,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case ID_VIEW_ENABLEHOTCHANGES:
|
||||
taseditor_config.enable_hot_changes ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
list.RedrawList(); // redraw buttons text
|
||||
piano_roll.RedrawList(); // redraw buttons text
|
||||
break;
|
||||
case ID_VIEW_JUMPWHENMAKINGUNDO:
|
||||
taseditor_config.jump_to_undo ^= 1;
|
||||
|
@ -1066,8 +1072,8 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
taseditor_config.undo_levels = new_size;
|
||||
history.reset();
|
||||
selection.reset();
|
||||
// hot changes were cleared, so update list
|
||||
list.RedrawList();
|
||||
// hot changes were cleared, so update Piano Roll
|
||||
piano_roll.RedrawList();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -1105,7 +1111,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case ID_CONFIG_BINDMARKERSTOINPUT:
|
||||
taseditor_config.bind_markers ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
list.RedrawList();
|
||||
piano_roll.RedrawList();
|
||||
break;
|
||||
case ID_CONFIG_EMPTYNEWMARKERNOTES:
|
||||
taseditor_config.empty_marker_notes ^= 1;
|
||||
|
@ -1125,8 +1131,8 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
taseditor_config.columnset_by_keys ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
break;
|
||||
case ID_CONFIG_KEYBOARDCONTROLSINLISTVIEW:
|
||||
taseditor_config.keyboard_for_listview ^= 1;
|
||||
case ID_CONFIG_KEYBOARDCONTROLSINPIANOROLL:
|
||||
taseditor_config.keyboard_for_piano_roll ^= 1;
|
||||
taseditor_window.UpdateCheckedItems();
|
||||
break;
|
||||
case ID_CONFIG_SUPERIMPOSE_AFFECTS_PASTE:
|
||||
|
@ -1218,8 +1224,8 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
int result = history.undo();
|
||||
if (result >= 0)
|
||||
{
|
||||
list.update();
|
||||
list.FollowUndo();
|
||||
piano_roll.update();
|
||||
piano_roll.FollowUndo();
|
||||
greenzone.InvalidateAndCheck(result);
|
||||
}
|
||||
}
|
||||
|
@ -1231,8 +1237,8 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
int result = history.redo();
|
||||
if (result >= 0)
|
||||
{
|
||||
list.update();
|
||||
list.FollowUndo();
|
||||
piano_roll.update();
|
||||
piano_roll.FollowUndo();
|
||||
greenzone.InvalidateAndCheck(result);
|
||||
}
|
||||
break;
|
||||
|
@ -1241,31 +1247,31 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
case ACCEL_CTRL_Q:
|
||||
{
|
||||
selection.undo();
|
||||
list.FollowSelection();
|
||||
piano_roll.FollowSelection();
|
||||
break;
|
||||
}
|
||||
case ID_EDIT_SELECTIONREDO:
|
||||
case ACCEL_CTRL_W:
|
||||
{
|
||||
selection.redo();
|
||||
list.FollowSelection();
|
||||
piano_roll.FollowSelection();
|
||||
break;
|
||||
}
|
||||
case ID_EDIT_RESELECTCLIPBOARD:
|
||||
case ACCEL_CTRL_B:
|
||||
{
|
||||
selection.ReselectClipboard();
|
||||
list.FollowSelection();
|
||||
piano_roll.FollowSelection();
|
||||
break;
|
||||
}
|
||||
case IDC_JUMP_PLAYBACK_BUTTON:
|
||||
{
|
||||
list.FollowPlayback();
|
||||
piano_roll.FollowPlayback();
|
||||
break;
|
||||
}
|
||||
case IDC_JUMP_SELECTION_BUTTON:
|
||||
{
|
||||
list.FollowSelection();
|
||||
piano_roll.FollowSelection();
|
||||
break;
|
||||
}
|
||||
case ID_SELECTED_SETMARKER:
|
||||
|
@ -1283,7 +1289,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
if (markers_manager.SetMarker(*it))
|
||||
{
|
||||
changes_made = true;
|
||||
list.RedrawRow(*it);
|
||||
piano_roll.RedrawRow(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1309,7 +1315,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
{
|
||||
markers_manager.ClearMarker(*it);
|
||||
changes_made = true;
|
||||
list.RedrawRow(*it);
|
||||
piano_roll.RedrawRow(*it);
|
||||
}
|
||||
}
|
||||
if (changes_made)
|
||||
|
@ -1395,7 +1401,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
break;
|
||||
}
|
||||
case WM_MOUSEWHEEL:
|
||||
return SendMessage(list.hwndList, uMsg, wParam, lParam);
|
||||
return SendMessage(piano_roll.hwndList, uMsg, wParam, lParam);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// Specification file for TASEDITOR_WINDOW class
|
||||
|
||||
#define TASEDITOR_WINDOW_TOTAL_ITEMS 43
|
||||
#define TOOLTIP_TEXT_MAX_LEN 80
|
||||
#define TOOLTIPS_AUTOPOP_TIMEOUT 30000
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
#include "./drivers/win/taseditor/taseditor_window.h"
|
||||
#include "./drivers/win/taseditor/markers.h"
|
||||
#include "./drivers/win/taseditor/taseditor_sel.h"
|
||||
#include "./drivers/win/taseditor/selection.h"
|
||||
#include "./drivers/win/taseditor/snapshot.h"
|
||||
#include "./drivers/win/taseditor/bookmarks.h"
|
||||
#include "./drivers/win/taseditor/playback.h"
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include "drivers/win/common.h"
|
||||
#include "drivers/win/taseditor/taseditor_sel.h"
|
||||
#include "drivers/win/taseditor/selection.h"
|
||||
#include "drivers/win/taseditor/markers.h"
|
||||
#include "drivers/win/taseditor/snapshot.h"
|
||||
#include "drivers/win/taseditor/taseditor_lua.h"
|
||||
|
|
|
@ -427,16 +427,16 @@
|
|||
<ClCompile Include="..\src\drivers\win\taseditor\history.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\markers.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\markers_manager.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\piano_roll.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\playback.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\popup_display.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\recorder.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\selection.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\snapshot.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\splicer.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_config.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_list.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_lua.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_project.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_sel.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_window.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\texthook.cpp" />
|
||||
<ClCompile Include="..\src\drivers\win\throttle.cpp" />
|
||||
|
@ -754,16 +754,16 @@
|
|||
<ClInclude Include="..\src\drivers\win\taseditor\history.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\markers.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\markers_manager.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\piano_roll.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\playback.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\popup_display.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\recorder.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\selection.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\snapshot.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\splicer.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_config.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_list.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_lua.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_project.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_sel.h" />
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_window.h" />
|
||||
<ClInclude Include="..\src\drivers\win\texthook.h" />
|
||||
<ClInclude Include="..\src\drivers\win\throttle.h" />
|
||||
|
|
|
@ -910,18 +910,12 @@
|
|||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_config.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_list.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_lua.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_project.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_sel.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\taseditor_window.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
|
@ -958,6 +952,12 @@
|
|||
<ClCompile Include="..\src\drivers\win\taseditor\markers_manager.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\piano_roll.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\drivers\win\taseditor\selection.cpp">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\cart.h">
|
||||
|
@ -1402,18 +1402,12 @@
|
|||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_config.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_list.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_lua.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_project.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_sel.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\taseditor_window.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1450,6 +1444,12 @@
|
|||
<ClInclude Include="..\src\drivers\win\taseditor\markers_manager.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\piano_roll.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\drivers\win\taseditor\selection.h">
|
||||
<Filter>drivers\win\taseditor</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\src\drivers\win\res.rc">
|
||||
|
|
Loading…
Reference in New Issue