Thread: VirtualDub2
View Single Post
Old 27th June 2016, 21:13   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK Shekh, I've had a little bit of a play and here some comments.

TAB space of 4 works, GREAT LOVE THAT !

Scrip Editor, Menu/Help/Avisynth Information/ Crashes, maybe because I have a LOT of plugs in my auto plugs directory (AVS standard v2.6).

Plugin (32bit only tried) crashes VD if put in VDub v1.10.4 Plugins32.

Fizick Fixes do not work, must be non implemented in the source you used.

Code:
Avisource("Cabaret.avi")
trim(10000,-100)           # 100 Frames, frames 0 -> 99
ShowFrameNumber

# Go to Frame 20, Press HOME, Go to frame 31 Press END, Press DELETE (deletes frames 20 -> 30 inclusive).
# Open Script Editor, 
# Press CTRL/I, should insert    "Trim(0,19) ++ Trim(31,99)"
#               Actually inserts "Trim(0,20) ++ Trim(31,100)"       # NOTE Frame 100 does not exist



/* Fizick Fix, AVSViewer.cpp

	case WM_VDM_SENDFRAMESET:
		{
			string buffer;
			char buf[50];
			VDM_FRAMESET *fs = (PVDM_FRAMESET) lParam;
			//SETTEXTEX st;
			//st.flags = ST_SELECTION;
			//st.codepage = CP_ACP;
			VDM_BASIC_RANGE range;
			for(int i = 0; i<fs->count; i++) {
				//range = (fs->ranges + (i*sizeof(VDM_BASIC_RANGE)));
				range = fs->ranges[i];
//				wsprintf(buf, "Trim(%d,%d)", range.from, range.to);
				// Fixed bug with TRIM position for Avisynth - code changed by Fizick:
				if (range.from == 0 && range.to == 1)
					wsprintf(buf, "Trim(%d,%d)", 0, -1); // special case of one very first frame
				else
					wsprintf(buf, "Trim(%d,%d)", range.from, range.to - 1); // -1 corrected by Fizick
				if (i>0) buffer += " ++ ";
				buffer += buf;
			}
			SendMessage(pcd->hwndView, SCI_REPLACESEL, 0, (LPARAM) buffer.c_str());
			if (fs->count==0) guiMessageBox(hwnd, IDS_ERR_AVS_NOFRAMESET, IDS_ERR_CAPTION, MB_OK|MB_ICONERROR);
			delete [] fs->ranges;
			delete [] fs;
		}
		return 0;
*/

# Send Range CTRL/R, mark 20 -> 31 should insert "20,30" but instead inserts "20,31"
# Same for Send Trim CTRL/T, mark 20 -> 31 should insert "Trim(20,30)" but instead inserts "Trim(20,31)"
/*
	case WM_VDM_SENDRANGE:
		{
			char buf[50];
			VDM_RANGE *range = (PVDM_RANGE) lParam;
			//SETTEXTEX st;
			//st.flags = ST_SELECTION;
			//st.codepage = CP_ACP;
			if (pcd->scriptType == SCRIPTTYPE_NONE)
//				wsprintf(buf, "%d-%d", range->range.from, range->range.to);
				wsprintf(buf, "%d-%d", range->range.from, range->range.to - 1); // -1 corrected by Fizick
			else
//				wsprintf(buf, (range->tag)?"Trim(%d,%d)":"%d,%d", range->range.from, range->range.to);
				// Fixed bug with TRIM position for Avisynth - code changed by Fizick:
				if (range->range.from == 0 && range->range.to == 1)
					wsprintf(buf, (range->tag)?"Trim(%d,%d)":"%d,%d", 0, -1);// special case of very first frame
				else
					wsprintf(buf, (range->tag)?"Trim(%d,%d)":"%d,%d", range->range.from, range->range.to -1);// -1 corrected by Fizick
			SendMessage(pcd->hwndView, SCI_REPLACESEL, 0, (LPARAM) &buf);
			delete [] range;
		}
		return 0;
*/
Is very promising, can probably get rid of VDubMod very soon

EDIT:
From gui.cpp, perhaps related to Avisynth Information crash
Code:
// *******************************************************************
// *** VirtualDubMod											   ***
// *** Tobias Minich, Apr 2003									   ***
// BEGIN *************************************************************
int guiMessageBox(HWND hwnd, UINT idText, UINT idCaption, UINT uType) {
	char caption[256];
//	char text[1024];
	char text[4096]; // increased by Fizick (for Avisynth functions list)
	bool error = false;

	// get caption
	if (LoadString(g_hInst, idCaption, (LPTSTR)caption, sizeof caption) == 0)
		error = true;

	// get message body
	if (LoadString(g_hInst, idText, (LPTSTR)text, sizeof text) == 0)
		error = true;

	if (error) {
		return MessageBox(hwnd, "Can't retrieve message!", "Internal Error", MB_OK);
	}

	return MessageBox(hwnd, text, caption, uType);
}

int guiMessageBoxF(HWND hwnd, UINT idFormat, UINT idCaption, UINT uType, ...) {
//	char buf[1024];
	char buf[40096];// increased by Fizick (for Avisynth functions list)
	char caption[256];
//	char format[1024];
	char format[4096];// increased by Fizick (for Avisynth functions list)
	bool error = false;
	va_list val;

	// get caption
	if (LoadString(g_hInst, idCaption, (LPTSTR)caption, sizeof caption) == 0)
		error = true;

	// get format string
	if (LoadString(g_hInst, idFormat, (LPTSTR)format, sizeof format) == 0)
		error = true;

	if (error) {
		return MessageBox(hwnd, "Can't retrieve message!", "Internal Error", MB_OK);
	}

	va_start(val, uType);
	vsprintf(buf, format, val);
	va_end(val);

	return MessageBox(hwnd, buf, caption, uType);
}
EDIT: Maybe that second from last one should be 40960 rather than 40096.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th June 2016 at 21:50.
StainlessS is offline   Reply With Quote