hmml_to_*.c: Multiple annotators/co-hosts/guests

This commit is contained in:
Matt Mascarenhas 2017-06-21 16:12:40 +01:00
parent bd74374962
commit d65d885804
6 changed files with 36 additions and 13 deletions

Binary file not shown.

View File

@ -403,6 +403,7 @@ SanitisePunctuation(char *String)
int
BuildCredits(buffer *CreditsMenu, buffer *HostInfo, buffer *AnnotatorInfo, bool *HasCreditsMenu, char *Host, char *Annotator)
{
// TODO(matt): Handle co-hosts and guests
bool FoundHost = FALSE;
bool FoundAnnotator = FALSE;
@ -1320,7 +1321,8 @@ main(int ArgC, char **Args)
" <div class=\"video_container\" data-videoId=\"%s\"></div>\n"
" <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
printf(" --- Entering Annotations Loop ---\n");
@ -1648,12 +1650,12 @@ AppendedIdentifier:
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",
Args[FileIndex],
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);
hmml_free(&HMML);
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"
" </div>\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,
TimecodeToSeconds(Anno->time),
QuoteIdentifier,

View File

@ -9,12 +9,21 @@
typedef struct {
char* member;
char* twitch;
char* stream_platform;
char* stream_username;
char* project;
char* title;
char* platform;
char* vod_platform;
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;
typedef struct {
@ -42,6 +51,7 @@ typedef struct {
HMML_MarkerType type;
char* marker;
char* parameter;
char* episode;
int offset;
} HMML_Marker;

BIN
hmml_to_youtube/hmml.a Normal file

Binary file not shown.

View File

@ -130,8 +130,8 @@ main(int ArgC, char **Args)
{
ClaimBuffer(MemoryArena, &ClaimedMemory, &Out, 1024 * 32);
char *Member = HMML.metadata.twitch ?
HMML.metadata.twitch :
char *Member = HMML.metadata.stream_username ?
HMML.metadata.stream_username :
HMML.metadata.member;
bool WritingChat = TRUE;
@ -319,8 +319,9 @@ SkipRef:
skip: {};
}
// TODO(matt): Handle multiple annotators
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)
{

View File

@ -9,12 +9,21 @@
typedef struct {
char* member;
char* twitch;
char* stream_platform;
char* stream_username;
char* project;
char* title;
char* platform;
char* vod_platform;
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;
typedef struct {
@ -42,6 +51,7 @@ typedef struct {
HMML_MarkerType type;
char* marker;
char* parameter;
char* episode;
int offset;
} HMML_Marker;