ExhibitPriv();
};
+
+// selection
ExSelection::ExSelection(Exhibit *ex)
{
this->ex = ex;
return ex != 0;
}
+// Exhibit data
+ExData::ExData()
+{
+ voice = 0;
+}
+
+ExData::~ExData()
+{
+ delete voice;
+}
+
+// private data for each exhibit type
ExhibitPriv::ExhibitPriv()
{
orig_node = 0;
}
+// exhibit class
Exhibit::Exhibit()
{
priv = new ExhibitPriv;
#ifndef EXHIBIT_H_
#define EXHIBIT_H_
+#include <string>
#include <gmath/gmath.h>
#include "object.h"
#include "geom.h"
+#include "audio/stream.h"
class Exhibit;
class ExhibitPriv;
operator bool() const;
};
+enum {
+ EXDATA_INFO,
+ EXDATA_VIDEO
+};
+
+class ExData {
+public:
+ int type;
+
+ std::string text;
+ AudioStream *voice;
+ // TODO: video stream
+
+ ExData();
+ ~ExData();
+};
+
+
/* TODO
- select me aktina kai select me sfaira, epistrefei Selection
- hover me aktina kai hover me sfaira
ExhibitPriv *priv;
public:
+ std::vector<ExData> data;
+
Exhibit();
virtual ~Exhibit();
continue;
}
+ const char *desc = ts_get_attr_str(node, "description");
+ const char *voice = ts_get_attr_str(node, "voiceover");
+ if(desc || voice) {
+ ExData exd;
+
+ if(desc) {
+ exd.text = std::string(desc);
+ }
+ if(voice) {
+ exd.voice = new OggVorbisStream;
+ if(!exd.voice->open(voice)) {
+ error_log("failed to open voiceover: %s\n", voice);
+ delete exd.voice;
+ exd.voice = 0;
+ }
+ }
+ ex->data.push_back(exd);
+ }
+
ex->set_node(snode);
items.push_back(ex);
}