summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-03 10:53:57 +0000
committerDavid Robillard <d@drobilla.net>2011-06-03 10:53:57 +0000
commit352137726820a7313a6a64fa0a8e276b490ad932 (patch)
treee70bd39875dad23d2c6c1e0ea168c103cb4c5b9b
parentb0f49e543d5f849bd128aecb7173a484b9748af9 (diff)
downloadpatchage-352137726820a7313a6a64fa0a8e276b490ad932.tar.gz
patchage-352137726820a7313a6a64fa0a8e276b490ad932.tar.bz2
patchage-352137726820a7313a6a64fa0a8e276b490ad932.zip
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
-rw-r--r--src/JackDriver.cpp6
-rw-r--r--src/JackDriver.hpp8
-rw-r--r--src/Patchage.cpp16
-rw-r--r--src/Patchage.hpp16
-rw-r--r--src/StateManager.hpp2
5 files changed, 27 insertions, 21 deletions
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<JackDriver*>(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<PatchagePort> src,
boost::shared_ptr<PatchagePort> 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<FlowCanvas::Module> > _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<Gtk::AboutDialog> _about_win;
Widget<Gtk::ScrolledWindow> _main_scrolledwin;
@@ -186,6 +180,16 @@ protected:
Widget<Gtk::Label> _sample_rate_label;
Widget<Gtk::TextView> _status_text;
Widget<Gtk::Statusbar> _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<Coord> input_location;
boost::optional<Coord> output_location;
boost::optional<Coord> inout_location;
+ bool split;
};
std::map<std::string,ModuleSettings> _module_settings;