diff --git a/cinera/cinera.c b/cinera/cinera.c
index b5f25ce..1def8eb 100644
--- a/cinera/cinera.c
+++ b/cinera/cinera.c
@@ -14,10 +14,10 @@ typedef struct
version CINERA_APP_VERSION = {
.Major = 0,
.Minor = 5,
- .Patch = 8
+ .Patch = 9
};
-#define CINERA_DB_VERSION 1
+#define CINERA_DB_VERSION 2
#define DEBUG 0
#define DEBUG_MEM 0
@@ -102,11 +102,14 @@ typedef struct
bool ForceIntegration;
char *RootDir; // Absolute
char *RootURL;
- char *ProjectID;
- char *BaseDir; // Absolute
char *CSSDir; // Relative to RootDir and RootURL
char *ImagesDir; // Relative to RootDir and RootURL
char *JSDir; // Relative to RootDir and RootURL
+ char *ProjectID;
+ char *BaseDir; // Absolute
+ char *BaseURL;
+ char *IndexLocation; // Relative to BaseDir and BaseURL
+ char *PlayerLocation; // Relative to BaseDir and BaseURL
char *TemplateIndexLocation; // Relative to RootDir and RootURL
char *TemplatePlayerLocation; // Relative to RootDir and RootURL
char *Theme;
@@ -115,7 +118,7 @@ typedef struct
char *OutLocation;
char *OutIntegratedLocation;
char *ProjectDir;
- char *URLPrefix; /* NOTE(matt): This will become a full blown customisable output URL.
+ char *PlayerURLPrefix; /* NOTE(matt): This will become a full blown customisable output URL.
For now it simply replaces the ProjectID */
} config;
@@ -160,7 +163,9 @@ enum
// Anywhere
TAG_PROJECT,
- TAG_TITLE
+ TAG_TITLE,
+ TAG_URL,
+ TAG_VIDEO_ID,
} template_tags;
typedef struct
@@ -177,6 +182,8 @@ tag Tags[] = {
{ TAG_SCRIPT, "__CINERA_SCRIPT__" },
{ TAG_PROJECT, "__CINERA_PROJECT__" },
{ TAG_TITLE, "__CINERA_TITLE__" },
+ { TAG_URL, "__CINERA_URL__" },
+ { TAG_VIDEO_ID, "__CINERA_VIDEO_ID__" },
};
typedef struct
@@ -209,8 +216,11 @@ typedef struct
buffer Menus;
buffer Player;
buffer ScriptPlayer;
- char Title[256];
char ProjectName[32];
+ char Title[256];
+ char URLIndex[2048];
+ char URLPlayer[2048];
+ char VideoID[16];
} buffers;
// TODO(matt): Consider putting the ref_info and quote_info into linked lists on the heap, just to avoid all the hardcoded sizes
@@ -908,7 +918,7 @@ enum
void
ConstructURLPrefix(buffer *URLPrefix, int IncludeType, int PageType)
{
- ClaimBuffer(URLPrefix, "URLPrefix", 1024);
+ RewindBuffer(URLPrefix);
if(StringsDiffer(Config.RootURL, ""))
{
URLPrefix->Ptr += CopyString(URLPrefix->Ptr, "%s/", Config.RootURL);
@@ -1002,6 +1012,7 @@ SearchCredentials(buffer *CreditsMenu, bool *HasCreditsMenu, char *Person, char
if(*Credentials[CredentialIndex].SupportIcon && *Credentials[CredentialIndex].SupportURL)
{
buffer URLPrefix;
+ ClaimBuffer(&URLPrefix, "URLPrefix", 1024);
ConstructURLPrefix(&URLPrefix, INCLUDE_Images, PAGE_INDEX);
CopyStringToBuffer(CreditsMenu,
" \n",
@@ -1650,39 +1661,49 @@ PrintUsage(char *BinaryLocation, config *DefaultConfig)
" Paths: \n"
" -r \n"
" Override default root directory (\"%s\")\n"
- " -u \n"
+ " -R \n"
" Override default root URL (\"%s\")\n"
- " -b \n"
- " Override project's default base output directory (\"%s\")\n"
" -c \n"
" Override default CSS directory (\"%s\"), relative to root\n"
" -i \n"
" Override default images directory (\"%s\"), relative to root\n"
" -j \n"
" Override default JS directory (\"%s\"), relative to root\n"
- " -t \n"
- " Override default player template location (\"%s\"), relative to root\n"
- " and automatically enable integration\n"
- " -x \n"
- " Override default index template location (\"%s\"), relative to root\n"
- " and automatically enable integration\n"
"\n"
- " -o