shithub: alienpatch

Download patch

ref: 709706891b14f0c9f46ee556c9dcdd122df062dc
parent: 5d0ee6967dcaba54cb08fde6ea7835208b15894c
author: qwx <[email protected]>
date: Sat Nov 12 02:28:02 EST 2022

ft2-clone-latest-and-midi: update and properly base on plan9 version

--- a/ft2-clone-latest-and-midi
+++ b/ft2-clone-latest-and-midi
@@ -173,16 +173,41 @@
 +rtmidi_in_ignore_types(RtMidiInPtr, bool, bool, bool)
 +{
 +}
---- a/src/ft2_audio.c
-+++ b/src/ft2_audio.c
-@@ -5,6 +5,7 @@
+--- a/mkfile.plan9
++++ b/mkfile.plan9
+@@ -2,7 +2,7 @@
  
- #include <stdio.h>
- #include <stdint.h>
-+#include <math.h>
- #include "ft2_header.h"
- #include "ft2_config.h"
- #include "scopes/ft2_scopes.h"
+ BIN=/$objtype/bin/audio
+ TARG=ft2
+-CFLAGS=$CFLAGS -p -Isrc -I/sys/include/npe -D__plan9__
++CFLAGS=$CFLAGS -p -Isrc -Isrc/rtmidi -I/sys/include/npe -D__plan9__ -DHAS_MIDI
+ 
+ HFILES=\
+ 	src/ft2_about.h\
+@@ -19,6 +19,7 @@
+ 	src/ft2_gui.h\
+ 	src/ft2_header.h\
+ 	src/ft2_help.h\
++	src/ft2_hpc.h\
+ 	src/ft2_inst_ed.h\
+ 	src/ft2_keyboard.h\
+ 	src/ft2_midi.h\
+@@ -68,6 +69,7 @@
+ 	src/ft2_events.$O\
+ 	src/ft2_gui.$O\
+ 	src/ft2_help.$O\
++	src/ft2_hpc.$O\
+ 	src/ft2_inst_ed.$O\
+ 	src/ft2_keyboard.$O\
+ 	src/ft2_main.$O\
+@@ -122,6 +124,7 @@
+ 	src/smploaders/ft2_load_iff.$O\
+ 	src/smploaders/ft2_load_raw.$O\
+ 	src/smploaders/ft2_load_wav.$O\
++	midi.$O\
+ 
+ default:V: all
+ 
 --- a/src/ft2_hpc.c
 +++ b/src/ft2_hpc.c
 @@ -11,6 +11,7 @@
@@ -223,80 +248,6 @@
  
  	const uint32_t numDevices = getNumMidiInDevices();
  	if (numDevices == 0)
---- a/src/ft2_scrollbars.c
-+++ b/src/ft2_scrollbars.c
-@@ -224,7 +224,7 @@
- 			{
- 				dTmp = (scrollBar->w / (double)scrollBar->end) * scrollBar->page;
- 				tmp32 = (int32_t)(dTmp + 0.5);
--				realThumbLength = (int16_t)CLAMP(tmp32, 1, scrollBar->w);
-+				realThumbLength = (int16_t)CLAMP(tmp32, 1, (int)scrollBar->w);
- 			}
- 			else
- 			{
-@@ -251,7 +251,7 @@
- 		}
- 
- 		// prevent scrollbar thumb coords from being outside of the scrollbar area
--		thumbX = CLAMP(thumbX, scrollBar->x, scrollEnd-1);
-+		thumbX = CLAMP((int)thumbX, (int)scrollBar->x, (int)scrollEnd-1);
- 		if (thumbX+thumbW > scrollEnd)
- 			thumbW = scrollEnd - thumbX;
- 	}
-@@ -267,7 +267,7 @@
- 		{
- 			dTmp = (scrollBar->h / (double)scrollBar->end) * scrollBar->page;
- 			tmp32 = (int32_t)(dTmp + 0.5);
--			realThumbLength = (int16_t)CLAMP(tmp32, 1, scrollBar->h);
-+			realThumbLength = (int16_t)CLAMP(tmp32, 1, (int)scrollBar->h);
- 		}
- 		else
- 		{
-@@ -293,7 +293,7 @@
- 		}
- 
- 		// prevent scrollbar thumb coords from being outside of the scrollbar area
--		thumbY = CLAMP(thumbY, scrollBar->y, scrollEnd - 1);
-+		thumbY = CLAMP((int)thumbY, (int)scrollBar->y, (int)scrollEnd - 1);
- 		if (thumbY+thumbH > scrollEnd)
- 			thumbH = scrollEnd - thumbY;
- 	}
-@@ -523,7 +523,7 @@
- 					}
- 
- 					assert(scrollBar->w > 0);
--					scrollPos = CLAMP(scrollPos, 0, scrollBar->w);
-+					scrollPos = CLAMP((int)scrollPos, 0, (int)scrollBar->w);
- 
- 					length = scrollBar->w + (scrollBar->realThumbLength - scrollBar->thumbW);
- 					if (length < 1)
-@@ -549,7 +549,7 @@
- 					scrollPos = mouse.lastScrollY - scrollBar->y - mouse.saveMouseY;
- 
- 					assert(scrollBar->h > 0);
--					scrollPos = CLAMP(scrollPos, 0, scrollBar->h);
-+					scrollPos = CLAMP((int)scrollPos, 0, (int)scrollBar->h);
- 
- 					length = scrollBar->h + (scrollBar->realThumbLength - scrollBar->thumbH);
- 					if (length < 1)
-@@ -617,7 +617,7 @@
- 			}
- 
- 			assert(scrollBar->w > 0);
--			scrollX = CLAMP(scrollX, 0, scrollBar->w);
-+			scrollX = CLAMP((int)scrollX, 0, (int)scrollBar->w);
- 
- 			length = scrollBar->w + (scrollBar->realThumbLength - scrollBar->thumbW);
- 			if (length < 1)
-@@ -641,7 +641,7 @@
- 			scrollY = mouse.lastScrollY - mouse.saveMouseY - scrollBar->y;
- 
- 			assert(scrollBar->h > 0);
--			scrollY = CLAMP(scrollY, 0, scrollBar->h);
-+			scrollY = CLAMP((int)scrollY, 0, (int)scrollBar->h);
- 
- 			length = scrollBar->h + (scrollBar->realThumbLength - scrollBar->thumbH);
- 			if (length < 1)
 --- a/src/ft2_video.c
 +++ b/src/ft2_video.c
 @@ -80,9 +80,9 @@