Constification: make Stateful::get_state() const, with all other required const-ness added (GUI)

This commit is contained in:
Paul Davis 2022-04-06 21:56:45 -06:00
parent 7bf89ce109
commit ca22ba77e1
35 changed files with 43 additions and 42 deletions

View File

@ -1186,7 +1186,7 @@ AutomationLine::track_exited()
} }
XMLNode & XMLNode &
AutomationLine::get_state (void) AutomationLine::get_state () const
{ {
/* function as a proxy for the model */ /* function as a proxy for the model */
return alist->get_state(); return alist->get_state();

View File

@ -142,7 +142,7 @@ public:
bool is_last_point (ControlPoint &); bool is_last_point (ControlPoint &);
bool is_first_point (ControlPoint &); bool is_first_point (ControlPoint &);
XMLNode& get_state (void); XMLNode& get_state () const;
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
void set_colors(); void set_colors();

View File

@ -2634,7 +2634,7 @@ Editor::set_state (const XMLNode& node, int version)
} }
XMLNode& XMLNode&
Editor::get_state () Editor::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Editor")); XMLNode* node = new XMLNode (X_("Editor"));

View File

@ -207,7 +207,7 @@ public:
void undo (uint32_t n = 1); void undo (uint32_t n = 1);
void redo (uint32_t n = 1); void redo (uint32_t n = 1);
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
void set_mouse_mode (Editing::MouseMode, bool force = false); void set_mouse_mode (Editing::MouseMode, bool force = false);
@ -358,7 +358,7 @@ public:
void get_onscreen_tracks (TrackViewList&); void get_onscreen_tracks (TrackViewList&);
Width editor_mixer_strip_width; Width editor_mixer_strip_width;
void maybe_add_mixer_strip_width (XMLNode&); void maybe_add_mixer_strip_width (XMLNode&) const;
void show_editor_mixer (bool yn); void show_editor_mixer (bool yn);
void create_editor_mixer (); void create_editor_mixer ();
void show_editor_list (bool yn); void show_editor_list (bool yn);

View File

@ -260,7 +260,7 @@ Editor::current_mixer_strip_hidden ()
} }
void void
Editor::maybe_add_mixer_strip_width (XMLNode& node) Editor::maybe_add_mixer_strip_width (XMLNode& node) const
{ {
if (current_mixer_strip) { if (current_mixer_strip) {
node.set_property ("mixer-width", editor_mixer_strip_width); node.set_property ("mixer-width", editor_mixer_strip_width);

View File

@ -2021,7 +2021,7 @@ EngineControl::maybe_display_saved_state ()
} }
XMLNode& XMLNode&
EngineControl::get_state () EngineControl::get_state () const
{ {
LocaleGuard lg; LocaleGuard lg;

View File

@ -51,7 +51,7 @@ public:
static bool need_setup (); static bool need_setup ();
XMLNode& get_state (); XMLNode& get_state () const;
bool set_state (const XMLNode&); bool set_state (const XMLNode&);
void set_desired_sample_rate (uint32_t); void set_desired_sample_rate (uint32_t);

View File

@ -282,7 +282,7 @@ ExportVideoDialog::apply_state (TimeSelection& tme, bool range)
} }
XMLNode& XMLNode&
ExportVideoDialog::get_state () ExportVideoDialog::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Videoexport")); XMLNode* node = new XMLNode (X_("Videoexport"));
node->set_property (X_("NormalizeAudio"), normalize_checkbox.get_active ()); node->set_property (X_("NormalizeAudio"), normalize_checkbox.get_active ());

View File

@ -55,7 +55,7 @@ public:
void apply_state (TimeSelection& tme, bool range); void apply_state (TimeSelection& tme, bool range);
XMLNode& get_state (); XMLNode& get_state () const;
void set_state (const XMLNode&); void set_state (const XMLNode&);
private: private:

View File

@ -229,7 +229,7 @@ ArdourKeyboard::setup_keybindings ()
} }
XMLNode& XMLNode&
ArdourKeyboard::get_state (void) ArdourKeyboard::get_state () const
{ {
XMLNode* node = &Keyboard::get_state (); XMLNode* node = &Keyboard::get_state ();

View File

@ -38,7 +38,7 @@ class ArdourKeyboard : public Gtkmm2ext::Keyboard
public: public:
ArdourKeyboard(ARDOUR_UI&); ArdourKeyboard(ARDOUR_UI&);
XMLNode& get_state (void); XMLNode& get_state () const;
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
void setup_keybindings (); void setup_keybindings ();

View File

@ -2037,7 +2037,7 @@ LuaCallback::~LuaCallback ()
} }
XMLNode& XMLNode&
LuaCallback::get_state (void) LuaCallback::get_state () const
{ {
std::string saved; std::string saved;
{ {

View File

@ -49,7 +49,7 @@ public:
LuaCallback (ARDOUR::Session*, XMLNode & node); LuaCallback (ARDOUR::Session*, XMLNode & node);
~LuaCallback (); ~LuaCallback ();
XMLNode& get_state (void); XMLNode& get_state () const;
void set_session (ARDOUR::Session *); void set_session (ARDOUR::Session *);
const PBD::ID& id () const { return _id; } const PBD::ID& id () const { return _id; }

View File

@ -245,8 +245,9 @@ Meterbridge::set_window_pos_and_size ()
} }
void void
Meterbridge::get_window_pos_and_size () Meterbridge::get_window_pos_and_size () const
{ {
#warning CONSTIFICATION this really needs to work some other way, since this supposed to be const
get_position(m_root_x, m_root_y); get_position(m_root_x, m_root_y);
get_size(m_width, m_height); get_size(m_width, m_height);
} }
@ -491,7 +492,7 @@ Meterbridge::set_state (const XMLNode& node)
} }
XMLNode& XMLNode&
Meterbridge::get_state (void) Meterbridge::get_state () const
{ {
XMLNode* node = new XMLNode ("Meterbridge"); XMLNode* node = new XMLNode ("Meterbridge");

View File

@ -49,7 +49,7 @@ public:
void set_session (ARDOUR::Session *); void set_session (ARDOUR::Session *);
XMLNode& get_state (void); XMLNode& get_state () const;
int set_state (const XMLNode& ); int set_state (const XMLNode& );
void show_window (); void show_window ();
@ -130,10 +130,10 @@ private:
void update_title (); void update_title ();
// for restoring window geometry. // for restoring window geometry.
int m_root_x, m_root_y, m_width, m_height; mutable int m_root_x, m_root_y, m_width, m_height;
void set_window_pos_and_size (); void set_window_pos_and_size ();
void get_window_pos_and_size (); void get_window_pos_and_size () const;
bool on_key_press_event (GdkEventKey*); bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*);

View File

@ -2564,7 +2564,7 @@ Mixer_UI::save_plugin_order_file ()
} }
XMLNode& XMLNode&
Mixer_UI::get_state () Mixer_UI::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Mixer")); XMLNode* node = new XMLNode (X_("Mixer"));

