mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 05:06:31 +01:00
Fix broken whitespace (no functional changes).
git-svn-id: svn://localhost/ardour2/branches/3.0@9288 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
847e8f0610
commit
62e730b57a
11 changed files with 561 additions and 560 deletions
|
|
@ -102,7 +102,7 @@ Please consider the possibilities, and perhaps (re)start JACK."));
|
||||||
|
|
||||||
static void export_search_path (const string& base_dir, const char* varname, const char* dir)
|
static void export_search_path (const string& base_dir, const char* varname, const char* dir)
|
||||||
{
|
{
|
||||||
string path;
|
string path;
|
||||||
const char * cstr = getenv (varname);
|
const char * cstr = getenv (varname);
|
||||||
|
|
||||||
if (cstr) {
|
if (cstr) {
|
||||||
|
|
@ -114,7 +114,7 @@ static void export_search_path (const string& base_dir, const char* varname, con
|
||||||
path += base_dir;
|
path += base_dir;
|
||||||
path += dir;
|
path += dir;
|
||||||
|
|
||||||
setenv (varname, path.c_str(), 1);
|
setenv (varname, path.c_str(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
@ -131,7 +131,7 @@ fixup_bundle_environment (int, char* [])
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV"));
|
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV"));
|
||||||
|
|
||||||
set_language_preference ();
|
set_language_preference ();
|
||||||
|
|
||||||
|
|
@ -175,8 +175,8 @@ fixup_bundle_environment (int, char* [])
|
||||||
|
|
||||||
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
|
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
path = user_config_directory().to_string();
|
path = user_config_directory().to_string();
|
||||||
path += ':';
|
path += ':';
|
||||||
path += dir_path;
|
path += dir_path;
|
||||||
path += "/../Resources/icons:";
|
path += "/../Resources/icons:";
|
||||||
path += dir_path;
|
path += dir_path;
|
||||||
|
|
@ -193,22 +193,22 @@ fixup_bundle_environment (int, char* [])
|
||||||
path += "/../Resources";
|
path += "/../Resources";
|
||||||
setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
|
setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
export_search_path (dir_path, "LADSPA_PATH", "/../Plugins");
|
export_search_path (dir_path, "LADSPA_PATH", "/../Plugins");
|
||||||
export_search_path (dir_path, "VAMP_PATH", "/../Frameworks");
|
export_search_path (dir_path, "VAMP_PATH", "/../Frameworks");
|
||||||
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
|
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
|
||||||
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
|
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
|
||||||
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
|
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
|
||||||
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/exports");
|
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/exports");
|
||||||
|
|
||||||
path = dir_path;
|
path = dir_path;
|
||||||
path += "/../Frameworks/clearlooks";
|
path += "/../Frameworks/clearlooks";
|
||||||
|
|
||||||
setenv ("GTK_PATH", path.c_str(), 1);
|
setenv ("GTK_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
/* unset GTK_RC_FILES so that we only load the RC files that we define
|
/* unset GTK_RC_FILES so that we only load the RC files that we define
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsetenv ("GTK_RC_FILES");
|
unsetenv ("GTK_RC_FILES");
|
||||||
|
|
||||||
if (!ARDOUR::translations_are_disabled ()) {
|
if (!ARDOUR::translations_are_disabled ()) {
|
||||||
|
|
||||||
|
|
@ -294,21 +294,21 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV"));
|
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true, "PREBUNDLE_ENV"));
|
||||||
|
|
||||||
Glib::ustring exec_path = argv[0];
|
Glib::ustring exec_path = argv[0];
|
||||||
Glib::ustring dir_path = Glib::path_get_dirname (Glib::path_get_dirname (exec_path));
|
Glib::ustring dir_path = Glib::path_get_dirname (Glib::path_get_dirname (exec_path));
|
||||||
Glib::ustring path;
|
Glib::ustring path;
|
||||||
Glib::ustring userconfigdir = user_config_directory().to_string();
|
Glib::ustring userconfigdir = user_config_directory().to_string();
|
||||||
|
|
||||||
/* ensure that we find any bundled executables (e.g. JACK),
|
/* ensure that we find any bundled executables (e.g. JACK),
|
||||||
and find them before any instances of the same name
|
and find them before any instances of the same name
|
||||||
elsewhere in PATH
|
elsewhere in PATH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* note that this function is POSIX/Linux specific, so using / as
|
/* note that this function is POSIX/Linux specific, so using / as
|
||||||
a dir separator in this context is just fine.
|
a dir separator in this context is just fine.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
path = dir_path;
|
path = dir_path;
|
||||||
path += "/etc:";
|
path += "/etc:";
|
||||||
|
|
@ -319,8 +319,8 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
|
||||||
|
|
||||||
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
|
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
path = userconfigdir;
|
path = userconfigdir;
|
||||||
path += ':';
|
path += ':';
|
||||||
path += dir_path;
|
path += dir_path;
|
||||||
path += "/etc/icons:";
|
path += "/etc/icons:";
|
||||||
path += dir_path;
|
path += dir_path;
|
||||||
|
|
@ -337,29 +337,29 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
|
||||||
path += "/etc";
|
path += "/etc";
|
||||||
setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
|
setenv ("ARDOUR_INSTANT_XML_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
export_search_path (dir_path, "LADSPA_PATH", "/../plugins");
|
export_search_path (dir_path, "LADSPA_PATH", "/../plugins");
|
||||||
export_search_path (dir_path, "VAMP_PATH", "/lib");
|
export_search_path (dir_path, "VAMP_PATH", "/lib");
|
||||||
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
|
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
|
||||||
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
|
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
|
||||||
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
|
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
|
||||||
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/export");
|
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/export");
|
||||||
|
|
||||||
path = dir_path;
|
path = dir_path;
|
||||||
path += "/lib/clearlooks";
|
path += "/lib/clearlooks";
|
||||||
setenv ("GTK_PATH", path.c_str(), 1);
|
setenv ("GTK_PATH", path.c_str(), 1);
|
||||||
|
|
||||||
/* unset GTK_RC_FILES so that we only load the RC files that we define
|
/* unset GTK_RC_FILES so that we only load the RC files that we define
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsetenv ("GTK_RC_FILES");
|
unsetenv ("GTK_RC_FILES");
|
||||||
|
|
||||||
if (!ARDOUR::translations_are_disabled ()) {
|
if (!ARDOUR::translations_are_disabled ()) {
|
||||||
path = dir_path;
|
path = dir_path;
|
||||||
path += "/share/locale";
|
path += "/share/locale";
|
||||||
|
|
||||||
localedir = strdup (path.c_str());
|
localedir = strdup (path.c_str());
|
||||||
setenv ("GTK_LOCALEDIR", localedir, 1);
|
setenv ("GTK_LOCALEDIR", localedir, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write a pango.rc file and tell pango to use it. we'd love
|
/* write a pango.rc file and tell pango to use it. we'd love
|
||||||
to put this into the Ardour.app bundle and leave it there,
|
to put this into the Ardour.app bundle and leave it there,
|
||||||
|
|
@ -374,29 +374,29 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
|
||||||
<< endmsg;
|
<< endmsg;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Glib::ustring mpath;
|
Glib::ustring mpath;
|
||||||
|
|
||||||
path = Glib::build_filename (userconfigdir, "pango.rc");
|
path = Glib::build_filename (userconfigdir, "pango.rc");
|
||||||
|
|
||||||
std::ofstream pangorc (path.c_str());
|
std::ofstream pangorc (path.c_str());
|
||||||
if (!pangorc) {
|
if (!pangorc) {
|
||||||
error << string_compose (_("cannot open pango.rc file %1") , path) << endmsg;
|
error << string_compose (_("cannot open pango.rc file %1") , path) << endmsg;
|
||||||
} else {
|
} else {
|
||||||
mpath = Glib::build_filename (userconfigdir, "pango.modules");
|
mpath = Glib::build_filename (userconfigdir, "pango.modules");
|
||||||
|
|
||||||
pangorc << "[Pango]\nModuleFiles=";
|
pangorc << "[Pango]\nModuleFiles=";
|
||||||
pangorc << mpath << endl;
|
pangorc << mpath << endl;
|
||||||
pangorc.close ();
|
pangorc.close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
setenv ("PANGO_RC_FILE", path.c_str(), 1);
|
setenv ("PANGO_RC_FILE", path.c_str(), 1);
|
||||||
|
|
||||||
/* similar for GDK pixbuf loaders, but there's no RC file required
|
/* similar for GDK pixbuf loaders, but there's no RC file required
|
||||||
to specify where it lives.
|
to specify where it lives.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mpath = Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders");
|
mpath = Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders");
|
||||||
setenv ("GDK_PIXBUF_MODULE_FILE", mpath.c_str(), 1);
|
setenv ("GDK_PIXBUF_MODULE_FILE", mpath.c_str(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -438,10 +438,10 @@ session at this time, because we would lose your connection information.\n"), PR
|
||||||
static void
|
static void
|
||||||
sigpipe_handler (int /*signal*/)
|
sigpipe_handler (int /*signal*/)
|
||||||
{
|
{
|
||||||
/* XXX fix this so that we do this again after a reconnect to JACK
|
/* XXX fix this so that we do this again after a reconnect to JACK
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool done_the_jack_thing = false;
|
static bool done_the_jack_thing = false;
|
||||||
|
|
||||||
if (!done_the_jack_thing) {
|
if (!done_the_jack_thing) {
|
||||||
AudioEngine::instance()->died ();
|
AudioEngine::instance()->died ();
|
||||||
|
|
@ -472,7 +472,7 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
if (!Glib::thread_supported()) {
|
if (!Glib::thread_supported()) {
|
||||||
Glib::thread_init();
|
Glib::thread_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_set_locale ();
|
gtk_set_locale ();
|
||||||
|
|
||||||
|
|
@ -501,9 +501,9 @@ int main (int argc, char *argv[])
|
||||||
text_receiver.listen_to (warning);
|
text_receiver.listen_to (warning);
|
||||||
|
|
||||||
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
|
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
|
||||||
if (getenv ("BOOST_DEBUG")) {
|
if (getenv ("BOOST_DEBUG")) {
|
||||||
boost_debug_shared_ptr_show_live_debugging (true);
|
boost_debug_shared_ptr_show_live_debugging (true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (parse_opts (argc, argv)) {
|
if (parse_opts (argc, argv)) {
|
||||||
|
|
@ -555,7 +555,7 @@ int main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->run (text_receiver);
|
ui->run (text_receiver);
|
||||||
Gtkmm2ext::Application::instance()->cleanup();
|
Gtkmm2ext::Application::instance()->cleanup();
|
||||||
ui = 0;
|
ui = 0;
|
||||||
|
|
||||||
ARDOUR::cleanup ();
|
ARDOUR::cleanup ();
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ AudioTrack::set_diskstream (boost::shared_ptr<Diskstream> ds)
|
||||||
{
|
{
|
||||||
Track::set_diskstream (ds);
|
Track::set_diskstream (ds);
|
||||||
|
|
||||||
_diskstream->set_track (this);
|
_diskstream->set_track (this);
|
||||||
_diskstream->set_destructive (_mode == Destructive);
|
_diskstream->set_destructive (_mode == Destructive);
|
||||||
_diskstream->set_non_layered (_mode == NonLayered);
|
_diskstream->set_non_layered (_mode == NonLayered);
|
||||||
|
|
||||||
|
|
@ -231,9 +231,9 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set rec-enable control *AFTER* setting up diskstream, because it may want to operate
|
/* set rec-enable control *AFTER* setting up diskstream, because it may want to operate
|
||||||
on the diskstream as it sets its own state
|
on the diskstream as it sets its own state
|
||||||
*/
|
*/
|
||||||
|
|
||||||
XMLNodeList nlist;
|
XMLNodeList nlist;
|
||||||
XMLNodeConstIterator niter;
|
XMLNodeConstIterator niter;
|
||||||
|
|
@ -242,14 +242,13 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
|
||||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
|
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
|
||||||
child = *niter;
|
child = *niter;
|
||||||
|
|
||||||
if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
|
if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
|
||||||
if (prop->value() == X_("recenable")) {
|
if (prop->value() == X_("recenable")) {
|
||||||
_rec_enable_control->set_state (*child, version);
|
_rec_enable_control->set_state (*child, version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pending_state = const_cast<XMLNode*> (&node);
|
pending_state = const_cast<XMLNode*> (&node);
|
||||||
|
|
||||||
if (_session.state_of_the_state() & Session::Loading) {
|
if (_session.state_of_the_state() & Session::Loading) {
|
||||||
|
|
@ -375,7 +374,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_active) {
|
if (!_active) {
|
||||||
silence (nframes);
|
silence (nframes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -387,7 +386,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
|
||||||
playback distance to zero, thus causing diskstream::commit
|
playback distance to zero, thus causing diskstream::commit
|
||||||
to do nothing.
|
to do nothing.
|
||||||
*/
|
*/
|
||||||
cerr << name() << " Can't operate at " << transport_frame << " since roll delay is only " << _roll_delay << endl;
|
cerr << name() << " Can't operate at " << transport_frame << " since roll delay is only " << _roll_delay << endl;
|
||||||
return diskstream->process (transport_frame, 0, can_record, rec_monitors_input, need_butler);
|
return diskstream->process (transport_frame, 0, can_record, rec_monitors_input, need_butler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -506,9 +505,11 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
|
||||||
|
|
||||||
/* final argument: don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
|
/* final argument: don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
|
||||||
|
|
||||||
process_output_buffers (bufs, start_frame, end_frame, nframes, (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick,
|
process_output_buffers (
|
||||||
(!diskstream->record_enabled() && _session.transport_rolling()));
|
bufs, start_frame, end_frame, nframes,
|
||||||
|
(!_session.get_record_enabled() || !Config->get_do_not_record_plugins()),
|
||||||
|
declick,
|
||||||
|
(!diskstream->record_enabled() && _session.transport_rolling()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* problem with the diskstream; just be quiet for a bit */
|
/* problem with the diskstream; just be quiet for a bit */
|
||||||
|
|
|
||||||
|
|
@ -96,9 +96,9 @@ _render_callback(void *userData,
|
||||||
}
|
}
|
||||||
|
|
||||||
static OSStatus
|
static OSStatus
|
||||||
_get_beat_and_tempo_callback (void* userData,
|
_get_beat_and_tempo_callback (void* userData,
|
||||||
Float64* outCurrentBeat,
|
Float64* outCurrentBeat,
|
||||||
Float64* outCurrentTempo)
|
Float64* outCurrentTempo)
|
||||||
{
|
{
|
||||||
if (userData) {
|
if (userData) {
|
||||||
return ((AUPlugin*)userData)->get_beat_and_tempo_callback (outCurrentBeat, outCurrentTempo);
|
return ((AUPlugin*)userData)->get_beat_and_tempo_callback (outCurrentBeat, outCurrentTempo);
|
||||||
|
|
@ -109,10 +109,10 @@ _get_beat_and_tempo_callback (void* userData,
|
||||||
|
|
||||||
static OSStatus
|
static OSStatus
|
||||||
_get_musical_time_location_callback (void * userData,
|
_get_musical_time_location_callback (void * userData,
|
||||||
UInt32 * outDeltaSampleOffsetToNextBeat,
|
UInt32 * outDeltaSampleOffsetToNextBeat,
|
||||||
Float32 * outTimeSig_Numerator,
|
Float32 * outTimeSig_Numerator,
|
||||||
UInt32 * outTimeSig_Denominator,
|
UInt32 * outTimeSig_Denominator,
|
||||||
Float64 * outCurrentMeasureDownBeat)
|
Float64 * outCurrentMeasureDownBeat)
|
||||||
{
|
{
|
||||||
if (userData) {
|
if (userData) {
|
||||||
return ((AUPlugin*)userData)->get_musical_time_location_callback (outDeltaSampleOffsetToNextBeat,
|
return ((AUPlugin*)userData)->get_musical_time_location_callback (outDeltaSampleOffsetToNextBeat,
|
||||||
|
|
@ -133,9 +133,10 @@ _get_transport_state_callback (void* userData,
|
||||||
Float64* outCycleEndBeat)
|
Float64* outCycleEndBeat)
|
||||||
{
|
{
|
||||||
if (userData) {
|
if (userData) {
|
||||||
return ((AUPlugin*)userData)->get_transport_state_callback (outIsPlaying, outTransportStateChanged,
|
return ((AUPlugin*)userData)->get_transport_state_callback (
|
||||||
outCurrentSampleInTimeLine, outIsCycling,
|
outIsPlaying, outTransportStateChanged,
|
||||||
outCycleStartBeat, outCycleEndBeat);
|
outCurrentSampleInTimeLine, outIsCycling,
|
||||||
|
outCycleStartBeat, outCycleEndBeat);
|
||||||
}
|
}
|
||||||
return paramErr;
|
return paramErr;
|
||||||
}
|
}
|
||||||
|
|
@ -162,9 +163,11 @@ save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
|
||||||
fd = open (path.c_str(), O_WRONLY|O_CREAT|O_EXCL, 0664);
|
fd = open (path.c_str(), O_WRONLY|O_CREAT|O_EXCL, 0664);
|
||||||
while (fd < 0) {
|
while (fd < 0) {
|
||||||
if (errno == EEXIST) {
|
if (errno == EEXIST) {
|
||||||
error << string_compose (_("Preset file %1 exists; not overwriting"), path);
|
error << string_compose (_("Preset file %1 exists; not overwriting"),
|
||||||
|
path) << endmsg;
|
||||||
} else {
|
} else {
|
||||||
error << string_compose (_("Cannot open preset file %1 (%2)"), path, strerror (errno)) << endmsg;
|
error << string_compose (_("Cannot open preset file %1 (%2)"),
|
||||||
|
path, strerror (errno)) << endmsg;
|
||||||
}
|
}
|
||||||
CFRelease (xmlData);
|
CFRelease (xmlData);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -451,19 +454,19 @@ AUPlugin::init ()
|
||||||
TRACE_API ("count output elements\n");
|
TRACE_API ("count output elements\n");
|
||||||
unit->GetElementCount (kAudioUnitScope_Output, output_elements);
|
unit->GetElementCount (kAudioUnitScope_Output, output_elements);
|
||||||
|
|
||||||
if (input_elements > 0) {
|
if (input_elements > 0) {
|
||||||
AURenderCallbackStruct renderCallbackInfo;
|
AURenderCallbackStruct renderCallbackInfo;
|
||||||
|
|
||||||
renderCallbackInfo.inputProc = _render_callback;
|
renderCallbackInfo.inputProc = _render_callback;
|
||||||
renderCallbackInfo.inputProcRefCon = this;
|
renderCallbackInfo.inputProcRefCon = this;
|
||||||
|
|
||||||
TRACE_API ("set render callback in input scope\n");
|
TRACE_API ("set render callback in input scope\n");
|
||||||
if ((err = unit->SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
|
if ((err = unit->SetProperty (kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
|
||||||
0, (void*) &renderCallbackInfo, sizeof(renderCallbackInfo))) != 0) {
|
0, (void*) &renderCallbackInfo, sizeof(renderCallbackInfo))) != 0) {
|
||||||
cerr << "cannot install render callback (err = " << err << ')' << endl;
|
cerr << "cannot install render callback (err = " << err << ')' << endl;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tell the plugin about tempo/meter/transport callbacks in case it wants them */
|
/* tell the plugin about tempo/meter/transport callbacks in case it wants them */
|
||||||
|
|
||||||
|
|
@ -474,7 +477,7 @@ AUPlugin::init ()
|
||||||
info.musicalTimeLocationProc = _get_musical_time_location_callback;
|
info.musicalTimeLocationProc = _get_musical_time_location_callback;
|
||||||
info.transportStateProc = _get_transport_state_callback;
|
info.transportStateProc = _get_transport_state_callback;
|
||||||
|
|
||||||
//ignore result of this - don't care if the property isn't supported
|
//ignore result of this - don't care if the property isn't supported
|
||||||
TRACE_API ("set host callbacks in global scope\n");
|
TRACE_API ("set host callbacks in global scope\n");
|
||||||
unit->SetProperty (kAudioUnitProperty_HostCallbacks,
|
unit->SetProperty (kAudioUnitProperty_HostCallbacks,
|
||||||
kAudioUnitScope_Global,
|
kAudioUnitScope_Global,
|
||||||
|
|
@ -1214,7 +1217,7 @@ AUPlugin::render_callback(AudioUnitRenderActionFlags*,
|
||||||
{
|
{
|
||||||
const uint8_t* b = ev.buffer();
|
const uint8_t* b = ev.buffer();
|
||||||
unit->MIDIEvent (b[0], b[1], b[2], ev.time());
|
unit->MIDIEvent (b[0], b[1], b[2], ev.time());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -1817,43 +1820,43 @@ GetDictionarySInt32Value(CFDictionaryRef inAUStateDictionary, CFStringRef inDict
|
||||||
static OSStatus
|
static OSStatus
|
||||||
GetAUComponentDescriptionFromStateData(CFPropertyListRef inAUStateData, ComponentDescription * outComponentDescription)
|
GetAUComponentDescriptionFromStateData(CFPropertyListRef inAUStateData, ComponentDescription * outComponentDescription)
|
||||||
{
|
{
|
||||||
CFDictionaryRef auStateDictionary;
|
CFDictionaryRef auStateDictionary;
|
||||||
ComponentDescription tempDesc = {0,0,0,0,0};
|
ComponentDescription tempDesc = {0,0,0,0,0};
|
||||||
SInt32 versionValue;
|
SInt32 versionValue;
|
||||||
Boolean gotValue;
|
Boolean gotValue;
|
||||||
|
|
||||||
if ( (inAUStateData == NULL) || (outComponentDescription == NULL) )
|
if ( (inAUStateData == NULL) || (outComponentDescription == NULL) )
|
||||||
return paramErr;
|
return paramErr;
|
||||||
|
|
||||||
// the property list for AU state data must be of the dictionary type
|
// the property list for AU state data must be of the dictionary type
|
||||||
if (CFGetTypeID(inAUStateData) != CFDictionaryGetTypeID()) {
|
if (CFGetTypeID(inAUStateData) != CFDictionaryGetTypeID()) {
|
||||||
return kAudioUnitErr_InvalidPropertyValue;
|
return kAudioUnitErr_InvalidPropertyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auStateDictionary = (CFDictionaryRef)inAUStateData;
|
auStateDictionary = (CFDictionaryRef)inAUStateData;
|
||||||
|
|
||||||
// first check to make sure that the version of the AU state data is one that we know understand
|
// first check to make sure that the version of the AU state data is one that we know understand
|
||||||
// XXX should I really do this? later versions would probably still hold these ID keys, right?
|
// XXX should I really do this? later versions would probably still hold these ID keys, right?
|
||||||
versionValue = GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetVersionKey), &gotValue);
|
versionValue = GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetVersionKey), &gotValue);
|
||||||
|
|
||||||
if (!gotValue) {
|
if (!gotValue) {
|
||||||
return kAudioUnitErr_InvalidPropertyValue;
|
return kAudioUnitErr_InvalidPropertyValue;
|
||||||
}
|
}
|
||||||
#define kCurrentSavedStateVersion 0
|
#define kCurrentSavedStateVersion 0
|
||||||
if (versionValue != kCurrentSavedStateVersion) {
|
if (versionValue != kCurrentSavedStateVersion) {
|
||||||
return kAudioUnitErr_InvalidPropertyValue;
|
return kAudioUnitErr_InvalidPropertyValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab the ComponentDescription values from the AU state data
|
// grab the ComponentDescription values from the AU state data
|
||||||
tempDesc.componentType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetTypeKey), NULL);
|
tempDesc.componentType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetTypeKey), NULL);
|
||||||
tempDesc.componentSubType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetSubtypeKey), NULL);
|
tempDesc.componentSubType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetSubtypeKey), NULL);
|
||||||
tempDesc.componentManufacturer = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetManufacturerKey), NULL);
|
tempDesc.componentManufacturer = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetManufacturerKey), NULL);
|
||||||
// zero values are illegit for specific ComponentDescriptions, so zero for any value means that there was an error
|
// zero values are illegit for specific ComponentDescriptions, so zero for any value means that there was an error
|
||||||
if ( (tempDesc.componentType == 0) || (tempDesc.componentSubType == 0) || (tempDesc.componentManufacturer == 0) )
|
if ( (tempDesc.componentType == 0) || (tempDesc.componentSubType == 0) || (tempDesc.componentManufacturer == 0) )
|
||||||
return kAudioUnitErr_InvalidPropertyValue;
|
return kAudioUnitErr_InvalidPropertyValue;
|
||||||
|
|
||||||
*outComponentDescription = tempDesc;
|
*outComponentDescription = tempDesc;
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1898,8 +1901,8 @@ static bool au_preset_filter (const string& str, void* arg)
|
||||||
bool
|
bool
|
||||||
check_and_get_preset_name (Component component, const string& pathstr, string& preset_name)
|
check_and_get_preset_name (Component component, const string& pathstr, string& preset_name)
|
||||||
{
|
{
|
||||||
OSStatus status;
|
OSStatus status;
|
||||||
CFPropertyListRef plist;
|
CFPropertyListRef plist;
|
||||||
ComponentDescription presetDesc;
|
ComponentDescription presetDesc;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
|
|
@ -1999,13 +2002,13 @@ AUPlugin::find_presets ()
|
||||||
|
|
||||||
delete preset_files;
|
delete preset_files;
|
||||||
|
|
||||||
/* now fill the vector<string> with the names we have */
|
/* now fill the vector<string> with the names we have */
|
||||||
|
|
||||||
for (UserPresetMap::iterator i = user_preset_map.begin(); i != user_preset_map.end(); ++i) {
|
for (UserPresetMap::iterator i = user_preset_map.begin(); i != user_preset_map.end(); ++i) {
|
||||||
_presets.insert (i->second, Plugin::PresetRecord (i->second, i->first));
|
_presets.insert (i->second, Plugin::PresetRecord (i->second, i->first));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add factory presets */
|
/* add factory presets */
|
||||||
|
|
||||||
for (FactoryPresetMap::iterator i = factory_preset_map.begin(); i != factory_preset_map.end(); ++i) {
|
for (FactoryPresetMap::iterator i = factory_preset_map.begin(); i != factory_preset_map.end(); ++i) {
|
||||||
/* XXX: dubious */
|
/* XXX: dubious */
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,22 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2000 Paul Davis
|
Copyright (C) 2000 Paul Davis
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef WAF_BUILD
|
#ifdef WAF_BUILD
|
||||||
#include "libardour-config.h"
|
#include "libardour-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -78,7 +77,7 @@ open_importable_source (const string& path, framecnt_t samplerate, ARDOUR::SrcQu
|
||||||
/* try libsndfile first, because it can get BWF info from .wav, which ExtAudioFile cannot.
|
/* try libsndfile first, because it can get BWF info from .wav, which ExtAudioFile cannot.
|
||||||
We don't necessarily need that information in an ImportableSource, but it keeps the
|
We don't necessarily need that information in an ImportableSource, but it keeps the
|
||||||
logic the same as in SourceFactory::create()
|
logic the same as in SourceFactory::create()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boost::shared_ptr<SndFileImportableSource> source(new SndFileImportableSource(path));
|
boost::shared_ptr<SndFileImportableSource> source(new SndFileImportableSource(path));
|
||||||
|
|
@ -123,43 +122,43 @@ get_non_existent_filename (HeaderFormat hf, DataType type, const bool allow_repl
|
||||||
bool goodfile = false;
|
bool goodfile = false;
|
||||||
string base = basename;
|
string base = basename;
|
||||||
string ext = native_header_format_extension (hf, type);
|
string ext = native_header_format_extension (hf, type);
|
||||||
uint32_t cnt = 1;
|
uint32_t cnt = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
if (type == DataType::AUDIO && channels == 2) {
|
if (type == DataType::AUDIO && channels == 2) {
|
||||||
if (channel == 0) {
|
if (channel == 0) {
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
snprintf (buf, sizeof(buf), "%s-L%s", base.c_str(), ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-L%s", base.c_str(), ext.c_str());
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof(buf), "%s-%d-L%s", base.c_str(), cnt, ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-%d-L%s", base.c_str(), cnt, ext.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
snprintf (buf, sizeof(buf), "%s-R%s", base.c_str(), ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-R%s", base.c_str(), ext.c_str());
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof(buf), "%s-%d-R%s", base.c_str(), cnt, ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-%d-R%s", base.c_str(), cnt, ext.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (channels > 1) {
|
} else if (channels > 1) {
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
snprintf (buf, sizeof(buf), "%s-c%d%s", base.c_str(), channel, ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-c%d%s", base.c_str(), channel, ext.c_str());
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof(buf), "%s-%d-c%d%s", base.c_str(), cnt, channel, ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-%d-c%d%s", base.c_str(), cnt, channel, ext.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
snprintf (buf, sizeof(buf), "%s%s", base.c_str(), ext.c_str());
|
snprintf (buf, sizeof(buf), "%s%s", base.c_str(), ext.c_str());
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof(buf), "%s-%d%s", base.c_str(), cnt, ext.c_str());
|
snprintf (buf, sizeof(buf), "%s-%d%s", base.c_str(), cnt, ext.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string tempname = destdir + "/" + buf;
|
string tempname = destdir + "/" + buf;
|
||||||
|
|
||||||
if (!allow_replacing && Glib::file_test (tempname, Glib::FILE_TEST_EXISTS)) {
|
if (!allow_replacing && Glib::file_test (tempname, Glib::FILE_TEST_EXISTS)) {
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -184,10 +183,10 @@ get_paths_for_new_sources (HeaderFormat hf, const bool allow_replacing, const st
|
||||||
const DataType type = SMFSource::safe_midi_file_extension (import_file_path) ? DataType::MIDI : DataType::AUDIO;
|
const DataType type = SMFSource::safe_midi_file_extension (import_file_path) ? DataType::MIDI : DataType::AUDIO;
|
||||||
|
|
||||||
std::string filepath = (type == DataType::MIDI)
|
std::string filepath = (type == DataType::MIDI)
|
||||||
? sdir.midi_path().to_string() : sdir.sound_path().to_string();
|
? sdir.midi_path().to_string() : sdir.sound_path().to_string();
|
||||||
|
|
||||||
filepath = Glib::build_filename (filepath,
|
filepath = Glib::build_filename (filepath,
|
||||||
get_non_existent_filename (hf, type, allow_replacing, filepath, basename, n, channels));
|
get_non_existent_filename (hf, type, allow_replacing, filepath, basename, n, channels));
|
||||||
new_paths.push_back (filepath);
|
new_paths.push_back (filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -196,10 +195,10 @@ get_paths_for_new_sources (HeaderFormat hf, const bool allow_replacing, const st
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
map_existing_mono_sources (const vector<string>& new_paths, Session& /*sess*/,
|
map_existing_mono_sources (const vector<string>& new_paths, Session& /*sess*/,
|
||||||
uint /*samplerate*/, vector<boost::shared_ptr<Source> >& newfiles, Session *session)
|
uint /*samplerate*/, vector<boost::shared_ptr<Source> >& newfiles, Session *session)
|
||||||
{
|
{
|
||||||
for (vector<string>::const_iterator i = new_paths.begin();
|
for (vector<string>::const_iterator i = new_paths.begin();
|
||||||
i != new_paths.end(); ++i)
|
i != new_paths.end(); ++i)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Source> source = session->source_by_path_and_channel(*i, 0);
|
boost::shared_ptr<Source> source = session->source_by_path_and_channel(*i, 0);
|
||||||
|
|
||||||
|
|
@ -218,7 +217,7 @@ create_mono_sources_for_writing (const string& origin,
|
||||||
const vector<string>& new_paths,
|
const vector<string>& new_paths,
|
||||||
Session& sess, uint samplerate,
|
Session& sess, uint samplerate,
|
||||||
vector<boost::shared_ptr<Source> >& newfiles,
|
vector<boost::shared_ptr<Source> >& newfiles,
|
||||||
framepos_t timeline_position)
|
framepos_t timeline_position)
|
||||||
{
|
{
|
||||||
for (vector<string>::const_iterator i = new_paths.begin(); i != new_paths.end(); ++i) {
|
for (vector<string>::const_iterator i = new_paths.begin(); i != new_paths.end(); ++i) {
|
||||||
|
|
||||||
|
|
@ -228,10 +227,10 @@ create_mono_sources_for_writing (const string& origin,
|
||||||
const DataType type = SMFSource::safe_midi_file_extension (*i) ? DataType::MIDI : DataType::AUDIO;
|
const DataType type = SMFSource::safe_midi_file_extension (*i) ? DataType::MIDI : DataType::AUDIO;
|
||||||
|
|
||||||
source = SourceFactory::createWritable (type, sess,
|
source = SourceFactory::createWritable (type, sess,
|
||||||
i->c_str(),
|
i->c_str(),
|
||||||
origin,
|
origin,
|
||||||
false, // destructive
|
false, // destructive
|
||||||
samplerate);
|
samplerate);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (const failed_constructor& err) {
|
catch (const failed_constructor& err) {
|
||||||
|
|
@ -241,30 +240,30 @@ create_mono_sources_for_writing (const string& origin,
|
||||||
|
|
||||||
newfiles.push_back(boost::dynamic_pointer_cast<Source>(source));
|
newfiles.push_back(boost::dynamic_pointer_cast<Source>(source));
|
||||||
|
|
||||||
/* for audio files, reset the timeline position so that any BWF-ish
|
/* for audio files, reset the timeline position so that any BWF-ish
|
||||||
information in the original files we are importing from is maintained.
|
information in the original files we are importing from is maintained.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
boost::shared_ptr<AudioFileSource> afs;
|
boost::shared_ptr<AudioFileSource> afs;
|
||||||
if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(source)) != 0) {
|
if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(source)) != 0) {
|
||||||
afs->set_timeline_position(timeline_position);
|
afs->set_timeline_position(timeline_position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static string
|
static string
|
||||||
compose_status_message (const string& path,
|
compose_status_message (const string& path,
|
||||||
uint file_samplerate,
|
uint file_samplerate,
|
||||||
uint session_samplerate,
|
uint session_samplerate,
|
||||||
uint /* current_file */,
|
uint /* current_file */,
|
||||||
uint /* total_files */)
|
uint /* total_files */)
|
||||||
{
|
{
|
||||||
if (file_samplerate != session_samplerate) {
|
if (file_samplerate != session_samplerate) {
|
||||||
return string_compose (_("Resampling %1 from %2kHz to %3kHz"),
|
return string_compose (_("Resampling %1 from %2kHz to %3kHz"),
|
||||||
Glib::path_get_basename (path),
|
Glib::path_get_basename (path),
|
||||||
file_samplerate/1000.0f,
|
file_samplerate/1000.0f,
|
||||||
session_samplerate/1000.0f);
|
session_samplerate/1000.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return string_compose (_("Copying %1"), Glib::path_get_basename (path));
|
return string_compose (_("Copying %1"), Glib::path_get_basename (path));
|
||||||
|
|
@ -272,7 +271,7 @@ compose_status_message (const string& path,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
|
write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
|
||||||
vector<boost::shared_ptr<Source> >& newfiles)
|
vector<boost::shared_ptr<Source> >& newfiles)
|
||||||
{
|
{
|
||||||
const framecnt_t nframes = ResampledImportableSource::blocksize;
|
const framecnt_t nframes = ResampledImportableSource::blocksize;
|
||||||
boost::shared_ptr<AudioFileSource> afs;
|
boost::shared_ptr<AudioFileSource> afs;
|
||||||
|
|
@ -377,86 +376,86 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status,
|
||||||
|
|
||||||
status.progress = 0.0f;
|
status.progress = 0.0f;
|
||||||
|
|
||||||
assert (newfiles.size() == source->num_tracks());
|
assert (newfiles.size() == source->num_tracks());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vector<boost::shared_ptr<Source> >::iterator s = newfiles.begin();
|
vector<boost::shared_ptr<Source> >::iterator s = newfiles.begin();
|
||||||
|
|
||||||
for (unsigned i = 1; i <= source->num_tracks(); ++i) {
|
for (unsigned i = 1; i <= source->num_tracks(); ++i) {
|
||||||
|
|
||||||
boost::shared_ptr<SMFSource> smfs = boost::dynamic_pointer_cast<SMFSource> (*s);
|
boost::shared_ptr<SMFSource> smfs = boost::dynamic_pointer_cast<SMFSource> (*s);
|
||||||
|
|
||||||
smfs->drop_model ();
|
smfs->drop_model ();
|
||||||
source->seek_to_track (i);
|
source->seek_to_track (i);
|
||||||
|
|
||||||
uint64_t t = 0;
|
uint64_t t = 0;
|
||||||
uint32_t delta_t = 0;
|
uint32_t delta_t = 0;
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
while (!status.cancel) {
|
while (!status.cancel) {
|
||||||
gint note_id_ignored; // imported files either don't have NoteID's or we ignore them.
|
gint note_id_ignored; // imported files either don't have NoteID's or we ignore them.
|
||||||
|
|
||||||
size = buf_size;
|
size = buf_size;
|
||||||
|
|
||||||
int ret = source->read_event (&delta_t, &size, &buf, ¬e_id_ignored);
|
int ret = source->read_event (&delta_t, &size, &buf, ¬e_id_ignored);
|
||||||
|
|
||||||
if (size > buf_size) {
|
if (size > buf_size) {
|
||||||
buf_size = size;
|
buf_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0) { // EOT
|
if (ret < 0) { // EOT
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
t += delta_t;
|
t += delta_t;
|
||||||
|
|
||||||
if (ret == 0) { // Meta
|
if (ret == 0) { // Meta
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
smfs->mark_streaming_write_started ();
|
smfs->mark_streaming_write_started ();
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
smfs->append_event_unlocked_beats(Evoral::Event<double>(0,
|
smfs->append_event_unlocked_beats(Evoral::Event<double>(0,
|
||||||
(double)t / (double)source->ppqn(),
|
(double)t / (double)source->ppqn(),
|
||||||
size,
|
size,
|
||||||
buf));
|
buf));
|
||||||
|
|
||||||
if (status.progress < 0.99) {
|
if (status.progress < 0.99) {
|
||||||
status.progress += 0.01;
|
status.progress += 0.01;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!first) {
|
if (!first) {
|
||||||
|
|
||||||
/* we wrote something */
|
/* we wrote something */
|
||||||
|
|
||||||
const framepos_t pos = 0;
|
const framepos_t pos = 0;
|
||||||
const double length_beats = ceil(t / (double)source->ppqn());
|
const double length_beats = ceil(t / (double)source->ppqn());
|
||||||
BeatsFramesConverter converter(smfs->session().tempo_map(), pos);
|
BeatsFramesConverter converter(smfs->session().tempo_map(), pos);
|
||||||
smfs->update_length(pos, converter.to(length_beats));
|
smfs->update_length(pos, converter.to(length_beats));
|
||||||
smfs->mark_streaming_write_completed ();
|
smfs->mark_streaming_write_completed ();
|
||||||
|
|
||||||
if (status.cancel) {
|
if (status.cancel) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
warning << string_compose (_("Track %1 of %2 contained no usable MIDI data"), i, source->file_path()) << endmsg;
|
warning << string_compose (_("Track %1 of %2 contained no usable MIDI data"), i, source->file_path()) << endmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
++s; // next source
|
++s; // next source
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
error << string_compose (_("MIDI file %1 was not readable (no reason available"), source->file_path()) << endmsg;
|
error << string_compose (_("MIDI file %1 was not readable (no reason available"), source->file_path()) << endmsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf) {
|
if (buf) {
|
||||||
free (buf);
|
free (buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -511,9 +510,9 @@ Session::import_audiofiles (ImportStatus& status)
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> new_paths = get_paths_for_new_sources (config.get_native_file_header_format(),
|
vector<string> new_paths = get_paths_for_new_sources (config.get_native_file_header_format(),
|
||||||
status.replace_existing_source, *p,
|
status.replace_existing_source, *p,
|
||||||
get_best_session_directory_for_new_source (),
|
get_best_session_directory_for_new_source (),
|
||||||
channels);
|
channels);
|
||||||
Sources newfiles;
|
Sources newfiles;
|
||||||
framepos_t natural_position = source ? source->natural_position() : 0;
|
framepos_t natural_position = source ? source->natural_position() : 0;
|
||||||
|
|
||||||
|
|
@ -522,7 +521,7 @@ Session::import_audiofiles (ImportStatus& status)
|
||||||
fatal << "THIS IS NOT IMPLEMENTED YET, IT SHOULD NEVER GET CALLED!!! DYING!" << endmsg;
|
fatal << "THIS IS NOT IMPLEMENTED YET, IT SHOULD NEVER GET CALLED!!! DYING!" << endmsg;
|
||||||
status.cancel = !map_existing_mono_sources (new_paths, *this, frame_rate(), newfiles, this);
|
status.cancel = !map_existing_mono_sources (new_paths, *this, frame_rate(), newfiles, this);
|
||||||
} else {
|
} else {
|
||||||
status.cancel = !create_mono_sources_for_writing (*p, new_paths, *this, frame_rate(), newfiles, natural_position);
|
status.cancel = !create_mono_sources_for_writing (*p, new_paths, *this, frame_rate(), newfiles, natural_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy on cancel/failure so that any files that were created will be removed below
|
// copy on cancel/failure so that any files that were created will be removed below
|
||||||
|
|
@ -540,7 +539,7 @@ Session::import_audiofiles (ImportStatus& status)
|
||||||
|
|
||||||
if (source) { // audio
|
if (source) { // audio
|
||||||
status.doing_what = compose_status_message (*p, source->samplerate(),
|
status.doing_what = compose_status_message (*p, source->samplerate(),
|
||||||
frame_rate(), status.current, status.total);
|
frame_rate(), status.current, status.total);
|
||||||
write_audio_data_to_new_files (source.get(), status, newfiles);
|
write_audio_data_to_new_files (source.get(), status, newfiles);
|
||||||
} else if (smf_reader.get()) { // midi
|
} else if (smf_reader.get()) { // midi
|
||||||
status.doing_what = string_compose(_("Loading MIDI file %1"), *p);
|
status.doing_what = string_compose(_("Loading MIDI file %1"), *p);
|
||||||
|
|
@ -562,7 +561,7 @@ Session::import_audiofiles (ImportStatus& status)
|
||||||
|
|
||||||
for (Sources::iterator x = all_new_sources.begin(); x != all_new_sources.end(); ) {
|
for (Sources::iterator x = all_new_sources.begin(); x != all_new_sources.end(); ) {
|
||||||
if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(*x)) != 0) {
|
if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(*x)) != 0) {
|
||||||
afs->update_header((*x)->natural_position(), *now, xnow);
|
afs->update_header((*x)->natural_position(), *now, xnow);
|
||||||
afs->done_with_peakfile_writes ();
|
afs->done_with_peakfile_writes ();
|
||||||
|
|
||||||
/* now that there is data there, requeue the file for analysis */
|
/* now that there is data there, requeue the file for analysis */
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ CubicInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input,
|
||||||
if (_speed != _target_speed) {
|
if (_speed != _target_speed) {
|
||||||
acceleration = _target_speed - _speed;
|
acceleration = _target_speed - _speed;
|
||||||
} else {
|
} else {
|
||||||
acceleration = 0.0;
|
acceleration = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
distance = phase[channel];
|
distance = phase[channel];
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cerr << "meter " << name() << " runs with " << bufs.available() << " inputs\n";
|
// cerr << "meter " << name() << " runs with " << bufs.available() << " inputs\n";
|
||||||
|
|
||||||
const uint32_t n_audio = min (current_meters.n_audio(), bufs.count().n_audio());
|
const uint32_t n_audio = min (current_meters.n_audio(), bufs.count().n_audio());
|
||||||
const uint32_t n_midi = min (current_meters.n_midi(), bufs.count().n_midi());
|
const uint32_t n_midi = min (current_meters.n_midi(), bufs.count().n_midi());
|
||||||
|
|
@ -117,7 +117,7 @@ PeakMeter::configure_io (ChanCount in, ChanCount out)
|
||||||
|
|
||||||
current_meters = in;
|
current_meters = in;
|
||||||
|
|
||||||
reset_max_channels (in);
|
reset_max_channels (in);
|
||||||
|
|
||||||
return Processor::configure_io (in, out);
|
return Processor::configure_io (in, out);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,13 +101,14 @@ struct RegionSortByLastLayerOp {
|
||||||
void
|
void
|
||||||
Playlist::make_property_quarks ()
|
Playlist::make_property_quarks ()
|
||||||
{
|
{
|
||||||
Properties::regions.property_id = g_quark_from_static_string (X_("regions"));
|
Properties::regions.property_id = g_quark_from_static_string (X_("regions"));
|
||||||
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for regions = %1\n", Properties::regions.property_id));
|
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for regions = %1\n",
|
||||||
|
Properties::regions.property_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
RegionListProperty::RegionListProperty (Playlist& pl)
|
RegionListProperty::RegionListProperty (Playlist& pl)
|
||||||
: SequenceProperty<std::list<boost::shared_ptr<Region> > > (Properties::regions.property_id, boost::bind (&Playlist::update, &pl, _1))
|
: SequenceProperty<std::list<boost::shared_ptr<Region> > > (Properties::regions.property_id, boost::bind (&Playlist::update, &pl, _1))
|
||||||
, _playlist (pl)
|
, _playlist (pl)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -149,32 +150,30 @@ RegionListProperty::get_content_from_xml (XMLNode const & node) const
|
||||||
|
|
||||||
PBD::ID id (prop->value ());
|
PBD::ID id (prop->value ());
|
||||||
|
|
||||||
boost::shared_ptr<Region> ret = _playlist.region_by_id (id);
|
boost::shared_ptr<Region> ret = _playlist.region_by_id (id);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ret = RegionFactory::region_by_id (id);
|
ret = RegionFactory::region_by_id (id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Playlist::Playlist (Session& sess, string nom, DataType type, bool hide)
|
Playlist::Playlist (Session& sess, string nom, DataType type, bool hide)
|
||||||
: SessionObject(sess, nom)
|
: SessionObject(sess, nom)
|
||||||
, regions (*this)
|
, regions (*this)
|
||||||
, _type(type)
|
, _type(type)
|
||||||
{
|
{
|
||||||
init (hide);
|
init (hide);
|
||||||
first_set_state = false;
|
first_set_state = false;
|
||||||
_name = nom;
|
_name = nom;
|
||||||
_set_sort_id ();
|
_set_sort_id ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide)
|
Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide)
|
||||||
: SessionObject(sess, "unnamed playlist")
|
: SessionObject(sess, "unnamed playlist")
|
||||||
, regions (*this)
|
, regions (*this)
|
||||||
, _type(type)
|
, _type(type)
|
||||||
|
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const XMLProperty* prop = node.property("type");
|
const XMLProperty* prop = node.property("type");
|
||||||
|
|
@ -183,14 +182,14 @@ Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide
|
||||||
|
|
||||||
init (hide);
|
init (hide);
|
||||||
_name = "unnamed"; /* reset by set_state */
|
_name = "unnamed"; /* reset by set_state */
|
||||||
_set_sort_id ();
|
_set_sort_id ();
|
||||||
|
|
||||||
/* set state called by derived class */
|
/* set state called by derived class */
|
||||||
}
|
}
|
||||||
|
|
||||||
Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, bool hide)
|
Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, bool hide)
|
||||||
: SessionObject(other->_session, namestr)
|
: SessionObject(other->_session, namestr)
|
||||||
, regions (*this)
|
, regions (*this)
|
||||||
, _type(other->_type)
|
, _type(other->_type)
|
||||||
, _orig_diskstream_id (other->_orig_diskstream_id)
|
, _orig_diskstream_id (other->_orig_diskstream_id)
|
||||||
{
|
{
|
||||||
|
|
@ -225,7 +224,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, boo
|
||||||
|
|
||||||
Playlist::Playlist (boost::shared_ptr<const Playlist> other, framepos_t start, framecnt_t cnt, string str, bool hide)
|
Playlist::Playlist (boost::shared_ptr<const Playlist> other, framepos_t start, framecnt_t cnt, string str, bool hide)
|
||||||
: SessionObject(other->_session, str)
|
: SessionObject(other->_session, str)
|
||||||
, regions (*this)
|
, regions (*this)
|
||||||
, _type(other->_type)
|
, _type(other->_type)
|
||||||
, _orig_diskstream_id (other->_orig_diskstream_id)
|
, _orig_diskstream_id (other->_orig_diskstream_id)
|
||||||
{
|
{
|
||||||
|
|
@ -332,8 +331,8 @@ Playlist::copy_regions (RegionList& newlist) const
|
||||||
void
|
void
|
||||||
Playlist::init (bool hide)
|
Playlist::init (bool hide)
|
||||||
{
|
{
|
||||||
add_property (regions);
|
add_property (regions);
|
||||||
_xml_node_name = X_("Playlist");
|
_xml_node_name = X_("Playlist");
|
||||||
|
|
||||||
g_atomic_int_set (&block_notifications, 0);
|
g_atomic_int_set (&block_notifications, 0);
|
||||||
g_atomic_int_set (&ignore_state_changes, 0);
|
g_atomic_int_set (&ignore_state_changes, 0);
|
||||||
|
|
@ -347,7 +346,7 @@ Playlist::init (bool hide)
|
||||||
_shuffling = false;
|
_shuffling = false;
|
||||||
_nudging = false;
|
_nudging = false;
|
||||||
in_set_state = 0;
|
in_set_state = 0;
|
||||||
in_update = false;
|
in_update = false;
|
||||||
_edit_mode = Config->get_edit_mode();
|
_edit_mode = Config->get_edit_mode();
|
||||||
in_flush = false;
|
in_flush = false;
|
||||||
in_partition = false;
|
in_partition = false;
|
||||||
|
|
@ -382,27 +381,27 @@ Playlist::~Playlist ()
|
||||||
void
|
void
|
||||||
Playlist::_set_sort_id ()
|
Playlist::_set_sort_id ()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Playlists are given names like <track name>.<id>
|
Playlists are given names like <track name>.<id>
|
||||||
or <track name>.<edit group name>.<id> where id
|
or <track name>.<edit group name>.<id> where id
|
||||||
is an integer. We extract the id and sort by that.
|
is an integer. We extract the id and sort by that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
size_t dot_position = _name.val().find_last_of(".");
|
size_t dot_position = _name.val().find_last_of(".");
|
||||||
|
|
||||||
if (dot_position == string::npos) {
|
if (dot_position == string::npos) {
|
||||||
_sort_id = 0;
|
_sort_id = 0;
|
||||||
} else {
|
} else {
|
||||||
string t = _name.val().substr(dot_position + 1);
|
string t = _name.val().substr(dot_position + 1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_sort_id = boost::lexical_cast<int>(t);
|
_sort_id = boost::lexical_cast<int>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (boost::bad_lexical_cast e) {
|
catch (boost::bad_lexical_cast e) {
|
||||||
_sort_id = 0;
|
_sort_id = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -418,11 +417,11 @@ Playlist::set_name (const string& str)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = SessionObject::set_name(str);
|
bool ret = SessionObject::set_name(str);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
_set_sort_id ();
|
_set_sort_id ();
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -436,7 +435,7 @@ Playlist::set_name (const string& str)
|
||||||
void
|
void
|
||||||
Playlist::begin_undo ()
|
Playlist::begin_undo ()
|
||||||
{
|
{
|
||||||
in_update = true;
|
in_update = true;
|
||||||
freeze ();
|
freeze ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -444,7 +443,7 @@ void
|
||||||
Playlist::end_undo ()
|
Playlist::end_undo ()
|
||||||
{
|
{
|
||||||
thaw (true);
|
thaw (true);
|
||||||
in_update = false;
|
in_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -476,8 +475,7 @@ Playlist::release_notifications (bool from_undo)
|
||||||
{
|
{
|
||||||
if (g_atomic_int_dec_and_test (&block_notifications)) {
|
if (g_atomic_int_dec_and_test (&block_notifications)) {
|
||||||
flush_notifications (from_undo);
|
flush_notifications (from_undo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -596,7 +594,7 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
|
||||||
pending_contents_change = true;
|
pending_contents_change = true;
|
||||||
pending_length = true;
|
pending_length = true;
|
||||||
} else {
|
} else {
|
||||||
r->clear_changes ();
|
r->clear_changes ();
|
||||||
pending_length = false;
|
pending_length = false;
|
||||||
LengthChanged (); /* EMIT SIGNAL */
|
LengthChanged (); /* EMIT SIGNAL */
|
||||||
pending_contents_change = false;
|
pending_contents_change = false;
|
||||||
|
|
@ -666,10 +664,10 @@ Playlist::flush_notifications (bool from_undo)
|
||||||
|
|
||||||
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
|
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
|
||||||
// cerr << _name << " sends RegionAdded\n";
|
// cerr << _name << " sends RegionAdded\n";
|
||||||
/* don't emit RegionAdded signal until relayering is done,
|
/* don't emit RegionAdded signal until relayering is done,
|
||||||
so that the region is fully setup by the time
|
so that the region is fully setup by the time
|
||||||
anyone hear's that its been added
|
anyone hear's that its been added
|
||||||
*/
|
*/
|
||||||
dependent_checks_needed.insert (*s);
|
dependent_checks_needed.insert (*s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -697,9 +695,9 @@ Playlist::flush_notifications (bool from_undo)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
|
for (s = pending_adds.begin(); s != pending_adds.end(); ++s) {
|
||||||
(*s)->clear_changes ();
|
(*s)->clear_changes ();
|
||||||
RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
|
RegionAdded (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
for (s = dependent_checks_needed.begin(); s != dependent_checks_needed.end(); ++s) {
|
for (s = dependent_checks_needed.begin(); s != dependent_checks_needed.end(); ++s) {
|
||||||
check_dependents (*s, false);
|
check_dependents (*s, false);
|
||||||
|
|
@ -904,7 +902,7 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
|
||||||
possibly_splice_unlocked (pos, -distance);
|
possibly_splice_unlocked (pos, -distance);
|
||||||
|
|
||||||
if (!holding_state ()) {
|
if (!holding_state ()) {
|
||||||
relayer ();
|
relayer ();
|
||||||
remove_dependents (region);
|
remove_dependents (region);
|
||||||
|
|
||||||
if (old_length != _get_extent().second) {
|
if (old_length != _get_extent().second) {
|
||||||
|
|
@ -1583,10 +1581,10 @@ Playlist::region_bounds_changed (const PropertyChange& what_changed, boost::shar
|
||||||
RegionList::iterator i = find (regions.begin(), regions.end(), region);
|
RegionList::iterator i = find (regions.begin(), regions.end(), region);
|
||||||
|
|
||||||
if (i == regions.end()) {
|
if (i == regions.end()) {
|
||||||
/* the region bounds are being modified but its not currently
|
/* the region bounds are being modified but its not currently
|
||||||
in the region list. we will use its bounds correctly when/if
|
in the region list. we will use its bounds correctly when/if
|
||||||
it is added
|
it is added
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1703,11 +1701,11 @@ Playlist::sync_all_regions_with_regions ()
|
||||||
{
|
{
|
||||||
RegionLock rl (this);
|
RegionLock rl (this);
|
||||||
|
|
||||||
all_regions.clear ();
|
all_regions.clear ();
|
||||||
|
|
||||||
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||||
all_regions.insert (*i);
|
all_regions.insert (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1724,18 +1722,18 @@ Playlist::clear (bool with_signals)
|
||||||
|
|
||||||
regions.clear ();
|
regions.clear ();
|
||||||
|
|
||||||
for (set<boost::shared_ptr<Region> >::iterator s = pending_removes.begin(); s != pending_removes.end(); ++s) {
|
for (set<boost::shared_ptr<Region> >::iterator s = pending_removes.begin(); s != pending_removes.end(); ++s) {
|
||||||
remove_dependents (*s);
|
remove_dependents (*s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (with_signals) {
|
if (with_signals) {
|
||||||
|
|
||||||
for (set<boost::shared_ptr<Region> >::iterator s = pending_removes.begin(); s != pending_removes.end(); ++s) {
|
for (set<boost::shared_ptr<Region> >::iterator s = pending_removes.begin(); s != pending_removes.end(); ++s) {
|
||||||
RegionRemoved (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
|
RegionRemoved (boost::weak_ptr<Region> (*s)); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
pending_removes.clear ();
|
pending_removes.clear ();
|
||||||
pending_length = false;
|
pending_length = false;
|
||||||
LengthChanged ();
|
LengthChanged ();
|
||||||
pending_contents_change = false;
|
pending_contents_change = false;
|
||||||
|
|
@ -1832,7 +1830,7 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
to_check.insert (start);
|
to_check.insert (start);
|
||||||
to_check.insert (end);
|
to_check.insert (end);
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, ">>>>> REGIONS TO READ\n");
|
DEBUG_TRACE (DEBUG::AudioPlayback, ">>>>> REGIONS TO READ\n");
|
||||||
|
|
||||||
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||||
|
|
||||||
|
|
@ -1844,38 +1842,38 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
|
|
||||||
case OverlapInternal:
|
case OverlapInternal:
|
||||||
covering.push_back (*i);
|
covering.push_back (*i);
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OInternal)\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OInternal)\n", (*i)->name()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OverlapStart:
|
case OverlapStart:
|
||||||
to_check.insert ((*i)->position());
|
to_check.insert ((*i)->position());
|
||||||
if ((*i)->position() != 0) {
|
if ((*i)->position() != 0) {
|
||||||
to_check.insert ((*i)->position()-1);
|
to_check.insert ((*i)->position()-1);
|
||||||
}
|
}
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will check %1 for %2\n", (*i)->position(), (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will check %1 for %2\n", (*i)->position(), (*i)->name()));
|
||||||
covering.push_back (*i);
|
covering.push_back (*i);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OverlapEnd:
|
case OverlapEnd:
|
||||||
to_check.insert ((*i)->last_frame());
|
to_check.insert ((*i)->last_frame());
|
||||||
to_check.insert ((*i)->last_frame()+1);
|
to_check.insert ((*i)->last_frame()+1);
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OEnd)\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OEnd)\n", (*i)->name()));
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
||||||
covering.push_back (*i);
|
covering.push_back (*i);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OverlapExternal:
|
case OverlapExternal:
|
||||||
covering.push_back (*i);
|
covering.push_back (*i);
|
||||||
to_check.insert ((*i)->position());
|
to_check.insert ((*i)->position());
|
||||||
if ((*i)->position() != 0) {
|
if ((*i)->position() != 0) {
|
||||||
to_check.insert ((*i)->position()-1);
|
to_check.insert ((*i)->position()-1);
|
||||||
}
|
}
|
||||||
to_check.insert ((*i)->last_frame());
|
to_check.insert ((*i)->last_frame());
|
||||||
to_check.insert ((*i)->last_frame()+1);
|
to_check.insert ((*i)->last_frame()+1);
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OExt)\n", (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("toread: will cover %1 (OExt)\n", (*i)->name()));
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->position(), (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->position(), (*i)->name()));
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("\ttoread: will check %1 for %2\n", (*i)->last_frame(), (*i)->name()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1893,7 +1891,7 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
if (covering.size() == 1) {
|
if (covering.size() == 1) {
|
||||||
|
|
||||||
rlist->push_back (covering.front());
|
rlist->push_back (covering.front());
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("Just one covering region (%1)\n", covering.front()->name()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("Just one covering region (%1)\n", covering.front()->name()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -1902,20 +1900,20 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
|
|
||||||
here.clear ();
|
here.clear ();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("++++ Considering %1\n", *t));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("++++ Considering %1\n", *t));
|
||||||
|
|
||||||
for (RegionList::iterator x = covering.begin(); x != covering.end(); ++x) {
|
for (RegionList::iterator x = covering.begin(); x != covering.end(); ++x) {
|
||||||
|
|
||||||
if ((*x)->covers (*t)) {
|
if ((*x)->covers (*t)) {
|
||||||
here.push_back (*x);
|
here.push_back (*x);
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("region %1 covers %2\n",
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("region %1 covers %2\n",
|
||||||
(*x)->name(),
|
(*x)->name(),
|
||||||
(*t)));
|
(*t)));
|
||||||
} else {
|
} else {
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("region %1 does NOT covers %2\n",
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("region %1 does NOT covers %2\n",
|
||||||
(*x)->name(),
|
(*x)->name(),
|
||||||
(*t)));
|
(*t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1931,8 +1929,8 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
if ((*c)->opaque()) {
|
if ((*c)->opaque()) {
|
||||||
|
|
||||||
/* the other regions at this position are hidden by this one */
|
/* the other regions at this position are hidden by this one */
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 is opaque, ignore all others\n",
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("%1 is opaque, ignore all others\n",
|
||||||
(*c)->name()));
|
(*c)->name()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1950,7 +1948,7 @@ Playlist::regions_to_read (framepos_t start, framepos_t end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("<<<<< REGIONS TO READ returns %1\n", rlist->size()));
|
DEBUG_TRACE (DEBUG::AudioPlayback, string_compose ("<<<<< REGIONS TO READ returns %1\n", rlist->size()));
|
||||||
|
|
||||||
return rlist;
|
return rlist;
|
||||||
}
|
}
|
||||||
|
|
@ -2206,20 +2204,20 @@ Playlist::clear_owned_changes ()
|
||||||
void
|
void
|
||||||
Playlist::update (const RegionListProperty::ChangeRecord& change)
|
Playlist::update (const RegionListProperty::ChangeRecord& change)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Properties, string_compose ("Playlist %1 updates from a change record with %2 adds %3 removes\n",
|
DEBUG_TRACE (DEBUG::Properties, string_compose ("Playlist %1 updates from a change record with %2 adds %3 removes\n",
|
||||||
name(), change.added.size(), change.removed.size()));
|
name(), change.added.size(), change.removed.size()));
|
||||||
|
|
||||||
freeze ();
|
freeze ();
|
||||||
/* add the added regions */
|
/* add the added regions */
|
||||||
for (RegionListProperty::ChangeContainer::iterator i = change.added.begin(); i != change.added.end(); ++i) {
|
for (RegionListProperty::ChangeContainer::iterator i = change.added.begin(); i != change.added.end(); ++i) {
|
||||||
add_region ((*i), (*i)->position());
|
add_region ((*i), (*i)->position());
|
||||||
}
|
}
|
||||||
/* remove the removed regions */
|
/* remove the removed regions */
|
||||||
for (RegionListProperty::ChangeContainer::iterator i = change.removed.begin(); i != change.removed.end(); ++i) {
|
for (RegionListProperty::ChangeContainer::iterator i = change.removed.begin(); i != change.removed.end(); ++i) {
|
||||||
remove_region (*i);
|
remove_region (*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
thaw ();
|
thaw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -2251,9 +2249,9 @@ Playlist::set_state (const XMLNode& node, int version)
|
||||||
|
|
||||||
if (prop->name() == X_("name")) {
|
if (prop->name() == X_("name")) {
|
||||||
_name = prop->value();
|
_name = prop->value();
|
||||||
_set_sort_id ();
|
_set_sort_id ();
|
||||||
} else if (prop->name() == X_("id")) {
|
} else if (prop->name() == X_("id")) {
|
||||||
_id = prop->value();
|
_id = prop->value();
|
||||||
} else if (prop->name() == X_("orig_diskstream_id")) {
|
} else if (prop->name() == X_("orig_diskstream_id")) {
|
||||||
_orig_diskstream_id = prop->value ();
|
_orig_diskstream_id = prop->value ();
|
||||||
} else if (prop->name() == X_("frozen")) {
|
} else if (prop->name() == X_("frozen")) {
|
||||||
|
|
@ -2439,11 +2437,11 @@ Playlist::set_edit_mode (EditMode mode)
|
||||||
void
|
void
|
||||||
Playlist::relayer ()
|
Playlist::relayer ()
|
||||||
{
|
{
|
||||||
/* never compute layers when changing state for undo/redo or setting from XML */
|
/* never compute layers when changing state for undo/redo or setting from XML */
|
||||||
|
|
||||||
if (in_update || in_set_state) {
|
if (in_update || in_set_state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
|
|
@ -2693,7 +2691,7 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
freeze ();
|
freeze ();
|
||||||
|
|
||||||
/* now reset the layers without holding the region lock */
|
/* now reset the layers without holding the region lock */
|
||||||
|
|
||||||
|
|
@ -2703,16 +2701,16 @@ Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region>
|
||||||
|
|
||||||
region->set_layer (target_layer);
|
region->set_layer (target_layer);
|
||||||
|
|
||||||
/* now check all dependents, since we changed the layering */
|
/* now check all dependents, since we changed the layering */
|
||||||
|
|
||||||
for (list<LayerInfo>::iterator x = layerinfo.begin(); x != layerinfo.end(); ++x) {
|
for (list<LayerInfo>::iterator x = layerinfo.begin(); x != layerinfo.end(); ++x) {
|
||||||
check_dependents (x->first, false);
|
check_dependents (x->first, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
check_dependents (region, false);
|
check_dependents (region, false);
|
||||||
notify_layering_changed ();
|
notify_layering_changed ();
|
||||||
|
|
||||||
thaw ();
|
thaw ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -2769,13 +2767,13 @@ Playlist::uses_source (boost::shared_ptr<const Source> src) const
|
||||||
{
|
{
|
||||||
RegionLock rlock (const_cast<Playlist*> (this));
|
RegionLock rlock (const_cast<Playlist*> (this));
|
||||||
|
|
||||||
for (set<boost::shared_ptr<Region> >::iterator r = all_regions.begin(); r != all_regions.end(); ++r) {
|
for (set<boost::shared_ptr<Region> >::iterator r = all_regions.begin(); r != all_regions.end(); ++r) {
|
||||||
if ((*r)->uses_source (src)) {
|
if ((*r)->uses_source (src)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Region>
|
boost::shared_ptr<Region>
|
||||||
|
|
@ -2798,11 +2796,11 @@ uint32_t
|
||||||
Playlist::region_use_count (boost::shared_ptr<Region> r) const
|
Playlist::region_use_count (boost::shared_ptr<Region> r) const
|
||||||
{
|
{
|
||||||
RegionLock rlock (const_cast<Playlist*> (this));
|
RegionLock rlock (const_cast<Playlist*> (this));
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
|
|
||||||
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
|
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||||
if ((*i) == r) {
|
if ((*i) == r) {
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,41 +34,41 @@ PortSet::PortSet()
|
||||||
|
|
||||||
static bool sort_ports_by_name (Port* a, Port* b)
|
static bool sort_ports_by_name (Port* a, Port* b)
|
||||||
{
|
{
|
||||||
string aname (a->name());
|
string aname (a->name());
|
||||||
string bname (b->name());
|
string bname (b->name());
|
||||||
|
|
||||||
string::size_type last_digit_position_a = aname.size();
|
string::size_type last_digit_position_a = aname.size();
|
||||||
string::reverse_iterator r_iterator = aname.rbegin();
|
string::reverse_iterator r_iterator = aname.rbegin();
|
||||||
|
|
||||||
while (r_iterator!= aname.rend() && Glib::Unicode::isdigit(*r_iterator)) {
|
while (r_iterator!= aname.rend() && Glib::Unicode::isdigit(*r_iterator)) {
|
||||||
r_iterator++;
|
r_iterator++;
|
||||||
last_digit_position_a--;
|
last_digit_position_a--;
|
||||||
}
|
}
|
||||||
|
|
||||||
string::size_type last_digit_position_b = bname.size();
|
string::size_type last_digit_position_b = bname.size();
|
||||||
r_iterator = bname.rbegin();
|
r_iterator = bname.rbegin();
|
||||||
|
|
||||||
while (r_iterator != bname.rend() && Glib::Unicode::isdigit(*r_iterator)) {
|
while (r_iterator != bname.rend() && Glib::Unicode::isdigit(*r_iterator)) {
|
||||||
r_iterator++;
|
r_iterator++;
|
||||||
last_digit_position_b--;
|
last_digit_position_b--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if some of the names don't have a number as posfix, compare as strings
|
// if some of the names don't have a number as posfix, compare as strings
|
||||||
|
|
||||||
if (last_digit_position_a == aname.size() or last_digit_position_b == bname.size()) {
|
if (last_digit_position_a == aname.size() or last_digit_position_b == bname.size()) {
|
||||||
return aname < bname;
|
return aname < bname;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string prefix_a = aname.substr(0, last_digit_position_a - 1);
|
const std::string prefix_a = aname.substr(0, last_digit_position_a - 1);
|
||||||
const unsigned int posfix_a = std::atoi(aname.substr(last_digit_position_a, aname.size() - last_digit_position_a).c_str());
|
const unsigned int posfix_a = std::atoi(aname.substr(last_digit_position_a, aname.size() - last_digit_position_a).c_str());
|
||||||
const std::string prefix_b = bname.substr(0, last_digit_position_b - 1);
|
const std::string prefix_b = bname.substr(0, last_digit_position_b - 1);
|
||||||
const unsigned int posfix_b = std::atoi(bname.substr(last_digit_position_b, bname.size() - last_digit_position_b).c_str());
|
const unsigned int posfix_b = std::atoi(bname.substr(last_digit_position_b, bname.size() - last_digit_position_b).c_str());
|
||||||
|
|
||||||
if (prefix_a != prefix_b) {
|
if (prefix_a != prefix_b) {
|
||||||
return aname < bname;
|
return aname < bname;
|
||||||
} else {
|
} else {
|
||||||
return posfix_a < posfix_b;
|
return posfix_a < posfix_b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,10 @@ SessionEvent::operator delete (void *ptr, size_t /*size*/)
|
||||||
Pool* p = pool->per_thread_pool ();
|
Pool* p = pool->per_thread_pool ();
|
||||||
SessionEvent* ev = static_cast<SessionEvent*> (ptr);
|
SessionEvent* ev = static_cast<SessionEvent*> (ptr);
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::SessionEvents, string_compose (
|
DEBUG_TRACE (DEBUG::SessionEvents, string_compose (
|
||||||
"%1 Deleting SessionEvent @ %2 ev thread pool = %3 ev pool = %4\n",
|
"%1 Deleting SessionEvent @ %2 ev thread pool = %3 ev pool = %4\n",
|
||||||
pthread_self(), ev, p->name(), ev->own_pool->name()
|
pthread_self(), ev, p->name(), ev->own_pool->name()
|
||||||
));
|
));
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (DEBUG::SessionEvents & PBD::debug_bits) {
|
if (DEBUG::SessionEvents & PBD::debug_bits) {
|
||||||
|
|
@ -133,7 +133,7 @@ SessionEventManager::dump_events () const
|
||||||
}
|
}
|
||||||
cerr << "Next event: ";
|
cerr << "Next event: ";
|
||||||
|
|
||||||
if ((Events::const_iterator) next_event == events.end()) {
|
if ((Events::const_iterator) next_event == events.end()) {
|
||||||
cerr << "none" << endl;
|
cerr << "none" << endl;
|
||||||
} else {
|
} else {
|
||||||
cerr << "at " << (*next_event)->action_frame << ' '
|
cerr << "at " << (*next_event)->action_frame << ' '
|
||||||
|
|
|
||||||
|
|
@ -107,26 +107,26 @@ Session::no_roll (pframes_t nframes)
|
||||||
_click_io->silence (nframes);
|
_click_io->silence (nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route_graph->threads_in_use() > 0) {
|
if (route_graph->threads_in_use() > 0) {
|
||||||
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
|
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
|
||||||
route_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), actively_recording(), declick);
|
route_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), actively_recording(), declick);
|
||||||
} else {
|
} else {
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
|
|
||||||
if ((*i)->is_hidden()) {
|
if ((*i)->is_hidden()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*i)->set_pending_declick (declick);
|
(*i)->set_pending_declick (declick);
|
||||||
|
|
||||||
if ((*i)->no_roll (nframes, _transport_frame, end_frame, non_realtime_work_pending(),
|
if ((*i)->no_roll (nframes, _transport_frame, end_frame, non_realtime_work_pending(),
|
||||||
actively_recording(), declick)) {
|
actively_recording(), declick)) {
|
||||||
error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
|
error << string_compose(_("Session: error in no roll for %1"), (*i)->name()) << endmsg;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -134,46 +134,46 @@ Session::no_roll (pframes_t nframes)
|
||||||
int
|
int
|
||||||
Session::process_routes (pframes_t nframes, bool& need_butler)
|
Session::process_routes (pframes_t nframes, bool& need_butler)
|
||||||
{
|
{
|
||||||
bool record_active;
|
bool record_active;
|
||||||
int declick = get_transport_declick_required();
|
int declick = get_transport_declick_required();
|
||||||
bool rec_monitors = get_rec_monitors_input();
|
bool rec_monitors = get_rec_monitors_input();
|
||||||
boost::shared_ptr<RouteList> r = routes.reader ();
|
boost::shared_ptr<RouteList> r = routes.reader ();
|
||||||
|
|
||||||
if (transport_sub_state & StopPendingCapture) {
|
if (transport_sub_state & StopPendingCapture) {
|
||||||
/* force a declick out */
|
/* force a declick out */
|
||||||
declick = -1;
|
declick = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
record_active = actively_recording(); // || (get_record_enabled() && get_punch_in());
|
record_active = actively_recording(); // || (get_record_enabled() && get_punch_in());
|
||||||
|
|
||||||
const framepos_t start_frame = _transport_frame;
|
const framepos_t start_frame = _transport_frame;
|
||||||
const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
|
const framepos_t end_frame = _transport_frame + floor (nframes * _transport_speed);
|
||||||
|
|
||||||
/* XXX this is hack to force use of the graph even if we are only
|
/* XXX this is hack to force use of the graph even if we are only
|
||||||
using 1 thread. its needed because otherwise when we remove
|
using 1 thread. its needed because otherwise when we remove
|
||||||
tracks, the graph never gets updated.
|
tracks, the graph never gets updated.
|
||||||
*/
|
*/
|
||||||
if (1 || route_graph->threads_in_use() > 0) {
|
if (1 || route_graph->threads_in_use() > 0) {
|
||||||
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
|
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
|
||||||
route_graph->process_routes( nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler);
|
route_graph->process_routes( nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((*i)->is_hidden()) {
|
if ((*i)->is_hidden()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*i)->set_pending_declick (declick);
|
(*i)->set_pending_declick (declick);
|
||||||
|
|
||||||
if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler)) < 0) {
|
if ((ret = (*i)->roll (nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler)) < 0) {
|
||||||
stop_transport ();
|
stop_transport ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -194,27 +194,27 @@ Session::silent_process_routes (pframes_t nframes, bool& need_butler)
|
||||||
const framepos_t start_frame = _transport_frame;
|
const framepos_t start_frame = _transport_frame;
|
||||||
const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
|
const framepos_t end_frame = _transport_frame + lrintf(nframes * _transport_speed);
|
||||||
|
|
||||||
/* XXX this is hack to force use of the graph even if we are only
|
/* XXX this is hack to force use of the graph even if we are only
|
||||||
using 1 thread. its needed because otherwise when we remove
|
using 1 thread. its needed because otherwise when we remove
|
||||||
tracks, the graph never gets updated.
|
tracks, the graph never gets updated.
|
||||||
*/
|
*/
|
||||||
if (1 || route_graph->threads_in_use() > 0) {
|
if (1 || route_graph->threads_in_use() > 0) {
|
||||||
route_graph->silent_process_routes( nframes, start_frame, end_frame, record_active, rec_monitors, need_butler);
|
route_graph->silent_process_routes( nframes, start_frame, end_frame, record_active, rec_monitors, need_butler);
|
||||||
} else {
|
} else {
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((*i)->is_hidden()) {
|
if ((*i)->is_hidden()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, record_active, rec_monitors, need_butler)) < 0) {
|
if ((ret = (*i)->silent_roll (nframes, start_frame, end_frame, record_active, rec_monitors, need_butler)) < 0) {
|
||||||
stop_transport ();
|
stop_transport ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -893,11 +893,11 @@ Session::process_audition (pframes_t nframes)
|
||||||
_butler->summon ();
|
_butler->summon ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if using a monitor section, run it because otherwise we don't hear anything */
|
/* if using a monitor section, run it because otherwise we don't hear anything */
|
||||||
|
|
||||||
if (auditioner->needs_monitor()) {
|
if (auditioner->needs_monitor()) {
|
||||||
_monitor_out->passthru (_transport_frame, _transport_frame + nframes, nframes, false);
|
_monitor_out->passthru (_transport_frame, _transport_frame + nframes, nframes, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle pending events */
|
/* handle pending events */
|
||||||
|
|
||||||
|
|
@ -1147,13 +1147,13 @@ Session::process_event (SessionEvent* ev)
|
||||||
del = false; // other side of RT request needs to clean up
|
del = false; // other side of RT request needs to clean up
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionEvent::AdjustPlaybackBuffering:
|
case SessionEvent::AdjustPlaybackBuffering:
|
||||||
schedule_playback_buffering_adjustment ();
|
schedule_playback_buffering_adjustment ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionEvent::AdjustCaptureBuffering:
|
case SessionEvent::AdjustCaptureBuffering:
|
||||||
schedule_capture_buffering_adjustment ();
|
schedule_capture_buffering_adjustment ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionEvent::SetTimecodeTransmission:
|
case SessionEvent::SetTimecodeTransmission:
|
||||||
g_atomic_int_set (&_suspend_timecode_transmission, ev->yes_or_no ? 0 : 1);
|
g_atomic_int_set (&_suspend_timecode_transmission, ev->yes_or_no ? 0 : 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue