I have a problem in Delphi7. My application creates mpg video files according to ie naming convention
\ 000_A_Title_YYYY-MM-DD_HH mm ss_Index.mpg
The following rules apply to this file name:
000 is a video sequence. It increases each time you press the stop button.
A (or B, C, D) indicates the recording camera - therefore, video files are associated with four video streams that play simultaneously.
Title - a string of variable length. In my application, it cannot contain _ .
YYYY-MM-DD_HH-mm-ss - start time of the video sequence (not one file)
Index - the index of the index based on zero and increases within 1 video sequence. That is, video files no more than 15 minutes, as soon as this is achieved, a new video file is launched with the same serial number, but followed by an index. Using this, we can calculate the actual start time of the file (Filename decoded time + 15*Index)
With this method, my application can retrieve the start time of recording a video file.
Now we have one more requirement for processing arbitrarily named video files. The only thing I know for sure is somewhere in the file name YHY-MM-DD HH-mm-ss.
How can I allow the user to specify a file name convention for the files that he imports? Something like Regular Expressions? I understand that there must be a template for the naming scheme.
So, if the user enters ?_(Camera)_*_YYYY-MM-DD_HH-mm-ss_(Index).mpg into the text box, how would I get the start time? Is there a better solution? Or should I just handle every opportunity when we come to them?
(I know that this is probably not the best way to deal with such a problem, but we cannot change the problem - new video files are recorded by another company)