aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine/SMFDriver.cpp2
-rw-r--r--src/engine/SMFReader.cpp11
-rw-r--r--src/engine/SMFWriter.cpp10
-rw-r--r--src/engine/wscript2
4 files changed, 11 insertions, 14 deletions
diff --git a/src/engine/SMFDriver.cpp b/src/engine/SMFDriver.cpp
index a822e7e..3dc51e2 100644
--- a/src/engine/SMFDriver.cpp
+++ b/src/engine/SMFDriver.cpp
@@ -17,8 +17,6 @@
#include <iostream>
#include <list>
-#include <glibmm/convert.h>
-
#include "machina/Context.hpp"
#include "machina/Machine.hpp"
#include "machina/types.hpp"
diff --git a/src/engine/SMFReader.cpp b/src/engine/SMFReader.cpp
index 5df636d..d71dca4 100644
--- a/src/engine/SMFReader.cpp
+++ b/src/engine/SMFReader.cpp
@@ -14,13 +14,12 @@
along with Raul. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <arpa/inet.h>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <string>
-#include <glib.h>
-
#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
#include "SMFReader.hpp"
@@ -118,17 +117,17 @@ SMFReader::open(const std::string& filename)
fseek(_fd, 8, SEEK_SET);
uint16_t type_be = 0;
fread(&type_be, 2, 1, _fd);
- _type = GUINT16_FROM_BE(type_be);
+ _type = ntohs(type_be);
// Read number of tracks (bytes 10..11)
uint16_t num_tracks_be = 0;
fread(&num_tracks_be, 2, 1, _fd);
- _num_tracks = GUINT16_FROM_BE(num_tracks_be);
+ _num_tracks = ntohs(num_tracks_be);
// Read PPQN (bytes 12..13)
uint16_t ppqn_be = 0;
fread(&ppqn_be, 2, 1, _fd);
- _ppqn = GUINT16_FROM_BE(ppqn_be);
+ _ppqn = ntohs(ppqn_be);
// TODO: Absolute (SMPTE seconds) time support
if ((_ppqn & 0x8000) != 0) {
@@ -175,7 +174,7 @@ SMFReader::seek_to_track(unsigned track) throw (std::logic_error)
uint32_t chunk_size_be;
fread(&chunk_size_be, 4, 1, _fd);
- chunk_size = GUINT32_FROM_BE(chunk_size_be);
+ chunk_size = ntohl(chunk_size_be);
if (track_pos == track) {
break;
diff --git a/src/engine/SMFWriter.cpp b/src/engine/SMFWriter.cpp
index 9d18d46..d3f79b6 100644
--- a/src/engine/SMFWriter.cpp
+++ b/src/engine/SMFWriter.cpp
@@ -14,7 +14,7 @@
along with Machina. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glib.h>
+#include <arpa/inet.h>
#include <stdint.h>
#include <stdio.h>
@@ -162,9 +162,9 @@ SMFWriter::write_header()
{
std::cout << "SMF Flushing header\n";
- const uint16_t type = GUINT16_TO_BE(0); // SMF Type 0 (single track)
- const uint16_t ntracks = GUINT16_TO_BE(1); // Number of tracks (always 1 for Type 0)
- const uint16_t division = GUINT16_TO_BE(_unit.ppt()); // PPQN
+ const uint16_t type = htons(0); // SMF Type 0 (single track)
+ const uint16_t ntracks = htons(1); // Number of tracks (always 1 for Type 0)
+ const uint16_t division = htons(_unit.ppt()); // PPQN
char data[6];
memcpy(data, &type, 2);
@@ -194,7 +194,7 @@ SMFWriter::write_footer()
void
SMFWriter::write_chunk_header(const char id[4], uint32_t length)
{
- const uint32_t length_be = GUINT32_TO_BE(length);
+ const uint32_t length_be = htonl(length);
fwrite(id, 1, 4, _fd);
fwrite(&length_be, 4, 1, _fd);
diff --git a/src/engine/wscript b/src/engine/wscript
index e1fc1ab..c12bd9f 100644
--- a/src/engine/wscript
+++ b/src/engine/wscript
@@ -34,7 +34,7 @@ def build(bld):
obj.includes = ['.', '..', '../..']
obj.name = 'libmachina_engine'
obj.target = 'machina_engine'
- core_libs = 'RAUL GLIBMM GTHREAD RAUL SERD SORD JACK LV2'
+ core_libs = 'RAUL SERD SORD JACK LV2'
if bld.env.HAVE_EUGENE:
core_libs += ' EUGENE '
autowaf.use_lib(bld, obj, core_libs)