summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xMakefile2
-rw-r--r--config.cpp11
-rw-r--r--config.h11
-rw-r--r--html/index.html39
-rw-r--r--whiteboard.conf3
-rw-r--r--whiteboard.cpp3
6 files changed, 32 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 8891bc7..2d14170 100755
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ endif
LIBS=-lfcgi -lboost_filesystem
INCLUDES=-I.
-HEADERS=file.h
+HEADERS=file.h config.h
SOURCES=$(HEADERS:.h=.cpp)
OBJECTS=$(HEADERS:.h=.o)
TARGETS=whiteboard.fcgi
diff --git a/config.cpp b/config.cpp
new file mode 100644
index 0000000..a3fcf3c
--- /dev/null
+++ b/config.cpp
@@ -0,0 +1,11 @@
+#include "config.h"
+
+Config::Config(): m_dataPath{"/var/lib/whiteboard"}
+{
+ // TODO: read /etc/whiteboard.conf xml
+}
+
+std::string Config::getDataPath()
+{
+ return m_dataPath;
+}
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..523b54d
--- /dev/null
+++ b/config.h
@@ -0,0 +1,11 @@
+#include <string>
+
+class Config
+{
+private:
+ std::string m_dataPath;
+
+public:
+ Config();
+ std::string getDataPath();
+};
diff --git a/html/index.html b/html/index.html
index 3b23e90..780660a 100644
--- a/html/index.html
+++ b/html/index.html
@@ -3,48 +3,15 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="keywords" content="Reichwein, DownTube, YouTube, Download MP3">
- <title>DownTube</title>
+ <meta name="keywords" content="Reichwein, Whiteboard">
+ <title>Reichwein Whiteboard</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="whiteboard.css"/>
<script src="whiteboard.js"></script>
</head>
<body onload="init();">
<div class="page">
- <h1><img src="Downtube256.png"></h1>
-
- <p>
- Download internet videos as MP3 (audio) or MP4 (video).
- </p>
-
- <p>
- Video URL:<br/>
- <input size="40" type="text" id="url" name="url"><br><br>
- </p>
-
- <p>
- Transform to format:<br/>
- <input type="radio" id="mp3" name="format" value="mp3" checked>
- <label for="mp3">MP3 (Audio)</label><br>
- <input type="radio" id="mp4" name="format" value="mp4">
- <label for="mp4">MP4 (Video)</label><br>
- </p>
-
- <br/>
- <div class="status" id="status">&nbsp;</div>
- <p>
- <button class="button" onclick="on_start();">Start</button>
- </p>
-
- <br/>
- <br/>
- <br/>
- <br/>
- <br/>
- <br/>
- <p>
- Note: Audio download is currently limited to 30MB, Video download is limited to 300MB.
- </p>
+ <textarea rows="30" cols="80" id="board" name="board"></textarea>
<br/>
<br/>
<h2>Contact</h2>
diff --git a/whiteboard.conf b/whiteboard.conf
new file mode 100644
index 0000000..d269e46
--- /dev/null
+++ b/whiteboard.conf
@@ -0,0 +1,3 @@
+<config>
+ <datapath>/home/ernie/code/whiteboard/data</datapath>
+</config>
diff --git a/whiteboard.cpp b/whiteboard.cpp
index 1cf8354..cecee9e 100644
--- a/whiteboard.cpp
+++ b/whiteboard.cpp
@@ -17,6 +17,7 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/property_tree/xml_parser.hpp>
+#include "config.h"
#include "file.h"
namespace pt = boost::property_tree;
@@ -59,6 +60,8 @@ namespace {
int main(void)
{
+ Config config;
+
int result = FCGX_Init();
if (result != 0) { // error on init
fprintf(stderr, "Error: FCGX_Init()\n");