#include "ardour/tempo.h"
#include "pbd/file_utils.h"
-#include "pbd/convert.h"
+#include "pbd/types_convert.h"
#include "ardour/session_directory.h"
#include "ardour_ui.h"
video_offset_lock = false;
video_aspect_ratio = 4.0/3.0;
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&VideoTimeLine::parameter_changed, this, _1), gui_context());
- video_server_url = video_get_server_url(Config);
- server_docroot = video_get_docroot(Config);
video_filename = "";
local_file = true;
video_file_fps = 25.0;
reopen_vmonitor=false;
find_xjadeo();
find_harvid();
+ video_server_url = video_get_server_url(Config);
+ server_docroot = video_get_docroot(Config);
VtlUpdate.connect (*this, invalidator (*this), boost::bind (&PublicEditor::queue_visual_videotimeline_update, editor), gui_context());
GuiUpdate.connect (*this, invalidator (*this), boost::bind (&VideoTimeLine::gui_update, this, _1), gui_context());
return;
}
- LocaleGuard lg;
-
XMLNode* node = new XMLNode(X_("Videomonitor"));
if (!node) return;
- node->add_property (X_("active"), (vmonitor && vmonitor->is_started())?"yes":"no");
+ node->set_property (X_("active"), (vmonitor && vmonitor->is_started()));
_session->add_extra_xml (*node);
if (vmonitor) {
/* VTL settings */
node = _session->extra_xml (X_("Videotimeline"));
if (!node) return;
- node->add_property (X_("id"), id().to_s());
- node->add_property (X_("Height"), editor->get_videotl_bar_height());
- node->add_property (X_("VideoOffsetLock"), video_offset_lock?X_("1"):X_("0"));
- node->add_property (X_("VideoOffset"), video_offset);
- node->add_property (X_("AutoFPS"), auto_set_session_fps?X_("1"):X_("0"));
+ node->set_property (X_("id"), id());
+ node->set_property (X_("Height"), editor->get_videotl_bar_height());
+ node->set_property (X_("VideoOffsetLock"), video_offset_lock);
+ node->set_property (X_("VideoOffset"), video_offset);
+ node->set_property (X_("AutoFPS"), auto_set_session_fps);
}
/* close and save settings */
if (!_session) { return ; }
_session->SessionSaveUnderway.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this));
- LocaleGuard lg;
XMLNode* node = _session->extra_xml (X_("Videotimeline"));
set_id(*node);
- XMLProperty const * proph = node->property (X_("Height"));
- if (proph) {
- editor->set_video_timeline_height(atoi(proph->value()));
+ int height;
+ if (node->get_property (X_("Height"), height)) {
+ editor->set_video_timeline_height(height);
}
#if 0 /* TODO THINK: set FPS first time only ?! */
XMLProperty const * propasfps = node->property (X_("AutoFPS"));
}
#endif
- XMLProperty const * propoffset = node->property (X_("VideoOffset"));
- if (propoffset) {
- video_offset = atoll(propoffset->value());
+ if (node->get_property (X_("VideoOffset"), video_offset)) {
video_offset_p = video_offset;
}
- XMLProperty const * proplock = node->property (X_("VideoOffsetLock"));
- if (proplock) {
- video_offset_lock = atoi(proplock->value())?true:false;
- }
+ node->get_property (X_("VideoOffsetLock"), video_offset_lock);
+ node->get_property (X_("LocalFile"), local_file);
- XMLProperty const * localfile = node->property (X_("LocalFile"));
- if (localfile) {
- local_file = atoi(localfile->value())?true:false;
+ std::string filename;
+ if (node->get_property (X_("Filename"), filename)) {
+ video_file_info (filename, local_file);
}
- XMLProperty const * propf = node->property (X_("Filename"));
- video_file_info(propf->value(), local_file);
-
if ((node = _session->extra_xml (X_("Videomonitor")))) {
- XMLProperty const * prop = node->property (X_("active"));
- if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
+ bool active;
+ if (node->get_property (X_("active"), active) && active && found_xjadeo () &&
+ !video_filename.empty () && local_file) {
open_video_monitor();
}
}
int
VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
{
- LocaleGuard lg;
- XMLProperty const * propoffset = node.property (X_("VideoOffset"));
- if (propoffset) {
- video_offset = atoll(propoffset->value());
- }
+ node.get_property (X_("VideoOffset"), video_offset);
ARDOUR_UI::instance()->flush_videotimeline_cache(true);
return 0;
}
VideoTimeLine::get_state ()
{
XMLNode* node = new XMLNode (X_("Videotimeline"));
- LocaleGuard lg;
- node->add_property (X_("VideoOffset"), video_offset_p);
+ node->set_property (X_("VideoOffset"), video_offset_p);
return *node;
}
if (_session) {
XMLNode* node = _session->extra_xml (X_("Videomonitor"));
if (node) {
- XMLProperty const * prop = node->property (X_("active"));
- if (prop && prop->value() != "yes") _session->set_dirty ();
+ bool active;
+ if (node->get_property (X_("active"), active) && !active) {
+ _session->set_dirty ();
+ }
} else {
_session->set_dirty ();
}