Changeset 1289
- Timestamp:
- 10/20/07 13:17:21 (12 months ago)
- Location:
- trunk/src/buzelib
- Files:
-
- 6 modified
-
PatternView.cpp (modified) (11 diffs)
-
PatternView.h (modified) (3 diffs)
-
SequenceView.cpp (modified) (1 diff)
-
SequenceView.h (modified) (2 diffs)
-
buze.rc (modified) (2 diffs)
-
resource.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/buzelib/PatternView.cpp
r1288 r1289 18 18 19 19 namespace { 20 21 struct beat_type { 22 int verydark, dark; 23 }; 24 25 beat_type all_beats[] = { 26 { 8, 4 }, 27 { 9, 3 }, 28 { 12, 3 }, 29 { 12, 4 }, 30 { 16, 4 }, 31 { 16, 8 }, 32 { 18, 3 }, 33 { 18, 6 }, 34 { 18, 9 }, 35 }; 36 37 int all_beats_count = sizeof(all_beats) / sizeof(beat_type); 20 38 21 39 bool isShiftDown() { … … 442 460 int sel = beatDropDown.GetCurSel(); 443 461 if (sel == -1) return 0; 462 beat_type& bt = all_beats[sel]; 463 patternEditor.editor.SetHighlightRows(bt.verydark, bt.dark); 444 464 // patternEditor.beat = sel; 445 465 patternEditor.Invalidate(); … … 482 502 if (updatePlugin == machine) { 483 503 bindPatternEditor(); 484 patternEditor.ScrollToView();485 504 patternEditor.UpdateScrollbars(); 486 505 patternEditor.UpdateCaret(); 506 patternEditor.ScrollToView(); 487 507 patternEditor.Invalidate(FALSE); 488 508 patternEditor.editor.Invalidate(FALSE); … … 594 614 595 615 if (GetFocus() != beatDropDown) { 596 //beatDropDown.SetCurSel(patternEditor.beat); 616 for (int i = 0; i < all_beats_count; i++) { 617 beat_type& bt = all_beats[i]; 618 if (bt.verydark == patternEditor.editor.verydark_row && bt.dark == patternEditor.editor.dark_row) { 619 beatDropDown.SetCurSel(i); 620 break; 621 } 622 } 597 623 } 598 624 … … 1117 1143 1118 1144 for (size_t i = 0; i< machine->loader->plugin_info->global_parameters.size(); i++, parameter_index++) { 1119 //TODO: document->configuration->getMachineParameterVisibility(machine->machineInfo->uri, parameter_index); 1145 // if parameter was marked hidden in parameterview, dont add the column to the pattern editor 1146 if (mainFrame->getMachineParameterHidden(machine, 1, 0, i)) continue; 1147 1120 1148 const zzub::parameter* paraGlobal = machine->loader->plugin_info->global_parameters[i]; 1121 1149 … … 1134 1162 parameter_index = first_track_index; 1135 1163 for (size_t i = 0; i< machine->loader->plugin_info->track_parameters.size(); i++, parameter_index++) { 1136 //TODO: document->configuration->getMachineParameterVisibility(machine->machineInfo->uri, parameter_index); 1164 // if parameter was marked hidden in parameterview, dont add the column to the pattern editor 1165 if (mainFrame->getMachineParameterHidden(machine, 2, j, i)) continue; 1166 1137 1167 const zzub::parameter* paraTrack = machine->loader->plugin_info->track_parameters[i]; 1138 1168 patternEditor.AddColumn(2, j, i, paraTrack->type, getNoValue(paraTrack), getParamMinValue(paraTrack), getParamMaxValue(paraTrack)); … … 1154 1184 patternEditor.MoveCursor(pos.group, pos.track, pos.column, pos.editPos, pos.row, false); 1155 1185 1156 // TODO:scroll editor to pos.scroll*1186 // scroll editor to pos.scroll* 1157 1187 POINT scroll = { pos.scrollColumns, pos.scrollRows }; 1158 1188 patternEditor.ScrollTo(scroll); … … 1344 1374 1345 1375 // see also CPatternEditor::getRowColor() for more beat stuff 1346 beatDropDown.AddString("3 / 3"); 1347 beatDropDown.AddString("4 / 3"); 1348 beatDropDown.AddString("3 / 4"); 1349 beatDropDown.AddString("4 / 4"); 1350 beatDropDown.AddString("5 / 4"); 1351 beatDropDown.AddString("5 / 5"); 1352 beatDropDown.AddString("6 / 6"); 1353 beatDropDown.AddString("6 / 8"); 1354 beatDropDown.AddString("8 / 8"); 1376 for (int i = 0; i < all_beats_count; i++) { 1377 beat_type& bt = all_beats[i]; 1378 std::stringstream strm; 1379 strm << bt.verydark << " / " << bt.dark; 1380 beatDropDown.AddString(strm.str().c_str()); 1381 } 1355 1382 1356 1383 octaveDropDown.SetRedraw(); … … 1713 1740 } 1714 1741 1715 LRESULT CPatternView::OnClear(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) {1716 patternEditor.Clear();1717 return 0;1718 }1719 1720 1742 LRESULT CPatternView::OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { 1721 1743 … … 1755 1777 menu.InsertMenu(-1, (!hasPattern||!patternEditor.HasSelection()?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_EDIT_COPY, "Copy\tCtrl+C"); 1756 1778 menu.InsertMenu(-1, (!hasPattern?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_EDIT_PASTE, "Paste\tCtrl+V"); 1757 menu.InsertMenu(-1, (!hasPattern||!patternEditor.HasSelection()?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_EDIT_ CLEAR, "Clear\tDelete");1779 menu.InsertMenu(-1, (!hasPattern||!patternEditor.HasSelection()?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_EDIT_DELETE, "Clear\tDelete"); 1758 1780 1759 1781 ClientToScreen(&pt); … … 1859 1881 return false; 1860 1882 } 1883 1884 LRESULT CPatternView::OnSetStepRange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { 1885 int step = wID - ID_EDIT_STEP_0; 1886 1887 MessageBox("HAHA", stringFromInt(step, 0, ' ').c_str()); 1888 if (step < 0 || step > 9) return 0; 1889 patternEditor.editor.step = step; 1890 return 0; 1891 } -
trunk/src/buzelib/PatternView.h
r1286 r1289 206 206 COMMAND_ID_HANDLER(ID_PATTERNEDITOR_MOVECURSOR, OnMoveCursor) 207 207 208 COMMAND_RANGE_HANDLER(ID_EDIT_STEP_0, ID_EDIT_STEP_9, OnSetStepRange) 209 208 210 END_MSG_MAP() 209 211 … … 268 270 LRESULT OnMoveNextTrack(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 269 271 LRESULT OnMovePrevTrack(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 270 LRESULT OnClear(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);271 272 LRESULT OnToggleColumnControl(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 272 273 LRESULT OnOctaveUp(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); … … 315 316 LRESULT OnEdit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 316 317 LRESULT OnMoveCursor(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 318 LRESULT OnSetStepRange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 317 319 318 320 virtual BOOL OnIdle(); -
trunk/src/buzelib/SequenceView.cpp
r1285 r1289 766 766 return 0; 767 767 } 768 769 LRESULT CSequenceView::OnSetStepRange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { 770 int step = wID - ID_EDIT_STEP_0; 771 if (step < 0 || step > 9) return 0; 772 editor.step = step; 773 return 0; 774 } -
trunk/src/buzelib/SequenceView.h
r1285 r1289 110 110 COMMAND_ID_HANDLER(ID_PATTERN_CLONE, OnPatternClone) 111 111 COMMAND_ID_HANDLER(ID_MACHINE_PARAMETERS, OnMachineParameters) 112 COMMAND_RANGE_HANDLER(ID_EDIT_STEP_0, ID_EDIT_STEP_9, OnSetStepRange) 112 113 113 114 END_MSG_MAP() … … 185 186 LRESULT OnPatternCreate(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 186 187 LRESULT OnMachineParameters(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 188 LRESULT OnSetStepRange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); 187 189 188 190 virtual BOOL OnIdle(); -
trunk/src/buzelib/buze.rc
r1282 r1289 879 879 ">", ID_PATTERNEDITOR_NEXTWAVE, ASCII, NOINVERT 880 880 "<", ID_PATTERNEDITOR_PREVWAVE, ASCII, NOINVERT 881 "0", ID_EDIT_STEP_0, VIRTKEY, CONTROL, NOINVERT 882 "1", ID_EDIT_STEP_1, VIRTKEY, CONTROL, NOINVERT 883 "2", ID_EDIT_STEP_2, VIRTKEY, CONTROL, NOINVERT 884 "3", ID_EDIT_STEP_3, VIRTKEY, CONTROL, NOINVERT 885 "4", ID_EDIT_STEP_4, VIRTKEY, CONTROL, NOINVERT 886 "5", ID_EDIT_STEP_5, VIRTKEY, CONTROL, NOINVERT 887 "6", ID_EDIT_STEP_6, VIRTKEY, CONTROL, NOINVERT 888 "7", ID_EDIT_STEP_7, VIRTKEY, CONTROL, NOINVERT 889 "8", ID_EDIT_STEP_8, VIRTKEY, CONTROL, NOINVERT 890 "9", ID_EDIT_STEP_9, VIRTKEY, CONTROL, NOINVERT 881 891 END 882 892 … … 939 949 VK_RETURN, ID_PATTERN_CLONE, VIRTKEY, SHIFT, CONTROL, 940 950 NOINVERT 951 "0", ID_EDIT_STEP_0, VIRTKEY, CONTROL, NOINVERT 952 "1", ID_EDIT_STEP_1, VIRTKEY, CONTROL, NOINVERT 953 "2", ID_EDIT_STEP_2, VIRTKEY, CONTROL, NOINVERT 954 "3", ID_EDIT_STEP_3, VIRTKEY, CONTROL, NOINVERT 955 "4", ID_EDIT_STEP_4, VIRTKEY, CONTROL, NOINVERT 956 "5", ID_EDIT_STEP_5, VIRTKEY, CONTROL, NOINVERT 957 "6", ID_EDIT_STEP_6, VIRTKEY, CONTROL, NOINVERT 958 "7", ID_EDIT_STEP_7, VIRTKEY, CONTROL, NOINVERT 959 "8", ID_EDIT_STEP_8, VIRTKEY, CONTROL, NOINVERT 960 "9", ID_EDIT_STEP_9, VIRTKEY, CONTROL, NOINVERT 941 961 END 942 962 -
trunk/src/buzelib/resource.h
r1282 r1289 388 388 #define ID_PATTERNVIEW_TRANSPOSENOTESONLYDOWN 53422 389 389 #define ID_WAVE_ZOOM_WORD 53423 390 #define ID_EDIT_STEP_0 53424 391 #define ID_EDIT_STEP_1 53425 392 #define ID_EDIT_STEP_2 53426 393 #define ID_EDIT_STEP_3 53427 394 #define ID_EDIT_STEP_4 53428 395 #define ID_EDIT_STEP_5 53429 396 #define ID_EDIT_STEP_6 53430 397 #define ID_EDIT_STEP_7 53431 398 #define ID_EDIT_STEP_8 53432 399 #define ID_EDIT_STEP_9 53433 390 400 391 401 // Next default values for new objects … … 394 404 #ifndef APSTUDIO_READONLY_SYMBOLS 395 405 #define _APS_NEXT_RESOURCE_VALUE 238 396 #define _APS_NEXT_COMMAND_VALUE 534 24406 #define _APS_NEXT_COMMAND_VALUE 53434 397 407 #define _APS_NEXT_CONTROL_VALUE 1082 398 408 #define _APS_NEXT_SYMED_VALUE 101
