mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Prepare configurable mini-timeline time-span
This commit is contained in:
parent
7688d22456
commit
f80fb029e2
4 changed files with 20 additions and 3 deletions
|
|
@ -67,6 +67,7 @@ void
|
||||||
MiniTimeline::session_going_away ()
|
MiniTimeline::session_going_away ()
|
||||||
{
|
{
|
||||||
super_rapid_connection.disconnect ();
|
super_rapid_connection.disconnect ();
|
||||||
|
session_connection.disconnect ();
|
||||||
SessionHandlePtr::session_going_away ();
|
SessionHandlePtr::session_going_away ();
|
||||||
_jumplist.clear ();
|
_jumplist.clear ();
|
||||||
}
|
}
|
||||||
|
|
@ -83,6 +84,11 @@ MiniTimeline::set_session (Session* s)
|
||||||
super_rapid_connection = Timers::super_rapid_connect (
|
super_rapid_connection = Timers::super_rapid_connect (
|
||||||
sigc::mem_fun (*this, &MiniTimeline::super_rapid_update)
|
sigc::mem_fun (*this, &MiniTimeline::super_rapid_update)
|
||||||
);
|
);
|
||||||
|
_session->config.ParameterChanged.connect (session_connection,
|
||||||
|
invalidator (*this),
|
||||||
|
boost::bind (&MiniTimeline::parameter_changed, this, _1), gui_context()
|
||||||
|
);
|
||||||
|
|
||||||
_jumplist.clear ();
|
_jumplist.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,6 +117,14 @@ MiniTimeline::set_colors ()
|
||||||
// TODO UIConfiguration::instance().color & font
|
// TODO UIConfiguration::instance().color & font
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MiniTimeline::parameter_changed (std::string const& p)
|
||||||
|
{
|
||||||
|
if (p == "minitimeline-span") {
|
||||||
|
update_minitimeline ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MiniTimeline::on_size_request (Gtk::Requisition* req)
|
MiniTimeline::on_size_request (Gtk::Requisition* req)
|
||||||
{
|
{
|
||||||
|
|
@ -321,7 +335,7 @@ MiniTimeline::render (cairo_t* cr, cairo_rectangle_t*)
|
||||||
|
|
||||||
|
|
||||||
/* time */
|
/* time */
|
||||||
const framepos_t time_span = 60; /* left+right: 2 minutes */
|
const framepos_t time_span = _session->config.get_minitimeline_span () / 2;
|
||||||
const framepos_t time_span_samples = time_span * _session->nominal_frame_rate ();
|
const framepos_t time_span_samples = time_span * _session->nominal_frame_rate ();
|
||||||
const framepos_t time_granularity = _session->nominal_frame_rate () * ceil (2. * time_span / n_labels);
|
const framepos_t time_granularity = _session->nominal_frame_rate () * ceil (2. * time_span / n_labels);
|
||||||
const framepos_t p = _last_update_frame;
|
const framepos_t p = _last_update_frame;
|
||||||
|
|
@ -446,7 +460,7 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
|
||||||
}
|
}
|
||||||
} else if (ev->button == 1) {
|
} else if (ev->button == 1) {
|
||||||
// copy from ::render() // TODO consolidate
|
// copy from ::render() // TODO consolidate
|
||||||
const framepos_t time_span = 60; /* left+right: 2 minutes */
|
const framepos_t time_span = _session->config.get_minitimeline_span () / 2;
|
||||||
const framepos_t time_span_samples = time_span * _session->nominal_frame_rate ();
|
const framepos_t time_span_samples = time_span * _session->nominal_frame_rate ();
|
||||||
const framepos_t p = _last_update_frame;
|
const framepos_t p = _last_update_frame;
|
||||||
const double px_per_sample = get_width () / (2. * time_span_samples);
|
const double px_per_sample = get_width () / (2. * time_span_samples);
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ private:
|
||||||
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
|
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
|
||||||
void on_name_changed ();
|
void on_name_changed ();
|
||||||
void set_colors ();
|
void set_colors ();
|
||||||
|
void parameter_changed (std::string const &);
|
||||||
|
|
||||||
void calculate_time_width ();
|
void calculate_time_width ();
|
||||||
void update_minitimeline ();
|
void update_minitimeline ();
|
||||||
|
|
@ -68,6 +69,7 @@ private:
|
||||||
Glib::RefPtr<Pango::Layout> _layout;
|
Glib::RefPtr<Pango::Layout> _layout;
|
||||||
sigc::connection super_rapid_connection;
|
sigc::connection super_rapid_connection;
|
||||||
PBD::ScopedConnectionList marker_connection;
|
PBD::ScopedConnectionList marker_connection;
|
||||||
|
PBD::ScopedConnection session_connection;
|
||||||
|
|
||||||
framepos_t _last_update_frame;
|
framepos_t _last_update_frame;
|
||||||
AudioClock::Mode _clock_mode;
|
AudioClock::Mode _clock_mode;
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ class RouteUI : public virtual ARDOUR::SessionHandlePtr, public virtual PBD::Sco
|
||||||
bool mark_hidden (bool yn);
|
bool mark_hidden (bool yn);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parameter_changed (std::string const &);
|
void parameter_changed (std::string const&);
|
||||||
void relabel_solo_button ();
|
void relabel_solo_button ();
|
||||||
void track_mode_changed ();
|
void track_mode_changed ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ CONFIG_VARIABLE (bool, punch_out, "punch-out", false)
|
||||||
CONFIG_VARIABLE (bool, layered_record_mode, "layered-record-mode", false)
|
CONFIG_VARIABLE (bool, layered_record_mode, "layered-record-mode", false)
|
||||||
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
|
CONFIG_VARIABLE (uint32_t, subframes_per_frame, "subframes-per-frame", 100)
|
||||||
CONFIG_VARIABLE (Timecode::TimecodeFormat, timecode_format, "timecode-format", Timecode::timecode_30)
|
CONFIG_VARIABLE (Timecode::TimecodeFormat, timecode_format, "timecode-format", Timecode::timecode_30)
|
||||||
|
CONFIG_VARIABLE (framecnt_t, minitimeline_span, "minitimeline-span", 120) // seconds
|
||||||
CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", PBD::path_expand)
|
CONFIG_VARIABLE_SPECIAL(std::string, raid_path, "raid-path", "", PBD::path_expand)
|
||||||
CONFIG_VARIABLE_SPECIAL(std::string, audio_search_path, "audio-search-path", "", PBD::search_path_expand)
|
CONFIG_VARIABLE_SPECIAL(std::string, audio_search_path, "audio-search-path", "", PBD::search_path_expand)
|
||||||
CONFIG_VARIABLE_SPECIAL(std::string, midi_search_path, "midi-search-path", "", PBD::search_path_expand)
|
CONFIG_VARIABLE_SPECIAL(std::string, midi_search_path, "midi-search-path", "", PBD::search_path_expand)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue