Commit bf34a1a

Nick Faro committed on
Quick instrument load
commit bf34a1a463b7993d825416d0117243a30a41878f parent 041f889
4 changed files +56−34
Modifiedsrc/hUGEDriver +1−1
@@ -1 +1 @@
1 Subproject commit a3c69884eea9f8a452c48fef7b724941950c2af7 1 Subproject commit 303f302c2a9b3a0cfe9e9b22cb5ea4b697f14546
Modifiedsrc/tracker.lfm +32−32
@@ -450,7 +450,7 @@ object frmTracker: TfrmTracker
450 BorderSpacing.Right = 7 450 BorderSpacing.Right = 7
451 BorderSpacing.Bottom = 7 451 BorderSpacing.Bottom = 7
452 Caption = 'Instrument' 452 Caption = 'Instrument'
453 ClientHeight = 254 453 ClientHeight = 269
454 ClientWidth = 276 454 ClientWidth = 276
455 ParentFont = False 455 ParentFont = False
456 TabOrder = 0 456 TabOrder = 0
@@ -672,7 +672,7 @@ object frmTracker: TfrmTracker
672 BorderSpacing.Right = 7 672 BorderSpacing.Right = 7
673 BorderSpacing.Bottom = 7 673 BorderSpacing.Bottom = 7
674 Caption = 'Envelope' 674 Caption = 'Envelope'
675 ClientHeight = 117 675 ClientHeight = 132
676 ClientWidth = 578 676 ClientWidth = 578
677 ParentFont = False 677 ParentFont = False
678 TabOrder = 1 678 TabOrder = 1
@@ -727,16 +727,16 @@ object frmTracker: TfrmTracker
727 Top = 0 727 Top = 0
728 Width = 270 728 Width = 270
729 BevelOuter = bvLowered 729 BevelOuter = bvLowered
730 ClientHeight = 104 730 ClientHeight = 100
731 ClientWidth = 270 731 ClientWidth = 266
732 ParentFont = False 732 ParentFont = False
733 TabOrder = 1 733 TabOrder = 1
734 object EnvelopePaintbox: TPaintBox 734 object EnvelopePaintbox: TPaintBox
735 Left = 1 735 Left = 1
736 Height = 102 736 Height = 98
737 Hint = 'Preview of the volume envelope' 737 Hint = 'Preview of the volume envelope'
738 Top = 1 738 Top = 1
739 Width = 268 739 Width = 264
740 Align = alClient 740 Align = alClient
741 ParentFont = False 741 ParentFont = False
742 OnPaint = EnvelopePaintboxPaint 742 OnPaint = EnvelopePaintboxPaint
@@ -776,7 +776,7 @@ object frmTracker: TfrmTracker
776 BorderSpacing.Right = 7 776 BorderSpacing.Right = 7
777 BorderSpacing.Bottom = 7 777 BorderSpacing.Bottom = 7
778 Caption = 'Square' 778 Caption = 'Square'
779 ClientHeight = 150 779 ClientHeight = 165
780 ClientWidth = 315 780 ClientWidth = 315
781 ParentFont = False 781 ParentFont = False
782 TabOrder = 2 782 TabOrder = 2
@@ -907,7 +907,7 @@ object frmTracker: TfrmTracker
907 BorderSpacing.Right = 7 907 BorderSpacing.Right = 7
908 BorderSpacing.Bottom = 7 908 BorderSpacing.Bottom = 7
909 Caption = 'Wave' 909 Caption = 'Wave'
910 ClientHeight = 150 910 ClientHeight = 165
911 ClientWidth = 293 911 ClientWidth = 293
912 ParentFont = False 912 ParentFont = False
913 TabOrder = 3 913 TabOrder = 3
@@ -967,16 +967,16 @@ object frmTracker: TfrmTracker
967 Top = 80 967 Top = 80
968 Width = 272 968 Width = 272
969 BevelOuter = bvLowered 969 BevelOuter = bvLowered
970 ClientHeight = 59 970 ClientHeight = 55
971 ClientWidth = 272 971 ClientWidth = 268
972 ParentFont = False 972 ParentFont = False
973 TabOrder = 1 973 TabOrder = 1
974 object WavePaintbox: TPaintBox 974 object WavePaintbox: TPaintBox
975 Left = 1 975 Left = 1
976 Height = 57 976 Height = 53
977 Hint = 'Preview of the waveform associated with this instrument' 977 Hint = 'Preview of the waveform associated with this instrument'
978 Top = 1 978 Top = 1
979 Width = 270 979 Width = 266
980 Align = alClient 980 Align = alClient
981 Color = clBlack 981 Color = clBlack
982 ParentColor = False 982 ParentColor = False
@@ -1901,7 +1901,7 @@ object frmTracker: TfrmTracker
1901 ParentShowHint = False 1901 ParentShowHint = False
1902 end 1902 end
1903 object PanicToolButton: TToolButton 1903 object PanicToolButton: TToolButton
1904 Left = 524 1904 Left = 528
1905 Hint = 'Stops all sound output' 1905 Hint = 'Stops all sound output'
1906 Top = 0 1906 Top = 0
1907 AutoSize = True 1907 AutoSize = True
@@ -1912,17 +1912,17 @@ object frmTracker: TfrmTracker
1912 ShowHint = True 1912 ShowHint = True
1913 end 1913 end
1914 object ToolButton2: TToolButton 1914 object ToolButton2: TToolButton
1915 Left = 119 1915 Left = 120
1916 Top = 0 1916 Top = 0
1917 Action = PlayCursorAction 1917 Action = PlayCursorAction
1918 end 1918 end
1919 object ToolButton4: TToolButton 1919 object ToolButton4: TToolButton
1920 Left = 148 1920 Left = 149
1921 Top = 0 1921 Top = 0
1922 Action = StopAction 1922 Action = StopAction
1923 end 1923 end
1924 object ExportGBButton: TToolButton 1924 object ExportGBButton: TToolButton
1925 Left = 243 1925 Left = 246
1926 Hint = 'Export the song as a standalone ROM' 1926 Hint = 'Export the song as a standalone ROM'
1927 Top = 0 1927 Top = 0
1928 AutoSize = True 1928 AutoSize = True
@@ -1938,21 +1938,21 @@ object frmTracker: TfrmTracker
1938 Style = tbsDivider 1938 Style = tbsDivider
1939 end 1939 end
1940 object ToolButton6: TToolButton 1940 object ToolButton6: TToolButton
1941 Left = 206 1941 Left = 207
1942 Height = 22 1942 Height = 22
1943 Top = 0 1943 Top = 0
1944 Caption = 'ToolButton6' 1944 Caption = 'ToolButton6'
1945 Style = tbsDivider 1945 Style = tbsDivider
1946 end 1946 end
1947 object ToolButton7: TToolButton 1947 object ToolButton7: TToolButton
1948 Left = 1066 1948 Left = 1072
1949 Height = 22 1949 Height = 22
1950 Top = 0 1950 Top = 0
1951 Caption = 'ToolButton7' 1951 Caption = 'ToolButton7'
1952 Style = tbsSeparator 1952 Style = tbsSeparator
1953 end 1953 end
1954 object OctaveSpinEdit: TSpinEdit 1954 object OctaveSpinEdit: TSpinEdit
1955 Left = 632 1955 Left = 638
1956 Height = 27 1956 Height = 27
1957 Hint = 'The octave offset for entering new notes' 1957 Hint = 'The octave offset for entering new notes'
1958 Top = 0 1958 Top = 0
@@ -1963,14 +1963,14 @@ object frmTracker: TfrmTracker
1963 TabOrder = 0 1963 TabOrder = 0
1964 end 1964 end
1965 object ToolButton9: TToolButton 1965 object ToolButton9: TToolButton
1966 Left = 583 1966 Left = 587
1967 Height = 22 1967 Height = 22
1968 Top = 0 1968 Top = 0
1969 Caption = 'ToolButton9' 1969 Caption = 'ToolButton9'
1970 Style = tbsSeparator 1970 Style = tbsSeparator
1971 end 1971 end
1972 object Label22: TLabel 1972 object Label22: TLabel
1973 Left = 589 1973 Left = 595
1974 Height = 22 1974 Height = 22
1975 Top = 0 1975 Top = 0
1976 Width = 43 1976 Width = 43
@@ -1981,7 +1981,7 @@ object frmTracker: TfrmTracker
1981 ParentFont = False 1981 ParentFont = False
1982 end 1982 end
1983 object Label23: TLabel 1983 object Label23: TLabel
1984 Left = 697 1984 Left = 703
1985 Height = 22 1985 Height = 22
1986 Top = 0 1986 Top = 0
1987 Width = 70 1987 Width = 70
@@ -1992,7 +1992,7 @@ object frmTracker: TfrmTracker
1992 ParentFont = False 1992 ParentFont = False
1993 end 1993 end
1994 object InstrumentComboBox: TComboBox 1994 object InstrumentComboBox: TComboBox
1995 Left = 767 1995 Left = 773
1996 Height = 25 1996 Height = 25
1997 Hint = 'The selected instrument for new notes' 1997 Hint = 'The selected instrument for new notes'
1998 Top = 0 1998 Top = 0
@@ -2011,7 +2011,7 @@ object frmTracker: TfrmTracker
2011 OnCloseUp = InstrumentComboBoxCloseUp 2011 OnCloseUp = InstrumentComboBoxCloseUp
2012 end 2012 end
2013 object Label24: TLabel 2013 object Label24: TLabel
2014 Left = 981 2014 Left = 987
2015 Height = 22 2015 Height = 22
2016 Top = 0 2016 Top = 0
2017 Width = 35 2017 Width = 35
@@ -2022,7 +2022,7 @@ object frmTracker: TfrmTracker
2022 ParentFont = False 2022 ParentFont = False
2023 end 2023 end
2024 object StepSpinEdit: TSpinEdit 2024 object StepSpinEdit: TSpinEdit
2025 Left = 1016 2025 Left = 1022
2026 Height = 27 2026 Height = 27
2027 Hint = 'How many rows to step down after entering a new note' 2027 Hint = 'How many rows to step down after entering a new note'
2028 Top = 0 2028 Top = 0
@@ -2033,12 +2033,12 @@ object frmTracker: TfrmTracker
2033 TabOrder = 2 2033 TabOrder = 2
2034 end 2034 end
2035 object ToolButton3: TToolButton 2035 object ToolButton3: TToolButton
2036 Left = 90 2036 Left = 91
2037 Top = 0 2037 Top = 0
2038 Action = PlayStartAction 2038 Action = PlayStartAction
2039 end 2039 end
2040 object ExportGBSButton: TToolButton 2040 object ExportGBSButton: TToolButton
2041 Left = 328 2041 Left = 331
2042 Hint = 'Export the song as a GBS soundtrack' 2042 Hint = 'Export the song as a GBS soundtrack'
2043 Top = 0 2043 Top = 0
2044 Caption = 'Export GBS' 2044 Caption = 'Export GBS'
@@ -2046,14 +2046,14 @@ object frmTracker: TfrmTracker
2046 OnClick = ExportGBSButtonClick 2046 OnClick = ExportGBSButtonClick
2047 end 2047 end
2048 object ToolButton5: TToolButton 2048 object ToolButton5: TToolButton
2049 Left = 520 2049 Left = 523
2050 Height = 22 2050 Height = 22
2051 Top = 0 2051 Top = 0
2052 Caption = 'ToolButton5' 2052 Caption = 'ToolButton5'
2053 Style = tbsDivider 2053 Style = tbsDivider
2054 end 2054 end
2055 object ToolButton10: TToolButton 2055 object ToolButton10: TToolButton
2056 Left = 420 2056 Left = 423
2057 Hint = 'Export the song as WAV or MP3' 2057 Hint = 'Export the song as WAV or MP3'
2058 Top = 0 2058 Top = 0
2059 Caption = 'Render Song' 2059 Caption = 'Render Song'
@@ -2061,21 +2061,21 @@ object frmTracker: TfrmTracker
2061 OnClick = ToolButton10Click 2061 OnClick = ToolButton10Click
2062 end 2062 end
2063 object ToolButton11: TToolButton 2063 object ToolButton11: TToolButton
2064 Left = 239 2064 Left = 241
2065 Height = 22 2065 Height = 22
2066 Top = 0 2066 Top = 0
2067 Caption = 'ToolButton11' 2067 Caption = 'ToolButton11'
2068 Style = tbsDivider 2068 Style = tbsDivider
2069 end 2069 end
2070 object LoopSongToolButton: TToolButton 2070 object LoopSongToolButton: TToolButton
2071 Left = 210 2071 Left = 212
2072 Top = 0 2072 Top = 0
2073 ImageIndex = 87 2073 ImageIndex = 87
2074 OnClick = LoopSongToolButtonClick 2074 OnClick = LoopSongToolButtonClick
2075 Style = tbsCheck 2075 Style = tbsCheck
2076 end 2076 end
2077 object ToolButton12: TToolButton 2077 object ToolButton12: TToolButton
2078 Left = 177 2078 Left = 178
2079 Top = 0 2079 Top = 0
2080 Action = SingleStepAction 2080 Action = SingleStepAction
2081 end 2081 end
Modifiedsrc/tracker.pas +18−0
@@ -562,6 +562,7 @@ type
562 procedure OnTrackerGridResize(Sender: TObject); 562 procedure OnTrackerGridResize(Sender: TObject);
563 procedure OnTrackerGridCursorOutOfBounds; 563 procedure OnTrackerGridCursorOutOfBounds;
564 procedure ApplyMidiSettings; 564 procedure ApplyMidiSettings;
565 procedure OnTrackerGridDoubleClickedInstrument;
565 end; 566 end;
566 567
567 var 568 var
@@ -1021,6 +1022,22 @@ begin
1021 end; 1022 end;
1022 end; 1023 end;
1023 1024
1025 procedure TfrmTracker.OnTrackerGridDoubleClickedInstrument;
1026 var
1027 Inst: Integer;
1028 begin
1029 Inst := TrackerGrid.GetAt(TrackerGrid.Cursor);
1030 if not InRange(Inst, 1, 15) then Exit;
1031
1032 case TrackerGrid.Cursor.X of
1033 0, 1: LoadInstrument(itSquare, Inst);
1034 2: LoadInstrument(itWave, Inst);
1035 3: LoadInstrument(itNoise, Inst);
1036 end;
1037
1038 PageControl1.ActivePage := InstrumentTabSheet;
1039 end;
1040
1024 procedure TfrmTracker.LoadWave(Wave: Integer); 1041 procedure TfrmTracker.LoadWave(Wave: Integer);
1025 begin 1042 begin
1026 CurrentWave := @Song.Waves[Wave]; 1043 CurrentWave := @Song.Waves[Wave];
@@ -1264,6 +1281,7 @@ begin
1264 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns, 4); 1281 TrackerGrid := TTrackerGrid.Create(Self, ScrollBox1, Song.Patterns, 4);
1265 TrackerGrid.OnResize:=@OnTrackerGridResize; 1282 TrackerGrid.OnResize:=@OnTrackerGridResize;
1266 TrackerGrid.OnCursorOutOfBounds:=@OnTrackerGridCursorOutOfBounds; 1283 TrackerGrid.OnCursorOutOfBounds:=@OnTrackerGridCursorOutOfBounds;
1284 TrackerGrid.OnDoubleClickedInstrument:=@OnTrackerGridDoubleClickedInstrument;
1267 TrackerGrid.FontSize := TrackerSettings.PatternEditorFontSize; 1285 TrackerGrid.FontSize := TrackerSettings.PatternEditorFontSize;
1268 TrackerGrid.Left := RowNumberStringGrid.Left + RowNumberStringGrid.Width; 1286 TrackerGrid.Left := RowNumberStringGrid.Left + RowNumberStringGrid.Width;
1269 TrackerGrid.PopupMenu := TrackerGridPopup; 1287 TrackerGrid.PopupMenu := TrackerGridPopup;
Modifiedsrc/trackergrid.pas +5−1
@@ -124,6 +124,7 @@ type
124 SelectedInstrument, SelectedOctave, Step: Integer; 124 SelectedInstrument, SelectedOctave, Step: Integer;
125 125
126 OnCursorOutOfBounds: procedure of object; 126 OnCursorOutOfBounds: procedure of object;
127 OnDoubleClickedInstrument: procedure of object;
127 128
128 property HighlightedRow: Integer read FHighlightedRow write SetHighlightedRow; 129 property HighlightedRow: Integer read FHighlightedRow write SetHighlightedRow;
129 property SelectionGridRect: TRect read GetSelectionGridRect write SetSelectionGridRect; 130 property SelectionGridRect: TRect read GetSelectionGridRect write SetSelectionGridRect;
@@ -545,7 +546,10 @@ end;
545 546
546 procedure TTrackerGrid.DblClick; 547 procedure TTrackerGrid.DblClick;
547 begin 548 begin
548 OpenEffectEditor; 549 if (Cursor.SelectedPart = cpInstrument) and Assigned(OnDoubleClickedInstrument) then
550 OnDoubleClickedInstrument
551 else
552 OpenEffectEditor;
549 553
550 NormalizeCursors; 554 NormalizeCursors;
551 MouseButtonDown := False; 555 MouseButtonDown := False;