summaryrefslogtreecommitdiffstats
path: root/raul/SMFWriter.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-02-09 18:23:57 +0000
committerDavid Robillard <d@drobilla.net>2008-02-09 18:23:57 +0000
commit81f335330c209359ef1d2b3bdedc5c19790d2eba (patch)
tree2262742e60b1360ecd66bf1f5be57e4df2b53de3 /raul/SMFWriter.hpp
parent43dd122ffcdb6a0b40a56777245a870e411d439c (diff)
downloadraul-81f335330c209359ef1d2b3bdedc5c19790d2eba.tar.gz
raul-81f335330c209359ef1d2b3bdedc5c19790d2eba.tar.bz2
raul-81f335330c209359ef1d2b3bdedc5c19790d2eba.zip
Use Raul::TimeStamp (LV2 compatible typed 32:32 fixed timestamp) everywhere.
Fix initial size of Patchage messages window. Machina disabled for now (transitioning to generic timestamps). git-svn-id: http://svn.drobilla.net/lad/raul@1133 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/SMFWriter.hpp')
-rw-r--r--raul/SMFWriter.hpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/raul/SMFWriter.hpp b/raul/SMFWriter.hpp
index df91909..3661ffd 100644
--- a/raul/SMFWriter.hpp
+++ b/raul/SMFWriter.hpp
@@ -20,6 +20,7 @@
#include <stdexcept>
#include <raul/MIDISink.hpp>
+#include <raul/TimeStamp.hpp>
namespace Raul {
@@ -28,15 +29,15 @@ namespace Raul {
*/
class SMFWriter : public Raul::MIDISink {
public:
- SMFWriter(unsigned short ppqn=1920);
+ SMFWriter(TimeUnit unit);
~SMFWriter();
bool start(const std::string& filename,
- BeatTime start_time=0) throw (std::logic_error);
+ TimeStamp start_time) throw (std::logic_error);
- uint16_t ppqn() const { return _ppqn; }
+ TimeUnit unit() const { return _unit; }
- void write_event(BeatTime time,
+ void write_event(TimeStamp time,
size_t ev_size,
const unsigned char* ev) throw (std::logic_error);
@@ -54,13 +55,13 @@ protected:
void write_chunk(const char id[4], uint32_t length, void* data);
size_t write_var_len(uint32_t val);
- std::string _filename;
- FILE* _fd;
- uint16_t _ppqn;
- Raul::BeatTime _start_time;
- Raul::BeatTime _last_ev_time; ///< Time last event was written relative to _start_time
- uint32_t _track_size;
- uint32_t _header_size; ///< size of SMF header, including MTrk chunk header
+ std::string _filename;
+ FILE* _fd;
+ TimeUnit _unit;
+ Raul::TimeStamp _start_time;
+ Raul::TimeStamp _last_ev_time; ///< Time last event was written relative to _start_time
+ uint32_t _track_size;
+ uint32_t _header_size; ///< size of SMF header, including MTrk chunk header
};