cinera.c: Mention "vimeo" in the help text
Also remove HMMLIB_MAJOR_VERSION #defined out code
This commit is contained in:
parent
97806c2c9c
commit
012d1608a0
434
cinera/cinera.c
434
cinera/cinera.c
|
@ -23,7 +23,7 @@ typedef struct
|
|||
version CINERA_APP_VERSION = {
|
||||
.Major = 0,
|
||||
.Minor = 9,
|
||||
.Patch = 1
|
||||
.Patch = 2
|
||||
};
|
||||
|
||||
#include <stdarg.h> // NOTE(matt): varargs
|
||||
|
@ -55,7 +55,6 @@ version CINERA_APP_VERSION = {
|
|||
|
||||
#define HMMLIB_IMPLEMENTATION
|
||||
#include "hmmlib.h"
|
||||
#define HMMLIB_MAJOR_VERSION 2 // TODO(matt): Remove this after testing
|
||||
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#define STBI_NO_LINEAR
|
||||
|
@ -1375,11 +1374,9 @@ files for the purpose of hashing them."
|
|||
file credits this person for the entire project. There is no way to \"uncredit\" people in a HMML file. If a person ought not be credited for the whole project, just add them in \
|
||||
video node of the entries for which they should be credited."
|
||||
},
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
{ "credit", "The ID of a person (see also person) who contributed to a project. They will then appear in the credits menu of each entry in the project. Note that setting a credit in the configuration \
|
||||
file credits this person for the entire project. There is no way to \"uncredit\" people in a HMML file. If a person ought not be credited for the whole project, just add them in \
|
||||
video node of the entries for which they should be credited." },
|
||||
#endif
|
||||
{ "css_path", "Path relative to assets_root_dir and assets_root_url where CSS files are located." },
|
||||
{ "db_location", "Absolute file path where the database file resides. If you run multiple instances of Cinera on the same machine, please ensure this db_location differs between them." },
|
||||
{ "default_medium", "The ID of a medium (see also medium) which will be the default for the project. May be overridden by setting the medium in the video node of an HMML file." },
|
||||
|
@ -1424,7 +1421,7 @@ video node of the entries for which they should be credited."
|
|||
{ "js_path", "Path relative to assets_root_dir and assets_root_url where JavaScript files are located." },
|
||||
{ "lineage", 0, 0, "A slash-separated string of all project IDs from the top of the family tree to the present project." },
|
||||
{ "lineage_without_origin", 0, 0, "Same as the $lineage, without the first component (the $origin)." },
|
||||
{ "log_level", "Possible log levels, from least to most verbose: \"emergency\", \"alert\", \"critical\", \"error\", \"warning\", \"notice\", \"informational\", \"debug\""},
|
||||
{ "log_level", "Possible log levels, from least to most verbose: \"emergency\", \"alert\", \"critical\", \"error\", \"warning\", \"notice\", \"informational\", \"debug\"."},
|
||||
{ "medium",
|
||||
"In HMML an indexer may prefix a word with a colon, to mark it as a category. This category will then appear in the filter menu, for viewers to toggle on / off. A category may be either a topic (by \
|
||||
default categories are assumed to be topics) or a medium, and both use the same colon prefix. Configuring a medium is our way of stating that a category is indeed a medium, not a topic."
|
||||
|
@ -1465,9 +1462,7 @@ fill the slots left vacant by positioned roles in the order in which they are co
|
|||
0,
|
||||
"The ID of the project within which scope the variable occurs."
|
||||
},
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
{ "quote_username", "The username by which insobot recognises a person, for the purpose of retrieving quotes attributed to them." },
|
||||
#endif
|
||||
{ "role",
|
||||
"This is the role for which a person deserves credit (see also: credit).",
|
||||
0,
|
||||
|
@ -1482,13 +1477,6 @@ fill the slots left vacant by positioned roles in the order in which they are co
|
|||
{ "search_template", "Path of a HTML template file relative to the templates_dir from which the project's search page will be generated." },
|
||||
{ "single_browser_tab", "Setting this to \"true\" (default \"false\") makes the search page open player pages in its own tab." },
|
||||
{ "stream_platform", "This is a setting for the future. We currently only support \"twitch\" but not in any meaningful way." },
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
{ "stream_username",
|
||||
"We use this username to retrieve quotes from insobot. If it is not set, we use the host's ID when contacting insobot. The purpose of this setting is to let us identify project owners in one way, \
|
||||
perhaps to automatically construct paths, while recognising that same person when they stream under a different username."
|
||||
},
|
||||
#endif
|
||||
{ "support",
|
||||
"Information detailing where a person may be supported, to be cited in the credits menu.",
|
||||
0,
|
||||
|
@ -1505,8 +1493,7 @@ perhaps to automatically construct paths, while recognising that same person whe
|
|||
{ "title_suffix", "Currently not implemented, probably to be removed." },
|
||||
{ "unit", "This works in conjunction with the numbering_scheme. It is a freely-configurable string - e.g. \"Day\", \"Session\", \"Episode\", \"Meeting\" - which is written on the search page, \
|
||||
preceding the derived number of each entry. If the unit is not set, then the entries will not be numbered." },
|
||||
{ "vod_platform", "This is a setting more for the future. We currently only support \"youtube\" for the purposes of generating the player page. But an additional use of the vod_platform is as \
|
||||
a template tag (see also Templating)." },
|
||||
{ "vod_platform", "Possible VOD platforms: \"vimeo\", \"youtube\"." },
|
||||
{ "url", "The URL where viewers may support the person, e.g. their page on a crowd funding site, the \"pledge\" page on their own website." },
|
||||
};
|
||||
|
||||
|
@ -1522,9 +1509,7 @@ typedef enum
|
|||
IDENT_BASE_URL,
|
||||
IDENT_CACHE_DIR,
|
||||
IDENT_COHOST,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
IDENT_CREDIT,
|
||||
#endif
|
||||
IDENT_CSS_PATH,
|
||||
IDENT_DB_LOCATION,
|
||||
IDENT_DEFAULT_MEDIUM,
|
||||
|
@ -1568,19 +1553,13 @@ typedef enum
|
|||
IDENT_POSITION,
|
||||
IDENT_PRIVACY_CHECK_INTERVAL,
|
||||
IDENT_PROJECT,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
IDENT_QUOTE_USERNAME,
|
||||
#endif
|
||||
IDENT_ROLE,
|
||||
IDENT_QUERY_STRING,
|
||||
IDENT_SEARCH_LOCATION,
|
||||
IDENT_SEARCH_TEMPLATE,
|
||||
IDENT_SINGLE_BROWSER_TAB,
|
||||
IDENT_STREAM_PLATFORM,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
IDENT_STREAM_USERNAME,
|
||||
#endif
|
||||
IDENT_SUPPORT,
|
||||
IDENT_SUPPRESS_PROMPTS,
|
||||
IDENT_TEMPLATES_DIR,
|
||||
|
@ -1998,29 +1977,15 @@ PrintTimecode(FILE *Dest, v3 Timecode)
|
|||
}
|
||||
|
||||
void
|
||||
IndexingChronologyError(string *Filename, uint64_t LineNumber,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
v3 ThisTimecode, v3 PrevTimecode
|
||||
#else
|
||||
char *ThisTimecode, char *PrevTimecode
|
||||
#endif
|
||||
)
|
||||
IndexingChronologyError(string *Filename, uint64_t LineNumber, v3 ThisTimecode, v3 PrevTimecode)
|
||||
{
|
||||
severity Severity = S_ERROR;
|
||||
ErrorFilenameAndLineNumber(Filename, LineNumber, Severity, ED_INDEXING);
|
||||
fprintf(stderr,
|
||||
"Timecode ");
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
PrintTimecode(stderr, ThisTimecode);
|
||||
#else
|
||||
PrintC(CS_BLUE_BOLD, ThisTimecode);
|
||||
#endif
|
||||
fprintf(stderr, " is chronologically earlier than previous timecode (");
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
PrintTimecode(stderr, PrevTimecode);
|
||||
#else
|
||||
PrintC(CS_BLUE_BOLD, PrevTimecode);
|
||||
#endif
|
||||
fprintf(stderr, ")\n");
|
||||
}
|
||||
|
||||
|
@ -3408,11 +3373,7 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
v3 Timecode;
|
||||
#else
|
||||
char *Timecode;
|
||||
#endif
|
||||
int Identifier;
|
||||
} identifier;
|
||||
|
||||
|
@ -4209,47 +4170,9 @@ V3(int A, int B, int C)
|
|||
}
|
||||
|
||||
int
|
||||
TimecodeToSeconds(
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
v3 Timecode
|
||||
#else
|
||||
char *Timecode
|
||||
#endif
|
||||
)
|
||||
TimecodeToSeconds(v3 Timecode)
|
||||
{
|
||||
int Result = 0;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
Result = Timecode.Hours * SECONDS_PER_HOUR + Timecode.Minutes * SECONDS_PER_MINUTE + Timecode.Seconds;
|
||||
#else
|
||||
int HMS[3] = { 0, 0, 0 }; // 0 == Seconds; 1 == Minutes; 2 == Hours
|
||||
int Colons = 0;
|
||||
while(*Timecode)
|
||||
{
|
||||
//if((*Timecode < '0' || *Timecode > '9') && *Timecode != ':') { return FALSE; }
|
||||
|
||||
if(*Timecode == ':')
|
||||
{
|
||||
++Colons;
|
||||
//if(Colons > 2) { return FALSE; }
|
||||
for(int i = 0; i < Colons; ++i)
|
||||
{
|
||||
HMS[Colons - i] = HMS[Colons - (i + 1)];
|
||||
}
|
||||
HMS[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
HMS[0] = HMS[0] * 10 + *Timecode - '0';
|
||||
}
|
||||
|
||||
++Timecode;
|
||||
}
|
||||
|
||||
//if(HMS[0] > 59 || HMS[1] > 59 || Timecode[-1] == ':') { return FALSE; }
|
||||
|
||||
Result = HMS[2] * 60 * 60 + HMS[1] * 60 + HMS[0];
|
||||
#endif
|
||||
return Result;
|
||||
return Timecode.Hours * SECONDS_PER_HOUR + Timecode.Minutes * SECONDS_PER_MINUTE + Timecode.Seconds;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
@ -6453,7 +6376,7 @@ PushConfiguredAssets()
|
|||
PushThemeAssets();
|
||||
}
|
||||
|
||||
// TODO(matt): REMOVE
|
||||
// TODO(matt): Remove once we're ready to deprecate the old annotator=person style of crediting
|
||||
//
|
||||
char *RoleStrings[] =
|
||||
{
|
||||
|
@ -6618,20 +6541,9 @@ FreeSpeakers(speakers *Speakers)
|
|||
}
|
||||
|
||||
void
|
||||
PushCredentials(buffer *CreditsMenu, memory_book *Speakers, person *Actor,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
role *Role,
|
||||
#else
|
||||
role_id Role,
|
||||
#endif
|
||||
bool *RequiresCineraJS)
|
||||
PushCredentials(buffer *CreditsMenu, memory_book *Speakers, person *Actor, role *Role, bool *RequiresCineraJS)
|
||||
{
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
if(!Role->NonSpeaking)
|
||||
#else
|
||||
if(Role != R_INDEXER)
|
||||
#endif
|
||||
{
|
||||
speaker *This = GetSpeaker(Speakers, Actor->ID);
|
||||
if(!This)
|
||||
|
@ -6662,13 +6574,7 @@ PushCredentials(buffer *CreditsMenu, memory_book *Speakers, person *Actor,
|
|||
" <div class=\"name\">%.*s</div>\n"
|
||||
" </a>\n",
|
||||
(int)Actor->Homepage.Length, Actor->Homepage.Base,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
(int)Role->Name.Length,
|
||||
Role->Name.Base,
|
||||
#else
|
||||
(int)StringLength(RoleStrings[Role]),
|
||||
RoleStrings[Role],
|
||||
#endif
|
||||
(int)Role->Name.Length, Role->Name.Base,
|
||||
(int)Name.Length, Name.Base);
|
||||
}
|
||||
else
|
||||
|
@ -6678,13 +6584,7 @@ PushCredentials(buffer *CreditsMenu, memory_book *Speakers, person *Actor,
|
|||
" <div class=\"role\">%.*s</div>\n"
|
||||
" <div class=\"name\">%.*s</div>\n"
|
||||
" </div>\n",
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
(int)Role->Name.Length,
|
||||
Role->Name.Base,
|
||||
#else
|
||||
(int)StringLength(RoleStrings[Role]),
|
||||
RoleStrings[Role],
|
||||
#endif
|
||||
(int)Role->Name.Length, Role->Name.Base,
|
||||
(int)Name.Length, Name.Base);
|
||||
}
|
||||
|
||||
|
@ -6706,22 +6606,12 @@ PushCredentials(buffer *CreditsMenu, memory_book *Speakers, person *Actor,
|
|||
}
|
||||
|
||||
void
|
||||
ErrorCredentials(string HMMLFilepath, string Actor,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
role *Role
|
||||
#else
|
||||
role_id Role
|
||||
#endif
|
||||
)
|
||||
ErrorCredentials(string HMMLFilepath, string Actor, role *Role)
|
||||
{
|
||||
ErrorFilenameAndLineNumber(&HMMLFilepath, 0, S_ERROR, ED_INDEXING);
|
||||
fprintf(stderr, "No credentials for%s%s%.*s%s: %s%.*s%s\n",
|
||||
ColourStrings[CS_YELLOW_BOLD],
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
Role ? " " : "", Role ? (int)Role->Name.Length : 0, Role ? Role->Name.Base : "",
|
||||
#else
|
||||
" ", (int)StringLength(RoleStrings[Role]), RoleStrings[Role],
|
||||
#endif
|
||||
ColourStrings[CS_END],
|
||||
ColourStrings[CS_MAGENTA_BOLD], (int)Actor.Length, Actor.Base, ColourStrings[CS_END]);
|
||||
fprintf(stderr, "Perhaps you'd like to add a new person to your config file, e.g.:\n"
|
||||
|
@ -6734,7 +6624,6 @@ ErrorCredentials(string HMMLFilepath, string Actor,
|
|||
WaitForInput();
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
void
|
||||
ErrorRole(string HMMLFilepath, string Role)
|
||||
{
|
||||
|
@ -6761,7 +6650,6 @@ ErrorRole(string HMMLFilepath, string Role)
|
|||
}
|
||||
WaitForInput();
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -6803,7 +6691,6 @@ misc_attribute MiscAttributes[] = {
|
|||
{ "custom15", MAT_CUSTOM, { 15 } },
|
||||
};
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
misc_attribute *
|
||||
GetMiscAttribute(HMML_VideoCustomMetaData *A)
|
||||
{
|
||||
|
@ -6819,7 +6706,6 @@ GetMiscAttribute(HMML_VideoCustomMetaData *A)
|
|||
}
|
||||
return Result;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
CreditsMatch(credit *A, credit *B)
|
||||
|
@ -6844,7 +6730,6 @@ GetCredit(memory_book *Credits, credit *C)
|
|||
return Result;
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
bool
|
||||
Uncredited(HMML_VideoMetaData *Metadata, credit *C)
|
||||
{
|
||||
|
@ -6916,17 +6801,10 @@ MergeCredits(memory_book *Credits, project *CurrentProject, HMML_VideoMetaData *
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
BuildCredits(string HMMLFilepath, buffer *CreditsMenu, HMML_VideoMetaData *Metadata,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
person *Host,
|
||||
#endif
|
||||
speakers *Speakers, bool *RequiresCineraJS)
|
||||
BuildCredits(string HMMLFilepath, buffer *CreditsMenu, HMML_VideoMetaData *Metadata, speakers *Speakers, bool *RequiresCineraJS)
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
memory_book Credits = InitBook(sizeof(credit), 4);
|
||||
MergeCredits(&Credits, CurrentProject, Metadata);
|
||||
for(int RoleIndex = 0; RoleIndex < Config->Role.ItemCount; ++RoleIndex)
|
||||
|
@ -6951,82 +6829,6 @@ BuildCredits(string HMMLFilepath, buffer *CreditsMenu, HMML_VideoMetaData *Metad
|
|||
SortAndAbbreviateSpeakers(Speakers);
|
||||
}
|
||||
|
||||
#else
|
||||
//person *Host = GetPersonFromConfig(Wrap0(Metadata->member));
|
||||
if(Host)
|
||||
{
|
||||
PushCredentials(CreditsMenu, &Speakers->Speakers, Host, R_HOST, RequiresCineraJS);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCredentials(HMMLFilepath, Wrap0(Metadata->member), R_HOST);
|
||||
return CreditsError_NoCredentials;
|
||||
}
|
||||
|
||||
for(int i = 0; i < Metadata->co_host_count; ++i)
|
||||
{
|
||||
person *CoHost = GetPersonFromConfig(Wrap0(Metadata->co_hosts[i]));
|
||||
if(CoHost)
|
||||
{
|
||||
PushCredentials(CreditsMenu, &Speakers->Speakers, CoHost, R_COHOST, RequiresCineraJS);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCredentials(HMMLFilepath, Wrap0(Metadata->co_hosts[i]), R_COHOST);
|
||||
return CreditsError_NoCredentials;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < Metadata->guest_count; ++i)
|
||||
{
|
||||
person *Guest = GetPersonFromConfig(Wrap0(Metadata->guests[i]));
|
||||
if(Guest)
|
||||
{
|
||||
PushCredentials(CreditsMenu, &Speakers->Speakers, Guest, R_GUEST, RequiresCineraJS);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCredentials(HMMLFilepath, Wrap0(Metadata->guests[i]), R_GUEST);
|
||||
return CreditsError_NoCredentials;
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(matt): As we only cite the speaker when there are a multiple of them, we only need to SortAndAbbreviateSpeakers()
|
||||
// in the same situation
|
||||
if(Speakers->Speakers.ItemCount > 1)
|
||||
{
|
||||
SortAndAbbreviateSpeakers(Speakers);
|
||||
}
|
||||
|
||||
if(Metadata->annotator_count > 0)
|
||||
{
|
||||
for(int i = 0; i < Metadata->annotator_count; ++i)
|
||||
{
|
||||
person *Indexer = GetPersonFromConfig(Wrap0(Metadata->annotators[i]));
|
||||
if(Indexer)
|
||||
{
|
||||
PushCredentials(CreditsMenu, &Speakers->Speakers, Indexer, R_INDEXER, RequiresCineraJS);
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorCredentials(HMMLFilepath, Wrap0(Metadata->annotators[i]), R_INDEXER);
|
||||
return CreditsError_NoCredentials;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(CreditsMenu->Ptr > CreditsMenu->Location)
|
||||
{
|
||||
CopyStringToBuffer(CreditsMenu,
|
||||
" </div>\n"
|
||||
" </div>\n");
|
||||
}
|
||||
IndexingError(HMMLFilepath, 0, S_ERROR, "Missing \"indexer\" in the [video] node", 0);
|
||||
return CreditsError_NoIndexer;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(CreditsMenu->Ptr > CreditsMenu->Location)
|
||||
{
|
||||
CopyStringToBuffer(CreditsMenu,
|
||||
|
@ -9276,13 +9078,7 @@ VideoIsPrivate(vod_platform VODPlatform, char *VideoID)
|
|||
}
|
||||
|
||||
bool
|
||||
IsCategorisedAFK(
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
HMML_Timestamp
|
||||
#else
|
||||
HMML_Annotation
|
||||
#endif
|
||||
*Timestamp)
|
||||
IsCategorisedAFK(HMML_Timestamp *Timestamp)
|
||||
{
|
||||
for(int i = 0; i < Timestamp->marker_count; ++i)
|
||||
{
|
||||
|
@ -9295,13 +9091,7 @@ IsCategorisedAFK(
|
|||
}
|
||||
|
||||
bool
|
||||
IsCategorisedAuthored(
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
HMML_Timestamp
|
||||
#else
|
||||
HMML_Annotation
|
||||
#endif
|
||||
*Timestamp)
|
||||
IsCategorisedAuthored(HMML_Timestamp *Timestamp)
|
||||
{
|
||||
for(int i = 0; i < Timestamp->marker_count; ++i)
|
||||
{
|
||||
|
@ -9726,41 +9516,21 @@ TimecodeIs(v3 Timecode, int Hours, int Minutes, int Seconds)
|
|||
rc
|
||||
ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, memory_book *Strings,
|
||||
menu_buffers *MenuBuffers, index_buffers *IndexBuffers, player_buffers *PlayerBuffers,
|
||||
medium *DefaultMedium, speakers *Speakers,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
person *Host,
|
||||
#endif
|
||||
string Author,
|
||||
medium *DefaultMedium, speakers *Speakers, string Author,
|
||||
_memory_book(ref_info) *ReferencesArray,
|
||||
bool *HasQuoteMenu, bool *HasReferenceMenu, bool *HasFilterMenu, bool *RequiresCineraJS,
|
||||
int *QuoteIdentifier, int *RefIdentifier,
|
||||
_memory_book(category_info) *Topics, _memory_book(category_info) *Media,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
HMML_Timestamp *Timestamp,
|
||||
v3 *PreviousTimecode
|
||||
#else
|
||||
HMML_Annotation *Timestamp,
|
||||
char **PreviousTimecode
|
||||
#endif
|
||||
)
|
||||
HMML_Timestamp *Timestamp, v3 *PreviousTimecode)
|
||||
{
|
||||
MEM_TEST_TOP("ProcessTimestamp");
|
||||
// TODO(matt): Introduce and use a SystemError() in here
|
||||
rc Result = RC_SUCCESS;
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
v3 Timecode = V3(Timestamp->h, Timestamp->m, Timestamp->s);
|
||||
if(TimecodeToSeconds(Timecode) >= TimecodeToSeconds(*PreviousTimecode))
|
||||
#else
|
||||
if(!*PreviousTimecode || TimecodeToSeconds(Timestamp->time) >= TimecodeToSeconds(*PreviousTimecode))
|
||||
#endif
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
*PreviousTimecode = Timecode;
|
||||
#else
|
||||
*PreviousTimecode = Timestamp->time;
|
||||
#endif
|
||||
|
||||
memory_book LocalTopics = InitBook(sizeof(category_info), 8);
|
||||
memory_book LocalMedia = InitBook(sizeof(category_info), 8);
|
||||
|
@ -9778,24 +9548,14 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
RewindBuffer(&IndexBuffers->CategoryIcons);
|
||||
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
CopyStringToBuffer(&IndexBuffers->Header,
|
||||
" <div data-timestamp=\"%d\"",
|
||||
TimecodeToSeconds(Timecode));
|
||||
#else
|
||||
CopyStringToBuffer(&IndexBuffers->Header,
|
||||
" <div data-timestamp=\"%d\"",
|
||||
TimecodeToSeconds(Timestamp->time));
|
||||
#endif
|
||||
|
||||
CopyStringToBuffer(&IndexBuffers->Class,
|
||||
" class=\"marker");
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
speaker *Speaker = GetSpeaker(&Speakers->Speakers, Author);
|
||||
#else
|
||||
speaker *Speaker = GetSpeaker(&Speakers->Speakers, Timestamp->author ? Wrap0(Timestamp->author) : CurrentProject->StreamUsername.Length > 0 ? CurrentProject->StreamUsername : Host->ID);
|
||||
#endif
|
||||
if(!IsCategorisedAFK(Timestamp))
|
||||
{
|
||||
// NOTE(matt): I reckon it's fair to only cite the speaker when there are a multiple of them
|
||||
|
@ -9894,11 +9654,7 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
if(This)
|
||||
{
|
||||
identifier *New = MakeSpaceInBook(&This->Identifier);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
New->Timecode = Timecode;
|
||||
#else
|
||||
New->Timecode = Timestamp->time;
|
||||
#endif
|
||||
New->Identifier = *RefIdentifier;
|
||||
}
|
||||
else
|
||||
|
@ -9972,11 +9728,7 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
|
||||
if(Result == RC_SUCCESS)
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
if(Timestamp->quote.present)
|
||||
#else
|
||||
if(Timestamp->is_quote)
|
||||
#endif
|
||||
{
|
||||
if(!*HasQuoteMenu)
|
||||
{
|
||||
|
@ -10010,7 +9762,6 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
Speaker = GetPlaceInBook(&Speakers->Speakers, 0);
|
||||
}
|
||||
string QuoteUsername;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
if(Timestamp->quote.author)
|
||||
{
|
||||
QuoteUsername = Wrap0(Timestamp->quote.author);
|
||||
|
@ -10023,9 +9774,6 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
{
|
||||
QuoteUsername = Author;
|
||||
}
|
||||
#else
|
||||
QuoteUsername = Author;
|
||||
#endif
|
||||
|
||||
/* */ MEM_TEST_MID("ProcessTimestamp()");
|
||||
/* +MEM */ Result = BuildQuote(Strings, &QuoteInfo,
|
||||
|
@ -10046,7 +9794,6 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
|
||||
CopyStringToBufferHTMLSafe(&MenuBuffers->Quote, QuoteInfo.Text);
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
string DateString = UnixTimeToDateString(Strings, QuoteInfo.Date);
|
||||
CopyStringToBuffer(&MenuBuffers->Quote, "</div>\n"
|
||||
" <div class=\"quote_byline\">—%.*s, %.*s</div>\n"
|
||||
|
@ -10062,22 +9809,6 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
" </div>\n"
|
||||
" </span>\n"
|
||||
" </a>\n");
|
||||
#else
|
||||
string DateString = UnixTimeToDateString(Strings, QuoteInfo.Date);
|
||||
CopyStringToBuffer(&MenuBuffers->Quote, "</div>\n"
|
||||
" <div class=\"quote_byline\">—%.*s, %.*s</div>\n"
|
||||
" </span>\n"
|
||||
" <div class=\"ref_indices\">\n"
|
||||
" <span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[&#%d;]</span><span class=\"time\">%s</span></span>\n"
|
||||
" </div>\n"
|
||||
" </span>\n"
|
||||
" </a>\n",
|
||||
(int)QuoteUsername.Length, QuoteUsername.Base,
|
||||
(int)DateString.Length, DateString.Base, // TODO(matt): Convert Unixtime to date-string
|
||||
TimecodeToSeconds(Timestamp->time),
|
||||
*QuoteIdentifier,
|
||||
Timestamp->time);
|
||||
#endif
|
||||
if(!Timestamp->text[0])
|
||||
{
|
||||
CopyStringToBuffer(&IndexBuffers->Text, "“");
|
||||
|
@ -10095,18 +9826,8 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
|
||||
if(Result == RC_SUCCESS)
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
CopyStringToBuffer(&CollationBuffers->SearchEntry, "\"%d\": \"", TimecodeToSeconds(Timecode));
|
||||
#else
|
||||
CopyStringToBuffer(&CollationBuffers->SearchEntry, "\"%d\": \"", TimecodeToSeconds(Timestamp->time));
|
||||
#endif
|
||||
if(
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
Timestamp->quote.present &&
|
||||
#else
|
||||
Timestamp->is_quote &&
|
||||
#endif
|
||||
!Timestamp->text[0])
|
||||
if(Timestamp->quote.present && !Timestamp->text[0])
|
||||
{
|
||||
CopyStringToBuffer(&CollationBuffers->SearchEntry, "\u201C");
|
||||
CopyStringToBufferNoFormat(&CollationBuffers->SearchEntry, QuoteInfo.Text);
|
||||
|
@ -10165,16 +9886,10 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
CopyStringToBuffer(&IndexBuffers->Header, ">\n");
|
||||
|
||||
CopyLandmarkedBuffer(&IndexBuffers->Master, &IndexBuffers->Header, 0, PAGE_PLAYER);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
CopyStringToBuffer(&IndexBuffers->Master,
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">");
|
||||
CopyTimecodeToBuffer(&IndexBuffers->Master, Timecode);
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</span>");
|
||||
#else
|
||||
CopyStringToBuffer(&IndexBuffers->Master,
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">%s</span>",
|
||||
Timestamp->time);
|
||||
#endif
|
||||
|
||||
CopyLandmarkedBuffer(&IndexBuffers->Master, &IndexBuffers->Text, 0, PAGE_PLAYER);
|
||||
|
||||
|
@ -10183,18 +9898,11 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
BuildCategoryIcons(&IndexBuffers->Master, &LocalTopics, &LocalMedia, DefaultMedium->ID, RequiresCineraJS);
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</div>\n"
|
||||
" <div class=\"progress faded\">\n"
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">");
|
||||
CopyTimecodeToBuffer(&IndexBuffers->Master, Timecode);
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</span>");
|
||||
#else
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</div>\n"
|
||||
" <div class=\"progress faded\">\n"
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">%s</span>",
|
||||
Timestamp->time);
|
||||
#endif
|
||||
|
||||
CopyLandmarkedBuffer(&IndexBuffers->Master, &IndexBuffers->Text, 0, PAGE_PLAYER);
|
||||
|
||||
|
@ -10203,20 +9911,12 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
BuildCategoryIcons(&IndexBuffers->Master, &LocalTopics, &LocalMedia, DefaultMedium->ID, RequiresCineraJS);
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</div>\n"
|
||||
" </div>\n"
|
||||
" <div class=\"progress main\">\n"
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">");
|
||||
CopyTimecodeToBuffer(&IndexBuffers->Master, Timecode);
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</span>");
|
||||
#else
|
||||
CopyStringToBuffer(&IndexBuffers->Master, "</div>\n"
|
||||
" </div>\n"
|
||||
" <div class=\"progress main\">\n"
|
||||
" <div class=\"cineraContent\"><span class=\"timecode\">%s</span>",
|
||||
Timestamp->time);
|
||||
#endif
|
||||
|
||||
CopyLandmarkedBuffer(&IndexBuffers->Master, &IndexBuffers->Text, 0, PAGE_PLAYER);
|
||||
|
||||
|
@ -10241,11 +9941,7 @@ ProcessTimestamp(buffers *CollationBuffers, neighbourhood *N, string Filepath, m
|
|||
}
|
||||
else
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
IndexingChronologyError(&Filepath, Timestamp->line, Timecode, *PreviousTimecode);
|
||||
#else
|
||||
IndexingChronologyError(&Filepath, Timestamp->line, Timestamp->time, *PreviousTimecode);
|
||||
#endif
|
||||
IndexingChronologyError(&Filepath, Timestamp->line, Timecode, *PreviousTimecode);
|
||||
Result = RC_ERROR_HMML;
|
||||
}
|
||||
MEM_TEST_END("ProcessTimestamp");
|
||||
|
@ -10314,13 +10010,9 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
|
||||
if(InFile)
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
char *HMMLContents = ReadFileIntoMemory0(InFile);
|
||||
HMML_Output HMML = hmml_parse(HMMLContents);
|
||||
Free(HMMLContents); // TODO(matt): Maybe we'll need to free this later?
|
||||
#else
|
||||
HMML_Output HMML = hmml_parse_file(InFile);
|
||||
#endif
|
||||
fclose(InFile);
|
||||
|
||||
if(HMML.well_formed)
|
||||
|
@ -10358,12 +10050,6 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
Title = Wrap0(HMML.metadata.title);
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
person *Host = CurrentProject->Owner;
|
||||
#endif
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
for(int CreditIndex = 0; CreditIndex < HMML.metadata.credit_count; ++CreditIndex)
|
||||
{
|
||||
HMML_Credit *This = HMML.metadata.credits + CreditIndex;
|
||||
|
@ -10380,7 +10066,6 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
Result = CreditsError_NoCredentials; // TODO(matt): Is this a fine error here?
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!HMML.metadata.id)
|
||||
{
|
||||
|
@ -10458,7 +10143,6 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
// The nice thing about doing it this way, though, is that it encourages bespoke template use, which should
|
||||
// usually be the more convenient way for people to write greater amounts of localised information
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
for(int CustomIndex = 0; CustomIndex < HMML.metadata.custom_count; ++CustomIndex)
|
||||
{
|
||||
HMML_VideoCustomMetaData *This = HMML.metadata.custom + CustomIndex;
|
||||
|
@ -10494,41 +10178,6 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
for(int CustomIndex = 0; CustomIndex < HMML_CUSTOM_ATTR_COUNT; ++CustomIndex)
|
||||
{
|
||||
if(HMML.metadata.custom[CustomIndex])
|
||||
{
|
||||
if(StringLength(HMML.metadata.custom[CustomIndex]) > (CustomIndex < 12 ? MAX_CUSTOM_SNIPPET_SHORT_LENGTH : MAX_CUSTOM_SNIPPET_LONG_LENGTH))
|
||||
{
|
||||
IndexingErrorCustomSizing(&FilepathL, 0, CustomIndex, Wrap0(HMML.metadata.custom[CustomIndex]));
|
||||
Result = RC_ERROR_HMML;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(CustomIndex)
|
||||
{
|
||||
case 0: CopyStringNoFormat(CollationBuffers->Custom0, sizeof(CollationBuffers->Custom0), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 1: CopyStringNoFormat(CollationBuffers->Custom1, sizeof(CollationBuffers->Custom1), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 2: CopyStringNoFormat(CollationBuffers->Custom2, sizeof(CollationBuffers->Custom2), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 3: CopyStringNoFormat(CollationBuffers->Custom3, sizeof(CollationBuffers->Custom3), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 4: CopyStringNoFormat(CollationBuffers->Custom4, sizeof(CollationBuffers->Custom4), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 5: CopyStringNoFormat(CollationBuffers->Custom5, sizeof(CollationBuffers->Custom5), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 6: CopyStringNoFormat(CollationBuffers->Custom6, sizeof(CollationBuffers->Custom6), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 7: CopyStringNoFormat(CollationBuffers->Custom7, sizeof(CollationBuffers->Custom7), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 8: CopyStringNoFormat(CollationBuffers->Custom8, sizeof(CollationBuffers->Custom8), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 9: CopyStringNoFormat(CollationBuffers->Custom9, sizeof(CollationBuffers->Custom9), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 10: CopyStringNoFormat(CollationBuffers->Custom10, sizeof(CollationBuffers->Custom10), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 11: CopyStringNoFormat(CollationBuffers->Custom11, sizeof(CollationBuffers->Custom11), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 12: CopyStringNoFormat(CollationBuffers->Custom12, sizeof(CollationBuffers->Custom12), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 13: CopyStringNoFormat(CollationBuffers->Custom13, sizeof(CollationBuffers->Custom13), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 14: CopyStringNoFormat(CollationBuffers->Custom14, sizeof(CollationBuffers->Custom14), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
case 15: CopyStringNoFormat(CollationBuffers->Custom15, sizeof(CollationBuffers->Custom15), Wrap0(HMML.metadata.custom[CustomIndex])); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(Result == RC_SUCCESS && !CurrentProject->DenyBespokeTemplates && HMML.metadata.template)
|
||||
{
|
||||
|
@ -10657,12 +10306,7 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
" <div class=\"markers\">\n");
|
||||
|
||||
bool RequiresCineraJS = FALSE;
|
||||
Result = BuildCredits(FilepathL, &MenuBuffers.Credits, &HMML.metadata,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
Host,
|
||||
#endif
|
||||
&Speakers, &RequiresCineraJS);
|
||||
Result = BuildCredits(FilepathL, &MenuBuffers.Credits, &HMML.metadata, &Speakers, &RequiresCineraJS);
|
||||
if(Result == RC_SUCCESS)
|
||||
{
|
||||
CopyStringToBuffer(&CollationBuffers->SearchEntry, "location: \"%.*s\"\n", (int)OutputLocation.Length, OutputLocation.Base);
|
||||
|
@ -10678,19 +10322,8 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
printf("\n\n --- Entering Timestamps Loop ---\n\n\n\n");
|
||||
#endif
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
v3 PreviousTimecode = {};
|
||||
#else
|
||||
char *PreviousTimecode = 0;
|
||||
#endif
|
||||
for(int TimestampIndex = 0; TimestampIndex <
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
HMML.timestamp_count
|
||||
#else
|
||||
HMML.annotation_count
|
||||
#endif
|
||||
; ++TimestampIndex)
|
||||
for(int TimestampIndex = 0; TimestampIndex < HMML.timestamp_count; ++TimestampIndex)
|
||||
{
|
||||
// TODO(matt): Thoroughly test this reorganisation
|
||||
//
|
||||
|
@ -10702,31 +10335,15 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
printf("%d\n", TimestampIndex);
|
||||
#endif
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
HMML_Timestamp *Timestamp = HMML.timestamps + TimestampIndex;
|
||||
#else
|
||||
HMML_Annotation *Timestamp = HMML.annotations + TimestampIndex;
|
||||
#endif
|
||||
|
||||
string Author = {};
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
if(Timestamp->author) { Author = Wrap0(Timestamp->author); }
|
||||
#else
|
||||
if(Timestamp->quote.author) { Author = Wrap0(Timestamp->quote.author); }
|
||||
else if(HMML.metadata.stream_username) { Author = Wrap0(HMML.metadata.stream_username); }
|
||||
else if(CurrentProject->StreamUsername.Length > 0) { Author = CurrentProject->StreamUsername; }
|
||||
else { Author = Host->ID; }
|
||||
#endif
|
||||
|
||||
/* */ MEM_TEST_MID("HMMLToBuffers");
|
||||
/* +MEM */ Result = ProcessTimestamp(CollationBuffers, N, Wrap0(Filepath), &Strings,
|
||||
/* */ &MenuBuffers, &IndexBuffers, &PlayerBuffers,
|
||||
/* */ DefaultMedium, &Speakers,
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
Host,
|
||||
#endif
|
||||
Author, &ReferencesArray,
|
||||
/* */ DefaultMedium, &Speakers, Author, &ReferencesArray,
|
||||
/* */ &HasQuoteMenu, &HasReferenceMenu, &HasFilterMenu, &RequiresCineraJS,
|
||||
/* */ &QuoteIdentifier, &RefIdentifier,
|
||||
/* */ &Topics, &Media,
|
||||
|
@ -10790,20 +10407,11 @@ HMMLToBuffers(buffers *CollationBuffers, template *BespokeTemplate, string BaseF
|
|||
" <div class=\"ref_indices\">\n ");
|
||||
for(int k = 0; k < 3 && j < This->Identifier.ItemCount; ++k, ++j)
|
||||
{
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
identifier *ThisIdentifier = GetPlaceInBook(&This->Identifier, j);
|
||||
CopyStringToBuffer(&MenuBuffers.Reference,
|
||||
"<span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[%d]</span><span class=\"time\">", TimecodeToSeconds(ThisIdentifier->Timecode), ThisIdentifier->Identifier);
|
||||
CopyTimecodeToBuffer(&MenuBuffers.Reference, ThisIdentifier->Timecode);
|
||||
CopyStringToBuffer(&MenuBuffers.Reference, "</span></span>");
|
||||
#else
|
||||
identifier *ThisIdentifier = GetPlaceInBook(&This->Identifier, j);
|
||||
CopyStringToBuffer(&MenuBuffers.Reference,
|
||||
"<span data-timestamp=\"%d\" class=\"timecode\"><span class=\"ref_index\">[%d]</span><span class=\"time\">%s</span></span>",
|
||||
TimecodeToSeconds(ThisIdentifier->Timecode),
|
||||
ThisIdentifier->Identifier,
|
||||
ThisIdentifier->Timecode);
|
||||
#endif
|
||||
}
|
||||
CopyStringToBuffer(&MenuBuffers.Reference, "\n"
|
||||
" </div>\n");
|
||||
|
|
|
@ -531,10 +531,6 @@ typedef struct project
|
|||
uint64_t IconVariants;
|
||||
asset *IconAsset;
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
string StreamUsername;
|
||||
#endif
|
||||
vod_platform VODPlatform;
|
||||
|
||||
bool DenyBespokeTemplates;
|
||||
|
@ -543,12 +539,6 @@ typedef struct project
|
|||
|
||||
person *Owner;
|
||||
_memory_book(credit *) Credit;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
_memory_book(person *) Indexer;
|
||||
_memory_book(person *) Guest;
|
||||
_memory_book(person *) CoHost;
|
||||
#endif
|
||||
|
||||
_memory_book(medium) Medium;
|
||||
medium *DefaultMedium;
|
||||
|
@ -923,10 +913,6 @@ InitTypeSpecs(void)
|
|||
PushTypeSpecField(Root, FT_STRING, IDENT_SEARCH_LOCATION, TRUE);
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_SEARCH_TEMPLATE, TRUE);
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_TEMPLATES_DIR, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_STREAM_USERNAME, TRUE);
|
||||
#endif
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_VOD_PLATFORM, TRUE);
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_THEME, TRUE);
|
||||
PushTypeSpecField(Root, FT_STRING, IDENT_TITLE, TRUE);
|
||||
|
@ -969,9 +955,7 @@ InitTypeSpecs(void)
|
|||
config_type_spec *Person = PushTypeSpec(&Result, IDENT_PERSON, FALSE);
|
||||
PushTypeSpecField(Person, FT_STRING, IDENT_NAME, TRUE);
|
||||
PushTypeSpecField(Person, FT_STRING, IDENT_HOMEPAGE, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
PushTypeSpecField(Person, FT_STRING, IDENT_QUOTE_USERNAME, TRUE);
|
||||
#endif
|
||||
PushTypeSpecField(Person, FT_SCOPE, IDENT_SUPPORT, FALSE);
|
||||
|
||||
config_type_spec *Role = PushTypeSpec(&Result, IDENT_ROLE, FALSE);
|
||||
|
@ -980,10 +964,8 @@ InitTypeSpecs(void)
|
|||
PushTypeSpecField(Role, FT_NUMBER, IDENT_POSITION, TRUE);
|
||||
PushTypeSpecField(Role, FT_BOOLEAN, IDENT_NON_SPEAKING, TRUE);
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
config_type_spec *Credit = PushTypeSpec(&Result, IDENT_CREDIT, FALSE);
|
||||
PushTypeSpecField(Credit, FT_STRING, IDENT_ROLE, FALSE);
|
||||
#endif
|
||||
|
||||
config_type_spec *Medium = PushTypeSpec(&Result, IDENT_MEDIUM, FALSE);
|
||||
PushTypeSpecField(Medium, FT_STRING, IDENT_ICON, TRUE);
|
||||
|
@ -998,21 +980,9 @@ InitTypeSpecs(void)
|
|||
config_type_spec *Project = PushTypeSpec(&Result, IDENT_PROJECT, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_BASE_DIR, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_BASE_URL, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_COHOST, FALSE); // TODO(matt): Remove
|
||||
#endif
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_DEFAULT_MEDIUM, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_GENRE, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_GUEST, FALSE); // TODO(matt): Remove
|
||||
#endif
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_HMML_DIR, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_INDEXER, FALSE); // TODO(matt): Remove
|
||||
#endif
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_NUMBERING_SCHEME, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_OWNER, TRUE); // NOTE(matt): Do not remove, because ResolveLocalVariable() recognises it
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_PLAYER_LOCATION, TRUE);
|
||||
|
@ -1021,10 +991,6 @@ InitTypeSpecs(void)
|
|||
PushTypeSpecField(Project, FT_STRING, IDENT_SEARCH_LOCATION, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_SEARCH_TEMPLATE, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_TEMPLATES_DIR, TRUE);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_STREAM_USERNAME, TRUE);
|
||||
#endif
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_VOD_PLATFORM, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_THEME, TRUE);
|
||||
PushTypeSpecField(Project, FT_STRING, IDENT_TITLE, TRUE);
|
||||
|
@ -1056,9 +1022,7 @@ InitTypeSpecs(void)
|
|||
PushTypeSpecField(Project, FT_BOOLEAN, IDENT_SINGLE_BROWSER_TAB, TRUE);
|
||||
//
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
PushTypeSpecField(Project, FT_SCOPE, IDENT_CREDIT, FALSE);
|
||||
#endif
|
||||
PushTypeSpecField(Project, FT_SCOPE, IDENT_INCLUDE, FALSE);
|
||||
PushTypeSpecField(Project, FT_SCOPE, IDENT_MEDIUM, FALSE);
|
||||
PushTypeSpecField(Project, FT_SCOPE, IDENT_PROJECT, FALSE);
|
||||
|
@ -1120,7 +1084,6 @@ PrintTypeField(config_type_field *F, config_identifier_id ParentScopeID, int Ind
|
|||
--IndentationLevel;
|
||||
}
|
||||
}
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
else if((F->ID == IDENT_ROLE) && ParentScopeID == IDENT_CREDIT)
|
||||
{
|
||||
if(!ConfigIdentifiers[F->ID].IdentifierDescription_CreditDisplayed)
|
||||
|
@ -1132,7 +1095,6 @@ PrintTypeField(config_type_field *F, config_identifier_id ParentScopeID, int Ind
|
|||
--IndentationLevel;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
if(!ConfigIdentifiers[F->ID].IdentifierDescriptionDisplayed)
|
||||
|
@ -3208,20 +3170,16 @@ PushPersonOntoConfig(config *C, resolution_errors *E, config_verifiers *V, scope
|
|||
{
|
||||
This->Homepage = ResolveString(C, E, PersonTree, Pair, FALSE);
|
||||
}
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
else if(IDENT_QUOTE_USERNAME == Pair->Key)
|
||||
{
|
||||
This->QuoteUsername = ResolveString(C, E, PersonTree, Pair, FALSE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
if(This->QuoteUsername.Length == 0)
|
||||
{
|
||||
This->QuoteUsername = This->ID;
|
||||
}
|
||||
#endif
|
||||
|
||||
This->Support = InitBook(sizeof(support), 2);
|
||||
for(int i = 0; i < PersonTree->Trees.ItemCount; ++i)
|
||||
|
@ -3258,37 +3216,6 @@ PushRoleOntoConfig(config *C, resolution_errors *E, config_verifiers *V, scope_t
|
|||
}
|
||||
}
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
void
|
||||
PushPersonOntoProject(config *C, resolution_errors *E, project *P, config_pair *Actor)
|
||||
{
|
||||
person *Person = GetPerson(C, E, Actor);
|
||||
if(Person)
|
||||
{
|
||||
switch(Actor->Key)
|
||||
{
|
||||
case IDENT_INDEXER:
|
||||
{
|
||||
person **Indexer = MakeSpaceInBook(&P->Indexer);
|
||||
*Indexer = Person;
|
||||
} break;
|
||||
case IDENT_COHOST:
|
||||
{
|
||||
person **CoHost = MakeSpaceInBook(&P->CoHost);
|
||||
*CoHost = Person;
|
||||
} break;
|
||||
case IDENT_GUEST:
|
||||
{
|
||||
person **Guest = MakeSpaceInBook(&P->Guest);
|
||||
*Guest = Person;
|
||||
} break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
PushCredit(config *C, resolution_errors *E, project *P, scope_tree *CreditTree)
|
||||
{
|
||||
|
@ -3408,13 +3335,7 @@ PushProject(config *C, resolution_errors *E, config_verifiers *V, project *P, sc
|
|||
{
|
||||
P->Medium = InitBook(sizeof(medium), 8);
|
||||
P->Child = InitBook(sizeof(project), 8);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
P->Credit = InitBook(sizeof(credit), 4);
|
||||
#else
|
||||
P->Indexer = InitBookOfPointers(4);
|
||||
P->CoHost = InitBookOfPointers(4);
|
||||
P->Guest = InitBookOfPointers(4);
|
||||
#endif
|
||||
|
||||
config_string_associations *HMMLDirs = &V->HMMLDirs;
|
||||
P->ID = ResolveString(C, E, ProjectTree, &ProjectTree->ID, FALSE);
|
||||
|
@ -3455,12 +3376,10 @@ PushProject(config *C, resolution_errors *E, config_verifiers *V, project *P, sc
|
|||
{
|
||||
PushMedium(C, E, V, P, This);
|
||||
} break;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
case IDENT_CREDIT:
|
||||
{
|
||||
PushCredit(C, E, P, This);
|
||||
} break;
|
||||
#endif
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
@ -3476,13 +3395,6 @@ PushProject(config *C, resolution_errors *E, config_verifiers *V, project *P, sc
|
|||
{ P->DefaultMedium = GetMediumFromProject(P, This->String); } break;
|
||||
case IDENT_HMML_DIR:
|
||||
{ SetUniqueHMMLDir(C, E, HMMLDirs, P, ProjectTree, This); } break;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
case IDENT_INDEXER:
|
||||
case IDENT_COHOST:
|
||||
case IDENT_GUEST:
|
||||
{ PushPersonOntoProject(C, E, P, This); } break;
|
||||
#endif
|
||||
case IDENT_PLAYER_TEMPLATE:
|
||||
{ P->PlayerTemplatePath = StripSlashes(ResolveString(C, E, ProjectTree, This, FALSE), P_REL); } break;
|
||||
case IDENT_THEME:
|
||||
|
@ -3555,12 +3467,6 @@ PushProject(config *C, resolution_errors *E, config_verifiers *V, project *P, sc
|
|||
{ P->SearchTemplatePath = StripSlashes(ResolveString(C, E, ProjectTree, This, FALSE), P_REL); } break;
|
||||
case IDENT_TEMPLATES_DIR:
|
||||
{ P->TemplatesDir = StripSlashes(ResolveString(C, E, ProjectTree, This, TRUE), P_ABS); } break;
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
case IDENT_STREAM_USERNAME:
|
||||
{ P->StreamUsername = ResolveString(C, E, ProjectTree, This, FALSE); } break;
|
||||
#endif
|
||||
|
||||
case IDENT_ART: { P->Art = StripSlashes(ResolveString(C, E, ProjectTree, This, FALSE), P_REL); } break;
|
||||
case IDENT_ICON: { P->Icon = StripSlashes(ResolveString(C, E, ProjectTree, This, FALSE), P_REL); } break;
|
||||
case IDENT_ICON_NORMAL: { P->IconNormal = ResolveString(C, E, ProjectTree, This, FALSE); } break;
|
||||
|
@ -4507,10 +4413,6 @@ PrintProject(config *C, project *P, typography *T, int Ancestors, int Indentatio
|
|||
TypesetPair(T, Generation, IDENT_BASE_URL, P->BaseURL, AvailableColumns);
|
||||
TypesetPair(T, Generation, IDENT_SEARCH_LOCATION, P->SearchLocation, AvailableColumns);
|
||||
TypesetPair(T, Generation, IDENT_PLAYER_LOCATION, P->PlayerLocation, AvailableColumns);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
TypesetPair(T, Generation, IDENT_STREAM_USERNAME, P->StreamUsername, AvailableColumns);
|
||||
#endif
|
||||
TypesetPair(T, Generation, IDENT_THEME, P->Theme, AvailableColumns);
|
||||
|
||||
CarriageReturn(T, Generation);
|
||||
|
@ -4532,25 +4434,6 @@ PrintProject(config *C, project *P, typography *T, int Ancestors, int Indentatio
|
|||
|
||||
TypesetPair(T, Generation, IDENT_OWNER, P->Owner ? P->Owner->ID : Wrap0(""), AvailableColumns);
|
||||
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
#else
|
||||
for(int i = 0; i < P->Indexer.ItemCount; ++i)
|
||||
{
|
||||
person **Indexer = GetPlaceInBook(&P->Indexer, i);
|
||||
TypesetPair(T, Generation, IDENT_INDEXER, (*Indexer)->ID, AvailableColumns);
|
||||
}
|
||||
for(int i = 0; i < P->CoHost.ItemCount; ++i)
|
||||
{
|
||||
person **CoHost = GetPlaceInBook(&P->CoHost, i);
|
||||
TypesetPair(T, Generation, IDENT_COHOST, (*CoHost)->ID, AvailableColumns);
|
||||
}
|
||||
for(int i = 0; i < P->Guest.ItemCount; ++i)
|
||||
{
|
||||
person **Guest = GetPlaceInBook(&P->Guest, i);
|
||||
TypesetPair(T, Generation, IDENT_GUEST, (*Guest)->ID, AvailableColumns);
|
||||
}
|
||||
#endif
|
||||
|
||||
CarriageReturn(T, Generation);
|
||||
CarriageReturn(T, Generation);
|
||||
fprintf(stderr, "%s", T->Margin);
|
||||
|
@ -4667,13 +4550,7 @@ void
|
|||
FreeProject(project *P)
|
||||
{
|
||||
FreeBook(&P->Medium);
|
||||
#if(HMMLIB_MAJOR_VERSION == 2)
|
||||
FreeBook(&P->Credit);
|
||||
#else
|
||||
FreeBook(&P->Indexer);
|
||||
FreeBook(&P->Guest);
|
||||
FreeBook(&P->CoHost);
|
||||
#endif
|
||||
for(int i = 0; i < P->Child.ItemCount; ++i)
|
||||
{
|
||||
FreeProject(GetPlaceInBook(&P->Child, i));
|
||||
|
|
Loading…
Reference in New Issue