#include "time_axis_view_item.h"
#include "utils.h"
#include "window_proxy.h"
-#ifdef WITH_VIDEOTIMELINE
#include "video_server_dialog.h"
#include "add_video_dialog.h"
#include "transcode_video_dialog.h"
-#include "system_exec.h" /* to launch video-server */
-#endif
+#include "system_exec.h"
#include "i18n.h"
session_selector_window = 0;
last_key_press_time = 0;
add_route_dialog = 0;
-#ifdef WITH_VIDEOTIMELINE
add_video_dialog = 0;
video_server_process = 0;
-#endif
route_params = 0;
bundle_manager = 0;
rc_option_editor = 0;
delete editor;
delete mixer;
delete add_route_dialog;
-#ifdef WITH_VIDEOTIMELINE
- if (add_video_dialog) delete add_video_dialog;
+ if (add_video_dialog) {
+ delete add_video_dialog;
+ }
stop_video_server();
-#endif
}
void
app->ready ();
nsm_url = getenv ("NSM_URL");
+ nsm = 0;
if (nsm_url) {
nsm = new NSM_Client;
if (!nsm->init (nsm_url)) {
nsm->announce (PROGRAM_NAME, ":dirty:", "ardour3");
- do {
+ unsigned int i = 0;
+ // wait for announce reply from nsm server
+ for ( i = 0; i < 5000; ++i) {
nsm->check ();
- usleep (10);
- } while (!nsm->client_id ());
+ usleep (i);
+ if (nsm->is_active())
+ break;
+ }
+ // wait for open command from nsm server
+ for ( i = 0; i < 5000; ++i) {
+ nsm->check ();
+ usleep (1000);
+ if (nsm->client_id ())
+ break;
+ }
+
+ if (_session && nsm) {
+ _session->set_nsm_state( nsm->is_active() );
+ }
+
+ // nsm requires these actions disabled
+ vector<string> action_names;
+ action_names.push_back("SaveAs");
+ action_names.push_back("Rename");
+ action_names.push_back("New");
+ action_names.push_back("Open");
+ action_names.push_back("Recent");
+ action_names.push_back("Close");
+
+ for (vector<string>::const_iterator n = action_names.begin(); n != action_names.end(); ++n) {
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), (*n).c_str());
+ if (act) {
+ act->set_sensitive (false);
+ }
+ }
}
else {
}
}
- if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
+ else if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
exit (1);
}
void
ARDOUR_UI::finish()
{
-#ifdef WITH_VIDEOTIMELINE
- /* close video-monitor & pending requests
- * would better be done in ~Editor() but that is not called..
- */
- ARDOUR_UI::instance()->video_timeline->close_session();
-#endif
if (_session) {
+ ARDOUR_UI::instance()->video_timeline->sync_session_state();
if (_session->dirty()) {
vector<string> actions;
point_zero_one_second_connection.disconnect();
}
-#ifdef WITH_VIDEOTIMELINE
delete ARDOUR_UI::instance()->video_timeline;
stop_video_server();
-#endif
/* Save state before deleting the session, as that causes some
windows to be destroyed before their visible state can be
update_disk_space ();
update_timecode_format ();
- if (nsm) {
+ if (nsm && nsm->is_active ()) {
nsm->check ();
if (!_was_dirty && _session->dirty ()) {
{
BusProfile bus_profile;
- if (Profile->get_sae()) {
+ if (nsm || Profile->get_sae()) {
bus_profile.master_out_channels = 2;
bus_profile.input_ac = AutoConnectPhysical;
* treat a non-dirty session this way, so that it stays visible
* as we bring up the new session dialog.
*/
-#ifdef WITH_VIDEOTIMELINE
+
if (_session && ARDOUR_UI::instance()->video_timeline) {
- ARDOUR_UI::instance()->video_timeline->close_session();
+ ARDOUR_UI::instance()->video_timeline->sync_session_state();
}
-#endif
+
if (_session && _session->dirty()) {
if (unload_session (false)) {
/* unload cancelled by user */
session_name = _startup->session_name (likely_new);
+ if (nsm) {
+ likely_new = true;
+ }
+
string::size_type suffix = session_name.find (statefile_suffix);
if (suffix != string::npos) {
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
- if (likely_new) {
+ if (likely_new && !nsm) {
std::string existing = Glib::build_filename (session_path, session_name);
void
ARDOUR_UI::close_session()
{
-#ifdef WITH_VIDEOTIMELINE
- ARDOUR_UI::instance()->video_timeline->close_session();
-#endif
if (!check_audioengine()) {
return;
}
string template_path = add_route_dialog->track_template();
if (!template_path.empty()) {
- _session->new_route_from_template (count, template_path);
+ if (add_route_dialog->name_template_is_default()) {
+ _session->new_route_from_template (count, template_path, string());
+ } else {
+ _session->new_route_from_template (count, template_path, add_route_dialog->name_template());
+ }
return;
}
/* idle connection will end at scope end */
}
-#ifdef WITH_VIDEOTIMELINE
void
ARDOUR_UI::stop_video_server (bool ask_confirm)
{
_session->add_extra_xml (*node);
_session->set_dirty ();
+ _session->maybe_update_session_range(
+ std::max(video_timeline->get_offset(), (ARDOUR::frameoffset_t) 0),
+ std::max(video_timeline->get_offset() + video_timeline->get_duration(), (ARDOUR::frameoffset_t) 0));
+
+
if (add_video_dialog->launch_xjadeo() && local_file) {
editor->set_xjadeo_sensitive(true);
editor->toggle_xjadeo_proc(1);
_session->add_extra_xml(*node);
node = new XMLNode(X_("Videomonitor"));
_session->add_extra_xml(*node);
+ stop_video_server();
}
void
}
editor->queue_visual_videotimeline_update();
}
-#endif
XMLNode*
ARDOUR_UI::mixer_settings () const
if (big_clock_window->get()) {
big_clock->set (pos);
}
-#ifdef WITH_VIDEOTIMELINE
ARDOUR_UI::instance()->video_timeline->manual_seek_video_monitor(pos);
-#endif
}