diff options
author | David Robillard <d@drobilla.net> | 2006-08-14 23:29:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-14 23:29:01 +0000 |
commit | 5952c48a848926edb02b5d630e36cc461c893964 (patch) | |
tree | 2e1126d7cfb015f37222eff2523766c759608241 /libs/ardour/smf_source.cc | |
parent | d752986314eb37151983393c1d62efefe503e47c (diff) |
More solid "fake" recording and serialization
git-svn-id: svn://localhost/ardour2/branches/midi@825 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 9a03d0fabd..dfe1419c4e 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -47,7 +47,7 @@ uint64_t SMFSource::header_position_offset; */ SMFSource::SMFSource (std::string path, Flag flags) - : MidiSource (path), _flags (flags) + : MidiSource (region_name_from_path(path)), _flags (flags) { /* constructor used for new internal-to-session files. file cannot exist */ @@ -55,6 +55,8 @@ SMFSource::SMFSource (std::string path, Flag flags) throw failed_constructor (); } + assert(_name.find("/") == string::npos); + SourceCreated (this); /* EMIT SIGNAL */ } @@ -71,6 +73,8 @@ SMFSource::SMFSource (const XMLNode& node) throw failed_constructor (); } + assert(_name.find("/") == string::npos); + SourceCreated (this); /* EMIT SIGNAL */ } @@ -91,10 +95,8 @@ SMFSource::removable () const int SMFSource::init (string pathstr, bool must_exist) { - bool is_new = false; + //bool is_new = false; - _length = 1024; // FIXME FIXME FIXME: force save - /* if (!find (pathstr, must_exist, is_new)) { cerr << "cannot find " << pathstr << " with me = " << must_exist << endl; @@ -106,8 +108,9 @@ SMFSource::init (string pathstr, bool must_exist) } */ - // Yeah, we sound it. Swear. + // Yeah, we found it. Swear. + assert(_name.find("/") == string::npos); return 0; } @@ -124,15 +127,18 @@ SMFSource::flush_header () } jack_nframes_t -SMFSource::read_unlocked (RawMidi* dst, jack_nframes_t start, jack_nframes_t cnt) const +SMFSource::read_unlocked (MidiBuffer& dst, jack_nframes_t start, jack_nframes_t cnt) const { - return 0; + dst.clear(); + return cnt; } jack_nframes_t -SMFSource::write_unlocked (RawMidi* dst, jack_nframes_t cnt) +SMFSource::write_unlocked (MidiBuffer& src, jack_nframes_t cnt) { - return 0; + ViewDataRangeReady (_length, cnt); /* EMIT SIGNAL */ + _length += cnt; + return cnt; } XMLNode& @@ -166,6 +172,8 @@ SMFSource::set_state (const XMLNode& node) } + assert(_name.find("/") == string::npos); + return 0; } |