Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move header files into include/midifile folder. #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(CheckIncludeFiles)

include_directories(include)

check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(humdrum.h HAVE_HUMDRUM_H)
check_include_files(sys/io.h HAVE_SYS_IO_H)
Expand Down Expand Up @@ -54,15 +52,17 @@ set(SRCS
)

set(HDRS
include/Binasc.h
include/MidiEvent.h
include/MidiEventList.h
include/MidiFile.h
include/MidiMessage.h
include/Options.h
include/midifile/Binasc.h
include/midifile/MidiEvent.h
include/midifile/MidiEventList.h
include/midifile/MidiFile.h
include/midifile/MidiMessage.h
include/midifile/Options.h
)

add_library(midifile STATIC ${SRCS} ${HDRS})
target_include_directories(midifile PUBLIC include)


##############################
##
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ options:
# necessary if you only want to use the compiled MidiFile library.
ifneq ($(shell which wget),)
wget https://raw.githubusercontent.com/craigsapp/optionlib/master/src/Options.cpp -O src/Options.cpp
wget https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/Options.h
wget https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/midifile/Options.h
else ifneq ($(shell which curl),)
curl https://raw.githubusercontent.com/craigsapp/optionlib/master/src/Options.cpp -o src/Options.cpp
curl https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/Options.h
curl https://raw.githubusercontent.com/craigsapp/optionlib/master/include/Options.h -O include/midifile/Options.h
endif


Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Using in your own project
-------------------------

The easiest way to use the midifile library in your own project is to
copy the header files in the `include` directory and the source-code
copy the header files in the `include/midifile` directory and the source-code
files in the `src` directory into your own project. You do not
need to copy `Options.h` or `Options.cpp` since the `MidiFile` class is
not dependent on them. The [verovio](https://github.com/rism-ch/verovio)
Expand Down Expand Up @@ -162,8 +162,8 @@ so `using namespace smf;` or `smf::` prefixes are needed to access
the classes.

``` cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>
#include <iomanip>

Expand Down Expand Up @@ -325,8 +325,8 @@ of program that joins the `MidiEvents` into a single track so that the
data can be processed in a single loop:

``` cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>
#include <iomanip>

Expand Down Expand Up @@ -451,8 +451,8 @@ before being written to a file.


``` cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <random>
#include <iostream>

Expand Down Expand Up @@ -605,7 +605,7 @@ into a standard MIDI file:


```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down Expand Up @@ -638,8 +638,8 @@ duration of a MIDI file. Also, this example shows how to process multiple
input files when using the Options class.

```cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>
using namespace std;
using namespace smf;
Expand Down Expand Up @@ -675,7 +675,7 @@ them out when found. The `MidiMessage::getMetaContent()` function extracts
the text string of the message from the raw MIDI file bytes.

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down Expand Up @@ -713,7 +713,7 @@ Here is a demonstration of converting a multi-track MIDI file into
a single-track MIDI file:

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>
using namespace std;
using namespace smf;
Expand Down Expand Up @@ -751,7 +751,7 @@ represented by the integer 9. The following example searches through
the MIDI events in each track until it finds a note on channel 9:

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>
using namespace std;
using namespace smf;
Expand Down Expand Up @@ -794,7 +794,7 @@ notes from a MIDI file. Here is an example of how that can be done with
the midifile library.

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>
using namespace std;
using namespace smf;
Expand Down Expand Up @@ -844,8 +844,8 @@ reserved for the drum track (and most MIDI files use the General MIDI
convention).

```cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>

using namespace std;
Expand Down Expand Up @@ -888,8 +888,8 @@ The following example lists all of the instrument numbers
used in a MIDI file. It does not analyze the drum track.

```cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <set>
#include <utility>
#include <iostream>
Expand Down Expand Up @@ -938,7 +938,7 @@ to avoid MIDI channel 10, which is reserved for percussion timbres
in General MIDI.

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>
using namespace std;
using namespace smf;
Expand Down Expand Up @@ -1306,7 +1306,7 @@ tracks of the first MIDI file are copied to the 1st track of
the output MIDI files.

```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>
#include <vector>
using namespace std;
Expand Down Expand Up @@ -1465,8 +1465,8 @@ The `MidiFile::getAbsoluteTickTime()` function calculates the conversion
between physical time in seconds and tick time in the MIDI file.

```cpp
#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>
#include <utility>
#include <cmath>
Expand Down Expand Up @@ -1541,7 +1541,7 @@ options are:


```cpp
#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include "Options.h"
#include <iostream>
#include <utility>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion include/MidiEvent.h → include/midifile/MidiEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef _MIDIEVENT_H_INCLUDED
#define _MIDIEVENT_H_INCLUDED

#include "MidiMessage.h"
#include "midifile/MidiMessage.h"
#include <vector>

namespace smf {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef _MIDIEVENTLIST_H_INCLUDED
#define _MIDIEVENTLIST_H_INCLUDED

#include "MidiEvent.h"
#include "midifile/MidiEvent.h"
#include <vector>

namespace smf {
Expand Down
2 changes: 1 addition & 1 deletion include/MidiFile.h → include/midifile/MidiFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef _MIDIFILE_H_INCLUDED
#define _MIDIFILE_H_INCLUDED

#include "MidiEventList.h"
#include "midifile/MidiEventList.h"

#include <vector>
#include <string>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Binasc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// description: Interface to convert bytes between binary and ASCII forms.
//

#include "Binasc.h"
#include "midifile/Binasc.h"

#include <sstream>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/MidiEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// for the MidiFile class.
//

#include "MidiEvent.h"
#include "midifile/MidiEvent.h"

#include <stdlib.h>

Expand Down
2 changes: 1 addition & 1 deletion src/MidiEventList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//


#include "MidiEventList.h"
#include "midifile/MidiEventList.h"

#include <vector>
#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/MidiFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// class is used for example in the MidiPerform class.
//

#include "MidiFile.h"
#include "Binasc.h"
#include "midifile/MidiFile.h"
#include "midifile/Binasc.h"

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/MidiMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MIDI Files.
//

#include "MidiMessage.h"
#include "midifile/MidiMessage.h"

#include <vector>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Description: Interface to command-line options.
//

#include "Options.h"
#include "midifile/Options.h"

#include <stdlib.h>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions tools/80off.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// "8? ?? 00".
//

#include "Options.h"
#include "MidiFile.h"
#include "midifile/Options.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down
4 changes: 2 additions & 2 deletions tools/asciimidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// reconversion into a binary Standard MIDI File.
//

#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>

using namespace std;
Expand Down
6 changes: 3 additions & 3 deletions tools/binasc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include <string.h>

#include "Binasc.h"
#include "Options.h"
#include "MidiFile.h"
#include "midifile/Binasc.h"
#include "midifile/Options.h"
#include "midifile/MidiFile.h"

using namespace std;
using namespace smf;
Expand Down
2 changes: 1 addition & 1 deletion tools/createmidifile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Description: Demonstration of how to create a Multi-track MIDI file.
//

#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion tools/createmidifile2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// with convenience functions.
//

#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion tools/drumtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// drum part.
//

#include "MidiFile.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down
4 changes: 2 additions & 2 deletions tools/durations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// events) will have a duration of 0.
//

#include "Options.h"
#include "MidiFile.h"
#include "midifile/Options.h"
#include "midifile/MidiFile.h"
#include <iostream>

using namespace std;
Expand Down
4 changes: 2 additions & 2 deletions tools/extractlyrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// that the lyric occurs at.
//

#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"
#include <iostream>

using namespace std;
Expand Down
8 changes: 4 additions & 4 deletions tools/henonfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// plain text.
//

#include "MidiFile.h"
#include "Convert.h"
#include "Options.h"
#include "CircularBuffer.h"
#include "midifile/MidiFile.h"
#include "midifile/Convert.h"
#include "midifile/Options.h"
#include "midifile/CircularBuffer.h"
#include <string.h>
#include <stdio.h>

Expand Down
4 changes: 2 additions & 2 deletions tools/maxtick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Description: Calculate the maximum timestamp in a MIDI file.
//

#include "MidiFile.h"
#include "Options.h"
#include "midifile/MidiFile.h"
#include "midifile/Options.h"

#include <iostream>

Expand Down
Loading