View File

@ -103,7 +103,7 @@ public:
void set_strip_width (Width, bool save = false); void set_strip_width (Width, bool save = false);
Width get_strip_width () const { return _strip_width; } Width get_strip_width () const { return _strip_width; }
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int /* version */); int set_state (const XMLNode&, int /* version */);
void save_plugin_order_file (); void save_plugin_order_file ();

View File

@ -4588,7 +4588,7 @@ ProcessorWindowProxy::session_handle()
} }
XMLNode& XMLNode&
ProcessorWindowProxy::get_state () ProcessorWindowProxy::get_state () const
{ {
XMLNode *node; XMLNode *node;
node = &ProxyBase::get_state(); node = &ProxyBase::get_state();

View File

@ -103,7 +103,7 @@ public:
void set_custom_ui_mode(bool use_custom) { want_custom = use_custom; } void set_custom_ui_mode(bool use_custom) { want_custom = use_custom; }
int set_state (const XMLNode&, int); int set_state (const XMLNode&, int);
XMLNode& get_state (); XMLNode& get_state () const;
private: private:
ProcessorBox* _processor_box; ProcessorBox* _processor_box;

View File

@ -4874,7 +4874,7 @@ RCOptionEditor::use_own_window (bool and_fill_it)
} }
XMLNode& XMLNode&
RCOptionEditor::get_state () RCOptionEditor::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Preferences")); XMLNode* node = new XMLNode (X_("Preferences"));
node->add_child_nocopy (Tabbable::get_state()); node->add_child_nocopy (Tabbable::get_state());

View File

@ -44,7 +44,7 @@ public:
void set_session (ARDOUR::Session*); void set_session (ARDOUR::Session*);
Gtk::Window* use_own_window (bool and_fill_it); Gtk::Window* use_own_window (bool and_fill_it);
XMLNode& get_state (); XMLNode& get_state () const;
bool on_key_release_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*);

View File

@ -364,7 +364,7 @@ RecorderUI::tabbed_changed (bool tabbed)
} }
XMLNode& XMLNode&
RecorderUI::get_state () RecorderUI::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Recorder")); XMLNode* node = new XMLNode (X_("Recorder"));
node->add_child_nocopy (Tabbable::get_state ()); node->add_child_nocopy (Tabbable::get_state ());

View File

@ -65,7 +65,7 @@ public:
void set_session (ARDOUR::Session*); void set_session (ARDOUR::Session*);
void cleanup (); void cleanup ();
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int /* version */); int set_state (const XMLNode&, int /* version */);
Gtk::Window* use_own_window (bool and_fill_it); Gtk::Window* use_own_window (bool and_fill_it);

View File

