13
0

use new Tempo API in two places where Tempo is explicitly constructed

This commit is contained in:
Paul Davis 2021-01-24 15:25:43 -07:00
parent b8a7de43b6
commit 97a3469972
2 changed files with 15 additions and 4 deletions

View File

@ -281,8 +281,19 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, timepos_t const & pos)
return;
}
#warning NUTEMPO need to be able to create a tempo map with no entries
TempoMap::SharedPtr new_map (new TempoMap (Tempo (120), Meter (4, 4)));
/* we have to create this in order to start the update process, but
we're going to throw it away by creating our own new map and
populating it. This will go out of scope when we return from this
method.
*/
TempoMap::SharedPtr ignore (TempoMap::write_copy());
/* cannot create an empty TempoMap, so create one with "default" single
values for tempo and meter, then overwrite them.
*/
TempoMap::SharedPtr new_map (new TempoMap (Tempo (120, 4), Meter (4, 4)));
Meter last_meter (4.0, 4.0);
bool have_initial_meter = false;

View File

@ -1960,7 +1960,7 @@ std::ostream&
std::operator<<(std::ostream& str, Tempo const & t)
{
if (t.ramped()) {
return str << t.note_types_per_minute() << " 1/" << t.note_type() << " RAMPED notes per minute [" << t.super_note_type_per_second() << " sntpm] (" << t.superclocks_per_note_type() << " sc-per-1/" << t.note_type() << ')';
return str << t.note_types_per_minute() << " 1/" << t.note_type() << " RAMPED notes per minute [ " << t.super_note_type_per_second() << " => " << t.end_super_note_type_per_second() << " sntpm ] (" << t.superclocks_per_note_type() << " sc-per-1/" << t.note_type() << ')';
} else {
return str << t.note_types_per_minute() << " 1/" << t.note_type() << " notes per minute [" << t.super_note_type_per_second() << " sntpm] (" << t.superclocks_per_note_type() << " sc-per-1/" << t.note_type() << ')';
}
@ -2998,7 +2998,7 @@ TempoMap::MementoBinder::set_state (XMLNode const & node, int version) const
void
TempoMap::init ()
{
SharedPtr new_map (new TempoMap (Tempo (120), Meter (4, 4)));
SharedPtr new_map (new TempoMap (Tempo (120, 4), Meter (4, 4)));
_map_mgr.init (new_map);
fetch ();
}