From 352137726820a7313a6a64fa0a8e276b490ad932 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Jun 2011 10:53:57 +0000 Subject: Better alignment of various class fields (save an insignificant amount of memory). git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3351 a436a847-0d15-0410-975c-d299462d15a1 --- src/JackDriver.cpp | 6 +++--- src/JackDriver.hpp | 8 ++++---- src/Patchage.cpp | 16 +++++++++------- src/Patchage.hpp | 16 ++++++++++------ src/StateManager.hpp | 2 +- 5 files changed, 27 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 13403f9..420d3fa 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -41,9 +41,9 @@ JackDriver::JackDriver(Patchage* app) : _app(app) , _client(NULL) , _events(128) - , _is_activated(false) , _xruns(0) , _xrun_delay(0) + , _is_activated(false) { _last_pos.frame = 0; _last_pos.valid = (jack_position_bits_t)0; @@ -517,7 +517,7 @@ JackDriver::jack_xrun_cb(void* jack_driver) JackDriver* me = reinterpret_cast(jack_driver); assert(me->_client); - me->_xruns++; + ++me->_xruns; me->_xrun_delay = jack_get_xrun_delayed_usecs(me->_client); jack_reset_max_delayed_usecs(me->_client); @@ -554,7 +554,7 @@ JackDriver::buffer_size() void JackDriver::reset_xruns() { - _xruns = 0; + _xruns = 0; _xrun_delay = 0; } diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp index d1cf395..311b72a 100644 --- a/src/JackDriver.hpp +++ b/src/JackDriver.hpp @@ -65,8 +65,8 @@ public: bool disconnect(boost::shared_ptr src, boost::shared_ptr dst); - size_t get_xruns() { return _xruns; } - void reset_xruns(); + uint32_t get_xruns() { return _xruns; } + void reset_xruns(); float get_max_dsp_load(); void reset_max_dsp_load(); @@ -104,11 +104,11 @@ private: Glib::Mutex _shutdown_mutex; - bool _is_activated; jack_position_t _last_pos; jack_nframes_t _buffer_size; - size_t _xruns; + uint32_t _xruns; float _xrun_delay; + bool _is_activated :1; }; #endif // PATCHAGE_JACKDRIVER_HPP diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 4355262..0cf5cc7 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -84,15 +84,9 @@ Patchage::Patchage(int argc, char** argv) #endif #ifdef HAVE_ALSA , _alsa_driver(NULL) - , _alsa_driver_autoattach(true) #endif , _jack_driver(NULL) - , _jack_driver_autoattach(true) , _state_manager(NULL) - , _attach(true) - , _driver_detached(false) - , _refresh(false) - , _enable_refresh(true) , INIT_WIDGET(_about_win) , INIT_WIDGET(_main_scrolledwin) , INIT_WIDGET(_main_win) @@ -125,6 +119,14 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_sample_rate_label) , INIT_WIDGET(_status_text) , INIT_WIDGET(_statusbar) + , _attach(true) + , _driver_detached(false) + , _refresh(false) + , _enable_refresh(true) + , _jack_driver_autoattach(true) +#ifdef HAVE_ALSA + , _alsa_driver_autoattach(true) +#endif { _settings_filename = getenv("HOME"); _settings_filename += "/.patchagerc"; @@ -408,7 +410,7 @@ Patchage::update_load() return true; char tmp_buf[8]; - snprintf(tmp_buf, sizeof(tmp_buf), "%zd", _jack_driver->get_xruns()); + snprintf(tmp_buf, sizeof(tmp_buf), "%u", _jack_driver->get_xruns()); _main_xrun_progress->set_text(string(tmp_buf) + " Dropouts"); diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 2a52efb..048c1e4 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -129,7 +129,6 @@ protected: #ifdef HAVE_ALSA AlsaDriver* _alsa_driver; - bool _alsa_driver_autoattach; void menu_alsa_connect(); void menu_alsa_disconnect(); #endif @@ -143,16 +142,11 @@ protected: std::set< boost::shared_ptr > _pending_resize; JackDriver* _jack_driver; - bool _jack_driver_autoattach; StateManager* _state_manager; Gtk::Main* _gtk_main; std::string _settings_filename; - bool _attach; - bool _driver_detached; - bool _refresh; - bool _enable_refresh; Widget _about_win; Widget _main_scrolledwin; @@ -186,6 +180,16 @@ protected: Widget _sample_rate_label; Widget _status_text; Widget _statusbar; + + bool _attach; + bool _driver_detached; + bool _refresh; + bool _enable_refresh; + bool _jack_driver_autoattach; +#ifdef HAVE_ALSA + bool _alsa_driver_autoattach; +#endif + }; #endif // PATCHAGE_PATCHAGE_HPP diff --git a/src/StateManager.hpp b/src/StateManager.hpp index 3f92a1c..cbf5cd4 100644 --- a/src/StateManager.hpp +++ b/src/StateManager.hpp @@ -61,10 +61,10 @@ public: private: struct ModuleSettings { ModuleSettings() : split(false) {} - bool split; boost::optional input_location; boost::optional output_location; boost::optional inout_location; + bool split; }; std::map _module_settings; -- cgit v1.2.1