diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-27 00:48:31 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-27 00:48:31 +0000 |
commit | dfc307801307f21d1db5db2395bce5cb1bc95c84 (patch) | |
tree | 26acacad7b5c61882907df1d91cc18d6bce3a75c /libs | |
parent | fd48e72fc212a0f7a2cb23a7c39ccc0f76cb7439 (diff) |
Add configure option to raise a FP exception when a denormal
is detected.
git-svn-id: svn://localhost/ardour2/branches/3.0@11086 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 5 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 1 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 5 | ||||
-rw-r--r-- | libs/ardour/session.cc | 5 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 8 | ||||
-rw-r--r-- | libs/ardour/test/playlist_layering_test.cc | 10 |
6 files changed, 25 insertions, 9 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 675950d986..4587c8fc68 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -149,7 +149,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi const std::string& fullpath, const std::string& snapshot_name, BusProfile* bus_profile = 0, - std::string mix_template = ""); + std::string mix_template = "", + bool with_midi_ui = true); virtual ~Session (); @@ -1076,7 +1077,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void auto_loop_changed (Location *); void first_stage_init (std::string path, std::string snapshot_name); - int second_stage_init (); + int second_stage_init (bool with_midi_ui = true); void remove_empty_sounds (); void setup_midi_control (); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index fa1d6fe175..a538ffcae7 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -91,6 +91,7 @@ AudioEngine::AudioEngine (string client_name, string session_uuid) g_atomic_int_set (&m_meter_exit, 0); if (connect_to_jack (client_name, session_uuid)) { + _instance = 0; throw NoBackendAvailable (); } diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 5a2a2addd6..e9383295e7 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -454,6 +454,11 @@ ARDOUR::setup_fpu () MXCSR = _mm_getcsr(); +#ifdef DEBUG_DENORMAL_EXCEPTION + /* This will raise a FP exception if a denormal is detected */ + MXCSR &= ~_MM_MASK_DENORM; +#endif + switch (Config->get_denormal_model()) { case DenormalNone: MXCSR &= ~(_MM_FLUSH_ZERO_ON|0x8000); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 37349cc5fb..1c9676e578 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -140,7 +140,8 @@ Session::Session (AudioEngine &eng, const string& fullpath, const string& snapshot_name, BusProfile* bus_profile, - string mix_template) + string mix_template, + bool with_midi_ui) : _engine (eng) , _target_transport_speed (0.0) , _requested_return_frame (-1) @@ -191,7 +192,7 @@ Session::Session (AudioEngine &eng, } } - if (second_stage_init ()) { + if (second_stage_init (with_midi_ui)) { destroy (); throw failed_constructor (); } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 7d6f44b786..aa117f00aa 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -293,7 +293,7 @@ Session::first_stage_init (string fullpath, string snapshot_name) } int -Session::second_stage_init () +Session::second_stage_init (bool with_midi_ui) { AudioFileSource::set_peak_dir (_session_dir->peak_path().to_string()); @@ -307,8 +307,10 @@ Session::second_stage_init () return -1; } - if (start_midi_thread ()) { - return -1; + if (with_midi_ui) { + if (start_midi_thread ()) { + return -1; + } } setup_midi_machine_control (); diff --git a/libs/ardour/test/playlist_layering_test.cc b/libs/ardour/test/playlist_layering_test.cc index 1371b0cfae..05c44f5625 100644 --- a/libs/ardour/test/playlist_layering_test.cc +++ b/libs/ardour/test/playlist_layering_test.cc @@ -68,11 +68,17 @@ PlaylistLayeringTest::setUp () test_receiver.listen_to (fatal); test_receiver.listen_to (warning); - AudioEngine* engine = new AudioEngine ("test", ""); + AudioEngine* engine = 0; + try { + engine = new AudioEngine ("test", ""); + } catch (...) { + CPPUNIT_ASSERT (false); + } + MIDI::Manager::create (engine->jack ()); CPPUNIT_ASSERT (engine->start () == 0); - _session = new Session (*engine, test_session_path, "playlist_layering_test"); + _session = new Session (*engine, test_session_path, "playlist_layering_test", 0, "", false); engine->set_session (_session); _playlist = PlaylistFactory::create (DataType::AUDIO, *_session, "test"); |