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:
David Robillard
2007-08-01 23:18:56 +00:00
parent 6698f5f686
commit 874f3bbf8b
5 changed files with 34 additions and 6 deletions

View File

@@ -90,6 +90,7 @@ class MidiSource : public Source
boost::shared_ptr<MidiModel> _model;
bool _model_loaded;
bool _writing;
private:
bool file_changed (string path);

View File

@@ -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;
}

View File

@@ -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);