continued work on using new tempo map API (before switch to RCU)
This commit is contained in:
parent
f7ff656619
commit
7ef11dc698
|
@ -585,8 +585,8 @@ public:
|
|||
|
||||
void mouse_add_new_tempo_event (Temporal::timepos_t where);
|
||||
void mouse_add_new_meter_event (Temporal::timepos_t where);
|
||||
void edit_tempo_section (Temporal::TempoPoint*);
|
||||
void edit_meter_section (Temporal::MeterPoint*);
|
||||
void edit_tempo_section (Temporal::TempoPoint&);
|
||||
void edit_meter_section (Temporal::MeterPoint&);
|
||||
|
||||
bool should_ripple () const;
|
||||
void do_ripple (boost::shared_ptr<ARDOUR::Playlist>, samplepos_t, samplecnt_t, ARDOUR::RegionList* exclude, bool add_to_command);
|
||||
|
|
|
@ -1042,17 +1042,13 @@ Editor::set_xjadeo_viewoption (int what)
|
|||
void
|
||||
Editor::edit_current_meter ()
|
||||
{
|
||||
#warning NUTEMPO needs new map API
|
||||
//ARDOUR::MeterSection* ms = const_cast<ARDOUR::MeterSection*>(&_session->tempo_map().meter_section_at_sample (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
//edit_meter_section (ms);
|
||||
edit_meter_section (_session->tempo_map().metric_at (ARDOUR_UI::instance()->primary_clock->absolute_time()).meter());
|
||||
}
|
||||
|
||||
void
|
||||
Editor::edit_current_tempo ()
|
||||
{
|
||||
#warning NUTEMPO needs new map API
|
||||
// ARDOUR::TempoSection* ts = const_cast<ARDOUR::TempoSection*>(&_session->tempo_map().tempo_section_at_sample (ARDOUR_UI::instance()->primary_clock->absolute_time()));
|
||||
// edit_tempo_section (ts);
|
||||
edit_tempo_section (_session->tempo_map().metric_at (ARDOUR_UI::instance()->primary_clock->absolute_time()).tempo());
|
||||
}
|
||||
|
||||
RefPtr<RadioAction>
|
||||
|
|
|
@ -298,18 +298,16 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, timepos_t const & pos)
|
|||
Temporal::BBT_Time bbt; /* 1|1|0 which is correct for the no-meter case */
|
||||
|
||||
if (have_initial_meter) {
|
||||
#warning NUTEMPO check API for this
|
||||
// new_map.add_tempo (tempo, t->time_pulses/ (double)smf.ppqn() / 4.0, 0, BeatTime);
|
||||
#warning NUTEMPO figure this out when i have a brain
|
||||
// new_map.set_tempo (tempo, Temporal::Beats (t->time_pulses/ (double)smf.ppqn() / 4.0);
|
||||
if (!(meter == last_meter)) {
|
||||
bbt = new_map.bbt_at (Beats::from_double (t->time_pulses/(double)smf.ppqn()));
|
||||
#warning NUTEMPO check API for this
|
||||
//new_map.add_meter (meter, bbt, 0, MusicTime);
|
||||
new_map.set_meter (meter, bbt);
|
||||
}
|
||||
|
||||
} else {
|
||||
#warning NUTEMPO needs new tempo map API
|
||||
//new_map.replace_meter (new_map.meter_section_at_sample (0), meter, bbt, pos, AudioTime);
|
||||
//new_map.replace_tempo (new_map.tempo_section_at_sample (0), tempo, 0.0, pos, AudioTime);
|
||||
new_map.set_meter (meter, bbt);
|
||||
new_map.set_tempo (tempo, bbt);
|
||||
have_initial_meter = true;
|
||||
|
||||
}
|
||||
|
|
|
@ -1466,9 +1466,9 @@ Editor::marker_menu_edit ()
|
|||
dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
|
||||
|
||||
if (mm) {
|
||||
edit_meter_section (&mm->meter());
|
||||
edit_meter_section (mm->meter());
|
||||
} else if (tm) {
|
||||
edit_tempo_section (&tm->tempo());
|
||||
edit_tempo_section (tm->tempo());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#include "pbd/whitespace.h"
|
||||
#include "pbd/stateful_diff_command.h"
|
||||
|
||||
#include "temporal/tempo.h"
|
||||
|
||||
#include "gtkmm2ext/utils.h"
|
||||
|
||||
#include "widgets/choice.h"
|
||||
|
@ -7080,9 +7082,7 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
|||
{
|
||||
timecnt_t length = start.distance (end);
|
||||
|
||||
#warning NUTEMPO need new map API
|
||||
#if 0
|
||||
const Meter& m (_session->tempo_map().meter_at_sample (start));
|
||||
const Meter& m (_session->tempo_map().meter_at (start));
|
||||
|
||||
/* length = 1 bar */
|
||||
|
||||
|
@ -7093,11 +7093,11 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
|||
*/
|
||||
|
||||
/* XXXX METER MATH */
|
||||
double samples_per_beat = length / m.divisions_per_bar();
|
||||
double superclocks_per_beat = length.superclocks() / m.divisions_per_bar();
|
||||
|
||||
/* beats per minute = */
|
||||
|
||||
double beats_per_minute = (_session->sample_rate() * 60.0) / samples_per_beat;
|
||||
double beats_per_minute = (superclock_ticks_per_second * 60.0) / superclocks_per_beat;
|
||||
|
||||
/* now decide whether to:
|
||||
|
||||
|
@ -7106,7 +7106,7 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
|||
|
||||
*/
|
||||
|
||||
const TempoSection& t (_session->tempo_map().tempo_section_at_sample (start));
|
||||
const TempoPoint& t (_session->tempo_map().tempo_at (start));
|
||||
|
||||
bool do_global = false;
|
||||
|
||||
|
@ -7153,20 +7153,19 @@ Editor::define_one_bar (timepos_t const & start, timepos_t const & end)
|
|||
XMLNode& before (_session->tempo_map().get_state());
|
||||
|
||||
if (do_global) {
|
||||
_session->tempo_map().change_initial_tempo (beats_per_minute, t.note_type(), t.end_note_types_per_minute());
|
||||
} else if (t.sample() == start) {
|
||||
_session->tempo_map().change_existing_tempo_at (start, beats_per_minute, t.note_type(), t.end_note_types_per_minute());
|
||||
_session->tempo_map().set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), timepos_t());
|
||||
} else if (t.time() == start) {
|
||||
_session->tempo_map().set_tempo (Tempo (beats_per_minute, t.end_note_types_per_minute(), t.note_type()), start);
|
||||
} else {
|
||||
/* constant tempo */
|
||||
const Tempo tempo (beats_per_minute, t.note_type());
|
||||
_session->tempo_map().add_tempo (tempo, 0.0, start, Temporal::AudioTime);
|
||||
_session->tempo_map().set_tempo (tempo, start);
|
||||
}
|
||||
|
||||
XMLNode& after (_session->tempo_map().get_state());
|
||||
|
||||
_session->add_command (new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
|
||||
commit_reversible_command ();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -501,9 +501,9 @@ Editor::remove_tempo_marker (ArdourCanvas::Item* item)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::edit_meter_section (Temporal::MeterPoint* section)
|
||||
Editor::edit_meter_section (Temporal::MeterPoint& section)
|
||||
{
|
||||
MeterDialog meter_dialog (_session->tempo_map(), *section, _("done"));
|
||||
MeterDialog meter_dialog (_session->tempo_map(), section, _("done"));
|
||||
|
||||
switch (meter_dialog.run()) {
|
||||
case RESPONSE_ACCEPT:
|
||||
|
@ -532,9 +532,9 @@ Editor::edit_meter_section (Temporal::MeterPoint* section)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::edit_tempo_section (TempoPoint* section)
|
||||
Editor::edit_tempo_section (TempoPoint& section)
|
||||
{
|
||||
TempoDialog tempo_dialog (_session->tempo_map(), *section, _("done"));
|
||||
TempoDialog tempo_dialog (_session->tempo_map(), section, _("done"));
|
||||
|
||||
switch (tempo_dialog.run ()) {
|
||||
case RESPONSE_ACCEPT:
|
||||
|
@ -565,13 +565,13 @@ Editor::edit_tempo_section (TempoPoint* section)
|
|||
void
|
||||
Editor::edit_tempo_marker (TempoMarker& tm)
|
||||
{
|
||||
edit_tempo_section (&tm.tempo());
|
||||
edit_tempo_section (tm.tempo());
|
||||
}
|
||||
|
||||
void
|
||||
Editor::edit_meter_marker (MeterMarker& mm)
|
||||
{
|
||||
edit_meter_section (&mm.meter());
|
||||
edit_meter_section (mm.meter());
|
||||
}
|
||||
|
||||
gint
|
||||
|
|
|
@ -2931,10 +2931,8 @@ MidiRegionView::update_resizing (NoteBase* primary, bool at_front, double delta_
|
|||
snapped_x = trackview.editor ().pixel_to_sample (current_x); /* samples */
|
||||
}
|
||||
|
||||
#warning NUTEMPO need new tempo map API
|
||||
//TempoMap& tmap (trackview.session()->tempo_map());
|
||||
//const timepos_t abs_beats (tmap.quarter_note_at (snapped_x));
|
||||
const timepos_t abs_beats;
|
||||
Temporal::TempoMap& tmap (trackview.session()->tempo_map());
|
||||
const timepos_t abs_beats (tmap.quarter_note_at (snapped_x));
|
||||
const Temporal::Beats beats = _region->absolute_time_to_source_beats (abs_beats);
|
||||
Temporal::Beats len = Temporal::Beats();
|
||||
|
||||
|
|
|
@ -518,8 +518,8 @@ public:
|
|||
|
||||
virtual void mouse_add_new_tempo_event (Temporal::timepos_t where) = 0;
|
||||
virtual void mouse_add_new_meter_event (Temporal::timepos_t where) = 0;
|
||||
virtual void edit_tempo_section (Temporal::TempoPoint*) = 0;
|
||||
virtual void edit_meter_section (Temporal::MeterPoint*) = 0;
|
||||
virtual void edit_tempo_section (Temporal::TempoPoint&) = 0;
|
||||
virtual void edit_meter_section (Temporal::MeterPoint&) = 0;
|
||||
|
||||
virtual bool should_ripple () const = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue