summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/BreadCrumb.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
committerDavid Robillard <d@drobilla.net>2006-09-13 06:11:25 +0000
commite5675ebfeb93175e16762d0a078bd51d15d05f63 (patch)
tree189249ed9014e4c482cfaed0d6af28ced68570ca /src/progs/ingenuity/BreadCrumb.h
parent23b7568ab7a87a79c186b8ddf3d3db4f1f934b06 (diff)
downloadingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.gz
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.tar.bz2
ingen-e5675ebfeb93175e16762d0a078bd51d15d05f63.zip
Heavy-duty redesign of client library and GUI (now fully signal driven with clean Model/View separation).
Smarter, centralized window creation/management (should make window unification easy (panes?)). Typed metadata system, no more fugly string conversion of floats. Supports OSC fundamental types string, int, float, blob for now (though blob isn't working over the wire yet). git-svn-id: http://svn.drobilla.net/lad/ingen@131 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/BreadCrumb.h')
-rw-r--r--src/progs/ingenuity/BreadCrumb.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/progs/ingenuity/BreadCrumb.h b/src/progs/ingenuity/BreadCrumb.h
index 66e6d40a..908e0f80 100644
--- a/src/progs/ingenuity/BreadCrumb.h
+++ b/src/progs/ingenuity/BreadCrumb.h
@@ -17,31 +17,44 @@
#ifndef BREADCRUMB_H
#define BREADCRUMB_H
-// FIXME: remove
-#include <iostream>
-using std::cerr; using std::endl;
-
#include <gtkmm.h>
#include "util/Path.h"
+#include "util/CountedPtr.h"
+#include "PatchView.h"
namespace Ingenuity {
/** Breadcrumb button in a PatchWindow.
*
+ * Each Breadcrumb stores a reference to a PatchView for quick switching.
+ * So, the amount of allocated PatchViews at a given time is equal to the
+ * number of visible breadcrumbs (which is the perfect cache for GUI
+ * responsiveness balanced with mem consumption).
+ *
* \ingroup Ingenuity
*/
class BreadCrumb : public Gtk::ToggleButton
{
public:
- BreadCrumb(const Path& path)
- : m_path(path)
+ BreadCrumb(const Path& path, CountedPtr<PatchView> view = CountedPtr<PatchView>())
+ : _path(path)
+ , _view(view)
{
+ assert( !view || view->patch()->path() == path);
set_border_width(0);
set_path(path);
show_all();
}
+ void set_view(CountedPtr<PatchView> view) {
+ assert( !view || view->patch()->path() == _path);
+ _view = view;
+ }
+
+ const Path& path() const { return _path; }
+ CountedPtr<PatchView> view() const { return _view; }
+
void set_path(const Path& path)
{
remove();
@@ -50,12 +63,14 @@ public:
lab->set_padding(0, 0);
lab->show();
add(*lab);
+
+ if (_view && _view->patch()->path() != path)
+ _view.reset();
}
- const Path& path() { return m_path; }
-
private:
- Path m_path;
+ Path _path;
+ CountedPtr<PatchView> _view;
};
} // namespace Ingenuity