diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h')
-rw-r--r-- | Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h b/Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h new file mode 100644 index 00000000..6266213d --- /dev/null +++ b/Src/external_dependencies/openmpt-trunk/mptrack/PatternFindReplace.h @@ -0,0 +1,73 @@ +/* + * PatternFindReplace.h + * -------------------- + * Purpose: Implementation of the pattern search. + * Notes : (currently none) + * Authors: Olivier Lapicque + * OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + +#pragma once + +#include "openmpt/all/BuildSettings.hpp" + +// Find/Replace data +struct FindReplace +{ + static FindReplace instance; + + enum Flags + { + Note = 0x01, // Search for note + Instr = 0x02, // Search for instrument + VolCmd = 0x04, // Search for volume effect + Volume = 0x08, // Search for volume + Command = 0x10, // Search for effect + Param = 0x20, // Search for effect parameter + PCParam = 0x40, // Parameter of PC event + PCValue = 0x80, // Value of PC event + + InChannels = 0x100, // Limit search to channels + FullSearch = 0x200, // Search whole song + InPatSelection = 0x400, // Search in current pattern selection + Replace = 0x800, // Replace + ReplaceAll = 0x1000, // Replace all + }; + + enum ReplaceMode + { + ReplaceValue, + ReplaceRelative, + ReplaceMultiply, + }; + + enum + { + ReplaceOctaveUp = 12000, + ReplaceOctaveDown = -12000, + }; + + FlagSet<Flags> findFlags, replaceFlags; // See Flags + + // Data to replace with + ReplaceMode replaceNoteAction, replaceInstrAction, replaceVolumeAction, replaceParamAction; + int replaceNote, replaceInstr, replaceVolume, replaceParam; + ModCommand::VOLCMD replaceVolCmd; + ModCommand::COMMAND replaceCommand; + + // Data to find + ModCommand::NOTE findNoteMin, findNoteMax; + ModCommand::INSTR findInstrMin, findInstrMax; + ModCommand::VOLCMD findVolCmd; + int findVolumeMin, findVolumeMax; + ModCommand::COMMAND findCommand; + int findParamMin, findParamMax; + + PatternRect selection; // Find in this selection (if FindReplace::InPatSelection is set) + CHANNELINDEX findChnMin, findChnMax; // Find in these channels (if FindReplace::InChannels is set) + + FindReplace(); +}; + +DECLARE_FLAGSET(FindReplace::Flags); |