2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
* Copyright (C) 2008-2011 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_location_ui_h__
|
|
|
|
#define __ardour_location_ui_h__
|
|
|
|
|
2005-10-27 00:40:14 -04:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/checkbutton.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/table.h>
|
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
#include <gtkmm/label.h>
|
2009-11-12 00:47:05 -05:00
|
|
|
#include <gtkmm/scrolledwindow.h>
|
2005-10-27 00:40:14 -04:00
|
|
|
|
2009-12-19 15:26:31 -05:00
|
|
|
#include "pbd/signals.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/location.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2017-07-15 11:38:28 -04:00
|
|
|
#include "widgets/ardour_button.h"
|
2017-07-16 22:55:52 -04:00
|
|
|
#include "widgets/pane.h"
|
2016-05-26 10:46:28 -04:00
|
|
|
|
2011-11-18 19:56:35 -05:00
|
|
|
#include "ardour_window.h"
|
2009-11-12 00:47:05 -05:00
|
|
|
#include "audio_clock.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Location;
|
|
|
|
}
|
|
|
|
|
2011-03-02 17:43:19 -05:00
|
|
|
class ClockGroup;
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
class LocationEditRow : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2017-02-14 09:46:37 -05:00
|
|
|
public:
|
2005-09-25 14:42:24 -04:00
|
|
|
LocationEditRow (ARDOUR::Session *sess=0, ARDOUR::Location *loc=0, int32_t num=-1);
|
|
|
|
virtual ~LocationEditRow();
|
|
|
|
|
|
|
|
void set_location (ARDOUR::Location*);
|
|
|
|
ARDOUR::Location * get_location() { return location; }
|
|
|
|
|
|
|
|
void set_session (ARDOUR::Session *);
|
|
|
|
|
|
|
|
void set_number (int);
|
2008-09-10 11:03:30 -04:00
|
|
|
void focus_name();
|
2017-02-14 09:46:37 -05:00
|
|
|
void set_clock_group (ClockGroup&);
|
|
|
|
void unset_clock_group () { _clock_group = 0; }
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
sigc::signal<void,ARDOUR::Location*> remove_requested;
|
|
|
|
sigc::signal<void> redraw_ranges;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2017-02-14 09:46:37 -05:00
|
|
|
protected:
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
enum LocationPart {
|
|
|
|
LocStart,
|
|
|
|
LocEnd,
|
|
|
|
LocLength
|
|
|
|
};
|
|
|
|
|
|
|
|
ARDOUR::Location *location;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Table item_table;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Entry name_entry;
|
|
|
|
Gtk::Label name_label;
|
|
|
|
Gtk::Label number_label;
|
2019-07-22 16:47:17 -04:00
|
|
|
Gtk::Label date_label;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::HBox start_hbox;
|
|
|
|
AudioClock start_clock;
|
2017-07-15 11:38:28 -04:00
|
|
|
ArdourWidgets::ArdourButton start_to_playhead_button;
|
|
|
|
ArdourWidgets::ArdourButton locate_to_start_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::HBox end_hbox;
|
|
|
|
AudioClock end_clock;
|
2017-07-15 11:38:28 -04:00
|
|
|
ArdourWidgets::ArdourButton end_to_playhead_button;
|
|
|
|
ArdourWidgets::ArdourButton locate_to_end_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
AudioClock length_clock;
|
|
|
|
Gtk::CheckButton cd_check_button;
|
2023-08-25 21:18:45 -04:00
|
|
|
Gtk::CheckButton section_check_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::CheckButton hide_check_button;
|
2010-08-09 14:22:10 -04:00
|
|
|
Gtk::CheckButton lock_check_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2017-07-15 11:38:28 -04:00
|
|
|
ArdourWidgets::ArdourButton remove_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::HBox cd_track_details_hbox;
|
|
|
|
Gtk::Entry isrc_entry;
|
|
|
|
Gtk::Label isrc_label;
|
|
|
|
|
|
|
|
|
|
|
|
Gtk::Label performer_label;
|
2011-03-02 17:43:19 -05:00
|
|
|
Gtk::Entry performer_entry;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Label composer_label;
|
2017-02-14 09:46:37 -05:00
|
|
|
Gtk::Entry composer_entry;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::CheckButton scms_check_button;
|
2011-12-12 10:13:10 -05:00
|
|
|
Gtk::Label scms_label;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::CheckButton preemph_check_button;
|
2011-12-12 10:13:10 -05:00
|
|
|
Gtk::Label preemph_label;
|
2017-02-14 09:46:37 -05:00
|
|
|
ClockGroup* _clock_group;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
guint32 i_am_the_modifier;
|
|
|
|
int number;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void name_entry_changed ();
|
|
|
|
void isrc_entry_changed ();
|
|
|
|
void performer_entry_changed ();
|
|
|
|
void composer_entry_changed ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-03-09 19:43:23 -05:00
|
|
|
void to_playhead_button_pressed (LocationPart part);
|
2016-04-25 12:17:35 -04:00
|
|
|
void locate_button_pressed (LocationPart part);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void clock_changed (LocationPart part);
|
2011-12-11 12:26:48 -05:00
|
|
|
bool locate_to_clock (GdkEventButton*, AudioClock*);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void cd_toggled ();
|
2023-08-25 21:18:45 -04:00
|
|
|
void section_toggled ();
|
2005-09-25 14:42:24 -04:00
|
|
|
void hide_toggled ();
|
2010-08-09 14:22:10 -04:00
|
|
|
void lock_toggled ();
|
2005-09-25 14:42:24 -04:00
|
|
|
void remove_button_pressed ();
|
|
|
|
|
|
|
|
void scms_toggled ();
|
|
|
|
void preemph_toggled ();
|
|
|
|
|
2014-09-19 22:50:50 -04:00
|
|
|
void end_changed ();
|
|
|
|
void start_changed ();
|
|
|
|
void name_changed ();
|
|
|
|
void location_changed ();
|
|
|
|
void flags_changed ();
|
|
|
|
void lock_changed ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-06-19 09:07:02 -04:00
|
|
|
void set_clock_editable_status ();
|
2013-07-01 13:56:10 -04:00
|
|
|
void show_cd_track_details ();
|
2010-08-09 20:28:20 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
PBD::ScopedConnectionList connections;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2017-02-14 09:46:37 -05:00
|
|
|
public:
|
2017-02-14 11:15:16 -05:00
|
|
|
LocationUI (std::string state_node_name = "LocationUI");
|
2005-09-25 14:42:24 -04:00
|
|
|
~LocationUI ();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-12 00:47:05 -05:00
|
|
|
void add_new_location();
|
|
|
|
void add_new_range();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-12 00:47:05 -05:00
|
|
|
void refresh_location_list ();
|
2008-01-10 16:20:59 -05:00
|
|
|
|
2011-11-23 16:22:02 -05:00
|
|
|
XMLNode & get_state () const;
|
2017-02-14 11:15:16 -05:00
|
|
|
int set_state (const XMLNode&);
|
2011-11-23 16:22:02 -05:00
|
|
|
|
2017-02-14 09:46:37 -05:00
|
|
|
private:
|
2012-05-01 17:34:24 -04:00
|
|
|
/** set to the location that has just been created with the LocationUI `add' button
|
|
|
|
(if Config->get_name_new_markers() is true); if it is non-0, the name entry of
|
|
|
|
the location is given the focus by location_added().
|
|
|
|
*/
|
2008-09-10 11:03:30 -04:00
|
|
|
ARDOUR::Location *newest_location;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void session_going_away ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
LocationEditRow loop_edit_row;
|
|
|
|
LocationEditRow punch_edit_row;
|
2009-11-23 19:06:12 -05:00
|
|
|
Gtk::VBox loop_punch_box;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2017-07-16 22:55:52 -04:00
|
|
|
ArdourWidgets::VPane loc_range_panes;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2018-06-09 13:08:15 -04:00
|
|
|
Gtk::VBox loc_frame_box;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Button add_location_button;
|
|
|
|
Gtk::ScrolledWindow location_rows_scroller;
|
|
|
|
Gtk::VBox location_rows;
|
|
|
|
|
2018-06-09 13:08:15 -04:00
|
|
|
Gtk::VBox range_frame_box;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Button add_range_button;
|
|
|
|
Gtk::ScrolledWindow range_rows_scroller;
|
|
|
|
Gtk::VBox range_rows;
|
|
|
|
|
|
|
|
/* When any location changes it start
|
|
|
|
or end points, it sends a signal that is caught
|
|
|
|
by one of these functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
void location_remove_requested (ARDOUR::Location *);
|
|
|
|
|
|
|
|
void location_redraw_ranges ();
|
2023-12-08 16:03:22 -05:00
|
|
|
void queue_refresh_location_list ();
|
|
|
|
bool idle_refresh_location_list ();
|
|
|
|
sigc::connection _redisplay_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
gint do_location_remove (ARDOUR::Location *);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
guint32 i_am_the_modifier;
|
|
|
|
|
|
|
|
void location_removed (ARDOUR::Location *);
|
|
|
|
void location_added (ARDOUR::Location *);
|
2014-10-24 12:18:40 -04:00
|
|
|
void map_locations (const ARDOUR::Locations::LocationList&);
|
2011-03-02 17:43:19 -05:00
|
|
|
|
2017-02-14 09:46:37 -05:00
|
|
|
ClockGroup* _clock_group;
|
2017-02-14 11:15:16 -05:00
|
|
|
AudioClock::Mode clock_mode_from_session_instant_xml ();
|
|
|
|
|
|
|
|
AudioClock::Mode _mode;
|
|
|
|
bool _mode_set;
|
|
|
|
|
|
|
|
std::string _state_node_name;
|
2009-11-12 00:47:05 -05:00
|
|
|
};
|
|
|
|
|
2011-11-18 19:56:35 -05:00
|
|
|
class LocationUIWindow : public ArdourWindow
|
2009-11-12 00:47:05 -05:00
|
|
|
{
|
2017-02-14 09:46:37 -05:00
|
|
|
public:
|
2009-11-12 00:47:05 -05:00
|
|
|
LocationUIWindow ();
|
|
|
|
~LocationUIWindow ();
|
|
|
|
|
2011-04-22 22:00:23 -04:00
|
|
|
void on_map ();
|
2009-11-12 00:47:05 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
|
|
|
|
|
|
|
LocationUI& ui() { return _ui; }
|
2005-12-29 19:34:21 -05:00
|
|
|
|
2017-02-14 09:46:37 -05:00
|
|
|
protected:
|
2009-11-12 00:47:05 -05:00
|
|
|
LocationUI _ui;
|
2005-12-29 19:34:21 -05:00
|
|
|
bool on_delete_event (GdkEventAny*);
|
2009-12-17 13:24:23 -05:00
|
|
|
void session_going_away();
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __ardour_location_ui_h__
|