hmml_to_*.c: Multiple annotators/co-hosts/guests
This commit is contained in:
parent
bd74374962
commit
d65d885804
Binary file not shown.
|
@ -403,6 +403,7 @@ SanitisePunctuation(char *String)
|
||||||
int
|
int
|
||||||
BuildCredits(buffer *CreditsMenu, buffer *HostInfo, buffer *AnnotatorInfo, bool *HasCreditsMenu, char *Host, char *Annotator)
|
BuildCredits(buffer *CreditsMenu, buffer *HostInfo, buffer *AnnotatorInfo, bool *HasCreditsMenu, char *Host, char *Annotator)
|
||||||
{
|
{
|
||||||
|
// TODO(matt): Handle co-hosts and guests
|
||||||
bool FoundHost = FALSE;
|
bool FoundHost = FALSE;
|
||||||
bool FoundAnnotator = FALSE;
|
bool FoundAnnotator = FALSE;
|
||||||
|
|
||||||
|
@ -1320,7 +1321,8 @@ main(int ArgC, char **Args)
|
||||||
" <div class=\"video_container\" data-videoId=\"%s\"></div>\n"
|
" <div class=\"video_container\" data-videoId=\"%s\"></div>\n"
|
||||||
" <div class=\"markers_container %s\">\n", HMML.metadata.id, HMML.metadata.project);
|
" <div class=\"markers_container %s\">\n", HMML.metadata.id, HMML.metadata.project);
|
||||||
|
|
||||||
BuildCredits(&CreditsMenu, &HostInfo, &AnnotatorInfo, &HasCreditsMenu, HMML.metadata.member, HMML.metadata.annotator);
|
// TODO(matt): Handle multiple annotators
|
||||||
|
BuildCredits(&CreditsMenu, &HostInfo, &AnnotatorInfo, &HasCreditsMenu, HMML.metadata.member, HMML.metadata.annotators[0]);
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
printf(" --- Entering Annotations Loop ---\n");
|
printf(" --- Entering Annotations Loop ---\n");
|
||||||
|
@ -1648,12 +1650,12 @@ AppendedIdentifier:
|
||||||
HasQuote = TRUE;
|
HasQuote = TRUE;
|
||||||
|
|
||||||
|
|
||||||
if(BuildQuote(&QuoteInfo, HMML.metadata.twitch ? HMML.metadata.twitch : HMML.metadata.member, Anno->quote.id) == 1)
|
if(BuildQuote(&QuoteInfo, HMML.metadata.stream_username ? HMML.metadata.stream_username : HMML.metadata.member, Anno->quote.id) == 1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s:%d: Quote #%s %d not found! Consider pulling the latest quotes\n",
|
fprintf(stderr, "%s:%d: Quote #%s %d not found! Consider pulling the latest quotes\n",
|
||||||
Args[FileIndex],
|
Args[FileIndex],
|
||||||
Anno->line,
|
Anno->line,
|
||||||
HMML.metadata.twitch ? HMML.metadata.twitch : HMML.metadata.member,
|
HMML.metadata.stream_username ? HMML.metadata.stream_username : HMML.metadata.member,
|
||||||
Anno->quote.id);
|
Anno->quote.id);
|
||||||
hmml_free(&HMML);
|
hmml_free(&HMML);
|
||||||
free(MemoryArena);
|
free(MemoryArena);
|
||||||
|
@ -1677,7 +1679,7 @@ Anno->quote.id);
|
||||||
" <span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[&#%d;]</span><span class=\"time\">%s</span></span>\n"
|
" <span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[&#%d;]</span><span class=\"time\">%s</span></span>\n"
|
||||||
" </div>\n"
|
" </div>\n"
|
||||||
" </span>\n",
|
" </span>\n",
|
||||||
HMML.metadata.twitch ? HMML.metadata.twitch : HMML.metadata.member,
|
HMML.metadata.stream_username ? HMML.metadata.stream_username : HMML.metadata.member,
|
||||||
QuoteInfo.Date,
|
QuoteInfo.Date,
|
||||||
TimecodeToSeconds(Anno->time),
|
TimecodeToSeconds(Anno->time),
|
||||||
QuoteIdentifier,
|
QuoteIdentifier,
|
||||||
|
|
|
@ -9,12 +9,21 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char* member;
|
char* member;
|
||||||
char* twitch;
|
char* stream_platform;
|
||||||
|
char* stream_username;
|
||||||
char* project;
|
char* project;
|
||||||
char* title;
|
char* title;
|
||||||
char* platform;
|
char* vod_platform;
|
||||||
char* id;
|
char* id;
|
||||||
char* annotator;
|
|
||||||
|
char** co_hosts;
|
||||||
|
size_t co_host_count;
|
||||||
|
|
||||||
|
char** guests;
|
||||||
|
size_t guest_count;
|
||||||
|
|
||||||
|
char** annotators;
|
||||||
|
size_t annotator_count;
|
||||||
} HMML_VideoMetaData;
|
} HMML_VideoMetaData;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -42,6 +51,7 @@ typedef struct {
|
||||||
HMML_MarkerType type;
|
HMML_MarkerType type;
|
||||||
char* marker;
|
char* marker;
|
||||||
char* parameter;
|
char* parameter;
|
||||||
|
char* episode;
|
||||||
int offset;
|
int offset;
|
||||||
} HMML_Marker;
|
} HMML_Marker;
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -130,8 +130,8 @@ main(int ArgC, char **Args)
|
||||||
{
|
{
|
||||||
ClaimBuffer(MemoryArena, &ClaimedMemory, &Out, 1024 * 32);
|
ClaimBuffer(MemoryArena, &ClaimedMemory, &Out, 1024 * 32);
|
||||||
|
|
||||||
char *Member = HMML.metadata.twitch ?
|
char *Member = HMML.metadata.stream_username ?
|
||||||
HMML.metadata.twitch :
|
HMML.metadata.stream_username :
|
||||||
HMML.metadata.member;
|
HMML.metadata.member;
|
||||||
|
|
||||||
bool WritingChat = TRUE;
|
bool WritingChat = TRUE;
|
||||||
|
@ -319,8 +319,9 @@ SkipRef:
|
||||||
skip: {};
|
skip: {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(matt): Handle multiple annotators
|
||||||
CopyStringToBuffer(&Out, "\nAnnotated by %s - https://handmade.network/m/%s\n",
|
CopyStringToBuffer(&Out, "\nAnnotated by %s - https://handmade.network/m/%s\n",
|
||||||
HMML.metadata.annotator, HMML.metadata.annotator);
|
HMML.metadata.annotators[0], HMML.metadata.annotators[0]);
|
||||||
|
|
||||||
if(Out.Ptr - Out.Location > 5000)
|
if(Out.Ptr - Out.Location > 5000)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,12 +9,21 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char* member;
|
char* member;
|
||||||
char* twitch;
|
char* stream_platform;
|
||||||
|
char* stream_username;
|
||||||
char* project;
|
char* project;
|
||||||
char* title;
|
char* title;
|
||||||
char* platform;
|
char* vod_platform;
|
||||||
char* id;
|
char* id;
|
||||||
char* annotator;
|
|
||||||
|
char** co_hosts;
|
||||||
|
size_t co_host_count;
|
||||||
|
|
||||||
|
char** guests;
|
||||||
|
size_t guest_count;
|
||||||
|
|
||||||
|
char** annotators;
|
||||||
|
size_t annotator_count;
|
||||||
} HMML_VideoMetaData;
|
} HMML_VideoMetaData;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -42,6 +51,7 @@ typedef struct {
|
||||||
HMML_MarkerType type;
|
HMML_MarkerType type;
|
||||||
char* marker;
|
char* marker;
|
||||||
char* parameter;
|
char* parameter;
|
||||||
|
char* episode;
|
||||||
int offset;
|
int offset;
|
||||||
} HMML_Marker;
|
} HMML_Marker;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue