Mark MIDI regons as transparent by default, and convert old sessions
This commit is contained in:
@@ -456,6 +456,10 @@ protected:
|
||||
bool verify_start_and_length (timepos_t const &, timecnt_t&);
|
||||
void first_edit ();
|
||||
|
||||
void override_opaqueness (bool yn) {
|
||||
_opaque = yn;
|
||||
}
|
||||
|
||||
/* This is always using AudioTime. convenient for evenlopes in AudioRegion */
|
||||
timepos_t len_as_tpos () const { return timepos_t((samplepos_t)_length.val().samples()); }
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@ MidiRegion::MidiRegion (const SourceList& srcs)
|
||||
: Region (srcs)
|
||||
, _ignore_shift (false)
|
||||
{
|
||||
/* by default MIDI regions are transparent,
|
||||
* this should probably be set depending on use-case,
|
||||
* (eg. loop recording, vs copy/edit/paste)
|
||||
*/
|
||||
override_opaqueness (false);
|
||||
|
||||
midi_source(0)->ModelChanged.connect_same_thread (_source_connection, boost::bind (&MidiRegion::model_changed, this));
|
||||
model_changed ();
|
||||
assert(_name.val().find("/") == string::npos);
|
||||
@@ -352,6 +358,14 @@ MidiRegion::set_state (const XMLNode& node, int version)
|
||||
{
|
||||
int ret = Region::set_state (node, version);
|
||||
|
||||
#ifdef MIXBUS
|
||||
#warning remember to convert MidiRegion opacity for v9 /* see also MidiPlaylist::render */
|
||||
#endif
|
||||
if (version < 7000) {
|
||||
/* previous sessions had uncontionally transparent MIDI regions */
|
||||
override_opaqueness (false);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user