OSDN Git Service

(parse_opt_Z1): Fix typo
authorShoichi Tamuki <tamuki@linet.gr.jp>
Thu, 4 Mar 2004 04:11:51 +0000 (04:11 +0000)
committerShoichi Tamuki <tamuki@linet.gr.jp>
Thu, 4 Mar 2004 04:11:51 +0000 (04:11 +0000)
Change behavior so that keysig control may not react
when initial keysig option for pure intonation is specified

ChangeLog
interface/alsaseq_c.c
interface/rtsyn_common.c
interface/w32g_pref.c
timidity/playmidi.c
timidity/timidity.c

index 2bc3461..77fb792 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-04  TAMUKI Shoichi <tamuki@linet.gr.jp>
+
+       * timidity/timidity.c (parse_opt_Z1): Fix typo
+       * interface/alsaseq_c.c, interface/rtsyn_common.c,
+         interface/w32g_pref.c, timidity/playmidi.c:
+         Change behavior so that keysig control may not react
+         when initial keysig option for pure intonation is specified
+
 2004-03-04  mput <root@mput.dip.jp>
 
        * timidity/readmidi.c (set_xg_chorus_type): Re-activate flanger
index 8ab5845..db4cc74 100644 (file)
@@ -354,7 +354,7 @@ static void ctl_pass_playing_list(int n, char *args[])
 
        opt_realtime_playing = 1; /* Enable loading patch while playing */
        allocate_cache_size = 0; /* Don't use pre-calclated samples */
-       current_keysig = opt_init_keysig;
+       current_keysig = (opt_init_keysig == 8) ? 0 : opt_init_keysig;
        note_key_offset = 0;
 
        if (IS_STREAM_TRACE) {
index 1ccde7f..d38a1e8 100644 (file)
@@ -265,7 +265,7 @@ void rtsyn_init(void){
        opt_realtime_playing = 1; /* Enable loading patch while playing */
        allocate_cache_size = 0; /* Don't use pre-calclated samples */
        auto_reduce_polyphony = 0;
-       current_keysig = opt_init_keysig;
+       current_keysig = (opt_init_keysig == 8) ? 0 : opt_init_keysig;
        note_key_offset = 0;
        time_advance=play_mode->rate/TICKTIME_HZ*2;
        if (!(play_mode->encoding & PE_MONO))
index 5eb43b0..93a1d68 100644 (file)
@@ -926,7 +926,8 @@ static char *cb_info_IDC_COMBO_INIT_KEYSIG[] = {
        "E  Maj / C# Min",
        "B  Maj / G# Min",
        "F# Maj / D# Min",
-       "C# Maj / A# Min"
+       "C# Maj / A# Min",
+       ""
 };
 
 // IDC_COMBO_FORCE_KEYSIG
@@ -993,21 +994,28 @@ PrefTiMidity2DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
                SetDlgItemInt(hwnd,IDC_EDIT_CONTROL_RATIO,st_temp->control_ratio,FALSE);
                SetDlgItemInt(hwnd,IDC_EDIT_DRUM_POWER,st_temp->opt_drum_power,FALSE);
                DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_AMP_COMPENSATION,st_temp->opt_amp_compensation);
-               for (i = 0; i < 15; i++)
+               for (i = 0; i < 16; i++)
                        SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG,
                                        CB_INSERTSTRING, (WPARAM) -1,
                                        (LPARAM) cb_info_IDC_COMBO_INIT_KEYSIG[i]);
                if (! st_temp->opt_pure_intonation) {
                        SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL,
-                                       (WPARAM) 7, (LPARAM) 0);
+                                       (WPARAM) 15, (LPARAM) 0);
                        SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK,
                                        0, 0);
                } else {
-                       SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL,
-                                       (WPARAM) st_temp->opt_init_keysig + 7 & 0x0f,
-                                       (LPARAM) 0);
-                       SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK,
-                                       (st_temp->opt_init_keysig + 7 & 0x10) ? 1 : 0, 0);
+                       if (st_temp->opt_init_keysig == 8) {
+                               SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL,
+                                               (WPARAM) 15, (LPARAM) 0);
+                               SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK,
+                                               0, 0);
+                       } else {
+                               SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL,
+                                               (WPARAM) st_temp->opt_init_keysig + 7 & 0x0f,
+                                               (LPARAM) 0);
+                               SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK,
+                                               (st_temp->opt_init_keysig + 7 & 0x10) ? 1 : 0, 0);
+                       }
                }
                DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHECKBOX_PURE_INTONATION,
                                st_temp->opt_pure_intonation);
@@ -1035,28 +1043,31 @@ PrefTiMidity2DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
                case IDC_CHECKBOX_SPECIAL_TONEBANK:
                        if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_SPECIAL_TONEBANK,
                                        BM_GETCHECK, 0, 0))
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK), TRUE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK),
+                                               TRUE);
                        else
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK), FALSE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK),
+                                               FALSE);
                        break;
                case IDC_CHECKBOX_PURE_INTONATION:
                        if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_PURE_INTONATION,
                                        BM_GETCHECK, 0, 0)) {
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), TRUE);
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), TRUE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), TRUE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), TRUE);
                        } else {
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), FALSE);
-                               EnableWindow(
-                                               GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), FALSE);
+                               EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE);
                        }
                        break;
                case IDC_COMBO_INIT_KEYSIG:
                case IDC_CHECKBOX_INIT_MI:
+                       if (SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_GETCURSEL,
+                                       (WPARAM) 0, (LPARAM) 0) == 15) {
+                               SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK,
+                                               0, 0);
+                               EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE);
+                       } else
+                               EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), TRUE);
                        st_temp->opt_init_keysig = SendDlgItemMessage(hwnd,
                                        IDC_COMBO_INIT_KEYSIG, CB_GETCURSEL,
                                        (WPARAM) 0, (LPARAM) 0) + ((SendDlgItemMessage(hwnd,
@@ -1145,7 +1156,7 @@ PrefTiMidity2DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
                                        IDC_CHECKBOX_INIT_MI, BM_GETCHECK,
                                        0, 0)) ? 16 : 0) - 7;
                else
-                       st_temp->opt_init_keysig = 0;
+                       st_temp->opt_init_keysig = 8;
                st_temp->key_adjust = GetDlgItemInt(
                                hwnd, IDC_EDIT_KEY_ADJUST, NULL, TRUE);
                if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_FORCE_KEYSIG,
index f9c0e70..4f40546 100644 (file)
@@ -112,7 +112,7 @@ Voice *voice = NULL;
 int8 current_keysig = 0;
 int8 current_temper_keysig = 0;
 int temper_adj = 0;
-int8 opt_init_keysig = 0;
+int8 opt_init_keysig = 8;
 int8 opt_force_keysig = 8;
 int32 current_play_tempo = 500000;
 int opt_realtime_playing = 0;
@@ -5726,6 +5726,8 @@ static void seek_forward(int32 until_time)
            break;
 
        case ME_KEYSIG:
+               if (opt_init_keysig != 8)
+                       break;
                current_keysig = current_event->a + current_event->b * 16;
                break;
 
@@ -7753,6 +7755,8 @@ int play_event(MidiEvent *ev)
        break;
 
        case ME_KEYSIG:
+               if (opt_init_keysig != 8)
+                       break;
                current_keysig = current_event->a + current_event->b * 16;
                ctl_mode_event(CTLE_KEYSIG, 1, current_keysig, 0);
                if (opt_force_keysig != 8) {
@@ -8295,7 +8299,7 @@ int play_midi_file(char *fn)
        return rc;
 
     /* Reset key & speed each files */
-    current_keysig = opt_init_keysig;
+    current_keysig = (opt_init_keysig == 8) ? 0 : opt_init_keysig;
     note_key_offset = 0;
     midi_time_ratio = 1.0;
        for (i = 0; i < MAX_CHANNELS; i++) {
index 50019b6..3e408c1 100644 (file)
@@ -4437,7 +4437,7 @@ static inline int parse_opt_Z1(const char *arg)
        
        opt_pure_intonation = 1;
        if (*arg) {
-               if (set_value(&keysig, atoi(arg), -7, -7,
+               if (set_value(&keysig, atoi(arg), -7, 7,
                                "Initial keysig (number of #(+)/b(-)[m(minor)])"))
                        return 1;
                opt_init_keysig = keysig;