Fix note delete crash bug.
Fix midi recording crash bug. git-svn-id: svn://localhost/ardour2/trunk@2216 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -90,6 +90,7 @@ class MidiSource : public Source
|
||||
|
||||
boost::shared_ptr<MidiModel> _model;
|
||||
bool _model_loaded;
|
||||
bool _writing;
|
||||
|
||||
private:
|
||||
bool file_changed (string path);
|
||||
|
||||
@@ -46,6 +46,7 @@ MidiSource::MidiSource (Session& s, string name)
|
||||
: Source (s, name, DataType::MIDI)
|
||||
, _model(new MidiModel(s))
|
||||
, _model_loaded (false)
|
||||
, _writing (false)
|
||||
{
|
||||
_read_data_count = 0;
|
||||
_write_data_count = 0;
|
||||
@@ -55,6 +56,7 @@ MidiSource::MidiSource (Session& s, const XMLNode& node)
|
||||
: Source (s, node)
|
||||
, _model(new MidiModel(s))
|
||||
, _model_loaded (false)
|
||||
, _writing (false)
|
||||
{
|
||||
_read_data_count = 0;
|
||||
_write_data_count = 0;
|
||||
@@ -131,6 +133,8 @@ MidiSource::mark_streaming_midi_write_started (NoteMode mode)
|
||||
_model->set_note_mode(mode);
|
||||
_model->start_write();
|
||||
}
|
||||
|
||||
_writing = true;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -138,6 +142,8 @@ MidiSource::mark_streaming_write_started ()
|
||||
{
|
||||
if (_model)
|
||||
_model->start_write();
|
||||
|
||||
_writing = true;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -145,5 +151,7 @@ MidiSource::mark_streaming_write_completed ()
|
||||
{
|
||||
if (_model)
|
||||
_model->end_write(false); // FIXME: param?
|
||||
|
||||
_writing = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -796,6 +796,9 @@ SMFSource::read_var_len() const
|
||||
void
|
||||
SMFSource::load_model(bool lock, bool force_reload)
|
||||
{
|
||||
if (_writing)
|
||||
return;
|
||||
|
||||
if (lock)
|
||||
Glib::Mutex::Lock lm (_lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user