Really all I'm working on now is recording itself. I figure 512 bytes should be good for the header, considering it's just some simple text and stuff. I have no experience actually writing to file though. I could make a file manually in a hex editor, I could parse it with PHP and handle it properly, but I've never had to do this in C++ before. Anyone here have some experience with this that wants to contribute some code? A simple function to create the header of the movie file would be great.
-----EDIT-----
Here's a sample header file. The actual file should be padded with 00's instead of 2D's(-). I padded it with 2D's to show exactly how long each part should be.
00000000 74 65 73 74 20 66 69 6c 65 2d 2d 2d 2d 2d 2d 2d test file------- Title of Run
00000010 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00000020 56 61 6c 61 72 6e 69 6e 2d 2d 2d 2d 2d 2d 2d 2d Valarnin-------- Runner's Name
00000030 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00000040 53 4c 45 53 5f 31 30 30 31 2d 2d 2d 2d 2d 2d 2d SLES_1001------- Disk ID
00000050 53 6f 6d 65 46 69 6c 65 2e 49 53 4f 2d 2d 2d 2d SomeFile.ISO---- Original File Name
00000060 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
00000070 31 00 31 00 34 35 33 34 35 36 39 33 38 37 32 31 1.1.453456938721
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000100 53 68 6f 72 74 20 63 6f 6d 6d 65 6e 74 73 20 66 Short comments f
00000110 72 6f 6d 20 61 75 74 68 6f 72 20 74 6f 20 64 65 rom author to de
00000120 73 63 72 69 62 65 20 74 68 65 20 72 75 6e 2e 20 scribe the run.
00000130 54 68 69 73 20 63 6f 75 6c 64 20 62 65 20 75 70 This could be up
00000140 20 74 6f 20 62 79 74 65 20 35 31 32 2e 20 49 6d to byte 512. Im
00000150 6d 65 64 69 61 74 6c 79 20 61 66 74 65 72 20 62 mediatly after b
00000160 79 74 65 20 35 31 32 20 74 68 65 20 76 69 64 65 yte 512 the vide
00000170 6f 20 72 65 63 6f 72 64 69 6e 67 20 77 69 6c 6c o recording will
00000180 20 73 74 61 72 74 2e 20 53 75 63 68 20 61 20 6c start. Such a l
00000190 6f 6e 67 20 73 70 61 63 65 20 69 73 20 72 65 73 ong space is res
000001a0 65 72 76 65 64 20 73 6f 20 77 65 20 63 61 6e 20 erved so we can
000001b0 6d 6f 76 65 20 63 6f 6d 6d 65 6e 74 73 20 75 70 move comments up
000001c0 20 6c 61 74 65 72 20 61 6e 64 20 68 61 76 65 20 later and have
000001d0 72 6f 6f 6d 20 66 6f 72 20 6e 65 77 20 66 6c 61 room for new fla
000001e0 67 73 2e 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d gs.-------------
000001f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
-----EDIT2-----
OK, I've coded a function to read the header of the file. I also modified the code above to reflect the changed test movie file. Any input on the read code?
int PlayMovie(char moviefile[256]) {
char RunName[32], RunnerName[32], RunCDID[16], RunCDName[32], RunComments[256];
char Controllers[1], DiskAmount[1], RunLength[12];
FILE * movptr;
movptr = fopen(moviefile, "r");
fgets(RunName, 32, movptr);
fseek(movptr, 32, SEEK_SET);
fgets(RunnerName, 32, movptr);
fseek(movptr, 64, SEEK_SET);
fgets(RunCDID, 16, movptr);
fseek(movptr, 80, SEEK_SET);
fgets(RunCDName, 32, movptr);
fseek(movptr, 112, SEEK_SET);
fgets(Controllers, 1, movptr);
fseek(movptr, 114, SEEK_SET);
fgets(DiskAmount, 1, movptr);
fseek(movptr, 116, SEEK_SET);
fgets(RunLength, 12, movptr);
fseek(movptr, 256, SEEK_SET);
fgets(RunComments, 256, movptr);
fclose(movptr);
return 1;
}