mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-18 20:56:28 +01:00
fix inheritance/class design to get both SessionOptionEditor and RCOptionEditor to work correctly
This commit is contained in:
parent
30b065f6ef
commit
e268a9d2aa
7 changed files with 47 additions and 15 deletions
|
|
@ -121,7 +121,7 @@ class ArdourPrompter;
|
||||||
class PublicEditor;
|
class PublicEditor;
|
||||||
class SaveAsDialog;
|
class SaveAsDialog;
|
||||||
class SessionDialog;
|
class SessionDialog;
|
||||||
class SessionOptionEditor;
|
class SessionOptionEditorWindow;
|
||||||
class ShuttleControl;
|
class ShuttleControl;
|
||||||
class Splash;
|
class Splash;
|
||||||
class TimeInfoBox;
|
class TimeInfoBox;
|
||||||
|
|
|
||||||
|
|
@ -474,15 +474,11 @@ OptionEditor::OptionEditor (PBD::Configuration* c, std::string const & t)
|
||||||
{
|
{
|
||||||
using namespace Notebook_Helpers;
|
using namespace Notebook_Helpers;
|
||||||
|
|
||||||
set_border_width (4);
|
|
||||||
|
|
||||||
pack_start (_notebook, true, true);
|
|
||||||
|
|
||||||
_notebook.set_show_tabs (true);
|
_notebook.set_show_tabs (true);
|
||||||
_notebook.set_show_border (true);
|
_notebook.set_show_border (true);
|
||||||
_notebook.set_name ("OptionsNotebook");
|
_notebook.set_name ("OptionsNotebook");
|
||||||
|
|
||||||
show_all ();
|
|
||||||
|
|
||||||
/* Watch out for changes to parameters */
|
/* Watch out for changes to parameters */
|
||||||
_config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&OptionEditor::parameter_changed, this, _1), gui_context());
|
_config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&OptionEditor::parameter_changed, this, _1), gui_context());
|
||||||
|
|
@ -591,3 +587,22 @@ DirectoryOption::selection_changed ()
|
||||||
{
|
{
|
||||||
_set (poor_mans_glob(_file_chooser.get_filename ()));
|
_set (poor_mans_glob(_file_chooser.get_filename ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*--------------------------*/
|
||||||
|
|
||||||
|
OptionEditorContainer::OptionEditorContainer (PBD::Configuration* c, string const& str)
|
||||||
|
: OptionEditor (c, str)
|
||||||
|
{
|
||||||
|
set_border_width (4);
|
||||||
|
pack_start (notebook(), true, true);
|
||||||
|
show_all ();
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionEditorWindow::OptionEditorWindow (PBD::Configuration* c, string const& str)
|
||||||
|
: OptionEditor (c, str)
|
||||||
|
{
|
||||||
|
container.set_border_width (4);
|
||||||
|
container.pack_start (notebook(), true, true);
|
||||||
|
container.show_all ();
|
||||||
|
add (container);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,10 @@
|
||||||
#include <gtkmm/comboboxtext.h>
|
#include <gtkmm/comboboxtext.h>
|
||||||
#include <gtkmm/spinbutton.h>
|
#include <gtkmm/spinbutton.h>
|
||||||
#include <gtkmm/table.h>
|
#include <gtkmm/table.h>
|
||||||
|
#include <gtkmm/window.h>
|
||||||
|
|
||||||
#include "gtkmm2ext/slider_controller.h"
|
#include "gtkmm2ext/slider_controller.h"
|
||||||
|
|
||||||
#include "ardour_window.h"
|
#include "ardour_window.h"
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
@ -680,7 +683,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The OptionEditor dialog base class */
|
/** The OptionEditor dialog base class */
|
||||||
class OptionEditor : public Gtk::VBox, public ARDOUR::SessionHandlePtr
|
class OptionEditor : public ARDOUR::SessionHandlePtr, virtual public sigc::trackable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OptionEditor (PBD::Configuration *, std::string const &);
|
OptionEditor (PBD::Configuration *, std::string const &);
|
||||||
|
|
@ -692,19 +695,33 @@ public:
|
||||||
void set_current_page (std::string const &);
|
void set_current_page (std::string const &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void parameter_changed (std::string const &);
|
virtual void parameter_changed (std::string const &);
|
||||||
|
|
||||||
PBD::Configuration* _config;
|
PBD::Configuration* _config;
|
||||||
|
Gtk::Notebook& notebook() { return _notebook; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
PBD::ScopedConnection config_connection;
|
PBD::ScopedConnection config_connection;
|
||||||
|
|
||||||
Gtk::Notebook _notebook;
|
Gtk::Notebook _notebook;
|
||||||
std::map<std::string, OptionEditorPage*> _pages;
|
std::map<std::string, OptionEditorPage*> _pages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** The OptionEditor dialog-as-container base class */
|
||||||
|
class OptionEditorContainer : public OptionEditor, public Gtk::VBox
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OptionEditorContainer (PBD::Configuration *, std::string const &);
|
||||||
|
~OptionEditorContainer() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** The OptionEditor dialog-as-container base class */
|
||||||
|
class OptionEditorWindow : public OptionEditor, public Gtk::Window
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OptionEditorWindow (PBD::Configuration *, std::string const &);
|
||||||
|
~OptionEditorWindow() {}
|
||||||
|
private:
|
||||||
|
Gtk::VBox container;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __gtk_ardour_option_editor_h__ */
|
#endif /* __gtk_ardour_option_editor_h__ */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1720,7 +1720,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
RCOptionEditor::RCOptionEditor ()
|
RCOptionEditor::RCOptionEditor ()
|
||||||
: OptionEditor (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
|
: OptionEditorContainer (Config, string_compose (_("%1 Preferences"), PROGRAM_NAME))
|
||||||
, Tabbable (*this, _("Preferences")) /* pack self-as-vbox into tabbable */
|
, Tabbable (*this, _("Preferences")) /* pack self-as-vbox into tabbable */
|
||||||
, _rc_config (Config)
|
, _rc_config (Config)
|
||||||
, _mixer_strip_visibility ("mixer-element-visibility")
|
, _mixer_strip_visibility ("mixer-element-visibility")
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Editor for options which are obtained from and written back to one of the .rc files. */
|
/** Editor for options which are obtained from and written back to one of the .rc files. */
|
||||||
class RCOptionEditor : public OptionEditor, public Gtkmm2ext::Tabbable
|
class RCOptionEditor : public OptionEditorContainer, public Gtkmm2ext::Tabbable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RCOptionEditor ();
|
RCOptionEditor ();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ using namespace ARDOUR;
|
||||||
using namespace Timecode;
|
using namespace Timecode;
|
||||||
|
|
||||||
SessionOptionEditor::SessionOptionEditor (Session* s)
|
SessionOptionEditor::SessionOptionEditor (Session* s)
|
||||||
: OptionEditor (&(s->config), _("Session Properties"))
|
: OptionEditorWindow (&(s->config), _("Session Properties"))
|
||||||
, _session_config (&(s->config))
|
, _session_config (&(s->config))
|
||||||
{
|
{
|
||||||
set_session (s);
|
set_session (s);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace ARDOUR {
|
||||||
class SessionConfiguration;
|
class SessionConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SessionOptionEditor : public OptionEditor
|
class SessionOptionEditor : public OptionEditorWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SessionOptionEditor (ARDOUR::Session* s);
|
SessionOptionEditor (ARDOUR::Session* s);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue