ardour/gtk2_ardour/mixer_snapshots.h

116 lines
3.3 KiB
C
Raw Normal View History

/*
Copyright (C) 2000-2019 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __gtk_ardour_mixer_snapshots_h__
#define __gtk_ardour_mixer_snapshots_h__
#include <ctime>
#include <gtkmm/button.h>
#include <gtkmm/widget.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treeview.h>
#include <gtkmm/box.h>
#include <sigc++/trackable.h>
2019-08-09 15:10:36 -05:00
#include "mixer_snapshot_substitution_dialog.h"
#include "ardour/mixer_snapshot.h"
#include "ardour/mixer_snapshot_manager.h"
#include "pbd/signals.h"
class MixerSnapshotList : public ARDOUR::SessionHandlePtr, public sigc::trackable
{
public:
2019-08-02 12:17:10 -05:00
MixerSnapshotList (bool global);
2019-08-02 12:17:10 -05:00
void set_session (ARDOUR::Session *);
2019-08-02 12:17:10 -05:00
Gtk::Widget& widget () {
return *_window_packer;
}
2019-08-02 12:17:10 -05:00
Gtk::Widget& display() {
return _scroller;
}
2019-08-02 12:17:10 -05:00
void new_snapshot();
void new_snapshot_from_session();
2019-08-02 12:17:10 -05:00
void redisplay ();
PBD::ScopedConnectionList connections;
private:
2019-08-02 12:17:10 -05:00
Gtk::VBox* _window_packer;
Gtk::HBox* _button_packer;
Gtk::ScrolledWindow _scroller;
struct Columns : public Gtk::TreeModel::ColumnRecord {
Columns () {
add (name);
add (n_tracks);
add (n_vcas);
add (n_groups);
add (date);
add (version);
add (timestamp);
add (snapshot);
2019-08-02 12:17:10 -05:00
}
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<int32_t> n_tracks;
Gtk::TreeModelColumn<int32_t> n_vcas;
Gtk::TreeModelColumn<int32_t> n_groups;
Gtk::TreeModelColumn<std::string> date;
Gtk::TreeModelColumn<std::string> version;
Gtk::TreeModelColumn<std::time_t> timestamp;
Gtk::TreeModelColumn<ARDOUR::MixerSnapshot*> snapshot; //TODO: these are leaked
2019-08-02 12:17:10 -05:00
};
2019-08-02 12:17:10 -05:00
Columns _columns;
Glib::RefPtr<Gtk::ListStore> _snapshot_model;
Gtk::TreeView _snapshot_display;
Gtk::Menu _menu;
2019-08-02 12:17:10 -05:00
Gtk::Button add_template_button;
Gtk::Button add_session_template_button;
2019-08-02 12:17:10 -05:00
void bootstrap_display_and_model();
2019-08-02 12:17:10 -05:00
bool _bug_user;
bool _global;
2019-08-09 15:10:36 -05:00
void substitution_dialog_response(int, MixerSnapshotSubstitutionDialog*);
2019-08-02 12:17:10 -05:00
bool button_press (GdkEventButton *);
void selection_changed ();
void popup_context_menu (int, int32_t, Gtk::TreeModel::iterator&);
void remove_snapshot (Gtk::TreeModel::iterator&);
void rename_snapshot (Gtk::TreeModel::iterator&);
void promote_snapshot (Gtk::TreeModel::iterator&);
Gtk::TreeModel::const_iterator get_row_by_name(const std::string&);
bool remove_row(Gtk::TreeModel::const_iterator&);
};
#endif // __gtk_ardour_mixer_snapshots_h__