@ -32,7 +32,7 @@ SelectionMemento::~SelectionMemento ()
} }
XMLNode& XMLNode&
SelectionMemento::get_state () { SelectionMemento::get_state () const {
XMLNode* node = new XMLNode ("SelectionMemento"); XMLNode* node = new XMLNode ("SelectionMemento");
PublicEditor& editor = PublicEditor::instance(); PublicEditor& editor = PublicEditor::instance();

View File

@ -27,7 +27,7 @@ public:
SelectionMemento (); SelectionMemento ();
~SelectionMemento (); ~SelectionMemento ();
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
}; };
#endif /* __ardour_gtk_selection_memento_h__ */ #endif /* __ardour_gtk_selection_memento_h__ */

View File

@ -361,7 +361,7 @@ StripSilenceDialog::update_progress_gui (float p)
} }
XMLNode& XMLNode&
StripSilenceDialog::get_state () StripSilenceDialog::get_state () const
{ {
XMLNode* node = new XMLNode(X_("StripSilence")); XMLNode* node = new XMLNode(X_("StripSilence"));
node->set_property(X_("threshold"), threshold()); node->set_property(X_("threshold"), threshold());

View File

@ -57,7 +57,7 @@ public:
Gtk::Dialog::on_response (response_id); Gtk::Dialog::on_response (response_id);
} }
XMLNode& get_state (); XMLNode& get_state () const;
void set_state (const XMLNode &); void set_state (const XMLNode &);
private: private:

View File

@ -218,7 +218,7 @@ TriggerPage::use_own_window (bool and_fill_it)
} }
XMLNode& XMLNode&
TriggerPage::get_state () TriggerPage::get_state () const
{ {
XMLNode* node = new XMLNode (X_("TriggerPage")); XMLNode* node = new XMLNode (X_("TriggerPage"));
node->add_child_nocopy (Tabbable::get_state ()); node->add_child_nocopy (Tabbable::get_state ());

View File

@ -56,7 +56,7 @@ public:
void set_session (ARDOUR::Session*); void set_session (ARDOUR::Session*);
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int /* version */); int set_state (const XMLNode&, int /* version */);
Gtk::Window* use_own_window (bool and_fill_it); Gtk::Window* use_own_window (bool and_fill_it);

View File

@ -512,7 +512,7 @@ UIConfiguration::save_state()
} }
XMLNode& XMLNode&
UIConfiguration::get_state () UIConfiguration::get_state () const
{ {
XMLNode* root; XMLNode* root;
@ -529,7 +529,7 @@ UIConfiguration::get_state ()
} }
XMLNode& XMLNode&
UIConfiguration::get_variables (std::string which_node) UIConfiguration::get_variables (std::string which_node) const
{ {
XMLNode* node; XMLNode* node;

View File

@ -62,8 +62,8 @@ public:
int load_color_theme (bool allow_own); int load_color_theme (bool allow_own);
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
XMLNode& get_state (void); XMLNode& get_state () const;
XMLNode& get_variables (std::string); XMLNode& get_variables (std::string) const;
void set_variables (const XMLNode&); void set_variables (const XMLNode&);
std::string color_file_name (bool use_my, bool with_version) const; std::string color_file_name (bool use_my, bool with_version) const;
@ -133,7 +133,7 @@ private:
#include "canvas_vars.h" #include "canvas_vars.h"
#undef CANVAS_FONT_VARIABLE #undef CANVAS_FONT_VARIABLE
XMLNode& state (); XMLNode& state () const;
bool _dirty; bool _dirty;
bool aliases_modified; bool aliases_modified;
bool colors_modified; bool colors_modified;

View File

@ -224,7 +224,7 @@ VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
} }
XMLNode& XMLNode&
VideoTimeLine::get_state () VideoTimeLine::get_state () const
{ {
XMLNode* node = new XMLNode (X_("Videotimeline")); XMLNode* node = new XMLNode (X_("Videotimeline"));
node->set_property (X_("VideoOffset"), video_offset_p); node->set_property (X_("VideoOffset"), video_offset_p);

View File

@ -62,7 +62,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
void set_height (int); void set_height (int);
void save_undo (void); void save_undo (void);
XMLNode& get_state (); XMLNode& get_state () const;
int set_state (const XMLNode&, int version); int set_state (const XMLNode&, int version);
bool video_file_info (std::string, bool); bool video_file_info (std::string, bool);

View File

@ -260,7 +260,7 @@ VirtualKeyboardWindow::parameter_changed (std::string const& p)
} }
XMLNode& XMLNode&
VirtualKeyboardWindow::get_state () VirtualKeyboardWindow::get_state () const
{ {
XMLNode* node = new XMLNode (X_("VirtualKeyboard")); XMLNode* node = new XMLNode (X_("VirtualKeyboard"));
node->set_property (X_("Channel"), _midi_channel.get_text ()); node->set_property (X_("Channel"), _midi_channel.get_text ());

View File

@ -89,7 +89,7 @@ public:
void set_session (ARDOUR::Session*); void set_session (ARDOUR::Session*);
XMLNode& get_state (); XMLNode& get_state () const;
void set_state (const XMLNode&); void set_state (const XMLNode&);
protected: protected: