summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/SMF.cc1
-rw-r--r--lib/message.cc1
-rw-r--r--tools/mididump.cc1
3 files changed, 3 insertions, 0 deletions
diff --git a/lib/SMF.cc b/lib/SMF.cc
index ba3179d..2c62b1f 100644
--- a/lib/SMF.cc
+++ b/lib/SMF.cc
@@ -1,28 +1,29 @@
#include <iostream>
#include <fstream>
#include <algorithm>
#include <iterator>
+#include <cstring>
#include <midillo/SMF.h>
namespace midillo {
using std::ifstream;
using std::ofstream;
using std::cin;
using std::cout;
using std::copy;
using std::ostream_iterator;
using std::endl;
void SMF_t::load(const char *f,bool stdinable) {
if(stdinable && !strcmp(f,"-")) {
load(cin);
}else{
ifstream s(f,std::ios::in|std::ios::binary);
load(s);
}
}
void SMF_t::load(istream& s) {
mthd.load(s);
tracks.resize(mthd.ntracks);
tracks_t::iterator i = tracks.begin();
diff --git a/lib/message.cc b/lib/message.cc
index 8f9e68a..6a5cfd6 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1,26 +1,27 @@
#include <algorithm>
#include <iterator>
+#include <cassert>
#include <midillo/message.h>
#include <midillo/util.h>
#include <midillo/exception.h>
namespace midillo {
using std::copy;
using std::ostream_iterator;
unsigned long message_t::calculate_save_size(int& rs) const {
unsigned long rv = 0;
if(status!=rs) {
++rv;
rs = status;
}else if((status&status_event_bits)==status_system) {
rs = -1;
++rv; // XXX: is it really needed?
}
switch(status&status_event_bits) {
case status_note_off:
case status_note_on:
case status_polyphonic_key_pressure: // aka status_aftertouch
case status_control_change:
case status_pitch_wheel_change:
rv += 2; break;
diff --git a/tools/mididump.cc b/tools/mididump.cc
index 83b7086..604bcc0 100644
--- a/tools/mididump.cc
+++ b/tools/mididump.cc
@@ -1,29 +1,30 @@
#include <getopt.h>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
+#include <cstring>
using namespace std;
#include <konforka/exception.h>
#include <midillo/SMF.h>
using namespace midillo;
#include "config.h"
#define PHEADER PACKAGE " " VERSION " - mididump - dump midi files"
#define PCOPY "Copyright (c) 2006 Klever Group"
static void usage(const char *p) {
cerr << PHEADER << endl
<< PCOPY << endl << endl
<< " " << p << " [options] [<input-file>[ <output-file>]]" << endl << endl
<< " -h, --help" << endl
<< " --usage display this text" << endl
<< " -V, --version display version number" << endl
<< " -L, --license show license" << endl;
}
main(int argc,char **argv) {
try {
while(true) {
static struct option opts[] = {
{ "help", no_argument, 0, 'h' },