Image sequence diplaying

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
lechoo
Junior Member
Junior Member
Posts: 3
Joined: 2005-08-01, 13:42 UTC

Image sequence diplaying

Post by *lechoo »

Hi,
it isn't clear to me after doing some reading on TC api so I will ask. Is it possible to write a plugin which instead of:

img0000.tga
img0001.tga
img0002.tga
img0003.tga
img0004.tga
img0005.tga
img0006.tga

will display something like

img[0-6]
or
img[####]

This would be very helpfull for people working with file sequences, including me. I want to write something like that but don't know if it is possible.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, it depends on what you want to do - you could do this in a file system plugin like my sample filesys plugin, but you will be restricted to the operations which can be performed in such plugins. For example, thumbnails view will not work there.
Author of Total Commander
https://www.ghisler.com
lechoo
Junior Member
Junior Member
Posts: 3
Joined: 2005-08-01, 13:42 UTC

Post by *lechoo »

Thanks for your answer, I will try modyfying that example.
All I need are typical file operations like copy, move etc. but performed on all files in sequence. For example, you move cursor over img[####].tga , press F5 and whole sequence is copied to another dir.
lechoo
Junior Member
Junior Member
Posts: 3
Joined: 2005-08-01, 13:42 UTC

Post by *lechoo »

Sorry if my problem is simple but I don't seem to get this and I'm quite new to TC api. Here is FsFindNext
from sample fs plugin.

Code: Select all

BOOL __stdcall FsFindNext(HANDLE Hdl,WIN32_FIND_DATA *FindData)
{
	char buf[MAX_PATH];
	pLastFindStuct lf;

	if ((int)Hdl==1)
		return false;

	lf=(pLastFindStuct)Hdl;
	if (lf->searchhandle==INVALID_HANDLE_VALUE)
	{   // drive list!
		char ch=lf->LastFoundName[0];
		strcpy(buf,"A:\\");
		buf[0]=ch+1;
		while (GetDriveType(buf)==DRIVE_NO_ROOT_DIR && ch<'Z'+1)
		{
			ch++;
			buf[0]=ch;
		}
		buf[2]=0;
		if (ch<='Z')
		{
			strcpy(lf->LastFoundName,buf);
			strcpy(FindData->cFileName,buf);
			return true;
		}
		else
		{
			return false;
		}

	}
	else
	{
		lf=(pLastFindStuct)Hdl;
		return FindNextFile(lf->searchhandle,FindData);
	}
	return false;
}
Now let's say I want to modify filenames, for example replace each "A" with "X" in each filename or dir name. How can I do that, through FindData struct?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Well, what you probably need to do is build a list of all files in FsFindFirst, sort the list, eliminate duplicate names, and then return the names one by one in FsFindNext calls. You can save this list for example in a dynamically created array of pointers to WIN32_FIND_DATA structures. To change the name, you need to change the FindData->cFileName item.
Author of Total Commander
https://www.ghisler.com
Post Reply