From 42cb7979e4bbf7e1e1a150a158c484108138b834 Mon Sep 17 00:00:00 2001 From: Adrian Ulrich Date: Sun, 26 Feb 2017 14:07:46 +0100 Subject: [PATCH] sync with bastp to add midi support --- src/ch/blinkenlights/bastp/Bastp.java | 4 +++ src/ch/blinkenlights/bastp/MidiFile.java | 35 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/ch/blinkenlights/bastp/MidiFile.java diff --git a/src/ch/blinkenlights/bastp/Bastp.java b/src/ch/blinkenlights/bastp/Bastp.java index 05bba727..e506c3f1 100644 --- a/src/ch/blinkenlights/bastp/Bastp.java +++ b/src/ch/blinkenlights/bastp/Bastp.java @@ -93,6 +93,10 @@ public class Bastp { tags = (new Mp4File()).getTags(s); tags.put("type", "MP4"); } + else if(magic.substring(0,4).equals("MThd")) { + tags = (new MidiFile()).getTags(s); + tags.put("type", "MIDI"); + } } catch (IOException e) { diff --git a/src/ch/blinkenlights/bastp/MidiFile.java b/src/ch/blinkenlights/bastp/MidiFile.java new file mode 100644 index 00000000..8a1b3d01 --- /dev/null +++ b/src/ch/blinkenlights/bastp/MidiFile.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2017 Google Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package ch.blinkenlights.bastp; + +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.HashMap; + +public class MidiFile extends Common { + + /** + * Returns the tags of a Midi File which is just an empty HashMap + * as there seems to be no midi-tag standard (?) + */ + public HashMap getTags(RandomAccessFile s) throws IOException { + HashMap tags = new HashMap(); + return tags; + } +} +