2019-07-25 18:26:13 -05:00
|
|
|
/*
|
2019-08-13 09:41:33 -05:00
|
|
|
Copyright (C) 2019 Nikolaus Gullotta
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-13 09:41:33 -05:00
|
|
|
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.
|
2019-07-25 18:26:13 -05:00
|
|
|
|
|
|
|
|
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
|
2019-08-13 09:41:33 -05:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2019-07-25 18:26:13 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __gtk_ardour_mixer_snapshots_h__
|
|
|
|
|
#define __gtk_ardour_mixer_snapshots_h__
|
|
|
|
|
|
2019-07-29 15:13:33 -05:00
|
|
|
#include <ctime>
|
|
|
|
|
|
2019-08-21 09:35:45 -05:00
|
|
|
#include <gtkmm/box.h>
|
2019-07-29 15:13:33 -05:00
|
|
|
#include <gtkmm/button.h>
|
2019-08-21 09:35:45 -05:00
|
|
|
#include <gtkmm/filechooserdialog.h>
|
2019-07-25 18:26:13 -05:00
|
|
|
#include <gtkmm/scrolledwindow.h>
|
|
|
|
|
#include <gtkmm/treemodel.h>
|
|
|
|
|
#include <gtkmm/treeview.h>
|
2019-08-21 09:35:45 -05:00
|
|
|
#include <gtkmm/widget.h>
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-08 09:13:07 -05:00
|
|
|
#include <sigc++/trackable.h>
|
|
|
|
|
|
2019-08-09 15:10:36 -05:00
|
|
|
#include "mixer_snapshot_substitution_dialog.h"
|
|
|
|
|
|
2019-07-25 18:26:13 -05:00
|
|
|
#include "ardour/mixer_snapshot.h"
|
2019-08-01 13:38:22 -05:00
|
|
|
#include "ardour/mixer_snapshot_manager.h"
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-08 09:13:07 -05:00
|
|
|
#include "pbd/signals.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MixerSnapshotList : public ARDOUR::SessionHandlePtr, public sigc::trackable
|
2019-07-25 18:26:13 -05:00
|
|
|
{
|
|
|
|
|
public:
|
2019-08-02 12:17:10 -05:00
|
|
|
MixerSnapshotList (bool global);
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
Gtk::Widget& widget () {
|
|
|
|
|
return *_window_packer;
|
|
|
|
|
}
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
Gtk::Widget& display() {
|
|
|
|
|
return _scroller;
|
|
|
|
|
}
|
2019-08-02 11:04:34 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
void new_snapshot();
|
2019-08-21 09:35:45 -05:00
|
|
|
void new_snapshot_from_external();
|
2019-08-15 10:40:27 -05:00
|
|
|
void new_row_from_snapshot(ARDOUR::MixerSnapshot*);
|
2019-07-29 15:13:33 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
void redisplay ();
|
2019-07-25 18:26:13 -05:00
|
|
|
|
2019-09-09 14:48:38 -05:00
|
|
|
bool get_make_tracks() {return _make_tracks;};
|
|
|
|
|
void set_make_tracks(bool yn) {_make_tracks = yn;};
|
|
|
|
|
|
2019-08-08 09:13:07 -05:00
|
|
|
PBD::ScopedConnectionList connections;
|
2019-07-25 18:26:13 -05:00
|
|
|
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);
|
2019-07-25 18:26:13 -05:00
|
|
|
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;
|
2019-07-30 15:21:33 -05:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::MixerSnapshot*> snapshot; //TODO: these are leaked
|
2019-08-02 12:17:10 -05:00
|
|
|
};
|
2019-07-25 18:26:13 -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-07-25 18:26:13 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
Gtk::Button add_template_button;
|
|
|
|
|
Gtk::Button add_session_template_button;
|
2019-07-29 15:13:33 -05:00
|
|
|
|
2019-08-21 09:35:45 -05:00
|
|
|
Gtk::FileChooserDialog _external_selector;
|
|
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
void bootstrap_display_and_model();
|
2019-08-02 11:04:34 -05:00
|
|
|
|
2019-08-02 12:17:10 -05:00
|
|
|
bool _bug_user;
|
|
|
|
|
bool _global;
|
2019-09-09 14:48:38 -05:00
|
|
|
bool _make_tracks;
|
2019-08-01 09:54:57 -05:00
|
|
|
|
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&);
|
2019-08-08 11:42:14 -05:00
|
|
|
Gtk::TreeModel::const_iterator get_row_by_name(const std::string&);
|
|
|
|
|
bool remove_row(Gtk::TreeModel::const_iterator&);
|
2019-08-14 14:05:05 -05:00
|
|
|
void add_promoted_snapshot(ARDOUR::MixerSnapshot*);
|
2019-08-20 14:15:43 -05:00
|
|
|
bool prompt_overwrite(const std::string&);
|
2019-08-21 09:35:45 -05:00
|
|
|
void choose_external_dialog_response(int);
|
2019-07-25 18:26:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // __gtk_ardour_mixer_snapshots_h__
|