Phase 6: Add WAV clips, graph playback and bounded recording
This commit is contained in:
parent
65640c4aad
commit
8a37090b81
40 changed files with 1450 additions and 69 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#define _POSIX_C_SOURCE 200809L
|
||||
#include "xtc/xtc_project.h"
|
||||
#include "xtc/xtc_audio.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -110,9 +110,20 @@ int main(void)
|
|||
for (i = 1; i < XTC_PROJECT_MAX_TRACKS; ++i) assert(xtc_project_add_track(q, "Track", &id) == XTC_OK);
|
||||
assert(xtc_project_add_track(q, "Full", &id) == XTC_ERR_CAPACITY);
|
||||
assert(xtc_project_get_track(q, 0, &(xtc_track_info){0}) == XTC_OK);
|
||||
for (i = 0; i < XTC_PROJECT_MAX_CLIPS; ++i) assert(xtc_project_add_clip(q, 2, "Region", 0, 960, &id) == XTC_OK);
|
||||
for (i = 0; i < XTC_PROJECT_MAX_CLIPS; ++i) {
|
||||
char asset[XTC_ASSET_PATH_BYTES];
|
||||
memset(asset, 'a', sizeof(asset)); asset[0] = '/'; asset[sizeof(asset) - 1] = 0;
|
||||
assert(xtc_project_add_clip(q, 2, "Region", 0, 960, &id) == XTC_OK);
|
||||
assert(xtc_project_set_clip_asset(q, id, asset) == XTC_OK);
|
||||
}
|
||||
assert(xtc_project_add_clip(q, 2, "Full", 0, 960, &id) == XTC_ERR_CAPACITY);
|
||||
assert(xtc_project_save(q, other) == XTC_OK && xtc_project_load(p, other) == XTC_OK);
|
||||
{
|
||||
const char *v1 = "XTC_PROJECT 1\nAPP 0 1 0\nTEMPO 120000\nIDS 1 1\nGRAPH 1 0 0 0\nTRACKS 1\nTRACK 0 41\nCLIPS 1\nCLIP 0 0 0 960 0 960 42\nEND\n";
|
||||
write_bytes(bad, v1, strlen(v1));
|
||||
assert(xtc_project_load(p, bad) == XTC_OK);
|
||||
assert(xtc_project_get_clip(p, 0, &info) == XTC_OK && info.asset_path[0] == 0);
|
||||
}
|
||||
xtc_project_destroy(p); xtc_project_destroy(q);
|
||||
assert(unlink(path) == 0 && unlink(other) == 0 && unlink(bad) == 0);
|
||||
assert(rmdir(dir) == 0); /* Also verifies no abandoned save temporaries. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue