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.
Image sequence diplaying
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
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.
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?
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;
}
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com