mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
RecorderUI: initial implementation
This commit is contained in:
parent
f10d380d9a
commit
582c99a156
12 changed files with 3309 additions and 18 deletions
187
gtk2_ardour/track_record_axis.h
Normal file
187
gtk2_ardour/track_record_axis.h
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* Copyright (C) 2020 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.
|
||||
*/
|
||||
|
||||
#ifndef __gtkardour_track_record_axis_h_
|
||||
#define __gtkardour_track_record_axis_h_
|
||||
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
#include <gtkmm/alignment.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/eventbox.h>
|
||||
#include <gtkmm/separator.h>
|
||||
#include <gtkmm/sizegroup.h>
|
||||
|
||||
#include "pbd/stateful.h"
|
||||
|
||||
#include "ardour/ardour.h"
|
||||
#include "ardour/types.h"
|
||||
|
||||
#include "widgets/ardour_button.h"
|
||||
#include "widgets/ardour_spacer.h"
|
||||
|
||||
#include "io_button.h"
|
||||
#include "level_meter.h"
|
||||
#include "route_ui.h"
|
||||
|
||||
namespace ARDOUR
|
||||
{
|
||||
class Region;
|
||||
class Route;
|
||||
class RouteGroup;
|
||||
class Session;
|
||||
class Track;
|
||||
}
|
||||
|
||||
class LevelMeterVBox;
|
||||
class RouteGroupMenu;
|
||||
|
||||
class TrackRecordAxis : public Gtk::VBox, public AxisView, public RouteUI
|
||||
{
|
||||
public:
|
||||
TrackRecordAxis (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
|
||||
~TrackRecordAxis ();
|
||||
|
||||
/* AxisView */
|
||||
std::string name () const;
|
||||
Gdk::Color color () const;
|
||||
|
||||
boost::shared_ptr<ARDOUR::Stripable> stripable() const {
|
||||
return RouteUI::stripable();
|
||||
}
|
||||
|
||||
void set_session (ARDOUR::Session* s);
|
||||
|
||||
void fast_update ();
|
||||
void set_gui_extents (samplepos_t, samplepos_t);
|
||||
bool rec_extent (samplepos_t&, samplepos_t&) const;
|
||||
int summary_xpos () const;
|
||||
int summary_width () const;
|
||||
|
||||
static PBD::Signal1<void, TrackRecordAxis*> CatchDeletion;
|
||||
|
||||
protected:
|
||||
void self_delete ();
|
||||
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
void on_size_request (Gtk::Requisition*);
|
||||
|
||||
/* AxisView */
|
||||
std::string state_id () const;
|
||||
|
||||
/* route UI */
|
||||
void set_button_names ();
|
||||
void blink_rec_display (bool onoff);
|
||||
void route_active_changed ();
|
||||
void map_frozen ();
|
||||
|
||||
private:
|
||||
void on_theme_changed ();
|
||||
void parameter_changed (std::string const& p);
|
||||
|
||||
void set_name_label ();
|
||||
|
||||
void reset_peak_display ();
|
||||
void reset_route_peak_display (ARDOUR::Route*);
|
||||
void reset_group_peak_display (ARDOUR::RouteGroup*);
|
||||
|
||||
bool playlist_click (GdkEventButton*);
|
||||
bool route_ops_click (GdkEventButton*);
|
||||
void build_route_ops_menu ();
|
||||
|
||||
/* RouteUI */
|
||||
void route_property_changed (const PBD::PropertyChange&);
|
||||
void route_color_changed ();
|
||||
void update_sensitivity ();
|
||||
|
||||
bool _clear_meters;
|
||||
|
||||
Gtk::Table _ctrls;
|
||||
Gtk::Menu* _route_ops_menu;
|
||||
|
||||
LevelMeterVBox* _level_meter;
|
||||
IOButton _input_button;
|
||||
ArdourWidgets::ArdourButton _number_label;
|
||||
ArdourWidgets::ArdourButton _playlist_button;
|
||||
ArdourWidgets::ArdourVSpacer _vseparator;
|
||||
|
||||
Glib::RefPtr<Gtk::SizeGroup> _ctrls_button_size_group;
|
||||
Glib::RefPtr<Gtk::SizeGroup> _monitor_ctrl_size_group;
|
||||
|
||||
static bool _size_group_initialized;
|
||||
static Glib::RefPtr<Gtk::SizeGroup> _track_number_size_group;
|
||||
|
||||
PBD::ScopedConnectionList _route_connections;
|
||||
|
||||
struct RecInfo {
|
||||
RecInfo (samplepos_t s, samplepos_t e)
|
||||
: capture_start (s)
|
||||
, capture_end (e)
|
||||
{}
|
||||
samplepos_t capture_start;
|
||||
samplepos_t capture_end;
|
||||
};
|
||||
|
||||
class TrackSummary : public CairoWidget
|
||||
{
|
||||
public:
|
||||
TrackSummary (boost::shared_ptr<ARDOUR::Route>);
|
||||
~TrackSummary ();
|
||||
|
||||
void playhead_position_changed (samplepos_t p);
|
||||
void set_gui_extents (samplepos_t, samplepos_t);
|
||||
bool rec_extent (samplepos_t&, samplepos_t&) const;
|
||||
|
||||
protected:
|
||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||
void on_size_request (Gtk::Requisition*);
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
bool on_button_press_event (GdkEventButton*);
|
||||
|
||||
private:
|
||||
void render_region (boost::shared_ptr<ARDOUR::Region>, Cairo::RefPtr<Cairo::Context> const&, double);
|
||||
void playlist_changed ();
|
||||
void property_changed (PBD::PropertyChange const&);
|
||||
void maybe_setup_rec_box ();
|
||||
void update_rec_box ();
|
||||
|
||||
double sample_to_xpos (samplepos_t p) const
|
||||
{
|
||||
return (p - _start) * _xscale;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ARDOUR::Track> _track;
|
||||
samplepos_t _start;
|
||||
samplepos_t _end;
|
||||
double _xscale;
|
||||
double _last_playhead;
|
||||
bool _rec_updating;
|
||||
bool _rec_active;
|
||||
|
||||
std::vector<RecInfo> _rec_rects;
|
||||
PBD::ScopedConnectionList _connections;
|
||||
sigc::connection _screen_update_connection;
|
||||
};
|
||||
|
||||
TrackSummary _track_summary;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue