GUI: add "set loop" to sample editor
This commit is contained in:
parent
f8796f8ec9
commit
5de31f510c
2
TODO.md
2
TODO.md
|
@ -3,12 +3,10 @@
|
|||
- additional YM2612 features
|
||||
- CSM
|
||||
- MSM6258 pitch and clock select
|
||||
- MSM6295 clock select
|
||||
- the last three compat flags
|
||||
- add OPL drum instrument type
|
||||
- Game Boy envelope macro/sequence
|
||||
- drag-and-drop ins/wave/sample loading
|
||||
- "set loop" in right click menu of sample editor
|
||||
- sample editor preview in selection
|
||||
- rewrite the system name detection function anyway
|
||||
- unified data view
|
||||
|
|
|
@ -1231,6 +1231,22 @@ void FurnaceGUI::doAction(int what) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GUI_ACTION_SAMPLE_SET_LOOP: {
|
||||
if (curSample<0 || curSample>=(int)e->song.sample.size()) break;
|
||||
DivSample* sample=e->song.sample[curSample];
|
||||
sample->prepareUndo(true);
|
||||
e->lockEngine([this,sample]() {
|
||||
SAMPLE_OP_BEGIN;
|
||||
|
||||
sample->trim(0,end);
|
||||
sample->loopStart=start;
|
||||
updateSampleTex=true;
|
||||
|
||||
e->renderSamples();
|
||||
});
|
||||
MARK_MODIFIED;
|
||||
break;
|
||||
}
|
||||
|
||||
case GUI_ACTION_ORDERS_UP:
|
||||
if (curOrder>0) {
|
||||
|
|
|
@ -491,6 +491,7 @@ enum FurnaceGUIActions {
|
|||
GUI_ACTION_SAMPLE_ZOOM_OUT,
|
||||
GUI_ACTION_SAMPLE_ZOOM_AUTO,
|
||||
GUI_ACTION_SAMPLE_MAKE_INS,
|
||||
GUI_ACTION_SAMPLE_SET_LOOP,
|
||||
GUI_ACTION_SAMPLE_MAX,
|
||||
|
||||
GUI_ACTION_ORDERS_MIN,
|
||||
|
|
|
@ -631,6 +631,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
|
|||
D("SAMPLE_ZOOM_OUT", "Zoom out", FURKMOD_CMD|SDLK_MINUS),
|
||||
D("SAMPLE_ZOOM_AUTO", "Toggle auto-zoom", FURKMOD_CMD|SDLK_0),
|
||||
D("SAMPLE_MAKE_INS", "Create instrument from sample", 0),
|
||||
D("SAMPLE_SET_LOOP", "Set loop to selection", FURKMOD_CMD|SDLK_l),
|
||||
D("SAMPLE_MAX", "", NOT_AN_ACTION),
|
||||
|
||||
D("ORDERS_MIN", "---Orders", NOT_AN_ACTION),
|
||||
|
|
|
@ -1247,6 +1247,10 @@ void FurnaceGUI::drawSampleEdit() {
|
|||
if (ImGui::MenuItem("select all",BIND_FOR(GUI_ACTION_SAMPLE_SELECT_ALL))) {
|
||||
doAction(GUI_ACTION_SAMPLE_SELECT_ALL);
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("set loop to selection",BIND_FOR(GUI_ACTION_SAMPLE_SET_LOOP))) {
|
||||
doAction(GUI_ACTION_SAMPLE_SET_LOOP);
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
|
|
|
@ -1835,6 +1835,7 @@ void FurnaceGUI::drawSettings() {
|
|||
UI_KEYBIND_CONFIG(GUI_ACTION_SAMPLE_ZOOM_OUT);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_SAMPLE_ZOOM_AUTO);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_SAMPLE_MAKE_INS);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_SAMPLE_SET_LOOP);
|
||||
|
||||
KEYBIND_CONFIG_END;
|
||||
ImGui::TreePop();
|
||||
|
|
Loading…
Reference in New Issue