Mercurial > libedl
comparison README.md @ 3:bd99b6549eb4
*: expand in readme and rename src/main to src/edl
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 20:22:54 -0500 |
parents | d00bc412900e |
children | c2408abb258a |
comparison
equal
deleted
inserted
replaced
2:d00bc412900e | 3:bd99b6549eb4 |
---|---|
1 # libedl | 1 # libedl |
2 libedl is a library for parsing Vegas Pro EDL files and translating them into usable C structures. | 2 libedl is a library for parsing Vegas Pro EDL files and translating them into usable C structures. |
3 | |
4 Currently, writing EDL files is not supported by this library. | |
5 | |
6 ## Build | |
7 ```console | |
8 $ autoreconf -i | |
9 $ mkdir build | |
10 $ cd build | |
11 $ ../configure | |
12 $ make | |
13 $ sudo make install | |
14 ``` | |
3 | 15 |
4 ## Usage | 16 ## Usage |
5 ```c | 17 ```c |
6 #include <stdio.h> | 18 #include <stdio.h> |
19 #include <stdlib.h> | |
7 #include "edl.h" | 20 #include "edl.h" |
8 | 21 |
9 int main(){ | 22 int main(){ |
10 /* open the file */ | 23 /* open the file */ |
11 FILE* file = fopen("MyProject.txt", "rb"); | 24 FILE* file = fopen("MyProject.txt", "rb"); |
12 if (!file) | 25 if (!file) |
13 return 1; | 26 return 1; |
14 | 27 |
15 /* get filesize */ | 28 /* get filesize */ |
16 fseek(file, 0L, SEEK_END); | 29 fseek(file, 0L, SEEK_END); |
29 /* pass it to libedl */ | 42 /* pass it to libedl */ |
30 EDL_file edl = EDL_parse(data, fsize + 1); | 43 EDL_file edl = EDL_parse(data, fsize + 1); |
31 | 44 |
32 /* do what we have to do with it */ | 45 /* do what we have to do with it */ |
33 for (int i = 0; i < edl.size; i++) { | 46 for (int i = 0; i < edl.size; i++) { |
34 printf("%s", edl.arr[i].filename); | 47 printf("%s\n", edl.arr[i].filename); |
35 } | 48 } |
36 | 49 |
37 /* free our memory */ | 50 /* free our memory */ |
38 EDL_free(edl); | 51 EDL_free(edl); |
39 free(data); | 52 free(data); |
40 | 53 |
41 return 0; | 54 return 0; |
42 } | 55 } |
43 ``` | 56 ``` |