Skip to content

Commit

Permalink
Merge branch 'release/201502'
Browse files Browse the repository at this point in the history
  • Loading branch information
kshoji committed Feb 22, 2015
2 parents 4ddb54f + a3ea1f9 commit d7a2f07
Show file tree
Hide file tree
Showing 30 changed files with 56 additions and 431 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ local.properties
# Proguard folder generated by Eclipse
proguard/
.idea

# IntelliJ
*.iml

13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: android
jdk: openjdk7
android:
components:
- build-tools-21.1.2
- extra-android-m2repository
- android-19
licenses:
- '.+'
before_install:
- chmod +x gradlew
script:
- ./gradlew check
19 changes: 0 additions & 19 deletions JFugue-for-Android.iml

This file was deleted.

71 changes: 5 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,18 @@
JFugue-for-Android
==================

[![Build Status](https://travis-ci.org/kshoji/JFugue-for-Android.svg?branch=master)](https://travis-ci.org/kshoji/JFugue-for-Android)

Music library [JFugue](http://www.jfugue.org/) porting for Android<br />
Based on the version 4.0.3.

*Currently, work in progress*

Usage
=====

Initialization / Termination
--------------
At the main Activity or Fragment, append `MidiSystem.initialize(Context)` in `onCreate` and append `MidiSystem.terminate()` in `onDestroy`.

```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

MidiSystem.initialize(this);
}

@Override
protected void onDestroy() {
super.onDestroy();
MidiSystem.terminate();
}
```

Use of JFugue
-------------
See the [original documents](http://www.jfugue.org/examples.html).

## Playing C scale:
```java
Player player = new Player();
player.play("C D E F G A B");
```

Different from the original JFugue, `Player.play(...)` **doesn't block the current thread**.
To wait finishing playing, `player.getSequencer().addMetaEventListener(...)` can be used.

For example:
```java
player.getSequencer().addMetaEventListener(new MetaEventListener() {
@Override
public void meta(MetaMessage metaMessage) {
if (MetaMessage.TYPE_END_OF_TRACK == metaMessage.getType()) {
// XXX playing finished
}
}
});
```

## Writing MusicXML to file:
```java
FileOutputStream file = context.openFileOutput("music.xml", MODE_PRIVATE);

MusicXmlRenderer renderer = new MusicXmlRenderer();
MusicStringParser parser = new MusicStringParser();
parser.addParserListener(renderer);

Pattern pattern = new Pattern("C D E F G A B |");
parser.parse(pattern);

Serializer serializer = new Serializer(file, "UTF-8");
serializer.setIndent(4);
serializer.write(renderer.getMusicXMLDoc());

file.flush();
file.close();
```
See [the wiki page](https://github.com/kshoji/JFugue-for-Android/wiki) for configurations and using of this library.
About the JFugue features, see [the original documents](http://www.jfugue.org/examples.html).

License
=======
- JFugue for Android's license is same as the original, [LGPL](https://www.gnu.org/licenses/lgpl.html).
- Other modified referencial library's license is also same as original. See each directories' license file for more information.
- Other modified referential library's license is also same as original. See each directories' license file for more information.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.android.tools.build:gradle:1.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 07 12:29:19 JST 2014
#Fri Feb 20 18:07:10 JST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
16 changes: 8 additions & 8 deletions jfugue-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
buildToolsVersion '21.1.2'
defaultConfig {
applicationId 'jp.kshoji.android.jfugue'
minSdkVersion 12
targetSdkVersion 19
versionCode 1
versionName '4.0.3'
}
buildTypes {
release {
runProguard false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
lintOptions {
abortOnError false
}
}

repositories {
maven {
url 'https://github.com/kshoji/USB-MIDI-Driver/raw/feature/add_j.s.m.Synthesizer/MIDIDriver/snapshots'
url 'https://github.com/kshoji/javax.sound.midi-for-Android/raw/master/javax.sound.midi/repository'
}
mavenCentral()
}
Expand All @@ -35,18 +35,18 @@ configurations.compile {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'xom:xom:1.2.5'
compile 'jp.kshoji:midi-driver:0.0.1-SNAPSHOT:@aar'
compile 'jp.kshoji:javax-sound-midi:0.0.1:@aar'
compile project(':mod_xalan')
}

apply plugin: 'maven'
group = 'jp.kshoji'
version = '4.0.3'
uploadArchives {
repositories {
mavenDeployer {
pom.version = '4.0.3'
pom.artifactId = 'jfugue-android'
repository url: 'file://' + file('snapshot').absolutePath
}
}
Expand Down
74 changes: 0 additions & 74 deletions jfugue-android/jfugue-android.iml

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
48d9c8fbc0202308c94eb085fbb54fd4
fcc39ac695d034789c83909fc7958594
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d6b2a9a28500304f78996a935ae7bb1b6555f589
cb82b7f1288c6c2e7259bb46a93c1801b72d9b37
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@
<version>4.0.3</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>19.+</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.kshoji</groupId>
<artifactId>midi-driver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>aar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>JFugue-for-Android</groupId>
<artifactId>mod_xalan</artifactId>
Expand All @@ -32,5 +19,12 @@
<version>1.2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.kshoji</groupId>
<artifactId>javax-sound-midi</artifactId>
<version>0.0.1</version>
<type>aar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17a0cd981872cb0b9c1277d9befef429
000e7a39ca6e765572e3adc09cdfb46d
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f1eeed2f3ae431acbdbff14717986580e240ef97
93138d2d02f9fb523486482f3127087e8f82e3a6
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<version>0.0.1-SNAPSHOT</version>
<version>4.0.3</version>
</versions>
<lastUpdated>20140708100100</lastUpdated>
<lastUpdated>20150220103148</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2c07e5b967a6edf1f95dce9b64fc588c
2d0df02f0edbad516f45fcdd03f153fe
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d2239cb1e5f6e661f2f6c9d08244857892471e3c
5d8a8ec6a47ef4ba166c9ff79f73b5066a43a3f2
8 changes: 0 additions & 8 deletions jfugue-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jp.kshoji.jfugueforandroid">

<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">

</application>

</manifest>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions jfugue-android/src/main/res/values/strings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions jfugue-android/src/main/res/values/styles.xml

This file was deleted.

Loading

0 comments on commit d7a2f07

Please sign in to comment.