Skip to content

Commit

Permalink
made more decompile options configurable #5
Browse files Browse the repository at this point in the history
  • Loading branch information
truj committed Jan 16, 2020
1 parent 7594a12 commit 17d6cce
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 80 deletions.
Binary file renamed midica-0.1578853935.jar → midica-0.1579206227.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/org/midica/Midica.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Midica {
public static final int VERSION_MAJOR = 0;

/** Minor version number. This is intended to be incremented automatically by precommit.pl. */
public static final int VERSION_MINOR = 1578853935;
public static final int VERSION_MINOR = 1579206227;

/** Full version string. */
public static final String VERSION = VERSION_MAJOR + "." + VERSION_MINOR;
Expand Down
11 changes: 10 additions & 1 deletion src/org/midica/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ public class Config {
public static final String DC_MUST_ADD_CONFIG = "dc_must_add_config";
public static final String DC_MUST_ADD_QUALITY_SCORE = "dc_must_add_quality_score";
public static final String DC_MUST_ADD_STATISTICS = "dc_must_add_statistics";
public static final String DC_LENGTH_STRATEGY = "dc_length_strategy";
public static final String DC_DURATION_TICK_TOLERANCE = "dc_duration_tick_tolerance";
public static final String DC_DURATION_RATIO_TOLERANCE = "dc_duration_ratio_tolerance";
public static final String DC_MIN_DURATION_TO_KEEP = "dc_min_duration_to_keep";
public static final String DC_NEXT_NOTE_ON_TOLERANCE = "dc_next_note_on_tolerance";
public static final String DC_MAX_TARGET_TICKS_ON = "dc_max_target_ticks_on";
public static final String DC_USE_PRE_DEFINED_CHORDS = "dc_use_pre_defined_chords";
public static final String DC_CHORD_NOTE_ON_TOLERANCE = "dc_chord_note_on_tolerance";
public static final String DC_CHORD_NOTE_OFF_TOLERANCE = "dc_chord_note_off_tolerance";
Expand Down Expand Up @@ -274,9 +277,12 @@ public static HashMap<String, String> getDefaultDecompileConfig() {
dcDefaults.put( DC_MUST_ADD_CONFIG, "" + MidicaPLExporter.DEFAULT_MUST_ADD_CONFIG );
dcDefaults.put( DC_MUST_ADD_QUALITY_SCORE, "" + MidicaPLExporter.DEFAULT_MUST_ADD_QUALITY_SCORE );
dcDefaults.put( DC_MUST_ADD_STATISTICS, "" + MidicaPLExporter.DEFAULT_MUST_ADD_STATISTICS );
dcDefaults.put( DC_LENGTH_STRATEGY, "" + MidicaPLExporter.DEFAULT_LENGTH_STRATEGY );
dcDefaults.put( DC_DURATION_TICK_TOLERANCE, "" + MidicaPLExporter.DEFAULT_DURATION_TICK_TOLERANCE );
dcDefaults.put( DC_DURATION_RATIO_TOLERANCE, "" + MidicaPLExporter.DEFAULT_DURATION_RATIO_TOLERANCE );
dcDefaults.put( DC_MIN_DURATION_TO_KEEP, "" + MidicaPLExporter.DEFAULT_MIN_DURATION_TO_KEEP );
dcDefaults.put( DC_NEXT_NOTE_ON_TOLERANCE, "" + MidicaPLExporter.DEFAULT_NEXT_NOTE_ON_TOLERANCE );
dcDefaults.put( DC_MAX_TARGET_TICKS_ON, "" + MidicaPLExporter.DEFAULT_MAX_TARGET_TICKS_ON );
dcDefaults.put( DC_USE_PRE_DEFINED_CHORDS, "" + MidicaPLExporter.DEFAULT_USE_PRE_DEFINED_CHORDS );
dcDefaults.put( DC_CHORD_NOTE_ON_TOLERANCE, "" + MidicaPLExporter.DEFAULT_CHORD_NOTE_ON_TOLERANCE );
dcDefaults.put( DC_CHORD_NOTE_OFF_TOLERANCE, "" + MidicaPLExporter.DEFAULT_CHORD_NOTE_OFF_TOLERANCE );
Expand Down Expand Up @@ -609,10 +615,13 @@ private static void restoreDefaultKeyBindings() {
addDefaultKeyBinding( Dict.KEY_DC_ADD_CONFIG, KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_ADD_SCORE, KeyEvent.VK_S, InputEvent.ALT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_ADD_STATISTICS, KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_NOTE_LENGTH_STRATEGY, KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_DUR_TICK, KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_DUR_RATIO, KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MIN_DUR_TO_KEEP, KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_NEXT_ON, KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_PREDEFINED, KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MAX_TARGET_TICKS_ON, KeyEvent.VK_M, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_PREDEFINED, KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_NOTE_ON, KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_NOTE_OFF, KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_VELOCITY, KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK );
Expand Down
110 changes: 69 additions & 41 deletions src/org/midica/config/Dict.java
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,12 @@ public class Dict {
public static final String KEY_DC_ADD_CONFIG = "key_dc_config";
public static final String KEY_DC_ADD_SCORE = "key_dc_add_score";
public static final String KEY_DC_ADD_STATISTICS = "key_dc_add_statistics";
public static final String KEY_DC_NOTE_LENGTH_STRATEGY = "key_dc_note_length_strategy";
public static final String KEY_DC_TOL_DUR_TICK = "key_dc_tol_dur_tick";
public static final String KEY_DC_TOL_DUR_RATIO = "key_dc_tol_dur_ratio";
public static final String KEY_DC_MIN_DUR_TO_KEEP = "key_dc_min_dur_to_keep";
public static final String KEY_DC_TOL_NEXT_ON = "key_dc_tol_next_on";
public static final String KEY_DC_MAX_TARGET_TICKS_ON = "key_dc_max_target_ticks_on";
public static final String KEY_DC_CRD_PREDEFINED = "key_dc_crd_predefined";
public static final String KEY_DC_CRD_NOTE_ON = "key_dc_crd_note_on";
public static final String KEY_DC_CRD_NOTE_OFF = "key_dc_crd_note_off";
Expand Down Expand Up @@ -745,47 +748,58 @@ public class Dict {
public static final String CHARSET_DESC_MID_WRITE = "charset_desc_mid_write";

// DecompileConfigView
public static final String TITLE_DC_CONFIG = "title_dc_config";
public static final String DC_CAT_DEBUG = "dc_cat_debug";
public static final String DC_CAT_NOTE_LENGTH = "dc_cat_note_length";
public static final String DC_CAT_CHORDS = "dc_cat_chords";
public static final String DC_CAT_KARAOKE = "dc_cat_karaoke";
public static final String DC_CAT_SLICE = "dc_cat_slice";
public static final String DC_ADD_TICK_COMMENT = "dc_add_tick_comment";
public static final String DC_ADD_CONFIG = "dc_add_config";
public static final String DC_ADD_SCORE = "dc_add_score";
public static final String DC_ADD_STATISTICS = "dc_add_statistics";
public static final String DURATION_TICK_TOLERANCE = "duration_tick_tolerance";
public static final String DURATION_TICK_TOLERANCE_D = "duration_tick_tolerance_d";
public static final String DURATION_RATIO_TOLERANCE = "duration_ratio_tolerance";
public static final String DURATION_RATIO_TOLERANCE_D = "duration_ratio_tolerance_d";
public static final String NEXT_NOTE_ON_TOLERANCE = "next_note_on_tolerance";
public static final String NEXT_NOTE_ON_TOLERANCE_D = "next_note_on_tolerance_d";
public static final String USE_PRE_DEFINED_CHORDS = "use_pre_defined_chords";
public static final String USE_PRE_DEFINED_CHORDS_D = "use_pre_defined_chords_d";
public static final String CHORD_NOTE_ON_TOLERANCE = "chord_note_on_tolerance";
public static final String CHORD_NOTE_ON_TOLERANCE_D = "chord_note_on_tolerance_d";
public static final String CHORD_NOTE_OFF_TOLERANCE = "chord_note_off_tolerance";
public static final String CHORD_NOTE_OFF_TOLERANCE_D = "chord_note_off_tolerance_d";
public static final String CHORD_VELOCITY_TOLERANCE = "chord_velocity_tolerance";
public static final String CHORD_VELOCITY_TOLERANCE_D = "chord_velocity_tolerance_d";
public static final String ORPHANED_SYLLABLES = "orphaned_syllables";
public static final String ORPHANED_SYLLABLES_D = "orphaned_syllables_d";
public static final String DC_INLINE = "dc_inline";
public static final String DC_BLOCK = "dc_block";
public static final String KAR_ONE_CHANNEL = "kar_one_channel";
public static final String KAR_ONE_CHANNEL_D = "kar_one_channel_d";
public static final String ADD_GLOBAL_AT_TICK = "add_global_at_tick";
public static final String ADD_GLOBAL_EACH = "add_global_each";
public static final String ADD_GLOBAL_FROM = "add_global_from";
public static final String ADD_GLOBAL_TO = "add_global_to";
public static final String DC_ALL_TICKS = "dc_all_ticks";
public static final String BTN_ADD_TICK = "btn_add_tick";
public static final String BTN_ADD_TICKS = "btn_add_ticks";
public static final String BTN_UPDATE_TICKS = "btn_update_ticks";
public static final String DC_RESTORE = "dc_restore";
public static final String DC_RESTORE_DEFAULTS = "dc_restore_defaults";
public static final String DC_SAVE = "dc_save";
public static final String TITLE_DC_CONFIG = "title_dc_config";
public static final String DC_CAT_DEBUG = "dc_cat_debug";
public static final String DC_CAT_NOTE_LENGTH = "dc_cat_note_length";
public static final String DC_CAT_CHORDS = "dc_cat_chords";
public static final String DC_CAT_KARAOKE = "dc_cat_karaoke";
public static final String DC_CAT_SLICE = "dc_cat_slice";
public static final String DC_ADD_TICK_COMMENT = "dc_add_tick_comment";
public static final String DC_ADD_CONFIG = "dc_add_config";
public static final String DC_ADD_SCORE = "dc_add_score";
public static final String DC_ADD_STATISTICS = "dc_add_statistics";
public static final String NOTE_LENGTH_STRATEGY = "note_length_strategy";
public static final String NOTE_LENGTH_STRATEGY_D = "note_length_strategy_d";
public static final String DURATION_TICK_TOLERANCE = "duration_tick_tolerance";
public static final String DURATION_TICK_TOLERANCE_D = "duration_tick_tolerance_d";
public static final String DURATION_RATIO_TOLERANCE = "duration_ratio_tolerance";
public static final String DURATION_RATIO_TOLERANCE_D = "duration_ratio_tolerance_d";
public static final String MIN_DURATION_TO_KEEP = "min_duration_to_keep";
public static final String MIN_DURATION_TO_KEEP_D = "min_duration_to_keep_d";
public static final String NEXT_NOTE_ON_TOLERANCE = "next_note_on_tolerance";
public static final String NEXT_NOTE_ON_TOLERANCE_D = "next_note_on_tolerance_d";
public static final String MAX_TARGET_TICKS_NEXT_ON = "max_target_ticks_next_on";
public static final String MAX_TARGET_TICKS_NEXT_ON_D = "max_target_ticks_next_on_d";
public static final String USE_PRE_DEFINED_CHORDS = "use_pre_defined_chords";
public static final String USE_PRE_DEFINED_CHORDS_D = "use_pre_defined_chords_d";
public static final String CHORD_NOTE_ON_TOLERANCE = "chord_note_on_tolerance";
public static final String CHORD_NOTE_ON_TOLERANCE_D = "chord_note_on_tolerance_d";
public static final String CHORD_NOTE_OFF_TOLERANCE = "chord_note_off_tolerance";
public static final String CHORD_NOTE_OFF_TOLERANCE_D = "chord_note_off_tolerance_d";
public static final String CHORD_VELOCITY_TOLERANCE = "chord_velocity_tolerance";
public static final String CHORD_VELOCITY_TOLERANCE_D = "chord_velocity_tolerance_d";
public static final String ORPHANED_SYLLABLES = "orphaned_syllables";
public static final String ORPHANED_SYLLABLES_D = "orphaned_syllables_d";
public static final String DC_INLINE = "dc_inline";
public static final String DC_BLOCK = "dc_block";
public static final String DC_STRAT_NEXT_DURATION_PRESS = "dc_strat_next_duration_press";
public static final String DC_STRAT_DURATION_NEXT_PRESS = "dc_strat_duration_next_press";
public static final String DC_STRAT_NEXT_PRESS = "dc_strat_next_press";
public static final String DC_STRAT_DURATION_PRESS = "dc_strat_duration_press";
public static final String DC_STRAT_PRESS = "dc_strat_press";
public static final String KAR_ONE_CHANNEL = "kar_one_channel";
public static final String KAR_ONE_CHANNEL_D = "kar_one_channel_d";
public static final String ADD_GLOBAL_AT_TICK = "add_global_at_tick";
public static final String ADD_GLOBAL_EACH = "add_global_each";
public static final String ADD_GLOBAL_FROM = "add_global_from";
public static final String ADD_GLOBAL_TO = "add_global_to";
public static final String DC_ALL_TICKS = "dc_all_ticks";
public static final String BTN_ADD_TICK = "btn_add_tick";
public static final String BTN_ADD_TICKS = "btn_add_ticks";
public static final String BTN_UPDATE_TICKS = "btn_update_ticks";
public static final String DC_RESTORE = "dc_restore";
public static final String DC_RESTORE_DEFAULTS = "dc_restore_defaults";
public static final String DC_SAVE = "dc_save";

// InfoView
public static final String TITLE_INFO_VIEW = "title_info_view";
Expand Down Expand Up @@ -1900,9 +1914,12 @@ private static void initLanguageEnglish() {
set( KEY_DC_ADD_CONFIG, "Toggle Checkbox: Add Configuration" );
set( KEY_DC_ADD_SCORE, "Toggle Checkbox: Add Quality Score" );
set( KEY_DC_ADD_STATISTICS, "Toggle Checkbox: Add Statistics" );
set( KEY_DC_NOTE_LENGTH_STRATEGY, "Open Selection: Note Length Strategy" );
set( KEY_DC_TOL_DUR_TICK, "Focus the text field for the Duration Tick Tolerance" );
set( KEY_DC_TOL_DUR_RATIO, "Focus the text field for the Duration Ratio Tolerance" );
set( KEY_DC_MIN_DUR_TO_KEEP, "Focus the text field for the Min Duration to keep" );
set( KEY_DC_TOL_NEXT_ON, "Focus the text field for the Next Note-ON Tolerance" );
set( KEY_DC_MAX_TARGET_TICKS_ON, "Focus the text field for the Max target ticks" );
set( KEY_DC_CRD_PREDEFINED, "Toggle Checkbox: Use Predefined Chords" );
set( KEY_DC_CRD_NOTE_ON, "Focus the text field for the chord Note-ON tolerance" );
set( KEY_DC_CRD_NOTE_OFF, "Focus the text field for the chord Note-OFF tolerance" );
Expand Down Expand Up @@ -1981,12 +1998,18 @@ private static void initLanguageEnglish() {
set( DC_ADD_CONFIG, "Add Configuration" );
set( DC_ADD_SCORE, "Add Quality Score" );
set( DC_ADD_STATISTICS, "Add Quality Statistics" );
set( NOTE_LENGTH_STRATEGY, "Priority of strategies" );
set( NOTE_LENGTH_STRATEGY_D, "Which strategy to prefer, if possible" );
set( DURATION_TICK_TOLERANCE, "Duration Tick Tolerance" );
set( DURATION_TICK_TOLERANCE_D, "Tolerance in Ticks for keeping a note's duration" );
set( DURATION_RATIO_TOLERANCE, "Duration Ratio Tolerance" );
set( DURATION_RATIO_TOLERANCE_D, "Tolerance fraction for keeping a note's duration" );
set( MIN_DURATION_TO_KEEP, "Min Duration to keep" );
set( MIN_DURATION_TO_KEEP_D, "Minimum Duration for using the duration strategy" );
set( NEXT_NOTE_ON_TOLERANCE, "Next Note-ON Tolerance" );
set( NEXT_NOTE_ON_TOLERANCE_D, "Tolerance in ticks to find out if the strategy 'next note-on' can be used" );
set( MAX_TARGET_TICKS_NEXT_ON, "Max length ticks for Next-ON" );
set( MAX_TARGET_TICKS_NEXT_ON_D, "Max note length in target ticks for using the Next-ON strategy" );
set( USE_PRE_DEFINED_CHORDS, "Pre-defined Chords" );
set( USE_PRE_DEFINED_CHORDS_D, "Use Pre-defined Chords (instead of inline chords)" );
set( CHORD_NOTE_ON_TOLERANCE, "Note-ON tolerance" );
Expand All @@ -1999,6 +2022,11 @@ private static void initLanguageEnglish() {
set( ORPHANED_SYLLABLES_D, "How to treat syllables that appear in a tick without any note-on" );
set( DC_INLINE, "Inline" );
set( DC_BLOCK, "Block" );
set( DC_STRAT_NEXT_DURATION_PRESS, "Next ON / Duration / Press length" );
set( DC_STRAT_DURATION_NEXT_PRESS, "Duration / Next ON / Press length" );
set( DC_STRAT_NEXT_PRESS, "Next ON / Press length" );
set( DC_STRAT_DURATION_PRESS, "Duration / Press length" );
set( DC_STRAT_PRESS, "Press length only" );
set( KAR_ONE_CHANNEL, "All Lyrics in one channel" );
set( KAR_ONE_CHANNEL_D, "If checked, all lyrics are put to the same channel" );
set( ADD_GLOBAL_AT_TICK, "Add one global command at tick:" );
Expand Down
Loading

0 comments on commit 17d6cce

Please sign in to comment.