merge with master and fix 2 conflicts
This commit is contained in:
commit
e5888d3983
|
@ -35,10 +35,9 @@
|
|||
<menuitem action='addExistingAudioFiles'/>
|
||||
<!--menuitem action='importFromSession'/-->
|
||||
|
||||
#ifndef NOVIDEOTIMELINE
|
||||
<menuitem action='OpenVideo'/>
|
||||
<menuitem action='CloseVideo'/>
|
||||
#endif
|
||||
|
||||
<menu name='Export' action='Export'>
|
||||
<menuitem action='ExportAudio'/>
|
||||
<menuitem action='StemExport'/>
|
||||
|
@ -282,9 +281,7 @@
|
|||
<menuitem action='snap-regions-to-grid'/>
|
||||
<menuitem action='toggle-region-lock'/>
|
||||
<menuitem action='toggle-region-lock-style'/>
|
||||
#ifndef NOVIDEOTIMELINE
|
||||
<menuitem action='toggle-region-video-lock'/>
|
||||
#endif
|
||||
<menuitem action='set-region-sync-position'/>
|
||||
<menuitem action='remove-region-sync'/>
|
||||
<menuitem action='nudge-forward'/>
|
||||
|
@ -437,9 +434,7 @@
|
|||
<menuitem action="toggle-cd-marker-ruler"/>
|
||||
<menuitem action="toggle-marker-ruler"/>
|
||||
<separator/>
|
||||
#ifndef NOVIDEOTIMELINE
|
||||
<menuitem action="toggle-video-ruler"/>
|
||||
#endif
|
||||
</menu>
|
||||
<menu action="VideoMonitorMenu">
|
||||
<menuitem action="zoom-vmon-100"/>
|
||||
|
@ -543,10 +538,8 @@
|
|||
<menuitem action="toggle-marker-ruler"/>
|
||||
<menuitem action="toggle-cd-marker-ruler"/>
|
||||
<menuitem action="toggle-loop-punch-ruler"/>
|
||||
#ifndef NOVIDEOTIMELINE
|
||||
<separator/>
|
||||
<menuitem action="toggle-video-ruler"/>
|
||||
#endif
|
||||
</popup>
|
||||
|
||||
<popup name='ProcessorMenu'>
|
||||
|
@ -642,9 +635,7 @@
|
|||
<menuitem action='naturalize-region'/>
|
||||
<menuitem action='toggle-region-lock'/>
|
||||
<menuitem action='toggle-region-lock-style'/>
|
||||
#ifndef NOVIDEOTIMELINE
|
||||
<menuitem action='toggle-region-video-lock'/>
|
||||
#endif
|
||||
<menuitem action='snap-regions-to-grid'/>
|
||||
<menuitem action='set-region-sync-position'/>
|
||||
<menuitem action='remove-region-sync'/>
|
||||
|
|
|
@ -162,7 +162,7 @@ ArdourButton::set_markup (const std::string& str)
|
|||
_layout = Pango::Layout::create (get_pango_context());
|
||||
}
|
||||
|
||||
_layout->set_text (str);
|
||||
_layout->set_markup (str);
|
||||
queue_resize ();
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
|
|||
bool _fixed_diameter;
|
||||
bool _distinct_led_click;
|
||||
bool _hovering;
|
||||
|
||||
|
||||
static bool _flat_buttons;
|
||||
|
||||
void setup_led_rect ();
|
||||
|
|
|
@ -109,6 +109,7 @@ typedef uint64_t microseconds_t;
|
|||
#include "rc_option_editor.h"
|
||||
#include "route_time_axis.h"
|
||||
#include "route_params_ui.h"
|
||||
#include "session_dialog.h"
|
||||
#include "session_metadata_dialog.h"
|
||||
#include "session_option_editor.h"
|
||||
#include "shuttle_control.h"
|
||||
|
@ -156,7 +157,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
/* start of private members */
|
||||
|
||||
, _startup (0)
|
||||
, nsm (0)
|
||||
, _was_dirty (false)
|
||||
, _mixer_on_top (false)
|
||||
|
@ -191,6 +191,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
, about (X_("about"), _("About"))
|
||||
, location_ui (X_("locations"), _("Locations"))
|
||||
, route_params (X_("inspector"), _("Tracks and Busses"))
|
||||
, audio_midi_setup (X_("audio-midi-setup"), _("Audio/MIDI Setup"))
|
||||
, session_option_editor (X_("session-options-editor"), _("Properties"), boost::bind (&ARDOUR_UI::create_session_option_editor, this))
|
||||
, add_video_dialog (X_("add-video"), _("Add Tracks/Busses"), boost::bind (&ARDOUR_UI::create_add_video_dialog, this))
|
||||
, bundle_manager (X_("bundle-manager"), _("Bundle Manager"), boost::bind (&ARDOUR_UI::create_bundle_manager, this))
|
||||
|
@ -202,7 +203,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
, _status_bar_visibility (X_("status-bar"))
|
||||
, _feedback_exists (false)
|
||||
, _audio_midi_setup (0)
|
||||
{
|
||||
Gtkmm2ext::init(localedir);
|
||||
|
||||
|
@ -353,6 +353,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
WM::Manager::instance().register_window (&add_route_dialog);
|
||||
WM::Manager::instance().register_window (&add_video_dialog);
|
||||
WM::Manager::instance().register_window (&route_params);
|
||||
WM::Manager::instance().register_window (&audio_midi_setup);
|
||||
WM::Manager::instance().register_window (&bundle_manager);
|
||||
WM::Manager::instance().register_window (&location_ui);
|
||||
WM::Manager::instance().register_window (&big_clock_window);
|
||||
|
@ -366,9 +367,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
(void) theme_manager.get (true);
|
||||
|
||||
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
|
||||
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
|
||||
|
||||
_process_thread = new ProcessThread ();
|
||||
_process_thread->init ();
|
||||
|
||||
|
@ -407,58 +405,12 @@ ARDOUR_UI::engine_running ()
|
|||
if (first_time_engine_run) {
|
||||
post_engine();
|
||||
first_time_engine_run = false;
|
||||
}
|
||||
}
|
||||
|
||||
ActionManager::set_sensitive (ActionManager::engine_sensitive_actions, true);
|
||||
ActionManager::set_sensitive (ActionManager::engine_opposite_sensitive_actions, false);
|
||||
|
||||
Glib::RefPtr<Action> action;
|
||||
const char* action_name = 0;
|
||||
|
||||
switch (AudioEngine::instance()->samples_per_cycle()) {
|
||||
case 32:
|
||||
action_name = X_("JACKLatency32");
|
||||
break;
|
||||
case 64:
|
||||
action_name = X_("JACKLatency64");
|
||||
break;
|
||||
case 128:
|
||||
action_name = X_("JACKLatency128");
|
||||
break;
|
||||
case 512:
|
||||
action_name = X_("JACKLatency512");
|
||||
break;
|
||||
case 1024:
|
||||
action_name = X_("JACKLatency1024");
|
||||
break;
|
||||
case 2048:
|
||||
action_name = X_("JACKLatency2048");
|
||||
break;
|
||||
case 4096:
|
||||
action_name = X_("JACKLatency4096");
|
||||
break;
|
||||
case 8192:
|
||||
action_name = X_("JACKLatency8192");
|
||||
break;
|
||||
default:
|
||||
/* XXX can we do anything useful ? */
|
||||
break;
|
||||
}
|
||||
|
||||
if (action_name) {
|
||||
|
||||
action = ActionManager::get_action (X_("JACK"), action_name);
|
||||
|
||||
if (action) {
|
||||
Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (action);
|
||||
ract->set_active ();
|
||||
}
|
||||
|
||||
update_disk_space ();
|
||||
update_cpu_load ();
|
||||
update_sample_rate (AudioEngine::instance()->sample_rate());
|
||||
update_timecode_format ();
|
||||
}
|
||||
update_disk_space ();
|
||||
update_cpu_load ();
|
||||
update_sample_rate (AudioEngine::instance()->sample_rate());
|
||||
update_timecode_format ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -486,13 +438,13 @@ ARDOUR_UI::engine_halted (const char* reason, bool free_reason)
|
|||
*/
|
||||
|
||||
if (strlen (reason)) {
|
||||
msgstr = string_compose (_("The audio backend (JACK) was shutdown because:\n\n%1"), reason);
|
||||
msgstr = string_compose (_("The audio backend was shutdown because:\n\n%1"), reason);
|
||||
} else {
|
||||
msgstr = string_compose (_("\
|
||||
JACK has either been shutdown or it\n\
|
||||
The audio backend has either been shutdown or it\n\
|
||||
disconnected %1 because %1\n\
|
||||
was not fast enough. Try to restart\n\
|
||||
JACK, reconnect and save the session."), PROGRAM_NAME);
|
||||
the audio backend and save the session."), PROGRAM_NAME);
|
||||
}
|
||||
|
||||
MessageDialog msg (*editor, msgstr);
|
||||
|
@ -587,6 +539,10 @@ ARDOUR_UI::post_engine ()
|
|||
|
||||
ARDOUR_UI::~ARDOUR_UI ()
|
||||
{
|
||||
if (ui_config->dirty()) {
|
||||
ui_config->save_state();
|
||||
}
|
||||
|
||||
delete keyboard;
|
||||
delete editor;
|
||||
delete mixer;
|
||||
|
@ -763,11 +719,12 @@ ARDOUR_UI::check_announcements ()
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::startup ()
|
||||
int
|
||||
ARDOUR_UI::starting ()
|
||||
{
|
||||
Application* app = Application::instance ();
|
||||
char *nsm_url;
|
||||
bool brand_new_user = ArdourStartup::required ();
|
||||
|
||||
app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
|
||||
app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
|
||||
|
@ -826,10 +783,39 @@ ARDOUR_UI::startup ()
|
|||
delete nsm;
|
||||
nsm = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
|
||||
exit (1);
|
||||
} else {
|
||||
|
||||
if (brand_new_user) {
|
||||
ArdourStartup s;
|
||||
s.present ();
|
||||
main().run();
|
||||
s.hide ();
|
||||
switch (s.response ()) {
|
||||
case Gtk::RESPONSE_OK:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* we need to create this early because it may need to set the
|
||||
* audio backend end up.
|
||||
*/
|
||||
|
||||
try {
|
||||
audio_midi_setup.get (true);
|
||||
} catch (...) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* go get a session */
|
||||
|
||||
const bool new_session_required = (ARDOUR_COMMAND_LINE::new_session || brand_new_user);
|
||||
|
||||
if (get_session_parameters (false, new_session_required, ARDOUR_COMMAND_LINE::load_template)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
use_config ();
|
||||
|
@ -844,6 +830,7 @@ ARDOUR_UI::startup ()
|
|||
_status_bar_visibility.update ();
|
||||
|
||||
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1157,7 +1144,6 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
sample_rate_label.set_markup (buf);
|
||||
}
|
||||
|
||||
|
@ -1861,7 +1847,7 @@ ARDOUR_UI::transport_roll ()
|
|||
#if 0
|
||||
if (_session->config.get_external_sync()) {
|
||||
switch (Config->get_sync_source()) {
|
||||
case JACK:
|
||||
case Engine:
|
||||
break;
|
||||
default:
|
||||
/* transport controlled by the master */
|
||||
|
@ -1911,7 +1897,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
|
|||
|
||||
if (_session->config.get_external_sync()) {
|
||||
switch (Config->get_sync_source()) {
|
||||
case JACK:
|
||||
case Engine:
|
||||
break;
|
||||
default:
|
||||
/* transport controlled by the master */
|
||||
|
@ -2483,7 +2469,7 @@ ARDOUR_UI::ask_about_loading_existing_session (const std::string& session_path)
|
|||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::string& session_name)
|
||||
ARDOUR_UI::build_session_from_dialog (SessionDialog& sd, const std::string& session_path, const std::string& session_name)
|
||||
{
|
||||
BusProfile bus_profile;
|
||||
|
||||
|
@ -2499,13 +2485,13 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s
|
|||
|
||||
/* get settings from advanced section of NSD */
|
||||
|
||||
if (_startup->create_master_bus()) {
|
||||
bus_profile.master_out_channels = (uint32_t) _startup->master_channel_count();
|
||||
if (sd.create_master_bus()) {
|
||||
bus_profile.master_out_channels = (uint32_t) sd.master_channel_count();
|
||||
} else {
|
||||
bus_profile.master_out_channels = 0;
|
||||
}
|
||||
|
||||
if (_startup->connect_inputs()) {
|
||||
if (sd.connect_inputs()) {
|
||||
bus_profile.input_ac = AutoConnectPhysical;
|
||||
} else {
|
||||
bus_profile.input_ac = AutoConnectOption (0);
|
||||
|
@ -2513,16 +2499,16 @@ ARDOUR_UI::build_session_from_nsd (const std::string& session_path, const std::s
|
|||
|
||||
bus_profile.output_ac = AutoConnectOption (0);
|
||||
|
||||
if (_startup->connect_outputs ()) {
|
||||
if (_startup->connect_outs_to_master()) {
|
||||
if (sd.connect_outputs ()) {
|
||||
if (sd.connect_outs_to_master()) {
|
||||
bus_profile.output_ac = AutoConnectMaster;
|
||||
} else if (_startup->connect_outs_to_physical()) {
|
||||
} else if (sd.connect_outs_to_physical()) {
|
||||
bus_profile.output_ac = AutoConnectPhysical;
|
||||
}
|
||||
}
|
||||
|
||||
bus_profile.requested_physical_in = (uint32_t) _startup->input_limit_count();
|
||||
bus_profile.requested_physical_out = (uint32_t) _startup->output_limit_count();
|
||||
bus_profile.requested_physical_in = (uint32_t) sd.input_limit_count();
|
||||
bus_profile.requested_physical_out = (uint32_t) sd.output_limit_count();
|
||||
}
|
||||
|
||||
if (build_session (session_path, session_name, bus_profile)) {
|
||||
|
@ -2558,6 +2544,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
string template_name;
|
||||
int ret = -1;
|
||||
bool likely_new = false;
|
||||
bool cancel_not_quit;
|
||||
|
||||
/* deal with any existing DIRTY session now, rather than later. don't
|
||||
* treat a non-dirty session this way, so that it stays visible
|
||||
|
@ -2568,6 +2555,11 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
ARDOUR_UI::instance()->video_timeline->sync_session_state();
|
||||
}
|
||||
|
||||
/* if there is already a session, relabel the button
|
||||
on the SessionDialog so that we don't Quit directly
|
||||
*/
|
||||
cancel_not_quit = (_session != 0);
|
||||
|
||||
if (_session && _session->dirty()) {
|
||||
if (unload_session (false)) {
|
||||
/* unload cancelled by user */
|
||||
|
@ -2581,6 +2573,20 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
template_name = load_template;
|
||||
}
|
||||
|
||||
session_name = basename_nosuffix (ARDOUR_COMMAND_LINE::session_name);
|
||||
session_path = ARDOUR_COMMAND_LINE::session_name;
|
||||
|
||||
if (!session_path.empty()) {
|
||||
if (Glib::file_test (session_path.c_str(), Glib::FILE_TEST_EXISTS)) {
|
||||
if (Glib::file_test (session_path.c_str(), Glib::FILE_TEST_IS_REGULAR)) {
|
||||
/* session/snapshot file, change path to be dir */
|
||||
session_path = Glib::path_get_dirname (session_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SessionDialog session_dialog (should_be_new, session_name, session_path, load_template, cancel_not_quit);
|
||||
|
||||
while (ret != 0) {
|
||||
|
||||
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
|
@ -2603,34 +2609,35 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
} else {
|
||||
session_path = "";
|
||||
session_name = "";
|
||||
session_dialog.clear_given ();
|
||||
}
|
||||
|
||||
if (should_be_new || session_name.empty()) {
|
||||
/* need the dialog to get info from user */
|
||||
|
||||
delete _startup;
|
||||
_startup = new ArdourStartup (should_be_new, session_name, session_path, load_template);
|
||||
|
||||
if (!_startup->ready_without_display()) {
|
||||
_startup->present ();
|
||||
main().run();
|
||||
_startup->hide ();
|
||||
}
|
||||
|
||||
switch (_startup->response()) {
|
||||
case RESPONSE_OK:
|
||||
break;
|
||||
default:
|
||||
if (quit_on_cancel) {
|
||||
exit (1);
|
||||
} else {
|
||||
return ret;
|
||||
cerr << "run dialog\n";
|
||||
|
||||
switch (session_dialog.run()) {
|
||||
case RESPONSE_ACCEPT:
|
||||
break;
|
||||
default:
|
||||
if (quit_on_cancel) {
|
||||
exit (1);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
session_dialog.hide ();
|
||||
}
|
||||
|
||||
/* if we run the startup dialog again, offer more than just "new session" */
|
||||
|
||||
should_be_new = false;
|
||||
|
||||
session_name = _startup->session_name (likely_new);
|
||||
|
||||
session_name = session_dialog.session_name (likely_new);
|
||||
session_path = session_dialog.session_folder ();
|
||||
|
||||
if (nsm) {
|
||||
likely_new = true;
|
||||
}
|
||||
|
@ -2647,8 +2654,8 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
continue;
|
||||
}
|
||||
|
||||
if (_startup->use_session_template()) {
|
||||
template_name = _startup->session_template_name();
|
||||
if (session_dialog.use_session_template()) {
|
||||
template_name = session_dialog.session_template_name();
|
||||
_session_is_new = true;
|
||||
}
|
||||
|
||||
|
@ -2665,12 +2672,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
|
||||
} else {
|
||||
|
||||
session_path = _startup->session_folder();
|
||||
session_path = session_dialog.session_folder();
|
||||
|
||||
char illegal = Session::session_name_is_legal (session_name);
|
||||
|
||||
if (illegal) {
|
||||
MessageDialog msg (*_startup,
|
||||
MessageDialog msg (session_dialog,
|
||||
string_compose (_("To ensure compatibility with various systems\n"
|
||||
"session names may not contain a '%1' character"),
|
||||
illegal));
|
||||
|
@ -2682,6 +2689,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
|
||||
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
|
||||
|
||||
|
||||
if (likely_new && !nsm) {
|
||||
|
||||
std::string existing = Glib::build_filename (session_path, session_name);
|
||||
|
@ -2697,12 +2705,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
} else {
|
||||
|
||||
if (!likely_new) {
|
||||
if (_startup) {
|
||||
pop_back_splash (*_startup);
|
||||
} else {
|
||||
hide_splash ();
|
||||
}
|
||||
|
||||
pop_back_splash (session_dialog);
|
||||
MessageDialog msg (string_compose (_("There is no existing session at \"%1\""), session_path));
|
||||
msg.run ();
|
||||
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
|
||||
|
@ -2710,10 +2713,11 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
}
|
||||
|
||||
char illegal = Session::session_name_is_legal(session_name);
|
||||
|
||||
if (illegal) {
|
||||
pop_back_splash (*_startup);
|
||||
MessageDialog msg (*_startup, string_compose(_("To ensure compatibility with various systems\n"
|
||||
"session names may not contain a '%1' character"), illegal));
|
||||
pop_back_splash (session_dialog);
|
||||
MessageDialog msg (session_dialog, string_compose(_("To ensure compatibility with various systems\n"
|
||||
"session names may not contain a '%1' character"), illegal));
|
||||
msg.run ();
|
||||
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
|
||||
continue;
|
||||
|
@ -2724,7 +2728,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
|
||||
if (likely_new && template_name.empty()) {
|
||||
|
||||
ret = build_session_from_nsd (session_path, session_name);
|
||||
ret = build_session_from_dialog (session_dialog, session_path, session_name);
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -2739,6 +2743,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
|
|||
_session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* clear this to avoid endless attempts to load the
|
||||
same session.
|
||||
*/
|
||||
|
||||
ARDOUR_COMMAND_LINE::session_name = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2831,22 +2841,12 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
Gtk::MESSAGE_INFO,
|
||||
BUTTONS_OK);
|
||||
|
||||
msg.set_keep_above (true);
|
||||
msg.set_title (_("Loading Error"));
|
||||
msg.set_secondary_text (_("Click the Refresh button to try again."));
|
||||
msg.add_button (Stock::REFRESH, 1);
|
||||
msg.set_position (Gtk::WIN_POS_CENTER);
|
||||
pop_back_splash (msg);
|
||||
msg.present ();
|
||||
|
||||
int response = msg.run ();
|
||||
|
||||
switch (response) {
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
exit (1);
|
||||
}
|
||||
|
||||
(void) msg.run ();
|
||||
msg.hide ();
|
||||
|
||||
goto out;
|
||||
|
@ -2860,6 +2860,22 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
}
|
||||
}
|
||||
|
||||
if (!new_session->writable()) {
|
||||
MessageDialog msg (_("This session has been opened in read-only mode.\n\nYou will not be able to record or save."),
|
||||
true,
|
||||
Gtk::MESSAGE_INFO,
|
||||
BUTTONS_OK);
|
||||
|
||||
msg.set_keep_above (true);
|
||||
msg.set_title (_("Read-only Session"));
|
||||
msg.set_position (Gtk::WIN_POS_CENTER);
|
||||
pop_back_splash (msg);
|
||||
msg.present ();
|
||||
(void) msg.run ();
|
||||
msg.hide ();
|
||||
}
|
||||
|
||||
|
||||
/* Now the session been created, add the transport controls */
|
||||
new_session->add_controllable(roll_controllable);
|
||||
new_session->add_controllable(stop_controllable);
|
||||
|
@ -3797,6 +3813,7 @@ ARDOUR_UI::disconnect_from_engine ()
|
|||
/* drop connection to AudioEngine::Halted so that we don't act
|
||||
* as if the engine unexpectedly shut down
|
||||
*/
|
||||
|
||||
halt_connection.disconnect ();
|
||||
|
||||
if (AudioEngine::instance()->stop ()) {
|
||||
|
@ -3815,8 +3832,13 @@ int
|
|||
ARDOUR_UI::reconnect_to_engine ()
|
||||
{
|
||||
if (AudioEngine::instance()->start ()) {
|
||||
MessageDialog msg (*editor, _("Could not reconnect to the Audio/MIDI engine"));
|
||||
msg.run ();
|
||||
if (editor) {
|
||||
MessageDialog msg (*editor, _("Could not reconnect to the Audio/MIDI engine"));
|
||||
msg.run ();
|
||||
} else {
|
||||
MessageDialog msg (_("Could not reconnect to the Audio/MIDI engine"));
|
||||
msg.run ();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -4129,41 +4151,13 @@ ARDOUR_UI::reset_route_peak_display (Route* route)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_audio_midi_setup ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-audio-midi-setup"));
|
||||
if (!act) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
if (tact->get_active()) {
|
||||
launch_audio_midi_setup ();
|
||||
} else {
|
||||
_audio_midi_setup->hide ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::launch_audio_midi_setup ()
|
||||
{
|
||||
if (!_audio_midi_setup) {
|
||||
_audio_midi_setup = new EngineControl ();
|
||||
}
|
||||
|
||||
_audio_midi_setup->present ();
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
|
||||
{
|
||||
launch_audio_midi_setup ();
|
||||
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
|
||||
audio_midi_setup->set_position (WIN_POS_CENTER);
|
||||
|
||||
_audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
|
||||
|
||||
switch (_audio_midi_setup->run()) {
|
||||
switch (audio_midi_setup->run()) {
|
||||
case Gtk::RESPONSE_OK:
|
||||
return 0;
|
||||
case Gtk::RESPONSE_APPLY:
|
||||
|
@ -4172,3 +4166,5 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,6 @@ class AddRouteDialog;
|
|||
class AddVideoDialog;
|
||||
class VideoTimeLine;
|
||||
class SystemExec;
|
||||
class ArdourStartup;
|
||||
class ArdourKeyboard;
|
||||
class AudioClock;
|
||||
class BigClockWindow;
|
||||
|
@ -97,6 +96,7 @@ class Mixer_UI;
|
|||
class PublicEditor;
|
||||
class RCOptionEditor;
|
||||
class RouteParams_UI;
|
||||
class SessionDialog;
|
||||
class SessionOptionEditor;
|
||||
class ShuttleControl;
|
||||
class Splash;
|
||||
|
@ -152,7 +152,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
bool get_smart_mode () const;
|
||||
|
||||
int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = "");
|
||||
int build_session_from_nsd (const std::string& session_name, const std::string& session_path);
|
||||
int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path);
|
||||
bool ask_about_loading_existing_session (const std::string& session_path);
|
||||
|
||||
/// @return true if session was successfully unloaded.
|
||||
|
@ -311,11 +311,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void toggle_session_options_window ();
|
||||
|
||||
private:
|
||||
ArdourStartup* _startup;
|
||||
Gtk::Tooltips _tooltips;
|
||||
Gtk::Tooltips _tooltips;
|
||||
NSM_Client *nsm;
|
||||
bool _was_dirty;
|
||||
bool _mixer_on_top;
|
||||
bool _was_dirty;
|
||||
bool _mixer_on_top;
|
||||
bool first_time_engine_run;
|
||||
|
||||
void goto_editor_window ();
|
||||
|
@ -330,8 +329,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
|
||||
static ARDOUR_UI *theArdourUI;
|
||||
|
||||
void startup ();
|
||||
void shutdown ();
|
||||
int starting ();
|
||||
|
||||
int ask_about_saving_session (const std::vector<std::string>& actions);
|
||||
|
||||
|
@ -602,6 +600,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
WM::Proxy<About> about;
|
||||
WM::Proxy<LocationUIWindow> location_ui;
|
||||
WM::Proxy<RouteParams_UI> route_params;
|
||||
WM::Proxy<EngineControl> audio_midi_setup;
|
||||
|
||||
/* Windows/Dialogs that require a creator method */
|
||||
|
||||
|
@ -669,8 +668,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
int pending_state_dialog ();
|
||||
int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
|
||||
|
||||
void set_engine_buffer_size (ARDOUR::pframes_t);
|
||||
|
||||
Gtk::MenuItem* jack_disconnect_item;
|
||||
Gtk::MenuItem* jack_reconnect_item;
|
||||
Gtk::Menu* jack_bufsize_menu;
|
||||
|
@ -748,8 +745,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
std::string _announce_string;
|
||||
void check_announcements ();
|
||||
|
||||
EngineControl* _audio_midi_setup;
|
||||
void launch_audio_midi_setup ();
|
||||
int do_audio_midi_setup (uint32_t);
|
||||
};
|
||||
|
||||
|
|
|
@ -50,14 +50,6 @@ namespace ARDOUR {
|
|||
|
||||
using namespace ARDOUR;
|
||||
|
||||
void
|
||||
ARDOUR_UI::shutdown ()
|
||||
{
|
||||
if (ui_config->dirty()) {
|
||||
ui_config->save_state();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::we_have_dependents ()
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ ARDOUR_UI::install_actions ()
|
|||
sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
|
||||
act->set_sensitive (false);
|
||||
act = ActionManager::register_action (main_actions, X_("ExportVideo"), _("Export To Video File"),
|
||||
sigc::mem_fun (*editor, &PublicEditor::export_video));
|
||||
hide_return (sigc::bind (sigc::mem_fun(*editor, &PublicEditor::export_video), false)));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
|
||||
|
@ -197,7 +197,6 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::register_toggle_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window));
|
||||
ActionManager::register_action (common_actions, X_("toggle-editor-mixer"), _("Toggle Editor+Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer));
|
||||
ActionManager::register_toggle_action (common_actions, X_("toggle-meterbridge"), S_("Window|Meterbridge"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_meterbridge));
|
||||
ActionManager::register_toggle_action (common_actions, X_("toggle-audio-midi-setup"), S_("Window|Audio/MIDI Setup"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_audio_midi_setup));
|
||||
|
||||
act = ActionManager::register_action (common_actions, X_("NewMIDITracer"), _("MIDI Tracer"), sigc::mem_fun(*this, &ARDOUR_UI::new_midi_tracer_window));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
@ -396,60 +395,6 @@ ARDOUR_UI::install_actions ()
|
|||
ActionManager::add_action_group (midi_actions);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::set_engine_buffer_size (pframes_t nframes)
|
||||
{
|
||||
Glib::RefPtr<Action> action;
|
||||
const char* action_name = 0;
|
||||
|
||||
switch (nframes) {
|
||||
case 32:
|
||||
action_name = X_("EngineLatency32");
|
||||
break;
|
||||
case 64:
|
||||
action_name = X_("EngineLatency64");
|
||||
break;
|
||||
case 128:
|
||||
action_name = X_("EngineLatency128");
|
||||
break;
|
||||
case 256:
|
||||
action_name = X_("EngineLatency256");
|
||||
break;
|
||||
case 512:
|
||||
action_name = X_("EngineLatency512");
|
||||
break;
|
||||
case 1024:
|
||||
action_name = X_("EngineLatency1024");
|
||||
break;
|
||||
case 2048:
|
||||
action_name = X_("EngineLatency2048");
|
||||
break;
|
||||
case 4096:
|
||||
action_name = X_("EngineLatency4096");
|
||||
break;
|
||||
case 8192:
|
||||
action_name = X_("EngineLatency8192");
|
||||
break;
|
||||
default:
|
||||
/* XXX can we do anything useful ? */
|
||||
break;
|
||||
}
|
||||
|
||||
if (action_name) {
|
||||
|
||||
action = ActionManager::get_action (X_("JACK"), action_name);
|
||||
|
||||
if (action) {
|
||||
Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (action);
|
||||
|
||||
if (ract && ract->get_active()) {
|
||||
AudioEngine::instance()->request_buffer_size (nframes);
|
||||
update_sample_rate (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::build_menu_bar ()
|
||||
{
|
||||
|
@ -528,7 +473,7 @@ ARDOUR_UI::build_menu_bar ()
|
|||
_status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
|
||||
_status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
|
||||
_status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
|
||||
_status_bar_visibility.add (&sample_rate_label, X_("JACK"), _("JACK Sampling Rate and Latency"), true);
|
||||
_status_bar_visibility.add (&sample_rate_label, X_("Audio"), _("Audio"), true);
|
||||
_status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true);
|
||||
_status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
|
||||
|
||||
|
@ -614,7 +559,7 @@ ARDOUR_UI::save_ardour_state ()
|
|||
window_node->add_child_nocopy (*tearoff_node);
|
||||
|
||||
Config->add_extra_xml (*window_node);
|
||||
Config->add_extra_xml (_audio_midi_setup->get_state());
|
||||
Config->add_extra_xml (audio_midi_setup->get_state());
|
||||
|
||||
Config->save_state();
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include "ardour/osc.h"
|
||||
#endif
|
||||
|
||||
#include "canvas/wave_view.h"
|
||||
|
||||
#include "audio_clock.h"
|
||||
#include "ardour_ui.h"
|
||||
#include "actions.h"
|
||||
|
@ -62,7 +60,7 @@ ARDOUR_UI::toggle_external_sync()
|
|||
{
|
||||
if (_session) {
|
||||
if (_session->config.get_video_pullup() != 0.0f) {
|
||||
if (Config->get_sync_source() == JACK) {
|
||||
if (Config->get_sync_source() == Engine) {
|
||||
MessageDialog msg (
|
||||
_("It is not possible to use JACK as the the sync source\n\
|
||||
when the pull up/down setting is non-zero."));
|
||||
|
@ -342,16 +340,6 @@ ARDOUR_UI::parameter_changed (std::string p)
|
|||
|
||||
ActionManager::map_some_state ("options", "SendMMC", &RCConfiguration::get_send_mmc);
|
||||
|
||||
} else if (p == "use-osc") {
|
||||
|
||||
#ifdef HAVE_LIBLO
|
||||
if (Config->get_use_osc()) {
|
||||
osc->start ();
|
||||
} else {
|
||||
osc->stop ();
|
||||
}
|
||||
#endif
|
||||
|
||||
} else if (p == "keep-tearoffs") {
|
||||
ActionManager::map_some_state ("Common", "KeepTearoffs", &RCConfiguration::get_keep_tearoffs);
|
||||
} else if (p == "mmc-control") {
|
||||
|
@ -467,7 +455,7 @@ ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
|
|||
act->set_sensitive (true);
|
||||
} else {
|
||||
/* can't sync to JACK if video pullup != 0.0 */
|
||||
if (Config->get_sync_source() == JACK) {
|
||||
if (Config->get_sync_source() == Engine) {
|
||||
act->set_sensitive (false);
|
||||
} else {
|
||||
act->set_sensitive (true);
|
||||
|
|
|
@ -996,7 +996,7 @@ AudioClock::set_slave_info ()
|
|||
Slave* slave = _session->slave();
|
||||
|
||||
switch (sync_src) {
|
||||
case JACK:
|
||||
case Engine:
|
||||
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
|
||||
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
|
||||
_right_layout->set_text ("");
|
||||
|
|
|
@ -1913,6 +1913,9 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
|
|||
edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
|
||||
edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
|
||||
edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
|
||||
if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
|
||||
edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*this, &Editor::export_video), true)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -895,7 +895,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void toggle_ruler_video (bool onoff) {ruler_video_action->set_active(onoff);}
|
||||
int videotl_bar_height; /* in units of timebar_height; default: 4 */
|
||||
int get_videotl_bar_height () const { return videotl_bar_height; }
|
||||
void export_video ();
|
||||
void export_video (bool range = false);
|
||||
void toggle_region_video_lock ();
|
||||
|
||||
Gtk::VBox time_bars_vbox;
|
||||
|
|
|
@ -2100,7 +2100,7 @@ Editor::transition_to_rolling (bool fwd)
|
|||
|
||||
if (_session->config.get_external_sync()) {
|
||||
switch (Config->get_sync_source()) {
|
||||
case JACK:
|
||||
case Engine:
|
||||
break;
|
||||
default:
|
||||
/* transport controlled by the master */
|
||||
|
|
|
@ -1115,7 +1115,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
|
|||
|
||||
switch (_sort_type) {
|
||||
case ByName:
|
||||
cmp = strcasecmp (region1->name().c_str(), region2->name().c_str());
|
||||
cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str());
|
||||
break;
|
||||
|
||||
case ByLength:
|
||||
|
@ -1140,7 +1140,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
|
|||
break;
|
||||
|
||||
case BySourceFileName:
|
||||
cmp = strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
|
||||
cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
|
||||
break;
|
||||
|
||||
case BySourceFileLength:
|
||||
|
@ -1153,9 +1153,9 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
|
|||
|
||||
case BySourceFileFS:
|
||||
if (region1->source()->name() == region2->source()->name()) {
|
||||
cmp = strcasecmp (region1->name().c_str(), region2->name().c_str());
|
||||
cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str());
|
||||
} else {
|
||||
cmp = strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
|
||||
cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::export_video ()
|
||||
Editor::export_video (bool range)
|
||||
{
|
||||
if (ARDOUR::Config->get_show_video_export_info()) {
|
||||
ExportVideoInfobox infobox (_session);
|
||||
|
@ -125,7 +125,7 @@ Editor::export_video ()
|
|||
break;
|
||||
}
|
||||
}
|
||||
ExportVideoDialog dialog (_session, get_selection().time);
|
||||
ExportVideoDialog dialog (_session, get_selection().time, range);
|
||||
Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
|
||||
(void) r; // keep gcc quiet
|
||||
dialog.hide();
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -36,6 +36,7 @@
|
|||
#include "pbd/signals.h"
|
||||
|
||||
#include "ardour_dialog.h"
|
||||
#include "ardour_button.h"
|
||||
|
||||
class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
||||
public:
|
||||
|
@ -62,6 +63,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
Gtk::ComboBoxText driver_combo;
|
||||
Gtk::ComboBoxText device_combo;
|
||||
Gtk::ComboBoxText sample_rate_combo;
|
||||
Gtk::ComboBoxText midi_option_combo;
|
||||
Gtk::ComboBoxText buffer_size_combo;
|
||||
Gtk::Label buffer_size_duration_label;
|
||||
Gtk::Adjustment input_latency_adjustment;
|
||||
|
@ -75,20 +77,26 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
Gtk::Adjustment ports_adjustment;
|
||||
Gtk::SpinButton ports_spinner;
|
||||
|
||||
Gtk::Label have_control_text;
|
||||
Gtk::Button control_app_button;
|
||||
|
||||
Gtk::Button connect_disconnect_button;
|
||||
|
||||
/* latency measurement */
|
||||
|
||||
Gtk::ComboBoxText lm_output_channel_combo;
|
||||
Gtk::ComboBoxText lm_input_channel_combo;
|
||||
Gtk::Label lm_start_stop_label;
|
||||
Gtk::ToggleButton lm_measure_button;
|
||||
Gtk::Label lm_measure_label;
|
||||
Gtk::Button lm_measure_button;
|
||||
Gtk::Button lm_use_button;
|
||||
Gtk::Button lm_back_button;
|
||||
ArdourButton lm_button;
|
||||
Gtk::Label lm_title;
|
||||
Gtk::Label lm_results;
|
||||
Gtk::Table lm_table;
|
||||
Gtk::VBox lm_vbox;
|
||||
bool have_lm_results;
|
||||
bool lm_running;
|
||||
|
||||
Gtk::Button* cancel_button;
|
||||
Gtk::Button* ok_button;
|
||||
|
@ -106,20 +114,20 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
|
||||
uint32_t ignore_changes;
|
||||
uint32_t _desired_sample_rate;
|
||||
|
||||
static bool engine_running ();
|
||||
|
||||
bool no_push;
|
||||
bool started_at_least_once;
|
||||
|
||||
void driver_changed ();
|
||||
void backend_changed ();
|
||||
void sample_rate_changed ();
|
||||
void buffer_size_changed ();
|
||||
void parameter_changed ();
|
||||
void midi_option_changed ();
|
||||
|
||||
void setup_midi_tab_for_backend ();
|
||||
void setup_midi_tab_for_jack ();
|
||||
void refresh_midi_display ();
|
||||
|
||||
std::string rate_as_string (float);
|
||||
std::string bufsize_as_string (uint32_t);
|
||||
|
||||
float get_rate() const;
|
||||
|
@ -131,6 +139,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
std::string get_device_name() const;
|
||||
std::string get_driver() const;
|
||||
std::string get_backend() const;
|
||||
std::string get_midi_option () const;
|
||||
|
||||
void device_changed ();
|
||||
void list_devices ();
|
||||
|
@ -147,6 +156,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
uint32_t input_channels;
|
||||
uint32_t output_channels;
|
||||
bool active;
|
||||
std::string midi_option;
|
||||
|
||||
State()
|
||||
: input_latency (0)
|
||||
|
@ -174,6 +184,8 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
static bool print_channel_count (Gtk::SpinButton*);
|
||||
|
||||
void build_notebook ();
|
||||
void build_full_control_notebook ();
|
||||
void build_no_control_notebook ();
|
||||
|
||||
void on_response (int);
|
||||
void control_app_button_clicked ();
|
||||
|
@ -181,18 +193,27 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
|||
void manage_control_app_sensitivity ();
|
||||
int push_state_to_backend (bool start);
|
||||
void post_push ();
|
||||
void update_sensitivity ();
|
||||
|
||||
/* latency measurement */
|
||||
void latency_button_toggled ();
|
||||
void latency_button_clicked ();
|
||||
bool check_latency_measurement ();
|
||||
sigc::connection latency_timeout;
|
||||
void enable_latency_tab ();
|
||||
void disable_latency_tab ();
|
||||
void start_latency_detection ();
|
||||
void end_latency_detection ();
|
||||
|
||||
|
||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
|
||||
void engine_running ();
|
||||
void engine_stopped ();
|
||||
PBD::ScopedConnection running_connection;
|
||||
PBD::ScopedConnection stopped_connection;
|
||||
|
||||
void connect_disconnect_click ();
|
||||
void calibrate_latency ();
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/convert.h"
|
||||
|
@ -62,7 +61,7 @@ using namespace PBD;
|
|||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
|
||||
ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme, bool range)
|
||||
: ArdourDialog (_("Export Video File "))
|
||||
, export_range (tme)
|
||||
, outfn_path_label (_("File:"), Gtk::ALIGN_LEFT)
|
||||
|
@ -153,7 +152,11 @@ ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
|
|||
if (!export_range.empty()) {
|
||||
insnd_combo.append_text (_("Selected range")); // TODO show export_range.start() -> export_range.end_frame()
|
||||
}
|
||||
insnd_combo.set_active(0);
|
||||
if (range) {
|
||||
insnd_combo.set_active(2);
|
||||
} else {
|
||||
insnd_combo.set_active(0);
|
||||
}
|
||||
|
||||
outfn_path_entry.set_width_chars(38);
|
||||
outfn_path_entry.set_text (_session->session_directory().export_path() + G_DIR_SEPARATOR +"export.avi");
|
||||
|
@ -511,9 +514,8 @@ ExportVideoDialog::launch_export ()
|
|||
end += av_offset;
|
||||
}
|
||||
else if (insnd_combo.get_active_row_number() == 2) {
|
||||
// TODO quantize to video-frame ?!
|
||||
start = export_range.start();
|
||||
end = export_range.end_frame();
|
||||
start = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.start());
|
||||
end = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.end_frame());
|
||||
}
|
||||
if (end <= 0) {
|
||||
start = _session->current_start_frame();
|
||||
|
@ -523,6 +525,15 @@ ExportVideoDialog::launch_export ()
|
|||
printf("audio export-range %lld -> %lld\n", start, end);
|
||||
#endif
|
||||
|
||||
const frameoffset_t vstart = ARDOUR_UI::instance()->video_timeline->get_offset();
|
||||
const frameoffset_t vend = vstart + ARDOUR_UI::instance()->video_timeline->get_duration();
|
||||
|
||||
if ( (start >= end) || (end < vstart) || (start > vend)) {
|
||||
warning << _("Export Video: export-range does not include video.") << endmsg;
|
||||
Gtk::Dialog::response(RESPONSE_CANCEL);
|
||||
return;
|
||||
}
|
||||
|
||||
tsp->set_range (start, end);
|
||||
tsp->set_name ("mysession");
|
||||
tsp->set_range_id ("session");
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
class ExportVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
|
||||
{
|
||||
public:
|
||||
ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme);
|
||||
ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme, bool range = false);
|
||||
~ExportVideoDialog ();
|
||||
|
||||
std::string get_exported_filename () { return outfn_path_entry.get_text(); }
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdint.h>
|
||||
#include <cairo/cairo.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
|
@ -740,13 +740,13 @@ piano_keyboard_set_keyboard_layout(PianoKeyboard *pk, const char *layout)
|
|||
{
|
||||
assert(layout);
|
||||
|
||||
if (!strcasecmp(layout, "QWERTY")) {
|
||||
if (!g_strcasecmp(layout, "QWERTY")) {
|
||||
bind_keys_qwerty(pk);
|
||||
|
||||
} else if (!strcasecmp(layout, "QWERTZ")) {
|
||||
} else if (!g_strcasecmp(layout, "QWERTZ")) {
|
||||
bind_keys_qwertz(pk);
|
||||
|
||||
} else if (!strcasecmp(layout, "AZERTY")) {
|
||||
} else if (!g_strcasecmp(layout, "AZERTY")) {
|
||||
bind_keys_azerty(pk);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -250,8 +250,6 @@ KeyEditor::populate ()
|
|||
//kinda kludgy way to avoid displaying menu items as mappable
|
||||
if ( parts[1] == _("Main_menu") )
|
||||
continue;
|
||||
if ( parts[1] == _("JACK") )
|
||||
continue;
|
||||
if ( parts[1] == _("redirectmenu") )
|
||||
continue;
|
||||
if ( parts[1] == _("Editor_menus") )
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include "pbd/boost_debug.h"
|
||||
#endif
|
||||
|
||||
#include <jack/jack.h>
|
||||
|
||||
#include "ardour/revision.h"
|
||||
#include "ardour/version.h"
|
||||
#include "ardour/ardour.h"
|
||||
|
@ -80,17 +78,10 @@ static const char* localedir = LOCALEDIR;
|
|||
void
|
||||
gui_jack_error ()
|
||||
{
|
||||
MessageDialog win (string_compose (_("%1 could not connect to JACK."), PROGRAM_NAME),
|
||||
MessageDialog win (string_compose (_("%1 could not connect to the audio backend."), PROGRAM_NAME),
|
||||
false,
|
||||
Gtk::MESSAGE_INFO,
|
||||
Gtk::BUTTONS_NONE);
|
||||
win.set_secondary_text(string_compose (_("There are several possible reasons:\n\
|
||||
\n\
|
||||
1) JACK is not running.\n\
|
||||
2) JACK is running as another user, perhaps root.\n\
|
||||
3) There is already another client called \"%1\".\n\
|
||||
\n\
|
||||
Please consider the possibilities, and perhaps (re)start JACK."), PROGRAM_NAME));
|
||||
|
||||
win.add_button (Stock::QUIT, RESPONSE_CLOSE);
|
||||
win.set_default_response (RESPONSE_CLOSE);
|
||||
|
@ -527,6 +518,7 @@ int main (int argc, char *argv[])
|
|||
|
||||
ui->run (text_receiver);
|
||||
Gtkmm2ext::Application::instance()->cleanup();
|
||||
delete ui;
|
||||
ui = 0;
|
||||
|
||||
ARDOUR::cleanup ();
|
||||
|
|
|
@ -698,7 +698,7 @@ MixerStrip::output_press (GdkEventButton *ev)
|
|||
{
|
||||
using namespace Menu_Helpers;
|
||||
if (!_session->engine().connected()) {
|
||||
MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
|
||||
MessageDialog msg (_("Not connected to audio engine - no I/O changes are possible"));
|
||||
msg.run ();
|
||||
return true;
|
||||
}
|
||||
|
@ -826,7 +826,7 @@ MixerStrip::input_press (GdkEventButton *ev)
|
|||
citems.clear();
|
||||
|
||||
if (!_session->engine().connected()) {
|
||||
MessageDialog msg (_("Not connected to JACK - no I/O changes are possible"));
|
||||
MessageDialog msg (_("Not connected to audio engine - no I/O changes are possible"));
|
||||
msg.run ();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -538,13 +538,13 @@ struct PluginMenuCompareByCreator {
|
|||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = strcasecmp (a->creator.c_str(), b->creator.c_str());
|
||||
cmp = g_strcasecmp (a->creator.c_str(), b->creator.c_str());
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same creator ... compare names */
|
||||
if (strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
|
||||
if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ struct PluginMenuCompareByName {
|
|||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = strcasecmp (a->name.c_str(), b->name.c_str());
|
||||
cmp = g_strcasecmp (a->name.c_str(), b->name.c_str());
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
|
@ -574,13 +574,13 @@ struct PluginMenuCompareByCategory {
|
|||
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
|
||||
int cmp;
|
||||
|
||||
cmp = strcasecmp (a->category.c_str(), b->category.c_str());
|
||||
cmp = g_strcasecmp (a->category.c_str(), b->category.c_str());
|
||||
|
||||
if (cmp < 0) {
|
||||
return true;
|
||||
} else if (cmp == 0) {
|
||||
/* same category ... compare names */
|
||||
if (strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
|
||||
if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,6 +161,7 @@ PluginUIWindow::PluginUIWindow (
|
|||
|
||||
PluginUIWindow::~PluginUIWindow ()
|
||||
{
|
||||
cerr << "PluginWindow deleted for " << this << endl;
|
||||
delete _pluginui;
|
||||
}
|
||||
|
||||
|
@ -405,8 +406,6 @@ PluginUIWindow::plugin_going_away ()
|
|||
}
|
||||
|
||||
death_connection.disconnect ();
|
||||
|
||||
delete_when_idle (this);
|
||||
}
|
||||
|
||||
PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
|
||||
|
|
2577
gtk2_ardour/po/de.po
2577
gtk2_ardour/po/de.po
File diff suppressed because it is too large
Load Diff
2817
gtk2_ardour/po/ru.po
2817
gtk2_ardour/po/ru.po
File diff suppressed because it is too large
Load Diff
|
@ -1392,7 +1392,7 @@ ProcessorBox::redisplay_processors ()
|
|||
|
||||
_route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display));
|
||||
|
||||
for (list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
|
||||
for (ProcessorWindowProxies::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
|
||||
(*i)->marked = false;
|
||||
}
|
||||
|
||||
|
@ -1400,16 +1400,43 @@ ProcessorBox::redisplay_processors ()
|
|||
|
||||
/* trim dead wood from the processor window proxy list */
|
||||
|
||||
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin();
|
||||
ProcessorWindowProxies::iterator i = _processor_window_info.begin();
|
||||
while (i != _processor_window_info.end()) {
|
||||
list<ProcessorWindowProxy*>::iterator j = i;
|
||||
ProcessorWindowProxies::iterator j = i;
|
||||
++j;
|
||||
|
||||
if (!(*i)->marked) {
|
||||
if (!(*i)->valid()) {
|
||||
|
||||
WM::Manager::instance().remove (*i);
|
||||
delete *i;
|
||||
_processor_window_info.erase (i);
|
||||
}
|
||||
|
||||
} else if (!(*i)->marked) {
|
||||
|
||||
/* this processor is no longer part of this processor
|
||||
* box.
|
||||
*
|
||||
* that could be because it was deleted or it could be
|
||||
* because the route being displayed in the parent
|
||||
* strip changed.
|
||||
*
|
||||
* The latter only happens with the editor mixer strip.
|
||||
*/
|
||||
|
||||
if (is_editor_mixer_strip()) {
|
||||
|
||||
/* editor mixer strip .. DO NOTHING
|
||||
*
|
||||
* note: the processor window stays visible if
|
||||
* it is already visible
|
||||
*/
|
||||
} else {
|
||||
(*i)->hide ();
|
||||
WM::Manager::instance().remove (*i);
|
||||
delete *i;
|
||||
_processor_window_info.erase (i);
|
||||
}
|
||||
}
|
||||
|
||||
i = j;
|
||||
}
|
||||
|
@ -1428,7 +1455,7 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
|
|||
return;
|
||||
}
|
||||
|
||||
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin ();
|
||||
ProcessorWindowProxies::iterator i = _processor_window_info.begin ();
|
||||
while (i != _processor_window_info.end()) {
|
||||
|
||||
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
|
||||
|
@ -2077,6 +2104,18 @@ ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor, bool us
|
|||
boost::shared_ptr<PortInsert> port_insert;
|
||||
Window* gidget = 0;
|
||||
|
||||
/* This method may or may not return a Window, but if it does not it
|
||||
* will modify the parent mixer strip appearance layout to allow
|
||||
* "editing" the @param processor that was passed in.
|
||||
*
|
||||
* So for example, if the processor is an Amp (gain), the parent strip
|
||||
* will be forced back into a model where the fader controls the main gain.
|
||||
* If the processor is a send, then we map the send controls onto the
|
||||
* strip.
|
||||
*
|
||||
* Plugins and others will return a window for control.
|
||||
*/
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) {
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioTrack> (_route)->freeze_state() == AudioTrack::Frozen) {
|
||||
|
@ -2151,7 +2190,7 @@ ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor, bool us
|
|||
} else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (processor)) != 0) {
|
||||
|
||||
if (!_session->engine().connected()) {
|
||||
MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible"));
|
||||
MessageDialog msg ( _("Not connected to audio engine - no I/O changes are possible"));
|
||||
msg.run ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -2554,7 +2593,13 @@ ProcessorBox::generate_processor_title (boost::shared_ptr<PluginInsert> pi)
|
|||
maker += " ...";
|
||||
}
|
||||
|
||||
return string_compose(_("%1: %2 (by %3)"), _route->name(), pi->name(), maker);
|
||||
SessionObject* owner = pi->owner();
|
||||
|
||||
if (owner) {
|
||||
return string_compose(_("%1: %2 (by %3)"), owner->name(), pi->name(), maker);
|
||||
} else {
|
||||
return string_compose(_("%2 (by %3)"), pi->name(), maker);
|
||||
}
|
||||
}
|
||||
|
||||
/** @param p Processor.
|
||||
|
@ -2667,6 +2712,12 @@ ProcessorBox::update_gui_object_state (ProcessorEntry* entry)
|
|||
entry->add_control_state (proc);
|
||||
}
|
||||
|
||||
bool
|
||||
ProcessorBox::is_editor_mixer_strip() const
|
||||
{
|
||||
return _parent_strip && !_parent_strip->mixer_owned();
|
||||
}
|
||||
|
||||
ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* box, boost::weak_ptr<Processor> processor)
|
||||
: WM::ProxyBase (name, string())
|
||||
, marked (false)
|
||||
|
@ -2674,8 +2725,34 @@ ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* b
|
|||
, _processor (processor)
|
||||
, is_custom (false)
|
||||
, want_custom (false)
|
||||
, _valid (true)
|
||||
{
|
||||
boost::shared_ptr<Processor> p = _processor.lock ();
|
||||
if (!p) {
|
||||
return;
|
||||
}
|
||||
p->DropReferences.connect (going_away_connection, MISSING_INVALIDATOR, boost::bind (&ProcessorWindowProxy::processor_going_away, this), gui_context());
|
||||
}
|
||||
|
||||
ProcessorWindowProxy::~ProcessorWindowProxy()
|
||||
{
|
||||
/* processor window proxies do not own the windows they create with
|
||||
* ::get(), so set _window to null before the normal WindowProxy method
|
||||
* deletes it.
|
||||
*/
|
||||
_window = 0;
|
||||
}
|
||||
|
||||
void
|
||||
ProcessorWindowProxy::processor_going_away ()
|
||||
{
|
||||
delete _window;
|
||||
_window = 0;
|
||||
_valid = false;
|
||||
/* should be no real reason to do this, since the object that would
|
||||
send DropReferences is about to be deleted, but lets do it anyway.
|
||||
*/
|
||||
going_away_connection.disconnect();
|
||||
}
|
||||
|
||||
ARDOUR::SessionHandlePtr*
|
||||
|
@ -2685,6 +2762,12 @@ ProcessorWindowProxy::session_handle()
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
ProcessorWindowProxy::valid() const
|
||||
{
|
||||
return _valid;
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
ProcessorWindowProxy::get_state () const
|
||||
{
|
||||
|
|
|
@ -79,6 +79,7 @@ class ProcessorWindowProxy : public WM::ProxyBase
|
|||
{
|
||||
public:
|
||||
ProcessorWindowProxy (std::string const &, ProcessorBox *, boost::weak_ptr<ARDOUR::Processor>);
|
||||
~ProcessorWindowProxy();
|
||||
|
||||
Gtk::Window* get (bool create = false);
|
||||
|
||||
|
@ -91,6 +92,7 @@ class ProcessorWindowProxy : public WM::ProxyBase
|
|||
void set_custom_ui_mode(bool use_custom) { want_custom = use_custom; }
|
||||
|
||||
bool marked;
|
||||
bool valid () const;
|
||||
|
||||
void set_state (const XMLNode&);
|
||||
XMLNode& get_state () const;
|
||||
|
@ -100,6 +102,10 @@ class ProcessorWindowProxy : public WM::ProxyBase
|
|||
boost::weak_ptr<ARDOUR::Processor> _processor;
|
||||
bool is_custom;
|
||||
bool want_custom;
|
||||
bool _valid;
|
||||
|
||||
void processor_going_away ();
|
||||
PBD::ScopedConnection going_away_connection;
|
||||
};
|
||||
|
||||
class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
|
||||
|
@ -303,6 +309,8 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
|
|||
|
||||
void route_going_away ();
|
||||
|
||||
bool is_editor_mixer_strip() const;
|
||||
|
||||
Gtkmm2ext::DnDVBox<ProcessorEntry> processor_display;
|
||||
Gtk::ScrolledWindow processor_scroller;
|
||||
|
||||
|
@ -404,7 +412,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
|
|||
void route_property_changed (const PBD::PropertyChange&);
|
||||
std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
|
||||
|
||||
std::list<ProcessorWindowProxy*> _processor_window_info;
|
||||
typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies;
|
||||
ProcessorWindowProxies _processor_window_info;
|
||||
|
||||
ProcessorWindowProxy* find_window_proxy (boost::shared_ptr<ARDOUR::Processor>) const;
|
||||
|
||||
void set_processor_ui (boost::shared_ptr<ARDOUR::Processor>, Gtk::Window *);
|
||||
|
|
|
@ -296,7 +296,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
virtual int get_videotl_bar_height () const = 0;
|
||||
virtual void set_video_timeline_height (const int h) = 0;
|
||||
virtual void embed_audio_from_video (std::string, framepos_t n = 0) = 0;
|
||||
virtual void export_video () = 0;
|
||||
virtual void export_video (bool range = false) = 0;
|
||||
|
||||
virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
|
||||
|
||||
|
|
|
@ -1146,7 +1146,7 @@ RCOptionEditor::RCOptionEditor ()
|
|||
|
||||
tsf = new BoolOption (
|
||||
"seamless-loop",
|
||||
_("Do seamless looping (not possible when slaved to MTC, JACK etc)"),
|
||||
_("Do seamless looping (not possible when slaved to MTC, LTC etc)"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_seamless_loop),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_seamless_loop)
|
||||
);
|
||||
|
@ -1456,12 +1456,10 @@ RCOptionEditor::RCOptionEditor ()
|
|||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_monitoring_model)
|
||||
);
|
||||
|
||||
#ifndef __APPLE__
|
||||
/* no JACK monitoring on CoreAudio */
|
||||
if (AudioEngine::instance()->port_engine().can_monitor_input()) {
|
||||
mm->add (HardwareMonitoring, _("via Audio Driver"));
|
||||
}
|
||||
#endif
|
||||
|
||||
mm->add (SoftwareMonitoring, _("ardour"));
|
||||
mm->add (ExternalMonitoring, _("audio hardware"));
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,240 @@
|
|||
/*
|
||||
Copyright (C) 2010 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __gtk2_ardour_session_dialog_h__
|
||||
#define __gtk2_ardour_session_dialog_h__
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <gdkmm/pixbuf.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/expander.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/radiobutton.h>
|
||||
#include <gtkmm/filechooserbutton.h>
|
||||
#include <gtkmm/scrolledwindow.h>
|
||||
#include <gtkmm/treeview.h>
|
||||
#include <gtkmm/treestore.h>
|
||||
#include <gtkmm/checkbutton.h>
|
||||
#include <gtkmm/table.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/spinbutton.h>
|
||||
#include <gtkmm/liststore.h>
|
||||
#include <gtkmm/combobox.h>
|
||||
|
||||
#include "ardour/utils.h"
|
||||
|
||||
#include "ardour_dialog.h"
|
||||
|
||||
class EngineControl;
|
||||
|
||||
class SessionDialog : public ArdourDialog {
|
||||
public:
|
||||
SessionDialog (bool require_new, const std::string& session_name, const std::string& session_path,
|
||||
const std::string& template_name, bool cancel_not_quit);
|
||||
~SessionDialog ();
|
||||
|
||||
void clear_given ();
|
||||
|
||||
std::string session_name (bool& should_be_new);
|
||||
std::string session_folder ();
|
||||
|
||||
bool use_session_template();
|
||||
std::string session_template_name();
|
||||
|
||||
// advanced session options
|
||||
|
||||
bool create_master_bus() const;
|
||||
int master_channel_count() const;
|
||||
|
||||
bool connect_inputs() const;
|
||||
bool limit_inputs_used_for_connection() const;
|
||||
int input_limit_count() const;
|
||||
|
||||
bool connect_outputs() const;
|
||||
bool limit_outputs_used_for_connection() const;
|
||||
int output_limit_count() const;
|
||||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const;
|
||||
|
||||
private:
|
||||
bool new_only;
|
||||
std::string _provided_session_name;
|
||||
std::string _provided_session_path;
|
||||
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
|
||||
Gtk::Button* cancel_button;
|
||||
Gtk::Button* open_button;
|
||||
Gtk::Button* back_button;
|
||||
Gtk::Button* quit_button;
|
||||
|
||||
bool back_button_pressed (GdkEventButton*);
|
||||
|
||||
Gtk::Frame info_frame;
|
||||
|
||||
/* initial choice page */
|
||||
|
||||
void setup_initial_choice_box ();
|
||||
Gtk::VBox ic_vbox;
|
||||
Gtk::Button ic_new_session_button;
|
||||
void new_session_button_clicked ();
|
||||
|
||||
/* recent sessions */
|
||||
|
||||
void setup_existing_session_page ();
|
||||
|
||||
struct RecentSessionsSorter {
|
||||
bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
|
||||
return cmp_nocase(a.first, b.first) == -1;
|
||||
}
|
||||
};
|
||||
|
||||
struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
RecentSessionModelColumns() {
|
||||
add (visible_name);
|
||||
add (tip);
|
||||
add (fullpath);
|
||||
add (sample_rate);
|
||||
add (disk_format);
|
||||
}
|
||||
Gtk::TreeModelColumn<std::string> visible_name;
|
||||
Gtk::TreeModelColumn<std::string> tip;
|
||||
Gtk::TreeModelColumn<std::string> fullpath;
|
||||
Gtk::TreeModelColumn<std::string> sample_rate;
|
||||
Gtk::TreeModelColumn<std::string> disk_format;
|
||||
};
|
||||
|
||||
RecentSessionModelColumns recent_session_columns;
|
||||
Gtk::TreeView recent_session_display;
|
||||
Glib::RefPtr<Gtk::TreeStore> recent_session_model;
|
||||
Gtk::ScrolledWindow recent_scroller;
|
||||
Gtk::Label recent_label;
|
||||
Gtk::FileChooserButton existing_session_chooser;
|
||||
int redisplay_recent_sessions ();
|
||||
void recent_session_row_selected ();
|
||||
void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
|
||||
|
||||
void existing_session_selected ();
|
||||
void session_selected ();
|
||||
|
||||
/* new sessions */
|
||||
|
||||
void setup_new_session_page ();
|
||||
Gtk::Entry new_name_entry;
|
||||
Gtk::FileChooserButton new_folder_chooser;
|
||||
|
||||
struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
SessionTemplateColumns () {
|
||||
add (name);
|
||||
add (path);
|
||||
}
|
||||
|
||||
Gtk::TreeModelColumn<std::string> name;
|
||||
Gtk::TreeModelColumn<std::string> path;
|
||||
};
|
||||
|
||||
SessionTemplateColumns session_template_columns;
|
||||
Glib::RefPtr<Gtk::ListStore> template_model;
|
||||
Gtk::ComboBox template_chooser;
|
||||
|
||||
Gtk::VBox session_new_vbox;
|
||||
Gtk::VBox session_existing_vbox;
|
||||
Gtk::Expander more_new_session_options_button;
|
||||
Gtk::CheckButton use_template_button;
|
||||
std::string load_template_override;
|
||||
|
||||
void more_new_session_options_button_clicked();
|
||||
void new_name_changed ();
|
||||
void new_name_activated ();
|
||||
void populate_session_templates ();
|
||||
|
||||
/* more options for new sessions */
|
||||
|
||||
Gtk::VBox more_options_vbox;
|
||||
|
||||
Gtk::Label chan_count_label_1;
|
||||
Gtk::Label chan_count_label_3;
|
||||
Gtk::Label chan_count_label_4;
|
||||
Gtk::Table advanced_table;
|
||||
Gtk::HBox input_port_limit_hbox;
|
||||
Gtk::VBox input_port_vbox;
|
||||
Gtk::Table input_table;
|
||||
Gtk::HBox input_hbox;
|
||||
|
||||
Gtk::Label bus_label;
|
||||
Gtk::Frame bus_frame;
|
||||
Gtk::Table bus_table;
|
||||
Gtk::HBox bus_hbox;
|
||||
|
||||
Gtk::Label input_label;
|
||||
Gtk::Frame input_frame;
|
||||
Gtk::HBox output_port_limit_hbox;
|
||||
Gtk::VBox output_port_vbox;
|
||||
Gtk::VBox output_conn_vbox;
|
||||
Gtk::VBox output_vbox;
|
||||
Gtk::HBox output_hbox;
|
||||
|
||||
Gtk::Label output_label;
|
||||
Gtk::Frame output_frame;
|
||||
Gtk::VBox advanced_vbox;
|
||||
Gtk::Label advanced_label;
|
||||
|
||||
Gtk::CheckButton _create_master_bus;
|
||||
Gtk::SpinButton _master_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton _connect_inputs;
|
||||
Gtk::CheckButton _limit_input_ports;
|
||||
Gtk::SpinButton _input_limit_count;
|
||||
|
||||
Gtk::CheckButton _connect_outputs;
|
||||
Gtk::CheckButton _limit_output_ports;
|
||||
Gtk::SpinButton _output_limit_count;
|
||||
|
||||
Gtk::RadioButtonGroup connect_outputs_group;
|
||||
Gtk::RadioButton _connect_outputs_to_master;
|
||||
Gtk::RadioButton _connect_outputs_to_physical;
|
||||
|
||||
Gtk::Adjustment _output_limit_count_adj;
|
||||
Gtk::Adjustment _input_limit_count_adj;
|
||||
Gtk::Adjustment _master_bus_channel_count_adj;
|
||||
|
||||
void connect_inputs_clicked ();
|
||||
void connect_outputs_clicked ();
|
||||
void limit_inputs_clicked ();
|
||||
void limit_outputs_clicked ();
|
||||
void master_bus_button_clicked ();
|
||||
void setup_more_options_box ();
|
||||
|
||||
/* always there */
|
||||
|
||||
Glib::RefPtr<Pango::Layout> layout;
|
||||
|
||||
bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used
|
||||
|
||||
Gtk::Label info_scroller_label;
|
||||
std::string::size_type info_scroller_count;
|
||||
bool info_scroller_update();
|
||||
sigc::connection info_scroller_connection;
|
||||
void updates_button_clicked ();
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_session_dialog_h__ */
|
|
@ -334,7 +334,7 @@ SessionOptionEditor::parameter_changed (std::string const & p)
|
|||
{
|
||||
OptionEditor::parameter_changed (p);
|
||||
if (p == "external-sync") {
|
||||
if (Config->get_sync_source() == JACK) {
|
||||
if (Config->get_sync_source() == Engine) {
|
||||
_vpu->set_sensitive(!_session_config->get_external_sync());
|
||||
} else {
|
||||
_vpu->set_sensitive(true);
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#include <sstream>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/stock.h>
|
||||
|
@ -1468,7 +1468,7 @@ SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths
|
|||
|
||||
for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
|
||||
|
||||
char tmpc[MAXPATHLEN+1];
|
||||
char tmpc[PATH_MAX+1];
|
||||
|
||||
snprintf (tmpc, sizeof(tmpc), "%s/%s", tmpdir.c_str(), Glib::path_get_basename (*i).c_str());
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -26,6 +26,7 @@
|
|||
#include <gtkmm/assistant.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/expander.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/radiobutton.h>
|
||||
#include <gtkmm/filechooserbutton.h>
|
||||
|
@ -45,32 +46,10 @@ class EngineControl;
|
|||
|
||||
class ArdourStartup : public Gtk::Assistant {
|
||||
public:
|
||||
ArdourStartup (bool require_new, const std::string& session_name, const std::string& session_path, const std::string& template_name);
|
||||
ArdourStartup ();
|
||||
~ArdourStartup ();
|
||||
|
||||
bool ready_without_display () const;
|
||||
|
||||
std::string session_name (bool& should_be_new);
|
||||
std::string session_folder ();
|
||||
|
||||
bool use_session_template();
|
||||
std::string session_template_name();
|
||||
|
||||
// advanced session options
|
||||
|
||||
bool create_master_bus() const;
|
||||
int master_channel_count() const;
|
||||
|
||||
bool connect_inputs() const;
|
||||
bool limit_inputs_used_for_connection() const;
|
||||
int input_limit_count() const;
|
||||
|
||||
bool connect_outputs() const;
|
||||
bool limit_outputs_used_for_connection() const;
|
||||
int output_limit_count() const;
|
||||
|
||||
bool connect_outs_to_master() const;
|
||||
bool connect_outs_to_physical() const;
|
||||
static bool required ();
|
||||
|
||||
gint response () const {
|
||||
return _response;
|
||||
|
@ -80,17 +59,12 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
gint _response;
|
||||
bool config_modified;
|
||||
bool new_user;
|
||||
bool need_session_info;
|
||||
bool new_only;
|
||||
std::string _provided_session_name;
|
||||
std::string _provided_session_path;
|
||||
|
||||
std::string been_here_before_path () const;
|
||||
static std::string been_here_before_path ();
|
||||
|
||||
void on_apply ();
|
||||
void on_cancel ();
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
void on_prepare (Gtk::Widget*);
|
||||
|
||||
static ArdourStartup *the_startup;
|
||||
|
||||
|
@ -108,15 +82,7 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
Gtk::FileChooserButton* default_dir_chooser;
|
||||
void default_dir_changed();
|
||||
void setup_first_page ();
|
||||
|
||||
/* initial choice page */
|
||||
|
||||
void setup_initial_choice_page ();
|
||||
Gtk::VBox ic_vbox;
|
||||
Gtk::RadioButton ic_new_session_button;
|
||||
Gtk::RadioButton ic_existing_session_button;
|
||||
bool initial_button_clicked(GdkEventButton*);
|
||||
void initial_button_activated();
|
||||
Gtk::FileChooserButton new_folder_chooser;
|
||||
|
||||
/* monitoring choices */
|
||||
|
||||
|
@ -134,134 +100,6 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
Gtk::RadioButton no_monitor_section_button;
|
||||
void setup_monitor_section_choice_page ();
|
||||
|
||||
/* session page (could be new or existing) */
|
||||
|
||||
void setup_session_page ();
|
||||
Gtk::VBox session_vbox;
|
||||
Gtk::HBox session_hbox;
|
||||
|
||||
/* recent sessions */
|
||||
|
||||
void setup_existing_session_page ();
|
||||
|
||||
struct RecentSessionsSorter {
|
||||
bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
|
||||
return cmp_nocase(a.first, b.first) == -1;
|
||||
}
|
||||
};
|
||||
|
||||
struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
RecentSessionModelColumns() {
|
||||
add (visible_name);
|
||||
add (tip);
|
||||
add (fullpath);
|
||||
}
|
||||
Gtk::TreeModelColumn<std::string> visible_name;
|
||||
Gtk::TreeModelColumn<std::string> tip;
|
||||
Gtk::TreeModelColumn<std::string> fullpath;
|
||||
};
|
||||
|
||||
RecentSessionModelColumns recent_session_columns;
|
||||
Gtk::TreeView recent_session_display;
|
||||
Glib::RefPtr<Gtk::TreeStore> recent_session_model;
|
||||
Gtk::ScrolledWindow recent_scroller;
|
||||
Gtk::FileChooserButton existing_session_chooser;
|
||||
int redisplay_recent_sessions ();
|
||||
void recent_session_row_selected ();
|
||||
void recent_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
|
||||
|
||||
void existing_session_selected ();
|
||||
|
||||
/* new sessions */
|
||||
|
||||
void setup_new_session_page ();
|
||||
Gtk::Entry new_name_entry;
|
||||
Gtk::FileChooserButton new_folder_chooser;
|
||||
Gtk::FileChooserButton session_template_chooser;
|
||||
|
||||
struct SessionTemplateColumns : public Gtk::TreeModel::ColumnRecord {
|
||||
SessionTemplateColumns () {
|
||||
add (name);
|
||||
add (path);
|
||||
}
|
||||
|
||||
Gtk::TreeModelColumn<std::string> name;
|
||||
Gtk::TreeModelColumn<std::string> path;
|
||||
};
|
||||
|
||||
SessionTemplateColumns session_template_columns;
|
||||
Glib::RefPtr<Gtk::ListStore> template_model;
|
||||
Gtk::ComboBox template_chooser;
|
||||
|
||||
Gtk::VBox session_new_vbox;
|
||||
Gtk::VBox session_existing_vbox;
|
||||
Gtk::CheckButton more_new_session_options_button;
|
||||
Gtk::RadioButtonGroup session_template_group;
|
||||
Gtk::RadioButton use_session_as_template_button;
|
||||
Gtk::RadioButton use_template_button;
|
||||
std::string load_template_override;
|
||||
|
||||
void more_new_session_options_button_clicked();
|
||||
void new_name_changed ();
|
||||
void populate_session_templates ();
|
||||
|
||||
/* more options for new sessions */
|
||||
|
||||
Gtk::VBox more_options_vbox;
|
||||
|
||||
Gtk::Label chan_count_label_1;
|
||||
Gtk::Label chan_count_label_3;
|
||||
Gtk::Label chan_count_label_4;
|
||||
Gtk::Table advanced_table;
|
||||
Gtk::HBox input_port_limit_hbox;
|
||||
Gtk::VBox input_port_vbox;
|
||||
Gtk::Table input_table;
|
||||
Gtk::HBox input_hbox;
|
||||
|
||||
Gtk::Label bus_label;
|
||||
Gtk::Frame bus_frame;
|
||||
Gtk::Table bus_table;
|
||||
Gtk::HBox bus_hbox;
|
||||
|
||||
Gtk::Label input_label;
|
||||
Gtk::Frame input_frame;
|
||||
Gtk::HBox output_port_limit_hbox;
|
||||
Gtk::VBox output_port_vbox;
|
||||
Gtk::VBox output_conn_vbox;
|
||||
Gtk::VBox output_vbox;
|
||||
Gtk::HBox output_hbox;
|
||||
|
||||
Gtk::Label output_label;
|
||||
Gtk::Frame output_frame;
|
||||
Gtk::VBox advanced_vbox;
|
||||
Gtk::Label advanced_label;
|
||||
|
||||
Gtk::CheckButton _create_master_bus;
|
||||
Gtk::SpinButton _master_bus_channel_count;
|
||||
|
||||
Gtk::CheckButton _connect_inputs;
|
||||
Gtk::CheckButton _limit_input_ports;
|
||||
Gtk::SpinButton _input_limit_count;
|
||||
|
||||
Gtk::CheckButton _connect_outputs;
|
||||
Gtk::CheckButton _limit_output_ports;
|
||||
Gtk::SpinButton _output_limit_count;
|
||||
|
||||
Gtk::RadioButtonGroup connect_outputs_group;
|
||||
Gtk::RadioButton _connect_outputs_to_master;
|
||||
Gtk::RadioButton _connect_outputs_to_physical;
|
||||
|
||||
Gtk::Adjustment _output_limit_count_adj;
|
||||
Gtk::Adjustment _input_limit_count_adj;
|
||||
Gtk::Adjustment _master_bus_channel_count_adj;
|
||||
|
||||
void connect_inputs_clicked ();
|
||||
void connect_outputs_clicked ();
|
||||
void limit_inputs_clicked ();
|
||||
void limit_outputs_clicked ();
|
||||
void master_bus_button_clicked ();
|
||||
void setup_more_options_page ();
|
||||
|
||||
/* final page */
|
||||
|
||||
void setup_final_page ();
|
||||
|
@ -278,21 +116,12 @@ class ArdourStartup : public Gtk::Assistant {
|
|||
gint default_folder_page_index;
|
||||
gint monitoring_page_index;
|
||||
gint monitor_section_page_index;
|
||||
gint session_page_index;
|
||||
gint initial_choice_index;
|
||||
gint final_page_index;
|
||||
gint session_options_page_index;
|
||||
|
||||
void move_along_now ();
|
||||
|
||||
bool _existing_session_chooser_used; ///< set to true when the existing session chooser has been used
|
||||
void setup_prerelease_page ();
|
||||
|
||||
Gtk::Label info_scroller_label;
|
||||
std::string::size_type info_scroller_count;
|
||||
bool info_scroller_update();
|
||||
sigc::connection info_scroller_connection;
|
||||
void updates_button_clicked ();
|
||||
};
|
||||
|
||||
#endif /* __gtk2_ardour_startup_h__ */
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/convert.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <clocale>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <list>
|
||||
#include <sys/stat.h>
|
||||
|
@ -841,3 +842,15 @@ unique_random_color (list<Gdk::Color>& used_colors)
|
|||
/* XXX need throttle here to make sure we don't spin for ever */
|
||||
}
|
||||
}
|
||||
|
||||
string
|
||||
rate_as_string (float r)
|
||||
{
|
||||
char buf[32];
|
||||
if (fmod (r, 1000.0f)) {
|
||||
snprintf (buf, sizeof (buf), "%.1f kHz", r/1000.0);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "%.0f kHz", r/1000.0);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -89,4 +89,6 @@ std::string escape_angled_brackets (std::string const &);
|
|||
|
||||
Gdk::Color unique_random_color (std::list<Gdk::Color> &);
|
||||
|
||||
std::string rate_as_string (float r);
|
||||
|
||||
#endif /* __ardour_gtk_utils_h__ */
|
||||
|
|
|
@ -554,7 +554,7 @@ VideoMonitor::xjadeo_sync_setup ()
|
|||
|
||||
bool my_manual_seek = true;
|
||||
if (_session->config.get_external_sync()) {
|
||||
if (ARDOUR::Config->get_sync_source() == ARDOUR::JACK)
|
||||
if (ARDOUR::Config->get_sync_source() == ARDOUR::Engine)
|
||||
my_manual_seek = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ VideoServerDialog::VideoServerDialog (Session* s)
|
|||
t->attach (cachesize_spinner, 1, 2, 2, 3);
|
||||
|
||||
l = manage (new Label (string_compose(
|
||||
_("%1 relies on an external Video Server for the videotimeline.\nThe server configured in Edit -> Prefereces -> Video is not reachable.\nDo you want ardour to launch 'harvid' on this machine?"), PROGRAM_NAME)
|
||||
_("%1 relies on an external video server for the videotimeline.\nThe server configured in Edit -> Preferences -> Video is not reachable.\nDo you want %1 to launch 'harvid' on this machine?"), PROGRAM_NAME)
|
||||
, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
|
||||
l->set_max_width_chars(80);
|
||||
l->set_line_wrap();
|
||||
|
|
|
@ -194,6 +194,7 @@ ProxyBase::ProxyBase (const string& name, const std::string& menu_name, const XM
|
|||
ProxyBase::~ProxyBase ()
|
||||
{
|
||||
delete vistracker;
|
||||
delete _window;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -348,7 +349,7 @@ ProxyBase::setup ()
|
|||
assert (_window);
|
||||
|
||||
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
|
||||
_window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::handle_win_event));
|
||||
_window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::delete_event_handler));
|
||||
|
||||
if (_width != -1 || _height != -1 || _x_off != -1 || _y_off != -1) {
|
||||
/* cancel any mouse-based positioning */
|
||||
|
@ -368,8 +369,9 @@ ProxyBase::setup ()
|
|||
void
|
||||
ProxyBase::show ()
|
||||
{
|
||||
Gtk::Window* win = get (true);
|
||||
win->show ();
|
||||
get (true);
|
||||
assert (_window);
|
||||
_window->show ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -383,17 +385,19 @@ ProxyBase::maybe_show ()
|
|||
void
|
||||
ProxyBase::show_all ()
|
||||
{
|
||||
Gtk::Window* win = get (true);
|
||||
win->show_all ();
|
||||
get (true);
|
||||
assert (_window);
|
||||
_window->show_all ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ProxyBase::present ()
|
||||
{
|
||||
Gtk::Window* win = get (true);
|
||||
win->show_all ();
|
||||
win->present ();
|
||||
get (true);
|
||||
assert (_window);
|
||||
|
||||
_window->show_all ();
|
||||
_window->present ();
|
||||
|
||||
/* turn off any mouse-based positioning */
|
||||
_window->set_position (Gtk::WIN_POS_NONE);
|
||||
|
@ -402,15 +406,14 @@ ProxyBase::present ()
|
|||
void
|
||||
ProxyBase::hide ()
|
||||
{
|
||||
Gtk::Window* win = get (false);
|
||||
if (win) {
|
||||
if (_window) {
|
||||
save_pos_and_size();
|
||||
win->hide ();
|
||||
_window->hide ();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
|
||||
ProxyBase::delete_event_handler (GdkEventAny* /*ev*/)
|
||||
{
|
||||
hide();
|
||||
return true;
|
||||
|
@ -419,10 +422,9 @@ ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
|
|||
void
|
||||
ProxyBase::save_pos_and_size ()
|
||||
{
|
||||
Gtk::Window* win = get (false);
|
||||
if (win) {
|
||||
win->get_position (_x_off, _y_off);
|
||||
win->get_size (_width, _height);
|
||||
if (_window) {
|
||||
_window->get_position (_x_off, _y_off);
|
||||
_window->get_size (_width, _height);
|
||||
}
|
||||
}
|
||||
/*-----------------------*/
|
||||
|
|
|
@ -122,7 +122,7 @@ class ProxyBase : public ARDOUR::SessionHandlePtr, public sigc::trackable {
|
|||
Gtkmm2ext::VisibilityTracker* vistracker;
|
||||
|
||||
void save_pos_and_size ();
|
||||
bool handle_win_event (GdkEventAny *ev);
|
||||
bool delete_event_handler (GdkEventAny *ev);
|
||||
|
||||
void setup ();
|
||||
};
|
||||
|
|
|
@ -196,6 +196,7 @@ gtk2_ardour_sources = [
|
|||
'search_path_option.cc',
|
||||
'selection.cc',
|
||||
'send_ui.cc',
|
||||
'session_dialog.cc',
|
||||
'session_import_dialog.cc',
|
||||
'session_metadata_dialog.cc',
|
||||
'session_option_editor.cc',
|
||||
|
@ -635,7 +636,7 @@ def build(bld):
|
|||
# Menus
|
||||
menus_argv = []
|
||||
if bld.is_defined('GTKOSX'):
|
||||
menus_argv = [ '-E', '-P', '-DGTKOSX', '-DNOVIDEOTIMELINE' ]
|
||||
menus_argv = [ '-E', '-P', '-DGTKOSX' ]
|
||||
else:
|
||||
menus_argv = [ '-E', '-P' ]
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace ARDOUR {
|
|||
*/
|
||||
bool init (bool with_vst, bool try_optimization, const char* localedir);
|
||||
void init_post_engine ();
|
||||
int cleanup ();
|
||||
void cleanup ();
|
||||
bool no_auto_connect ();
|
||||
void make_property_quarks ();
|
||||
|
||||
|
|
|
@ -239,7 +239,38 @@ class AudioBackend : public PortEngine {
|
|||
* app is undefined or cannot be launched.
|
||||
*/
|
||||
virtual void launch_control_app () = 0;
|
||||
/* Basic state control */
|
||||
|
||||
/* @return a vector of strings that describe the available
|
||||
* MIDI options.
|
||||
*
|
||||
* These can be presented to the user to decide which
|
||||
* MIDI drivers, options etc. can be used. The returned strings
|
||||
* should be thought of as the key to a map of possible
|
||||
* approaches to handling MIDI within the backend. Ensure that
|
||||
* the strings will make sense to the user.
|
||||
*/
|
||||
virtual std::vector<std::string> enumerate_midi_options () const = 0;
|
||||
|
||||
/* Request the use of the MIDI option named @param option, which
|
||||
* should be one of the strings returned by enumerate_midi_options()
|
||||
*
|
||||
* @return zero if successful, non-zero otherwise
|
||||
*/
|
||||
virtual int set_midi_option (const std::string& option) = 0;
|
||||
|
||||
virtual std::string midi_option () const = 0;
|
||||
|
||||
/* State Control */
|
||||
|
||||
/* non-virtual method to avoid possible overrides of default
|
||||
* parameters. See Scott Meyers or other books on C++ to
|
||||
* understand this pattern, or possibly just this:
|
||||
*
|
||||
* http://stackoverflow.com/questions/12139786/good-pratice-default-arguments-for-pure-virtual-method
|
||||
*/
|
||||
int start (bool for_latency_measurement=false) {
|
||||
return _start (for_latency_measurement);
|
||||
}
|
||||
|
||||
/** Start using the device named in the most recent call
|
||||
* to set_device(), with the parameters set by various
|
||||
|
@ -250,9 +281,14 @@ class AudioBackend : public PortEngine {
|
|||
* the AudioEngine referenced by @param engine. These calls will
|
||||
* occur in a thread created by and/or under the control of the backend.
|
||||
*
|
||||
* @param for_latency_measurement if true, the device is being started
|
||||
* to carry out latency measurements and the backend should this
|
||||
* take care to return latency numbers that do not reflect
|
||||
* any existing systemic latency settings.
|
||||
*
|
||||
* Return zero if successful, negative values otherwise.
|
||||
*/
|
||||
virtual int start () = 0;
|
||||
virtual int _start (bool for_latency_measurement) = 0;
|
||||
|
||||
/** Stop using the device currently in use.
|
||||
*
|
||||
|
@ -399,13 +435,25 @@ class AudioBackend : public PortEngine {
|
|||
* stacksize. The thread will begin executing @param func, and will exit
|
||||
* when that function returns.
|
||||
*/
|
||||
virtual int create_process_thread (boost::function<void()> func, AudioBackendNativeThread*, size_t stacksize) = 0;
|
||||
virtual int create_process_thread (boost::function<void()> func) = 0;
|
||||
|
||||
/** Wait for the thread specified by @param thread to exit.
|
||||
/** Wait for all processing threads to exit.
|
||||
*
|
||||
* Return zero on success, non-zero on failure.
|
||||
*/
|
||||
virtual int wait_for_process_thread_exit (AudioBackendNativeThread thread) = 0;
|
||||
virtual int join_process_threads () = 0;
|
||||
|
||||
/** Return true if execution context is in a backend thread
|
||||
*/
|
||||
virtual bool in_process_thread () = 0;
|
||||
|
||||
/** Return the minimum stack size of audio threads in bytes
|
||||
*/
|
||||
static size_t thread_stack_size () { return 100000; }
|
||||
|
||||
/** Return number of processing threads
|
||||
*/
|
||||
virtual uint32_t process_thread_count () = 0;
|
||||
|
||||
virtual void update_latencies () = 0;
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
int discover_backends();
|
||||
std::vector<const AudioBackendInfo*> available_backends() const;
|
||||
std::string current_backend_name () const;
|
||||
boost::shared_ptr<AudioBackend> set_default_backend ();
|
||||
boost::shared_ptr<AudioBackend> set_backend (const std::string&, const std::string& arg1, const std::string& arg2);
|
||||
boost::shared_ptr<AudioBackend> current_backend() const { return _backend; }
|
||||
bool setup_required () const;
|
||||
|
@ -82,8 +83,8 @@ public:
|
|||
* just forward to a backend implementation.
|
||||
*/
|
||||
|
||||
int start ();
|
||||
int stop ();
|
||||
int start (bool for_latency_measurement=false);
|
||||
int stop (bool for_latency_measurement=false);
|
||||
int pause ();
|
||||
int freewheel (bool start_stop);
|
||||
float get_cpu_load() const ;
|
||||
|
@ -100,8 +101,12 @@ public:
|
|||
pframes_t sample_time_at_cycle_start ();
|
||||
pframes_t samples_since_cycle_start ();
|
||||
bool get_sync_offset (pframes_t& offset) const;
|
||||
int create_process_thread (boost::function<void()> func, AudioBackendNativeThread*, size_t stacksize);
|
||||
int wait_for_process_thread_exit (AudioBackendNativeThread);
|
||||
|
||||
int create_process_thread (boost::function<void()> func);
|
||||
int join_process_threads ();
|
||||
bool in_process_thread ();
|
||||
uint32_t process_thread_count ();
|
||||
|
||||
bool is_realtime() const;
|
||||
bool connected() const;
|
||||
|
||||
|
@ -189,7 +194,7 @@ public:
|
|||
|
||||
MTDM* mtdm();
|
||||
int prepare_for_latency_measurement ();
|
||||
void start_latency_detection ();
|
||||
int start_latency_detection ();
|
||||
void stop_latency_detection ();
|
||||
void set_latency_input_port (const std::string&);
|
||||
void set_latency_output_port (const std::string&);
|
||||
|
@ -224,7 +229,9 @@ public:
|
|||
std::string _latency_input_name;
|
||||
std::string _latency_output_name;
|
||||
framecnt_t _latency_signal_latency;
|
||||
bool _stopped_for_latency;
|
||||
bool _started_for_latency;
|
||||
bool _in_destructor;
|
||||
|
||||
void meter_thread ();
|
||||
void start_metering_thread ();
|
||||
|
@ -232,9 +239,6 @@ public:
|
|||
|
||||
static gint m_meter_exit;
|
||||
|
||||
void parameter_changed (const std::string&);
|
||||
PBD::ScopedConnection config_connection;
|
||||
|
||||
typedef std::map<std::string,AudioBackendInfo*> BackendMap;
|
||||
BackendMap _backends;
|
||||
AudioBackendInfo* backend_discover (const std::string&);
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include <glib.h>
|
||||
#include <cassert>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "pbd/semutils.h"
|
||||
|
||||
#include "ardour/types.h"
|
||||
|
@ -59,8 +57,6 @@ class Graph : public SessionHandleRef
|
|||
public:
|
||||
Graph (Session & session);
|
||||
|
||||
uint32_t threads_in_use () const { return _thread_list.size(); }
|
||||
|
||||
void prep();
|
||||
void trigger (GraphNode * n);
|
||||
void rechain (boost::shared_ptr<RouteList>, GraphEdges const &);
|
||||
|
@ -93,7 +89,6 @@ protected:
|
|||
virtual void session_going_away ();
|
||||
|
||||
private:
|
||||
std::list<AudioBackendNativeThread> _thread_list;
|
||||
volatile bool _quit_threads;
|
||||
|
||||
void reset_thread_list ();
|
||||
|
|
|
@ -113,6 +113,9 @@ class Processor : public SessionObject, public Automatable, public Latent
|
|||
void set_ui (void*);
|
||||
void* get_ui () const { return _ui_pointer; }
|
||||
|
||||
void set_owner (SessionObject*);
|
||||
SessionObject* owner() const;
|
||||
|
||||
protected:
|
||||
virtual int set_state_2X (const XMLNode&, int version);
|
||||
|
||||
|
@ -125,6 +128,7 @@ protected:
|
|||
bool _display_to_user;
|
||||
bool _pre_fader; ///< true if this processor is currently placed before the Amp, otherwise false
|
||||
void* _ui_pointer;
|
||||
SessionObject* _owner;
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
|
|
@ -51,7 +51,7 @@ CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5)
|
|||
CONFIG_VARIABLE (bool, timecode_sync_frame_rate, "timecode-sync-frame-rate", true)
|
||||
CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true)
|
||||
CONFIG_VARIABLE (bool, timecode_source_2997, "timecode-source-2997", false)
|
||||
CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
|
||||
CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", Engine)
|
||||
CONFIG_VARIABLE (std::string, ltc_source_port, "ltc-source-port", "system:capture_1")
|
||||
CONFIG_VARIABLE (bool, send_ltc, "send-ltc", false)
|
||||
CONFIG_VARIABLE (bool, ltc_send_continuously, "ltc-send-continuously", true)
|
||||
|
|
|
@ -161,6 +161,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
|
||||
virtual ~Session ();
|
||||
|
||||
static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format);
|
||||
|
||||
std::string path() const { return _path; }
|
||||
std::string name() const { return _name; }
|
||||
std::string snap_name() const { return _current_snapshot_name; }
|
||||
|
@ -509,7 +511,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
static PBD::Signal1<void, framepos_t> EndTimeChanged;
|
||||
|
||||
void request_sync_source (Slave*);
|
||||
bool synced_to_jack() const { return config.get_external_sync() && Config->get_sync_source() == JACK; }
|
||||
bool synced_to_engine() const { return config.get_external_sync() && Config->get_sync_source() == Engine; }
|
||||
|
||||
double transport_speed() const { return _transport_speed; }
|
||||
bool transport_stopped() const { return _transport_speed == 0.0f; }
|
||||
|
@ -879,15 +881,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
|
||||
MIDI::MachineControl& mmc() { return *_mmc; }
|
||||
|
||||
/* Callbacks specifically related to JACK, and called directly
|
||||
* from the JACK audio backend.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
void jack_session_event (jack_session_event_t* event);
|
||||
#endif
|
||||
void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
|
||||
|
||||
protected:
|
||||
friend class AudioEngine;
|
||||
void set_block_size (pframes_t nframes);
|
||||
|
@ -1617,7 +1610,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
|
||||
void setup_ltc ();
|
||||
void setup_click ();
|
||||
void setup_click_state (const XMLNode&);
|
||||
void setup_bundles ();
|
||||
|
||||
static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath);
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
|
|
@ -486,11 +486,11 @@ class MIDIClock_Slave : public Slave {
|
|||
bool _starting;
|
||||
};
|
||||
|
||||
class JACK_Slave : public Slave
|
||||
class Engine_Slave : public Slave
|
||||
{
|
||||
public:
|
||||
JACK_Slave (AudioEngine&);
|
||||
~JACK_Slave ();
|
||||
Engine_Slave (AudioEngine&);
|
||||
~Engine_Slave ();
|
||||
|
||||
bool speed_and_position (double& speed, framepos_t& pos);
|
||||
|
||||
|
|
|
@ -489,7 +489,12 @@ namespace ARDOUR {
|
|||
};
|
||||
|
||||
enum SyncSource {
|
||||
JACK,
|
||||
/* These are "synonyms". It is important for JACK to be first
|
||||
both here and in enums.cc, so that the string "JACK" is
|
||||
correctly recognized in older session and preference files.
|
||||
*/
|
||||
JACK = 0,
|
||||
Engine = 0,
|
||||
MTC,
|
||||
MIDIClock,
|
||||
LTC
|
||||
|
@ -610,16 +615,6 @@ namespace ARDOUR {
|
|||
uint32_t max; //< samples
|
||||
};
|
||||
|
||||
/* PLATFORM SPECIFIC #ifdef's here */
|
||||
|
||||
/** Define the native thread type used on the platform */
|
||||
typedef pthread_t AudioBackendNativeThread;
|
||||
static inline bool self_thread_equal (AudioBackendNativeThread thr) {
|
||||
return pthread_equal (thr, pthread_self());
|
||||
}
|
||||
|
||||
/* PLATFORM SPECIFIC #endif's here */
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
||||
|
||||
|
|
|
@ -80,7 +80,8 @@ AudioEngine::AudioEngine ()
|
|||
, _latency_output_port (0)
|
||||
, _latency_flush_frames (0)
|
||||
, _latency_signal_latency (0)
|
||||
, _started_for_latency (false)
|
||||
, _stopped_for_latency (false)
|
||||
, _in_destructor (false)
|
||||
{
|
||||
g_atomic_int_set (&m_meter_exit, 0);
|
||||
discover_backends ();
|
||||
|
@ -88,15 +89,9 @@ AudioEngine::AudioEngine ()
|
|||
|
||||
AudioEngine::~AudioEngine ()
|
||||
{
|
||||
_in_destructor = true;
|
||||
stop_metering_thread ();
|
||||
drop_backend ();
|
||||
|
||||
config_connection.disconnect ();
|
||||
|
||||
{
|
||||
Glib::Threads::Mutex::Lock tm (_process_lock);
|
||||
session_removed.signal ();
|
||||
stop_metering_thread ();
|
||||
}
|
||||
}
|
||||
|
||||
AudioEngine*
|
||||
|
@ -479,6 +474,7 @@ AudioEngine::discover_backends ()
|
|||
|
||||
Glib::PatternSpec so_extension_pattern("*backend.so");
|
||||
Glib::PatternSpec dylib_extension_pattern("*backend.dylib");
|
||||
Glib::PatternSpec dll_extension_pattern("*backend.dll");
|
||||
|
||||
find_matching_files_in_search_path (backend_search_path (),
|
||||
so_extension_pattern, backend_modules);
|
||||
|
@ -486,6 +482,9 @@ AudioEngine::discover_backends ()
|
|||
find_matching_files_in_search_path (backend_search_path (),
|
||||
dylib_extension_pattern, backend_modules);
|
||||
|
||||
find_matching_files_in_search_path (backend_search_path (),
|
||||
dll_extension_pattern, backend_modules);
|
||||
|
||||
DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for backends in %1\n"), backend_search_path().to_string()));
|
||||
|
||||
for (vector<std::string>::iterator i = backend_modules.begin(); i != backend_modules.end(); ++i) {
|
||||
|
@ -558,6 +557,16 @@ AudioEngine::drop_backend ()
|
|||
}
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioBackend>
|
||||
AudioEngine::set_default_backend ()
|
||||
{
|
||||
if (_backends.empty()) {
|
||||
return boost::shared_ptr<AudioBackend>();
|
||||
}
|
||||
|
||||
return set_backend (_backends.begin()->first, "", "");
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioBackend>
|
||||
AudioEngine::set_backend (const std::string& name, const std::string& arg1, const std::string& arg2)
|
||||
{
|
||||
|
@ -587,7 +596,7 @@ AudioEngine::set_backend (const std::string& name, const std::string& arg1, cons
|
|||
/* BACKEND PROXY WRAPPERS */
|
||||
|
||||
int
|
||||
AudioEngine::start ()
|
||||
AudioEngine::start (bool for_latency)
|
||||
{
|
||||
if (!_backend) {
|
||||
return -1;
|
||||
|
@ -600,7 +609,7 @@ AudioEngine::start ()
|
|||
_processed_frames = 0;
|
||||
last_monitor_check = 0;
|
||||
|
||||
if (_backend->start()) {
|
||||
if (_backend->start (for_latency)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -616,7 +625,7 @@ AudioEngine::start ()
|
|||
|
||||
start_metering_thread ();
|
||||
|
||||
if (!_started_for_latency) {
|
||||
if (!for_latency) {
|
||||
Running(); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
|
@ -624,7 +633,7 @@ AudioEngine::start ()
|
|||
}
|
||||
|
||||
int
|
||||
AudioEngine::stop ()
|
||||
AudioEngine::stop (bool for_latency)
|
||||
{
|
||||
if (!_backend) {
|
||||
return 0;
|
||||
|
@ -645,7 +654,10 @@ AudioEngine::stop ()
|
|||
stop_metering_thread ();
|
||||
|
||||
Port::PortDrop ();
|
||||
Stopped (); /* EMIT SIGNAL */
|
||||
|
||||
if (!for_latency) {
|
||||
Stopped (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -826,21 +838,39 @@ AudioEngine::get_sync_offset (pframes_t& offset) const
|
|||
}
|
||||
|
||||
int
|
||||
AudioEngine::create_process_thread (boost::function<void()> func, AudioBackendNativeThread* thr, size_t stacksize)
|
||||
AudioEngine::create_process_thread (boost::function<void()> func)
|
||||
{
|
||||
if (!_backend) {
|
||||
return -1;
|
||||
}
|
||||
return _backend->create_process_thread (func, thr, stacksize);
|
||||
return _backend->create_process_thread (func);
|
||||
}
|
||||
|
||||
int
|
||||
AudioEngine::wait_for_process_thread_exit (AudioBackendNativeThread thr)
|
||||
AudioEngine::join_process_threads ()
|
||||
{
|
||||
if (!_backend) {
|
||||
return -1;
|
||||
}
|
||||
return _backend->join_process_threads ();
|
||||
}
|
||||
|
||||
bool
|
||||
AudioEngine::in_process_thread ()
|
||||
{
|
||||
if (!_backend) {
|
||||
return false;
|
||||
}
|
||||
return _backend->in_process_thread ();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
AudioEngine::process_thread_count ()
|
||||
{
|
||||
if (!_backend) {
|
||||
return 0;
|
||||
}
|
||||
return _backend->wait_for_process_thread_exit (thr);
|
||||
return _backend->process_thread_count ();
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -982,11 +1012,19 @@ AudioEngine::update_latencies ()
|
|||
void
|
||||
AudioEngine::halted_callback (const char* why)
|
||||
{
|
||||
if (_in_destructor) {
|
||||
/* everything is under control */
|
||||
return;
|
||||
}
|
||||
|
||||
stop_metering_thread ();
|
||||
_running = false;
|
||||
|
||||
Port::PortDrop (); /* EMIT SIGNAL */
|
||||
Halted (why); /* EMIT SIGNAL */
|
||||
|
||||
if (!_started_for_latency) {
|
||||
Halted (why); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1015,23 +1053,26 @@ AudioEngine::mtdm()
|
|||
int
|
||||
AudioEngine::prepare_for_latency_measurement ()
|
||||
{
|
||||
if (!running()) {
|
||||
_started_for_latency = true;
|
||||
if (running()) {
|
||||
_stopped_for_latency = true;
|
||||
stop (true);
|
||||
}
|
||||
|
||||
if (start()) {
|
||||
_started_for_latency = false;
|
||||
return -1;
|
||||
}
|
||||
if (start (true)) {
|
||||
_started_for_latency = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
AudioEngine::start_latency_detection ()
|
||||
{
|
||||
if (prepare_for_latency_measurement ()) {
|
||||
return;
|
||||
if (!running()) {
|
||||
if (prepare_for_latency_measurement ()) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
PortEngine& pe (port_engine());
|
||||
|
@ -1045,27 +1086,32 @@ AudioEngine::start_latency_detection ()
|
|||
PortEngine::PortHandle* in = pe.get_port_by_name (_latency_input_name);
|
||||
|
||||
if (!out || !in) {
|
||||
return;
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* create the ports we will use to read/write data */
|
||||
|
||||
if ((_latency_output_port = pe.register_port ("latency_out", DataType::AUDIO, IsOutput)) == 0) {
|
||||
return;
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
if (pe.connect (_latency_output_port, _latency_output_name)) {
|
||||
pe.unregister_port (_latency_output_port);
|
||||
return;
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
|
||||
const string portname ("latency_in");
|
||||
if ((_latency_input_port = pe.register_port (portname, DataType::AUDIO, IsInput)) == 0) {
|
||||
pe.unregister_port (_latency_output_port);
|
||||
return;
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
if (pe.connect (_latency_input_name, make_port_name_non_relative (portname))) {
|
||||
pe.unregister_port (_latency_output_port);
|
||||
return;
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LatencyRange lr;
|
||||
|
@ -1081,6 +1127,7 @@ AudioEngine::start_latency_detection ()
|
|||
_measuring_latency = true;
|
||||
_latency_flush_frames = samples_per_cycle();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1096,9 +1143,15 @@ AudioEngine::stop_latency_detection ()
|
|||
port_engine().unregister_port (_latency_input_port);
|
||||
_latency_input_port = 0;
|
||||
}
|
||||
if (_started_for_latency) {
|
||||
stop ();
|
||||
|
||||
stop (true);
|
||||
|
||||
if (_stopped_for_latency) {
|
||||
start ();
|
||||
}
|
||||
|
||||
_stopped_for_latency = false;
|
||||
_started_for_latency = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
|
||||
JACK_Slave::JACK_Slave (AudioEngine& e)
|
||||
Engine_Slave::Engine_Slave (AudioEngine& e)
|
||||
: engine (e)
|
||||
{
|
||||
double x;
|
||||
|
@ -35,24 +35,24 @@ JACK_Slave::JACK_Slave (AudioEngine& e)
|
|||
speed_and_position (x, p);
|
||||
}
|
||||
|
||||
JACK_Slave::~JACK_Slave ()
|
||||
Engine_Slave::~Engine_Slave ()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
JACK_Slave::locked() const
|
||||
Engine_Slave::locked() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
JACK_Slave::ok() const
|
||||
Engine_Slave::ok() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
JACK_Slave::speed_and_position (double& sp, framepos_t& position)
|
||||
Engine_Slave::speed_and_position (double& sp, framepos_t& position)
|
||||
{
|
||||
switch (engine.transport_state()) {
|
||||
case TransportStopped:
|
|
@ -336,6 +336,7 @@ setup_enum_writer ()
|
|||
|
||||
REGISTER_ENUM (MTC);
|
||||
REGISTER_ENUM (JACK);
|
||||
REGISTER_ENUM (Engine);
|
||||
REGISTER_ENUM (MIDIClock);
|
||||
REGISTER_ENUM (LTC);
|
||||
REGISTER (_SyncSource);
|
||||
|
|
|
@ -354,9 +354,15 @@ ARDOUR::init_post_engine ()
|
|||
ARDOUR::PluginManager::instance().refresh ();
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR::cleanup ()
|
||||
void
|
||||
ARDOUR::cleanup ()
|
||||
{
|
||||
if (!libardour_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
ARDOUR::AudioEngine::destroy ();
|
||||
|
||||
delete Library;
|
||||
lrdf_cleanup ();
|
||||
delete &ControlProtocolManager::instance();
|
||||
|
@ -368,7 +374,8 @@ ARDOUR::cleanup ()
|
|||
vstfx_exit();
|
||||
#endif
|
||||
PBD::cleanup ();
|
||||
return 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -530,7 +537,11 @@ ARDOUR::get_available_sync_options ()
|
|||
{
|
||||
vector<SyncSource> ret;
|
||||
|
||||
ret.push_back (JACK);
|
||||
boost::shared_ptr<AudioBackend> backend = AudioEngine::instance()->current_backend();
|
||||
if (backend && backend->name() == "JACK") {
|
||||
ret.push_back (Engine);
|
||||
}
|
||||
|
||||
ret.push_back (MTC);
|
||||
ret.push_back (MIDIClock);
|
||||
ret.push_back (LTC);
|
||||
|
|
|
@ -96,29 +96,24 @@ Graph::reset_thread_list ()
|
|||
number of threads.
|
||||
*/
|
||||
|
||||
if (_thread_list.size() == num_threads) {
|
||||
if (AudioEngine::instance()->process_thread_count() == num_threads) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::Threads::Mutex::Lock lm (_session.engine().process_lock());
|
||||
AudioBackendNativeThread a_thread;
|
||||
|
||||
if (!_thread_list.empty()) {
|
||||
if (AudioEngine::instance()->process_thread_count() != 0) {
|
||||
drop_threads ();
|
||||
}
|
||||
|
||||
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), &a_thread, 100000) != 0) {
|
||||
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this)) != 0) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
_thread_list.push_back (a_thread);
|
||||
|
||||
for (uint32_t i = 1; i < num_threads; ++i) {
|
||||
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), &a_thread, 100000) != 0) {
|
||||
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this))) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
_thread_list.push_back (a_thread);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,17 +135,15 @@ Graph::drop_threads ()
|
|||
{
|
||||
_quit_threads = true;
|
||||
|
||||
for (unsigned int i=0; i< _thread_list.size(); i++) {
|
||||
uint32_t thread_count = AudioEngine::instance()->process_thread_count ();
|
||||
|
||||
for (unsigned int i=0; i < thread_count; i++) {
|
||||
_execution_sem.signal ();
|
||||
}
|
||||
|
||||
_callback_start_sem.signal ();
|
||||
|
||||
for (list<AudioBackendNativeThread>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) {
|
||||
AudioEngine::instance()->wait_for_process_thread_exit (*i);
|
||||
}
|
||||
|
||||
_thread_list.clear ();
|
||||
AudioEngine::instance()->join_process_threads ();
|
||||
|
||||
_execution_tokens = 0;
|
||||
|
||||
|
@ -583,10 +576,5 @@ Graph::process_one_route (Route* route)
|
|||
bool
|
||||
Graph::in_process_thread () const
|
||||
{
|
||||
for (list<AudioBackendNativeThread>::const_iterator i = _thread_list.begin (); i != _thread_list.end(); ++i) {
|
||||
if (self_thread_equal (*i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return AudioEngine::instance()->in_process_thread ();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -269,3 +269,15 @@ Processor::set_ui (void* p)
|
|||
{
|
||||
_ui_pointer = p;
|
||||
}
|
||||
|
||||
void
|
||||
Processor::set_owner (SessionObject* o)
|
||||
{
|
||||
_owner = o;
|
||||
}
|
||||
|
||||
SessionObject*
|
||||
Processor::owner() const
|
||||
{
|
||||
return _owner;
|
||||
}
|
||||
|
|
|
@ -149,6 +149,7 @@ Route::init ()
|
|||
*/
|
||||
|
||||
_meter.reset (new PeakMeter (_session, _name));
|
||||
_meter->set_owner (this);
|
||||
_meter->set_display_to_user (false);
|
||||
_meter->activate ();
|
||||
|
||||
|
@ -1011,6 +1012,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
|
|||
}
|
||||
|
||||
_processors.insert (loc, processor);
|
||||
processor->set_owner (this);
|
||||
|
||||
// Set up processor list channels. This will set processor->[input|output]_streams(),
|
||||
// configure redirect ports properly, etc.
|
||||
|
@ -1161,6 +1163,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
|
|||
}
|
||||
|
||||
_processors.insert (loc, *i);
|
||||
(*i)->set_owner (this);
|
||||
|
||||
if ((*i)->active()) {
|
||||
(*i)->activate ();
|
||||
|
@ -2616,6 +2619,7 @@ Route::set_processor_state (const XMLNode& node)
|
|||
|
||||
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
|
||||
|
||||
(*i)->set_owner (this);
|
||||
(*i)->ActiveChanged.connect_same_thread (*this, boost::bind (&Session::update_latency_compensation, &_session, false));
|
||||
|
||||
boost::shared_ptr<PluginInsert> pi;
|
||||
|
|
|
@ -8,20 +8,7 @@ if [ ! -f './tempo.cc' ]; then
|
|||
exit 1;
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
top=`pwd`
|
||||
cd build
|
||||
|
||||
libs='libs'
|
||||
|
||||
export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
|
||||
|
||||
export ARDOUR_CONFIG_PATH=$top:$top/gtk2_ardour:$libs/..:$libs/../gtk2_ardour
|
||||
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
|
||||
export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
|
||||
export ARDOUR_MCP_PATH="../mcp"
|
||||
export ARDOUR_DLL_PATH=$libs
|
||||
export ARDOUR_DATA_PATH=$top/gtk2_ardour:$top/build/gtk2_ardour:.
|
||||
. test-env.sh
|
||||
|
||||
f=""
|
||||
if [ "$1" == "--debug" -o "$1" == "--valgrind" ]; then
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
# Run libardour test suite.
|
||||
#
|
||||
. test-env.sh
|
||||
|
||||
if [ "$1" == "--single" ] || [ "$2" == "--single" ]; then
|
||||
if [ "$1" == "--single" ]; then
|
||||
|
|
|
@ -276,6 +276,21 @@ Session::Session (AudioEngine &eng,
|
|||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
/* if a mix template was provided, then ::create() will
|
||||
* have copied it into the session and we need to load it
|
||||
* so that we have the state ready for ::set_state()
|
||||
* after the engine is started.
|
||||
*
|
||||
* Note that we do NOT try to get the sample rate from
|
||||
* the template at this time, though doing so would
|
||||
* be easy if we decided this was an appropriate part
|
||||
* of a template.
|
||||
*/
|
||||
|
||||
if (!mix_template.empty() && load_state (_current_snapshot_name)) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (load_state (_current_snapshot_name)) {
|
||||
|
@ -393,7 +408,7 @@ Session::immediately_post_engine ()
|
|||
|
||||
_engine.Running.connect_same_thread (*this, boost::bind (&Session::initialize_latencies, this));
|
||||
|
||||
if (synced_to_jack()) {
|
||||
if (synced_to_engine()) {
|
||||
_engine.transport_stop ();
|
||||
}
|
||||
|
||||
|
@ -577,14 +592,21 @@ Session::setup_ltc ()
|
|||
void
|
||||
Session::setup_click ()
|
||||
{
|
||||
XMLNode* child = 0;
|
||||
|
||||
_clicking = false;
|
||||
_click_io.reset (new ClickIO (*this, "click"));
|
||||
_click_gain.reset (new Amp (*this));
|
||||
_click_gain->activate ();
|
||||
|
||||
if (state_tree && (child = find_named_node (*state_tree->root(), "Click")) != 0) {
|
||||
if (state_tree) {
|
||||
setup_click_state (*state_tree->root());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Session::setup_click_state (const XMLNode& node)
|
||||
{
|
||||
const XMLNode* child = 0;
|
||||
|
||||
if ((child = find_named_node (node, "Click")) != 0) {
|
||||
|
||||
/* existing state for Click */
|
||||
int c = 0;
|
||||
|
@ -1406,7 +1428,7 @@ Session::audible_frame () const
|
|||
offset = current_block_size;
|
||||
}
|
||||
|
||||
if (synced_to_jack()) {
|
||||
if (synced_to_engine()) {
|
||||
tf = _engine.transport_frame();
|
||||
} else {
|
||||
tf = _transport_frame;
|
||||
|
|
|
@ -493,9 +493,10 @@ Session::create (const string& session_template, BusProfile* bus_profile)
|
|||
ifstream in(in_path.c_str());
|
||||
|
||||
if (in) {
|
||||
string out_path = _path;
|
||||
out_path += _name;
|
||||
out_path += statefile_suffix;
|
||||
/* no need to call legalize_for_path() since the string
|
||||
* in session_template is already a legal path name
|
||||
*/
|
||||
string out_path = Glib::build_filename (_session_dir->root_path(), _name + statefile_suffix);
|
||||
|
||||
ofstream out(out_path.c_str());
|
||||
|
||||
|
@ -1316,13 +1317,7 @@ Session::set_state (const XMLNode& node, int version)
|
|||
if ((child = find_named_node (node, "Click")) == 0) {
|
||||
warning << _("Session: XML state has no click section") << endmsg;
|
||||
} else if (_click_io) {
|
||||
const XMLNodeList& children (child->children());
|
||||
XMLNodeList::const_iterator i = children.begin();
|
||||
_click_io->set_state (**i, version);
|
||||
++i;
|
||||
if (i != children.end()) {
|
||||
_click_gain->set_state (**i, version);
|
||||
}
|
||||
setup_click_state (node);
|
||||
}
|
||||
|
||||
if ((child = find_named_node (node, ControlProtocolManager::state_node_name)) != 0) {
|
||||
|
@ -3742,3 +3737,68 @@ Session::rename (const std::string& new_name)
|
|||
|
||||
#undef RENAME
|
||||
}
|
||||
|
||||
int
|
||||
Session::get_session_info_from_path (XMLTree& tree, const string& xmlpath)
|
||||
{
|
||||
if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!tree.read (xmlpath)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFormat& data_format)
|
||||
{
|
||||
XMLTree tree;
|
||||
bool found_sr = false;
|
||||
bool found_data_format = false;
|
||||
|
||||
if (get_session_info_from_path (tree, xmlpath)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* sample rate */
|
||||
|
||||
const XMLProperty* prop;
|
||||
if ((prop = tree.root()->property (X_("sample-rate"))) != 0) {
|
||||
sample_rate = atoi (prop->value());
|
||||
found_sr = true;
|
||||
}
|
||||
|
||||
const XMLNodeList& children (tree.root()->children());
|
||||
for (XMLNodeList::const_iterator c = children.begin(); c != children.end(); ++c) {
|
||||
const XMLNode* child = *c;
|
||||
if (child->name() == "Config") {
|
||||
const XMLNodeList& options (child->children());
|
||||
for (XMLNodeList::const_iterator oc = options.begin(); oc != options.end(); ++oc) {
|
||||
const XMLNode* option = *oc;
|
||||
const XMLProperty* name = option->property("name");
|
||||
|
||||
if (!name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name->value() == "native-file-data-format") {
|
||||
const XMLProperty* value = option->property ("value");
|
||||
if (value) {
|
||||
SampleFormat fmt = (SampleFormat) string_2_enum (option->property ("value")->value(), fmt);
|
||||
data_format = fmt;
|
||||
found_data_format = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found_data_format) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return !(found_sr && found_data_format); // zero if they are both found
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ Session::timecode_time (Timecode::Time &t)
|
|||
int
|
||||
Session::backend_sync_callback (TransportState state, framepos_t pos)
|
||||
{
|
||||
bool slave = synced_to_jack();
|
||||
bool slave = synced_to_engine();
|
||||
|
||||
switch (state) {
|
||||
case TransportStopped:
|
||||
|
|
|
@ -86,7 +86,7 @@ Session::request_sync_source (Slave* new_slave)
|
|||
|
||||
seamless = Config->get_seamless_loop ();
|
||||
|
||||
if (dynamic_cast<JACK_Slave*>(new_slave)) {
|
||||
if (dynamic_cast<Engine_Slave*>(new_slave)) {
|
||||
/* JACK cannot support seamless looping at present */
|
||||
Config->set_seamless_loop (false);
|
||||
} else {
|
||||
|
@ -514,13 +514,13 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
|
|||
if (auto_return_enabled ||
|
||||
(ptw & PostTransportLocate) ||
|
||||
(_requested_return_frame >= 0) ||
|
||||
synced_to_jack()) {
|
||||
synced_to_engine()) {
|
||||
|
||||
if (pending_locate_flush) {
|
||||
flush_all_inserts ();
|
||||
}
|
||||
|
||||
if ((auto_return_enabled || synced_to_jack() || _requested_return_frame >= 0) &&
|
||||
if ((auto_return_enabled || synced_to_engine() || _requested_return_frame >= 0) &&
|
||||
!(ptw & PostTransportLocate)) {
|
||||
|
||||
/* no explicit locate queued */
|
||||
|
@ -543,7 +543,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
|
|||
|
||||
/* don't try to handle loop play when synced to JACK */
|
||||
|
||||
if (!synced_to_jack()) {
|
||||
if (!synced_to_engine()) {
|
||||
|
||||
Location *location = _locations->auto_loop_location();
|
||||
|
||||
|
@ -734,7 +734,7 @@ Session::set_play_loop (bool yn)
|
|||
return;
|
||||
}
|
||||
|
||||
if (yn && Config->get_seamless_loop() && synced_to_jack()) {
|
||||
if (yn && Config->get_seamless_loop() && synced_to_engine()) {
|
||||
warning << string_compose (
|
||||
_("Seamless looping cannot be supported while %1 is using JACK transport.\n"
|
||||
"Recommend changing the configured options"), PROGRAM_NAME)
|
||||
|
@ -811,7 +811,7 @@ Session::flush_all_inserts ()
|
|||
void
|
||||
Session::start_locate (framepos_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force)
|
||||
{
|
||||
if (synced_to_jack()) {
|
||||
if (synced_to_engine()) {
|
||||
|
||||
double sp;
|
||||
framepos_t pos;
|
||||
|
@ -926,7 +926,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool
|
|||
|
||||
bool transport_was_stopped = !transport_rolling();
|
||||
|
||||
if (transport_was_stopped && (!auto_play_legal || !config.get_auto_play()) && !with_roll && !(synced_to_jack() && play_loop)) {
|
||||
if (transport_was_stopped && (!auto_play_legal || !config.get_auto_play()) && !with_roll && !(synced_to_engine() && play_loop)) {
|
||||
realtime_stop (false, true); // XXX paul - check if the 2nd arg is really correct
|
||||
transport_was_stopped = true;
|
||||
} else {
|
||||
|
@ -1067,7 +1067,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a
|
|||
set_track_monitor_input_status (true);
|
||||
}
|
||||
|
||||
if (synced_to_jack ()) {
|
||||
if (synced_to_engine ()) {
|
||||
if (clear_state) {
|
||||
/* do this here because our response to the slave won't
|
||||
take care of it.
|
||||
|
@ -1090,7 +1090,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a
|
|||
set_track_monitor_input_status (false);
|
||||
}
|
||||
|
||||
if (synced_to_jack()) {
|
||||
if (synced_to_engine()) {
|
||||
_engine.transport_start ();
|
||||
} else {
|
||||
start_transport ();
|
||||
|
@ -1100,7 +1100,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a
|
|||
|
||||
/* not zero, not 1.0 ... varispeed */
|
||||
|
||||
if ((synced_to_jack()) && speed != 0.0 && speed != 1.0) {
|
||||
if ((synced_to_engine()) && speed != 0.0 && speed != 1.0) {
|
||||
warning << string_compose (
|
||||
_("Global varispeed cannot be supported while %1 is connected to JACK transport control"),
|
||||
PROGRAM_NAME)
|
||||
|
@ -1429,8 +1429,8 @@ Session::switch_to_sync_source (SyncSource src)
|
|||
}
|
||||
break;
|
||||
|
||||
case JACK:
|
||||
if (_slave && dynamic_cast<JACK_Slave*>(_slave)) {
|
||||
case Engine:
|
||||
if (_slave && dynamic_cast<Engine_Slave*>(_slave)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ Session::switch_to_sync_source (SyncSource src)
|
|||
return;
|
||||
}
|
||||
|
||||
new_slave = new JACK_Slave (*AudioEngine::instance());
|
||||
new_slave = new Engine_Slave (*AudioEngine::instance());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1632,9 +1632,9 @@ bool
|
|||
Session::maybe_stop (framepos_t limit)
|
||||
{
|
||||
if ((_transport_speed > 0.0f && _transport_frame >= limit) || (_transport_speed < 0.0f && _transport_frame == 0)) {
|
||||
if (synced_to_jack () && config.get_jack_time_master ()) {
|
||||
if (synced_to_engine () && config.get_jack_time_master ()) {
|
||||
_engine.transport_stop ();
|
||||
} else if (!synced_to_jack ()) {
|
||||
} else if (!synced_to_engine ()) {
|
||||
stop_transport ();
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -22,3 +22,4 @@ export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs
|
|||
export ARDOUR_MCP_PATH="../mcp"
|
||||
export ARDOUR_DLL_PATH=$libs
|
||||
export ARDOUR_DATA_PATH=$top/gtk2_ardour:$top/build/gtk2_ardour:.
|
||||
export ARDOUR_BACKEND_PATH=$libs/backends/jack
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "ardour/region.h"
|
||||
#include "ardour/audioregion.h"
|
||||
#include "audio_region_read_test.h"
|
||||
#include "test_globals.h"
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (AudioRegionReadTest);
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "ardour/audioregion.h"
|
||||
#include "ardour/audioplaylist.h"
|
||||
#include "audio_region_test.h"
|
||||
#include "test_globals.h"
|
||||
#include "test_common.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -42,7 +41,7 @@ AudioRegionTest::setUp ()
|
|||
std::string const test_wav_path = Glib::build_filename (new_test_output_dir(), "test.wav");
|
||||
_playlist = PlaylistFactory::create (DataType::AUDIO, *_session, "test");
|
||||
_audio_playlist = boost::dynamic_pointer_cast<AudioPlaylist> (_playlist);
|
||||
_source = SourceFactory::createWritable (DataType::AUDIO, *_session, test_wav_path, "", false, Fs);
|
||||
_source = SourceFactory::createWritable (DataType::AUDIO, *_session, test_wav_path, false, get_test_sample_rate ());
|
||||
|
||||
/* Write a staircase to the source */
|
||||
|
||||
|
|
|
@ -16,11 +16,15 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <glibmm/fileutils.h>
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "pbd/properties.h"
|
||||
#include "pbd/stateful_diff_command.h"
|
||||
#include "ardour/automation_list.h"
|
||||
#include "automation_list_property_test.h"
|
||||
#include "test_util.h"
|
||||
#include "test_common.h"
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (AutomationListPropertyTest);
|
||||
|
||||
|
@ -28,6 +32,16 @@ using namespace std;
|
|||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
|
||||
void
|
||||
write_automation_list_xml (XMLNode* node, std::string filename)
|
||||
{
|
||||
// use the same output dir for all of them
|
||||
static std::string test_output_dir = new_test_output_dir ("automation_list_property");
|
||||
std::string output_file = Glib::build_filename (test_output_dir, filename);
|
||||
|
||||
CPPUNIT_ASSERT (write_ref (node, output_file));
|
||||
}
|
||||
|
||||
void
|
||||
AutomationListPropertyTest::basicTest ()
|
||||
{
|
||||
|
@ -52,9 +66,18 @@ AutomationListPropertyTest::basicTest ()
|
|||
/* Now it has changed */
|
||||
CPPUNIT_ASSERT_EQUAL (true, property.changed());
|
||||
|
||||
std::string test_data_filename = "automation_list_property_test1.ref";
|
||||
std::string test_data_file1 = Glib::build_filename (test_search_path().front(), test_data_filename);
|
||||
CPPUNIT_ASSERT (Glib::file_test (test_data_file1, Glib::FILE_TEST_EXISTS));
|
||||
|
||||
XMLNode* foo = new XMLNode ("test");
|
||||
property.get_changes_as_xml (foo);
|
||||
check_xml (foo, "../libs/ardour/test/data/automation_list_property_test1.ref", ignore_properties);
|
||||
write_automation_list_xml (foo, test_data_filename);
|
||||
check_xml (foo, test_data_file1, ignore_properties);
|
||||
|
||||
test_data_filename = "automation_list_property_test2.ref";
|
||||
std::string test_data_file2 = Glib::build_filename (test_search_path().front(), test_data_filename);
|
||||
CPPUNIT_ASSERT (Glib::file_test (test_data_file2, Glib::FILE_TEST_EXISTS));
|
||||
|
||||
/* Do some more */
|
||||
property.clear_changes ();
|
||||
|
@ -64,7 +87,8 @@ AutomationListPropertyTest::basicTest ()
|
|||
CPPUNIT_ASSERT_EQUAL (true, property.changed());
|
||||
foo = new XMLNode ("test");
|
||||
property.get_changes_as_xml (foo);
|
||||
check_xml (foo, "../libs/ardour/test/data/automation_list_property_test2.ref", ignore_properties);
|
||||
write_automation_list_xml (foo, test_data_filename);
|
||||
check_xml (foo, test_data_file2, ignore_properties);
|
||||
}
|
||||
|
||||
/** Here's a StatefulDestructible class that has a AutomationListProperty */
|
||||
|
@ -119,11 +143,21 @@ AutomationListPropertyTest::undoTest ()
|
|||
sheila->_jim->add (7, 8);
|
||||
StatefulDiffCommand sdc (sheila);
|
||||
|
||||
std::string test_data_filename = "automation_list_property_test3.ref";
|
||||
std::string test_data_file3 = Glib::build_filename (test_search_path().front(), test_data_filename);
|
||||
CPPUNIT_ASSERT (Glib::file_test (test_data_file3, Glib::FILE_TEST_EXISTS));
|
||||
|
||||
/* Undo */
|
||||
sdc.undo ();
|
||||
check_xml (&sheila->get_state(), "../libs/ardour/test/data/automation_list_property_test3.ref", ignore_properties);
|
||||
write_automation_list_xml (&sheila->get_state(), test_data_filename);
|
||||
check_xml (&sheila->get_state(), test_data_file3, ignore_properties);
|
||||
|
||||
test_data_filename = "automation_list_property_test4.ref";
|
||||
std::string test_data_file4 = Glib::build_filename (test_search_path().front(), test_data_filename);
|
||||
CPPUNIT_ASSERT (Glib::file_test (test_data_file4, Glib::FILE_TEST_EXISTS));
|
||||
|
||||
/* Redo */
|
||||
sdc.redo ();
|
||||
check_xml (&sheila->get_state(), "../libs/ardour/test/data/automation_list_property_test4.ref", ignore_properties);
|
||||
write_automation_list_xml (&sheila->get_state(), test_data_filename);
|
||||
check_xml (&sheila->get_state(), test_data_file4, ignore_properties);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "ardour/ardour.h"
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/session.h"
|
||||
#include "midi++/manager.h"
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
|
@ -41,9 +40,8 @@ int main (int argc, char* argv[])
|
|||
|
||||
AudioEngine::instance()->remove_session ();
|
||||
delete s;
|
||||
AudioEngine::instance()->stop (true);
|
||||
AudioEngine::instance()->stop ();
|
||||
|
||||
MIDI::Manager::destroy ();
|
||||
AudioEngine::destroy ();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "ardour/audioregion.h"
|
||||
#include "ardour/session.h"
|
||||
#include "playlist_read_test.h"
|
||||
#include "test_globals.h"
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (PlaylistReadTest);
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include "ardour/ardour.h"
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/session.h"
|
||||
#include "midi++/manager.h"
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
|
@ -41,9 +40,8 @@ int main (int argc, char* argv[])
|
|||
|
||||
AudioEngine::instance()->remove_session ();
|
||||
delete s;
|
||||
AudioEngine::instance()->stop (true);
|
||||
AudioEngine::instance()->stop ();
|
||||
|
||||
MIDI::Manager::destroy ();
|
||||
AudioEngine::destroy ();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <iostream>
|
||||
#include "midi++/manager.h"
|
||||
#include "pbd/textreceiver.h"
|
||||
#include "pbd/compose.h"
|
||||
#include "pbd/enumwriter.h"
|
||||
|
@ -31,7 +30,7 @@ main (int argc, char* argv[])
|
|||
cout << "INFO: " << session->get_routes()->size() << " routes.\n";
|
||||
|
||||
for (int i = 0; i < 32768; ++i) {
|
||||
session->process (session->engine().frames_per_cycle ());
|
||||
session->process (session->engine().samples_per_cycle ());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include <stdexcept>
|
||||
#include "midi++/manager.h"
|
||||
|
||||
#include "pbd/textreceiver.h"
|
||||
#include "pbd/file_utils.h"
|
||||
#include "ardour/session.h"
|
||||
|
@ -33,17 +33,12 @@ SessionTest::setUp ()
|
|||
text_receiver.listen_to (fatal);
|
||||
text_receiver.listen_to (warning);
|
||||
|
||||
// this is not a good singleton constructor pattern
|
||||
AudioEngine* engine = 0;
|
||||
|
||||
try {
|
||||
engine = new AudioEngine ("session_test", "");
|
||||
} catch (const AudioEngine::NoBackendAvailable& engine_exception) {
|
||||
cerr << engine_exception.what ();
|
||||
}
|
||||
AudioEngine* engine = AudioEngine::create ();
|
||||
|
||||
CPPUNIT_ASSERT (engine);
|
||||
|
||||
CPPUNIT_ASSERT (engine->set_default_backend());
|
||||
|
||||
init_post_engine ();
|
||||
|
||||
CPPUNIT_ASSERT (engine->start () == 0);
|
||||
|
@ -53,9 +48,8 @@ void
|
|||
SessionTest::tearDown ()
|
||||
{
|
||||
// this is needed or there is a crash in MIDI::Manager::destroy
|
||||
AudioEngine::instance()->stop (true);
|
||||
AudioEngine::instance()->stop ();
|
||||
|
||||
MIDI::Manager::destroy ();
|
||||
AudioEngine::destroy ();
|
||||
}
|
||||
|
||||
|
|
|
@ -37,13 +37,14 @@ test_search_path ()
|
|||
}
|
||||
|
||||
std::string
|
||||
new_test_output_dir ()
|
||||
new_test_output_dir (std::string prefix)
|
||||
{
|
||||
std::string tmp_dir = Glib::build_filename (g_get_tmp_dir(), "ardour_test");
|
||||
std::string dir_name;
|
||||
std::string new_test_dir;
|
||||
do {
|
||||
ostringstream oss;
|
||||
oss << prefix;
|
||||
oss << g_random_int ();
|
||||
dir_name = oss.str();
|
||||
new_test_dir = Glib::build_filename (tmp_dir, dir_name);
|
||||
|
@ -51,3 +52,9 @@ new_test_output_dir ()
|
|||
} while (g_mkdir_with_parents (new_test_dir.c_str(), 0755) != 0);
|
||||
return new_test_dir;
|
||||
}
|
||||
|
||||
int
|
||||
get_test_sample_rate ()
|
||||
{
|
||||
return 44100;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
PBD::SearchPath test_search_path ();
|
||||
|
||||
std::string new_test_output_dir ();
|
||||
std::string new_test_output_dir (std::string prefix = "");
|
||||
|
||||
int get_test_sample_rate ();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
#include "test_globals.h"
|
||||
|
||||
int const Fs = 44100;
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
extern int const Fs;
|
|
@ -1,6 +1,5 @@
|
|||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "midi++/manager.h"
|
||||
#include "pbd/compose.h"
|
||||
#include "pbd/enumwriter.h"
|
||||
#include "ardour/session.h"
|
||||
|
@ -26,8 +25,7 @@ TestNeedingSession::tearDown ()
|
|||
{
|
||||
AudioEngine::instance()->remove_session ();
|
||||
delete _session;
|
||||
AudioEngine::instance()->stop (true);
|
||||
AudioEngine::instance()->stop ();
|
||||
|
||||
MIDI::Manager::destroy ();
|
||||
AudioEngine::destroy ();
|
||||
}
|
||||
|
|
|
@ -60,12 +60,12 @@ check_xml (XMLNode* node, string ref_file, list<string> const & ignore_propertie
|
|||
check_nodes (p, q, ignore_properties);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
write_ref (XMLNode* node, string ref_file)
|
||||
{
|
||||
XMLTree ref;
|
||||
ref.set_root (node);
|
||||
ref.write (ref_file);
|
||||
return ref.write (ref_file);
|
||||
}
|
||||
|
||||
class TestReceiver : public Receiver
|
||||
|
@ -124,7 +124,10 @@ load_session (string dir, string state)
|
|||
*/
|
||||
Config->set_use_lxvst (false);
|
||||
|
||||
AudioEngine* engine = new AudioEngine ("test", "");
|
||||
AudioEngine* engine = AudioEngine::create ();
|
||||
|
||||
CPPUNIT_ASSERT (engine->set_default_backend ());
|
||||
|
||||
init_post_engine ();
|
||||
|
||||
CPPUNIT_ASSERT (engine->start () == 0);
|
||||
|
|
|
@ -8,5 +8,5 @@ namespace ARDOUR {
|
|||
}
|
||||
|
||||
extern void check_xml (XMLNode *, std::string, std::list<std::string> const &);
|
||||
extern void write_ref (XMLNode *, std::string);
|
||||
extern bool write_ref (XMLNode *, std::string);
|
||||
extern ARDOUR::Session* load_session (std::string, std::string);
|
||||
|
|
|
@ -395,12 +395,12 @@ string_to_sync_source (string str)
|
|||
}
|
||||
|
||||
if (str == _("JACK")) {
|
||||
return JACK;
|
||||
return Engine;
|
||||
}
|
||||
|
||||
fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg;
|
||||
/*NOTREACHED*/
|
||||
return JACK;
|
||||
return Engine;
|
||||
}
|
||||
|
||||
/** @param sh Return a short version of the string */
|
||||
|
@ -408,7 +408,10 @@ const char*
|
|||
sync_source_to_string (SyncSource src, bool sh)
|
||||
{
|
||||
switch (src) {
|
||||
case JACK:
|
||||
case Engine:
|
||||
/* no other backends offer sync for now ... deal with this if we
|
||||
* ever have to.
|
||||
*/
|
||||
return _("JACK");
|
||||
|
||||
case MTC:
|
||||
|
|
|
@ -69,6 +69,7 @@ libardour_sources = [
|
|||
'diskstream.cc',
|
||||
'element_import_handler.cc',
|
||||
'element_importer.cc',
|
||||
'engine_slave.cc',
|
||||
'enums.cc',
|
||||
'event_type_map.cc',
|
||||
'export_channel.cc',
|
||||
|
@ -103,7 +104,6 @@ libardour_sources = [
|
|||
'interpolation.cc',
|
||||
'io.cc',
|
||||
'io_processor.cc',
|
||||
'jack_slave.cc',
|
||||
'kmeterdsp.cc',
|
||||
'ladspa_plugin.cc',
|
||||
'location.cc',
|
||||
|
@ -180,7 +180,6 @@ libardour_sources = [
|
|||
'session_events.cc',
|
||||
'session_export.cc',
|
||||
'session_handle.cc',
|
||||
'session_jack.cc',
|
||||
'session_ltc.cc',
|
||||
'session_metadata.cc',
|
||||
'session_midi.cc',
|
||||
|
@ -246,8 +245,6 @@ def configure(conf):
|
|||
autowaf.configure(conf)
|
||||
autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO',
|
||||
atleast_version='0.3.2')
|
||||
autowaf.check_pkg(conf, 'jack', uselib_store='JACK',
|
||||
atleast_version='0.118.2')
|
||||
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
|
||||
autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF',
|
||||
atleast_version='0.4.0')
|
||||
|
@ -298,9 +295,6 @@ def configure(conf):
|
|||
conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H',mandatory=False)
|
||||
conf.check(header_name='sys/statvfs.h', define_name='HAVE_SYS_STATVFS_H',mandatory=False)
|
||||
|
||||
conf.check(header_name='jack/session.h', uselib = [ 'JACK' ],
|
||||
define_name='HAVE_JACK_SESSION')
|
||||
|
||||
conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
|
||||
|
||||
if flac_supported():
|
||||
|
@ -337,11 +331,11 @@ def build(bld):
|
|||
obj.name = 'libardour'
|
||||
obj.target = 'ardour'
|
||||
obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
|
||||
'JACK','SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
|
||||
'SNDFILE','SAMPLERATE','LRDF','AUDIOUNITS',
|
||||
'OSX','BOOST','CURL','DL']
|
||||
obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
|
||||
'libvampplugin','libtaglib','librubberband',
|
||||
'libaudiographer','libltc']
|
||||
'libaudiographer','libltc','libtimecode']
|
||||
obj.vnum = LIBARDOUR_LIB_VERSION
|
||||
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
|
||||
obj.defines = [
|
||||
|
@ -402,9 +396,9 @@ def build(bld):
|
|||
# only build these common sources once
|
||||
testcommon = bld(features = 'cxx')
|
||||
testcommon.includes = obj.includes + ['test', '../pbd', '..']
|
||||
testcommon.source = ['test/test_globals.cc', 'test/testrunner.cc', 'test/test_needing_session.cc',
|
||||
testcommon.source = ['test/testrunner.cc', 'test/test_needing_session.cc',
|
||||
'test/test_common.cc', 'test/dummy_lxvst.cc', 'test/audio_region_test.cc', 'test/test_util.cc']
|
||||
testcommon.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
|
||||
testcommon.uselib = ['CPPUNIT','SIGCPP','GLIBMM','GTHREAD',
|
||||
'SAMPLERATE','XML','LRDF','COREAUDIO']
|
||||
testcommon.use = ['libpbd','libmidipp','libevoral','libvamphost',
|
||||
'libvampplugin','libtaglib','librubberband',
|
||||
|
@ -480,7 +474,7 @@ def build(bld):
|
|||
|
||||
session_load_tester.includes = obj.includes
|
||||
session_load_tester.includes.append ('test')
|
||||
session_load_tester.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
|
||||
session_load_tester.uselib = ['CPPUNIT','SIGCPP','GLIBMM','GTHREAD',
|
||||
'SAMPLERATE','XML','LRDF','COREAUDIO']
|
||||
session_load_tester.use = ['libpbd','libmidipp','ardour']
|
||||
session_load_tester.name = 'libardour-session-load-tester'
|
||||
|
@ -515,7 +509,7 @@ def build(bld):
|
|||
|
||||
profilingobj.includes = obj.includes
|
||||
profilingobj.includes.append ('test')
|
||||
profilingobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
|
||||
profilingobj.uselib = ['CPPUNIT','SIGCPP','GLIBMM','GTHREAD',
|
||||
'SAMPLERATE','XML','LRDF','COREAUDIO']
|
||||
profilingobj.use = ['libpbd','libmidipp','ardour']
|
||||
profilingobj.name = 'libardour-profiling'
|
||||
|
@ -542,7 +536,7 @@ def create_ardour_test_program(bld, includes, name, target, sources):
|
|||
testobj = bld(features = 'cxx cxxprogram')
|
||||
testobj.includes = includes + ['test', '../pbd', '..']
|
||||
testobj.source = sources
|
||||
testobj.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
|
||||
testobj.uselib = ['CPPUNIT','SIGCPP','GLIBMM','GTHREAD',
|
||||
'SAMPLERATE','XML','LRDF','COREAUDIO']
|
||||
testobj.use = ['libpbd','libmidipp','libevoral','libvamphost',
|
||||
'libvampplugin','libtaglib','librubberband',
|
||||
|
|
|
@ -63,7 +63,7 @@ deinstantiate ()
|
|||
static bool
|
||||
already_configured ()
|
||||
{
|
||||
return JackConnection::server_running ();
|
||||
return !JackConnection::in_control ();
|
||||
}
|
||||
|
||||
static ARDOUR::AudioBackendInfo _descriptor = {
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "jack_audiobackend.h"
|
||||
#include "jack_connection.h"
|
||||
#include "jack_utils.h"
|
||||
#include "jack_session.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -45,6 +46,7 @@ using namespace PBD;
|
|||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
|
||||
#define GET_PRIVATE_JACK_POINTER(localvar) jack_client_t* localvar = _jack_connection->jack(); if (!(localvar)) { return; }
|
||||
#define GET_PRIVATE_JACK_POINTER_RET(localvar,r) jack_client_t* localvar = _jack_connection->jack(); if (!(localvar)) { return r; }
|
||||
|
||||
|
@ -63,6 +65,7 @@ JACKAudioBackend::JACKAudioBackend (AudioEngine& e, boost::shared_ptr<JackConnec
|
|||
, _target_systemic_output_latency (0)
|
||||
, _current_sample_rate (0)
|
||||
, _current_buffer_size (0)
|
||||
, _session (0)
|
||||
{
|
||||
_jack_connection->Connected.connect_same_thread (jack_connection_connection, boost::bind (&JACKAudioBackend::when_connected_to_jack, this));
|
||||
_jack_connection->Disconnected.connect_same_thread (disconnect_connection, boost::bind (&JACKAudioBackend::disconnected, this, _1));
|
||||
|
@ -406,6 +409,12 @@ JACKAudioBackend::interleaved () const
|
|||
return false;
|
||||
}
|
||||
|
||||
string
|
||||
JACKAudioBackend::midi_option () const
|
||||
{
|
||||
return _target_midi_option;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
JACKAudioBackend::input_channels () const
|
||||
{
|
||||
|
@ -462,7 +471,7 @@ JACKAudioBackend::raw_buffer_size(DataType t)
|
|||
}
|
||||
|
||||
void
|
||||
JACKAudioBackend::setup_jack_startup_command ()
|
||||
JACKAudioBackend::setup_jack_startup_command (bool for_latency_measurement)
|
||||
{
|
||||
/* first we map the parameters that have been set onto a
|
||||
* JackCommandLineOptions object.
|
||||
|
@ -487,6 +496,8 @@ JACKAudioBackend::setup_jack_startup_command ()
|
|||
options.realtime = true;
|
||||
options.ports_max = 2048;
|
||||
|
||||
ARDOUR::set_midi_option (options, _target_midi_option);
|
||||
|
||||
/* this must always be true for any server instance we start ourselves
|
||||
*/
|
||||
|
||||
|
@ -494,7 +505,7 @@ JACKAudioBackend::setup_jack_startup_command ()
|
|||
|
||||
string cmdline;
|
||||
|
||||
if (!get_jack_command_line_string (options, cmdline)) {
|
||||
if (!get_jack_command_line_string (options, cmdline, for_latency_measurement)) {
|
||||
/* error, somehow - we will still try to start JACK
|
||||
* automatically but it will be without our preferred options
|
||||
*/
|
||||
|
@ -509,12 +520,15 @@ JACKAudioBackend::setup_jack_startup_command ()
|
|||
/* ---- BASIC STATE CONTROL API: start/stop/pause/freewheel --- */
|
||||
|
||||
int
|
||||
JACKAudioBackend::start ()
|
||||
JACKAudioBackend::_start (bool for_latency_measurement)
|
||||
{
|
||||
if (!available()) {
|
||||
|
||||
if (!_jack_connection->server_running()) {
|
||||
setup_jack_startup_command ();
|
||||
if (_jack_connection->in_control()) {
|
||||
/* we will be starting JACK, so set up the
|
||||
command that JACK will use when it (auto-)starts
|
||||
*/
|
||||
setup_jack_startup_command (for_latency_measurement);
|
||||
}
|
||||
|
||||
if (_jack_connection->open ()) {
|
||||
|
@ -591,7 +605,7 @@ JACKAudioBackend::freewheel (bool onoff)
|
|||
}
|
||||
|
||||
if (jack_set_freewheel (_priv_jack, onoff) == 0) {
|
||||
_freewheeling = true;
|
||||
_freewheeling = onoff;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -744,7 +758,8 @@ JACKAudioBackend::jack_timebase_callback (jack_transport_state_t state, pframes_
|
|||
ARDOUR::Session* session = engine.session();
|
||||
|
||||
if (session) {
|
||||
session->jack_timebase_callback (state, nframes, pos, new_position);
|
||||
JACKSession jsession (session);
|
||||
jsession.timebase_callback (state, nframes, pos, new_position);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -789,7 +804,6 @@ JACKAudioBackend::_xrun_callback (void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
void
|
||||
JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
|
||||
{
|
||||
|
@ -797,10 +811,10 @@ JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
|
|||
ARDOUR::Session* session = jab->engine.session();
|
||||
|
||||
if (session) {
|
||||
session->jack_session_event (event);
|
||||
JACKSession jsession (session);
|
||||
jsession.session_event (event);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
JACKAudioBackend::_freewheel_callback (int onoff, void *arg)
|
||||
|
@ -822,25 +836,72 @@ JACKAudioBackend::_latency_callback (jack_latency_callback_mode_t mode, void* ar
|
|||
}
|
||||
|
||||
int
|
||||
JACKAudioBackend::create_process_thread (boost::function<void()> f, pthread_t* thread, size_t stacksize)
|
||||
JACKAudioBackend::create_process_thread (boost::function<void()> f)
|
||||
{
|
||||
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
|
||||
ThreadData* td = new ThreadData (this, f, stacksize);
|
||||
|
||||
if (jack_client_create_thread (_priv_jack, thread, jack_client_real_time_priority (_priv_jack),
|
||||
jack_native_thread_t thread_id;
|
||||
ThreadData* td = new ThreadData (this, f, thread_stack_size());
|
||||
|
||||
if (jack_client_create_thread (_priv_jack, &thread_id, jack_client_real_time_priority (_priv_jack),
|
||||
jack_is_realtime (_priv_jack), _start_process_thread, td)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
_jack_threads.push_back(thread_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
JACKAudioBackend::wait_for_process_thread_exit (AudioBackendNativeThread thr)
|
||||
JACKAudioBackend::join_process_threads ()
|
||||
{
|
||||
void* status;
|
||||
/* this doesn't actively try to stop the thread, it just waits till it exits */
|
||||
return pthread_join (thr, &status);
|
||||
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
|
||||
|
||||
int ret = 0;
|
||||
|
||||
for (std::vector<jack_native_thread_t>::const_iterator i = _jack_threads.begin ();
|
||||
i != _jack_threads.end(); i++) {
|
||||
|
||||
#if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(PLATFORM_WINDOWS)
|
||||
if (jack_client_stop_thread (_priv_jack, *i) != 0) {
|
||||
#else
|
||||
void* status;
|
||||
if (pthread_join (*i, &status) != 0) {
|
||||
#endif
|
||||
error << "AudioEngine: cannot stop process thread" << endmsg;
|
||||
ret += -1;
|
||||
}
|
||||
}
|
||||
|
||||
_jack_threads.clear();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
JACKAudioBackend::in_process_thread ()
|
||||
{
|
||||
for (std::vector<jack_native_thread_t>::const_iterator i = _jack_threads.begin ();
|
||||
i != _jack_threads.end(); i++) {
|
||||
|
||||
#ifdef COMPILER_MINGW
|
||||
if (*i == GetCurrentThread()) {
|
||||
return true;
|
||||
}
|
||||
#else // pthreads
|
||||
if (pthread_equal (*i, pthread_self()) != 0) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
JACKAudioBackend::process_thread_count ()
|
||||
{
|
||||
return _jack_threads.size();
|
||||
}
|
||||
|
||||
void*
|
||||
|
@ -960,6 +1021,7 @@ JACKAudioBackend::disconnected (const char* why)
|
|||
engine.halted_callback (why); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
JACKAudioBackend::cpu_load() const
|
||||
{
|
||||
|
@ -1056,3 +1118,16 @@ JACKAudioBackend::launch_control_app ()
|
|||
args.push_back (appname);
|
||||
Glib::spawn_async ("", args, Glib::SPAWN_SEARCH_PATH);
|
||||
}
|
||||
|
||||
vector<string>
|
||||
JACKAudioBackend::enumerate_midi_options () const
|
||||
{
|
||||
return ARDOUR::enumerate_midi_options ();
|
||||
}
|
||||
|
||||
int
|
||||
JACKAudioBackend::set_midi_option (const string& opt)
|
||||
{
|
||||
_target_midi_option = opt;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -30,15 +30,14 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <jack/jack.h>
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
#include <jack/session.h>
|
||||
#endif
|
||||
|
||||
#include "ardour/audio_backend.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
class JackConnection;
|
||||
class JACKSession;
|
||||
|
||||
class JACKAudioBackend : public AudioBackend {
|
||||
public:
|
||||
|
@ -90,7 +89,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
std::string control_app_name () const;
|
||||
void launch_control_app ();
|
||||
|
||||
int start ();
|
||||
int _start (bool for_latency_measurement);
|
||||
int stop ();
|
||||
int pause ();
|
||||
int freewheel (bool);
|
||||
|
@ -103,8 +102,10 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
size_t raw_buffer_size (DataType t);
|
||||
|
||||
int create_process_thread (boost::function<void()> func, AudioBackendNativeThread*, size_t stacksize);
|
||||
int wait_for_process_thread_exit (AudioBackendNativeThread);
|
||||
int create_process_thread (boost::function<void()> func);
|
||||
int join_process_threads ();
|
||||
bool in_process_thread ();
|
||||
uint32_t process_thread_count ();
|
||||
|
||||
void transport_start ();
|
||||
void transport_stop ();
|
||||
|
@ -148,6 +149,10 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
/* MIDI */
|
||||
|
||||
std::vector<std::string> enumerate_midi_options () const;
|
||||
int set_midi_option (const std::string&);
|
||||
std::string midi_option () const;
|
||||
|
||||
int midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index);
|
||||
int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size);
|
||||
uint32_t get_midi_event_count (void* port_buffer);
|
||||
|
@ -184,6 +189,8 @@ class JACKAudioBackend : public AudioBackend {
|
|||
bool _freewheeling;
|
||||
std::map<DataType,size_t> _raw_buffer_sizes;
|
||||
|
||||
std::vector<jack_native_thread_t> _jack_threads;
|
||||
|
||||
static int _xrun_callback (void *arg);
|
||||
static void* _process_thread (void *arg);
|
||||
static int _sample_rate_callback (pframes_t nframes, void *arg);
|
||||
|
@ -192,9 +199,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg);
|
||||
static void _freewheel_callback (int , void *arg);
|
||||
static void _latency_callback (jack_latency_callback_mode_t, void*);
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
static void _session_callback (jack_session_event_t *event, void *arg);
|
||||
#endif
|
||||
|
||||
void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
|
||||
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
|
||||
|
@ -220,7 +225,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
void* process_thread ();
|
||||
static void* _start_process_thread (void*);
|
||||
|
||||
void setup_jack_startup_command ();
|
||||
void setup_jack_startup_command (bool for_latency_measurement);
|
||||
|
||||
/* pffooo */
|
||||
|
||||
|
@ -236,6 +241,7 @@ class JACKAudioBackend : public AudioBackend {
|
|||
uint32_t _target_systemic_output_latency;
|
||||
uint32_t _current_sample_rate;
|
||||
uint32_t _current_buffer_size;
|
||||
std::string _target_midi_option;
|
||||
|
||||
typedef std::set<std::string> DeviceList;
|
||||
typedef std::map<std::string,DeviceList> DriverDeviceMap;
|
||||
|
@ -257,6 +263,12 @@ class JACKAudioBackend : public AudioBackend {
|
|||
|
||||
void when_connected_to_jack ();
|
||||
PBD::ScopedConnection jack_connection_connection;
|
||||
|
||||
/* Object to manage interactions with Session in a way that
|
||||
keeps JACK out of libardour directly
|
||||
*/
|
||||
|
||||
JACKSession* _session;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -36,6 +36,8 @@ using std::vector;
|
|||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
bool JackConnection::_in_control = false;
|
||||
|
||||
static void jack_halted_callback (void* arg)
|
||||
{
|
||||
JackConnection* jc = static_cast<JackConnection*> (arg);
|
||||
|
@ -54,17 +56,9 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
|
|||
, _client_name (arg1)
|
||||
, session_uuid (arg2)
|
||||
{
|
||||
_in_control = !server_running();
|
||||
}
|
||||
/* See if the server is already up
|
||||
*/
|
||||
|
||||
JackConnection::~JackConnection ()
|
||||
{
|
||||
close ();
|
||||
}
|
||||
|
||||
bool
|
||||
JackConnection::server_running ()
|
||||
{
|
||||
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
|
||||
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa;
|
||||
|
||||
|
@ -83,10 +77,15 @@ JackConnection::server_running ()
|
|||
|
||||
if (status == 0) {
|
||||
jack_client_close (c);
|
||||
return true;
|
||||
_in_control = false;
|
||||
} else {
|
||||
_in_control = true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
JackConnection::~JackConnection ()
|
||||
{
|
||||
close ();
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -106,19 +105,6 @@ JackConnection::open ()
|
|||
global_epa->restore ();
|
||||
}
|
||||
|
||||
/* check to see if the server is already running so that we know if we
|
||||
* are starting it.
|
||||
*/
|
||||
|
||||
jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
|
||||
|
||||
if (status == 0) {
|
||||
_in_control = false;
|
||||
jack_client_close (c);
|
||||
} else {
|
||||
_in_control = true;
|
||||
}
|
||||
|
||||
/* ensure that PATH or equivalent includes likely locations of the JACK
|
||||
* server, in case the user's default does not.
|
||||
*/
|
||||
|
|
|
@ -27,15 +27,13 @@ class JackConnection {
|
|||
void halted_callback ();
|
||||
void halted_info_callback (jack_status_t, const char*);
|
||||
|
||||
bool in_control() const { return _in_control; }
|
||||
static bool in_control() { return _in_control; }
|
||||
|
||||
static bool server_running();
|
||||
|
||||
private:
|
||||
jack_client_t* volatile _jack;
|
||||
std::string _client_name;
|
||||
std::string session_uuid;
|
||||
bool _in_control;
|
||||
static bool _in_control;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 1999-2013 Paul Davis
|
||||
Copyright (C) 2013 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -18,16 +18,11 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifdef WAF_BUILD
|
||||
#include "libardour-config.h"
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <glibmm/miscutils.h>
|
||||
|
||||
#include "jack/jack.h"
|
||||
#include "jack/session.h"
|
||||
#include <jack/jack.h>
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/filename_extensions.h"
|
||||
|
@ -35,12 +30,22 @@
|
|||
#include "ardour/session_directory.h"
|
||||
#include "ardour/tempo.h"
|
||||
|
||||
#include "jack_session.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using std::string;
|
||||
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
JACKSession::JACKSession (Session* s)
|
||||
: SessionHandlePtr (s)
|
||||
{
|
||||
}
|
||||
|
||||
JACKSession::~JACKSession ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Session::jack_session_event (jack_session_event_t* event)
|
||||
JACKSession::session_event (jack_session_event_t* event)
|
||||
{
|
||||
char timebuf[128], *tmp;
|
||||
time_t n;
|
||||
|
@ -54,7 +59,7 @@ Session::jack_session_event (jack_session_event_t* event)
|
|||
|
||||
if (event->type == JackSessionSaveTemplate)
|
||||
{
|
||||
if (save_template( timebuf )) {
|
||||
if (_session->save_template( timebuf )) {
|
||||
event->flags = JackSessionSaveError;
|
||||
} else {
|
||||
string cmd ("ardour3 -P -U ");
|
||||
|
@ -67,10 +72,10 @@ Session::jack_session_event (jack_session_event_t* event)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (save_state (timebuf)) {
|
||||
if (_session->save_state (timebuf)) {
|
||||
event->flags = JackSessionSaveError;
|
||||
} else {
|
||||
std::string xml_path (_session_dir->root_path());
|
||||
std::string xml_path (_session->session_directory().root_path());
|
||||
std::string legalized_filename = legalize_for_path (timebuf) + statefile_suffix;
|
||||
xml_path = Glib::build_filename (xml_path, legalized_filename);
|
||||
|
||||
|
@ -95,66 +100,69 @@ Session::jack_session_event (jack_session_event_t* event)
|
|||
}
|
||||
|
||||
if (event->type == JackSessionSaveAndQuit) {
|
||||
Quit (); /* EMIT SIGNAL */
|
||||
_session->Quit (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
jack_session_event_free( event );
|
||||
jack_session_event_free (event);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Session::jack_timebase_callback (jack_transport_state_t /*state*/,
|
||||
JACKSession::timebase_callback (jack_transport_state_t /*state*/,
|
||||
pframes_t /*nframes*/,
|
||||
jack_position_t* pos,
|
||||
int /*new_position*/)
|
||||
{
|
||||
Timecode::BBT_Time bbt;
|
||||
TempoMap& tempo_map (_session->tempo_map());
|
||||
framepos_t tf = _session->transport_frame ();
|
||||
|
||||
/* BBT info */
|
||||
|
||||
if (_tempo_map) {
|
||||
|
||||
TempoMetric metric (_tempo_map->metric_at (_transport_frame));
|
||||
|
||||
try {
|
||||
_tempo_map->bbt_time_rt (_transport_frame, bbt);
|
||||
|
||||
pos->bar = bbt.bars;
|
||||
pos->beat = bbt.beats;
|
||||
pos->tick = bbt.ticks;
|
||||
|
||||
// XXX still need to set bar_start_tick
|
||||
|
||||
pos->beats_per_bar = metric.meter().divisions_per_bar();
|
||||
pos->beat_type = metric.meter().note_divisor();
|
||||
pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_beat;
|
||||
pos->beats_per_minute = metric.tempo().beats_per_minute();
|
||||
|
||||
pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
|
||||
|
||||
} catch (...) {
|
||||
/* no message */
|
||||
}
|
||||
TempoMetric metric (tempo_map.metric_at (tf));
|
||||
|
||||
try {
|
||||
tempo_map.bbt_time_rt (tf, bbt);
|
||||
|
||||
pos->bar = bbt.bars;
|
||||
pos->beat = bbt.beats;
|
||||
pos->tick = bbt.ticks;
|
||||
|
||||
// XXX still need to set bar_start_tick
|
||||
|
||||
pos->beats_per_bar = metric.meter().divisions_per_bar();
|
||||
pos->beat_type = metric.meter().note_divisor();
|
||||
pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_beat;
|
||||
pos->beats_per_minute = metric.tempo().beats_per_minute();
|
||||
|
||||
pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
|
||||
|
||||
} catch (...) {
|
||||
/* no message */
|
||||
}
|
||||
|
||||
#ifdef HAVE_JACK_VIDEO_SUPPORT
|
||||
//poke audio video ratio so Ardour can track Video Sync
|
||||
pos->audio_frames_per_video_frame = frame_rate() / timecode_frames_per_second();
|
||||
pos->audio_frames_per_video_frame = _session->frame_rate() / _session->timecode_frames_per_second();
|
||||
pos->valid = jack_position_bits_t (pos->valid | JackAudioVideoRatio);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef HAVE_JACK_TIMCODE_SUPPORT
|
||||
/* This is not yet defined in JACK */
|
||||
|
||||
/* Timecode info */
|
||||
|
||||
pos->timecode_offset = config.get_timecode_offset();
|
||||
t.timecode_frame_rate = timecode_frames_per_second();
|
||||
pos->valid = jack_position_bits_t (pos->valid | JackPositionTimecode;
|
||||
pos->timecode_offset = _session->config.get_timecode_offset();
|
||||
t.timecode_frame_rate = _session->timecode_frames_per_second();
|
||||
pos->valid = jack_position_bits_t (pos->valid | JackPositionTimecode);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_JACK_LOOPING_SUPPORT
|
||||
/* This is not yet defined in JACK */
|
||||
if (_transport_speed) {
|
||||
|
||||
if (play_loop) {
|
||||
|
||||
Location* location = _locations.auto_loop_location();
|
||||
Location* location = _session->locations()->auto_loop_location();
|
||||
|
||||
if (location) {
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright (C) 2013 Paul Davis
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __ardour_jack_audiobackend_jack_session_h__
|
||||
#define __ardour_jack_audiobackend_jack_session_h__
|
||||
|
||||
#include <jack/session.h>
|
||||
#include <jack/transport.h>
|
||||
|
||||
#include "ardour/types.h"
|
||||
#include "ardour/session_handle.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
|
||||
class JACKSession : public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
public:
|
||||
JACKSession (ARDOUR::Session* s);
|
||||
~JACKSession ();
|
||||
|
||||
void session_event (jack_session_event_t* event);
|
||||
void timebase_callback (jack_transport_state_t /*state*/,
|
||||
ARDOUR::pframes_t /*nframes*/,
|
||||
jack_position_t* pos,
|
||||
int /*new_position*/);
|
||||
};
|
||||
|
||||
} /* namespace */
|
||||
|
||||
#endif /* __ardour_jack_audiobackend_jack_session_h__ */
|
|
@ -83,6 +83,8 @@ namespace {
|
|||
const char * const dummy_driver_command_line_name = X_("dummy");
|
||||
|
||||
// should we provide more "pretty" names like above?
|
||||
const char * const alsa_seq_midi_driver_name = X_("alsa");
|
||||
const char * const alsa_raw_midi_driver_name = X_("alsarawmidi");
|
||||
const char * const alsaseq_midi_driver_name = X_("seq");
|
||||
const char * const alsaraw_midi_driver_name = X_("raw");
|
||||
const char * const winmme_midi_driver_name = X_("winmme");
|
||||
|
@ -92,6 +94,8 @@ namespace {
|
|||
const char * const default_device_name = X_("Default");
|
||||
}
|
||||
|
||||
static ARDOUR::MidiOptions midi_options;
|
||||
|
||||
std::string
|
||||
get_none_string ()
|
||||
{
|
||||
|
@ -682,7 +686,7 @@ ARDOUR::JackCommandLineOptions::JackCommandLineOptions ()
|
|||
}
|
||||
|
||||
bool
|
||||
ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line)
|
||||
ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& command_line, bool for_latency_measurement)
|
||||
{
|
||||
vector<string> args;
|
||||
|
||||
|
@ -740,6 +744,16 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
}
|
||||
#endif
|
||||
|
||||
if (options.driver == alsa_driver_name) {
|
||||
if (options.midi_driver == alsa_seq_midi_driver_name) {
|
||||
args.push_back ("-X");
|
||||
args.push_back ("alsa_midi");
|
||||
} else if (options.midi_driver == alsa_raw_midi_driver_name) {
|
||||
args.push_back ("-X");
|
||||
args.push_back ("alsarawmidi");
|
||||
}
|
||||
}
|
||||
|
||||
string command_line_driver_name;
|
||||
|
||||
if (!get_jack_command_line_audio_driver_name (options.driver, command_line_driver_name)) {
|
||||
|
@ -811,7 +825,7 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
args.push_back ("-p");
|
||||
args.push_back (to_string (options.period_size, std::dec));
|
||||
|
||||
if (get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
|
||||
if (!for_latency_measurement && get_jack_audio_driver_supports_latency_adjustment (options.driver)) {
|
||||
if (options.input_latency) {
|
||||
args.push_back ("-I");
|
||||
args.push_back (to_string (options.input_latency, std::dec));
|
||||
|
@ -846,10 +860,15 @@ ARDOUR::get_jack_command_line_string (JackCommandLineOptions& options, string& c
|
|||
if (options.soft_mode) {
|
||||
args.push_back ("-s");
|
||||
}
|
||||
}
|
||||
|
||||
if (!options.midi_driver.empty() && options.midi_driver != get_none_string ()) {
|
||||
args.push_back ("-X");
|
||||
args.push_back (options.midi_driver);
|
||||
if (options.driver == alsa_driver_name || options.driver == coreaudio_driver_name) {
|
||||
|
||||
if (options.midi_driver != alsa_seq_midi_driver_name) {
|
||||
if (!options.midi_driver.empty() && options.midi_driver != get_none_string ()) {
|
||||
args.push_back ("-X");
|
||||
args.push_back (options.midi_driver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -900,3 +919,54 @@ ARDOUR::write_jack_config_file (const std::string& config_file_path, const strin
|
|||
jackdrc.close ();
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<string>
|
||||
ARDOUR::enumerate_midi_options ()
|
||||
{
|
||||
if (midi_options.empty()) {
|
||||
#ifdef HAVE_ALSA
|
||||
midi_options.push_back (make_pair (_("(legacy) ALSA raw devices"), alsaraw_midi_driver_name));
|
||||
midi_options.push_back (make_pair (_("(legacy) ALSA sequencer"), alsaseq_midi_driver_name));
|
||||
midi_options.push_back (make_pair (_("ALSA (JACK1, 0.124 and later)"), alsa_seq_midi_driver_name));
|
||||
midi_options.push_back (make_pair (_("ALSA (JACK2, 1.9.8 and later)"), alsa_raw_midi_driver_name));
|
||||
#endif
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
/* Windows folks: what name makes sense here? Are there other
|
||||
choices as well ?
|
||||
*/
|
||||
midi_options.push_back (make_pair (_("Multimedia Extension"), winmme_midi_driver_name));
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
midi_options.push_back (make_pair (_("CoreMIDI"), coremidi_midi_driver_name));
|
||||
#endif
|
||||
}
|
||||
|
||||
vector<string> v;
|
||||
|
||||
v.push_back (get_none_string());
|
||||
|
||||
for (MidiOptions::const_iterator i = midi_options.begin(); i != midi_options.end(); ++i) {
|
||||
v.push_back (i->first);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
int
|
||||
ARDOUR::set_midi_option (ARDOUR::JackCommandLineOptions& options, const string& opt)
|
||||
{
|
||||
if (opt.empty() || opt == get_none_string()) {
|
||||
options.midi_driver = "";
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (MidiOptions::const_iterator i = midi_options.begin(); i != midi_options.end(); ++i) {
|
||||
if (i->first == opt) {
|
||||
options.midi_driver = i->second;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,6 +180,8 @@ namespace ARDOUR {
|
|||
*/
|
||||
bool get_jack_default_server_path (std::string& server_path);
|
||||
|
||||
typedef std::vector<std::pair<std::string,std::string> > MidiOptions;
|
||||
|
||||
/**
|
||||
* @return The name of the jack server config file
|
||||
*/
|
||||
|
@ -228,8 +230,11 @@ namespace ARDOUR {
|
|||
std::string midi_driver;
|
||||
};
|
||||
|
||||
std::vector<std::string> enumerate_midi_options ();
|
||||
int set_midi_option (ARDOUR::JackCommandLineOptions&, const std::string& opt);
|
||||
|
||||
/**
|
||||
* @return true if able to build a valid command line based on options
|
||||
*/
|
||||
bool get_jack_command_line_string (JackCommandLineOptions& options, std::string& command_line);
|
||||
bool get_jack_command_line_string (JackCommandLineOptions& options, std::string& command_line, bool for_latency_measurement);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ def options(opt):
|
|||
autowaf.set_options(opt)
|
||||
|
||||
def configure(conf):
|
||||
autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.121.0')
|
||||
autowaf.configure(conf)
|
||||
|
||||
def build(bld):
|
||||
|
@ -28,10 +29,10 @@ def build(bld):
|
|||
'jack_connection.cc',
|
||||
'jack_audiobackend.cc',
|
||||
'jack_portengine.cc',
|
||||
'jack_utils.cc'
|
||||
'jack_utils.cc',
|
||||
'jack_session.cc',
|
||||
]
|
||||
obj.includes = ['.']
|
||||
obj.cxxflags = [ '-fPIC' ]
|
||||
obj.name = 'jack_audiobackend'
|
||||
obj.target = 'jack_audiobackend'
|
||||
obj.uselib = [ 'JACK' ]
|
||||
|
|
|
@ -120,9 +120,9 @@ UI::UI (string namestr, int *argc, char ***argv)
|
|||
|
||||
UI::~UI ()
|
||||
{
|
||||
_receiver.hangup ();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
UI::caller_is_ui_thread ()
|
||||
{
|
||||
|
@ -265,12 +265,14 @@ UI::run (Receiver &old_receiver)
|
|||
|
||||
Glib::signal_idle().connect (bind_return (mem_fun (old_receiver, &Receiver::hangup), false));
|
||||
|
||||
starting ();
|
||||
if (starting ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_active = true;
|
||||
theMain->run ();
|
||||
_active = false;
|
||||
stopping ();
|
||||
_receiver.hangup ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,8 +152,7 @@ class UI : public AbstractUI<UIRequest>
|
|||
stopping just after we return from it (at the top level)
|
||||
*/
|
||||
|
||||
sigc::signal<void> starting;
|
||||
sigc::signal<void> stopping;
|
||||
virtual int starting() = 0;
|
||||
|
||||
sigc::signal<void> theme_changed;
|
||||
|
||||
|
|
|
@ -7,26 +7,25 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: gtkmm2ext\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-08-15 15:09-0400\n"
|
||||
"PO-Revision-Date: 2012-12-31 01:38+0300\n"
|
||||
"POT-Creation-Date: 2013-10-15 21:33+0400\n"
|
||||
"PO-Revision-Date: 2013-10-15 21:54+0300\n"
|
||||
"Last-Translator: Александр Прокудин <alexandre.prokoudine@gmail.com>\n"
|
||||
"Language-Team: русский <>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); 10<=4 && (n%100<10 || n"
|
||||
"%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
|
||||
#: actions.cc:386
|
||||
msgid "Unknown action name: %1"
|
||||
msgstr "Неизвестное название действия: %1"
|
||||
|
||||
#: binding_proxy.cc:84
|
||||
#, fuzzy
|
||||
msgid "operate controller now"
|
||||
msgstr "включить MIDI-контроллер"
|
||||
msgstr ""
|
||||
|
||||
#: bindable_button.cc:48
|
||||
msgid "button cannot watch state of non-existing Controllable\n"
|
||||
|
@ -36,7 +35,7 @@ msgstr ""
|
|||
msgid "Log"
|
||||
msgstr "Журнал"
|
||||
|
||||
#: gtk_ui.cc:361
|
||||
#: gtk_ui.cc:363
|
||||
msgid ""
|
||||
"\n"
|
||||
"\n"
|
||||
|
@ -46,11 +45,11 @@ msgstr ""
|
|||
"\n"
|
||||
"Комбинация клавиш: "
|
||||
|
||||
#: gtk_ui.cc:633
|
||||
#: gtk_ui.cc:635
|
||||
msgid "Press To Exit"
|
||||
msgstr "Нажмите для выхода"
|
||||
|
||||
#: gtk_ui.cc:669
|
||||
#: gtk_ui.cc:671
|
||||
msgid "I'm sorry %1, I can't do that"
|
||||
msgstr ""
|
||||
|
||||
|
@ -78,21 +77,21 @@ msgstr "Alt"
|
|||
msgid "Meta"
|
||||
msgstr "Meta"
|
||||
|
||||
#: keyboard.cc:139 keyboard.cc:531
|
||||
#: keyboard.cc:139 keyboard.cc:535
|
||||
msgid "Unknown"
|
||||
msgstr "Неизвестно"
|
||||
|
||||
#: keyboard.cc:542
|
||||
#: keyboard.cc:546
|
||||
msgid "key bindings file not found at \"%2\" or contains errors."
|
||||
msgstr ""
|
||||
|
||||
#: tearoff.cc:57
|
||||
msgid "Click to tear this into its own window"
|
||||
msgstr ""
|
||||
msgstr "Щелкните, чтобы превратить эту панель инструментов в плавающее окно"
|
||||
|
||||
#: tearoff.cc:63
|
||||
msgid "Click to put this back in the main window"
|
||||
msgstr ""
|
||||
msgstr "Щелкните, чтобы превратить это плавающее окно в панель инструментов"
|
||||
|
||||
#: textviewer.cc:34
|
||||
msgid "Close"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue