2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 1999-2002 Paul Davis
|
2005-09-25 14:42:24 -04: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.
|
|
|
|
|
|
|
|
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 __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
|
|
|
|
2016-05-26 10:46:28 -04:00
|
|
|
#include <gtkmm2ext/pane.h>
|
|
|
|
|
2016-04-25 13:39:59 -04:00
|
|
|
#include "ardour_button.h"
|
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
|
|
|
{
|
|
|
|
public:
|
|
|
|
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();
|
2011-03-02 17:43:19 -05:00
|
|
|
void set_clock_group (ClockGroup&);
|
2015-01-22 20:16:21 -05:00
|
|
|
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
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
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;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::HBox start_hbox;
|
|
|
|
AudioClock start_clock;
|
2016-04-25 13:39:59 -04:00
|
|
|
ArdourButton start_to_playhead_button;
|
|
|
|
ArdourButton locate_to_start_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::HBox end_hbox;
|
|
|
|
AudioClock end_clock;
|
2016-04-25 13:39:59 -04:00
|
|
|
ArdourButton end_to_playhead_button;
|
|
|
|
ArdourButton locate_to_end_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
AudioClock length_clock;
|
|
|
|
Gtk::CheckButton cd_check_button;
|
|
|
|
Gtk::CheckButton hide_check_button;
|
2010-08-09 14:22:10 -04:00
|
|
|
Gtk::CheckButton lock_check_button;
|
|
|
|
Gtk::CheckButton glue_check_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2016-04-25 13:39:59 -04:00
|
|
|
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;
|
2011-03-02 17:43:19 -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;
|
2011-03-02 17:43:19 -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 ();
|
|
|
|
void hide_toggled ();
|
2010-08-09 14:22:10 -04:00
|
|
|
void lock_toggled ();
|
|
|
|
void glue_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 ();
|
|
|
|
void position_lock_style_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
|
|
|
{
|
|
|
|
public:
|
|
|
|
LocationUI ();
|
|
|
|
~LocationUI ();
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2011-03-02 17:43:19 -05:00
|
|
|
void set_clock_mode (AudioClock::Mode);
|
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;
|
|
|
|
|
2005-09-25 14:42:24 -04: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
|
|
|
|
2016-05-26 10:46:28 -04:00
|
|
|
Gtkmm2ext::VPane loc_range_panes;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::VBox loc_frame_box;
|
|
|
|
Gtk::Button add_location_button;
|
|
|
|
Gtk::ScrolledWindow location_rows_scroller;
|
|
|
|
Gtk::VBox location_rows;
|
|
|
|
|
|
|
|
Gtk::VBox range_frame_box;
|
|
|
|
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 ();
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
ClockGroup* _clock_group;
|
2011-11-23 16:22:02 -05:00
|
|
|
AudioClock::Mode clock_mode_from_session_instant_xml () const;
|
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
|
|
|
{
|
|
|
|
public:
|
|
|
|
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
|
|
|
|
|
|
|
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__
|