Skip to content

Commit

Permalink
Add stub classes of com.jblend.media.smaf.phrase
Browse files Browse the repository at this point in the history
  • Loading branch information
woesss committed Dec 8, 2023
1 parent a798427 commit 693743c
Show file tree
Hide file tree
Showing 10 changed files with 394 additions and 0 deletions.
41 changes: 41 additions & 0 deletions app/src/main/java/com/j_phone/system/DeviceControl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.j_phone.system;

import javax.microedition.lcdui.keyboard.VirtualKeyboard;
import javax.microedition.util.ContextHolder;

public class DeviceControl {
private static final DeviceControl deviceControl = new DeviceControl();

public static DeviceControl getDefaultDeviceControl() {
return deviceControl;
}

public int getDeviceState(int device) {
if (device != 3) {
return 0;
}
VirtualKeyboard vk = ContextHolder.getVk();
if (vk == null) return 0;
return vk.getKeyStatesVodafone();
}

public boolean setDeviceActive(int device, boolean active) {
return true;
}
}
29 changes: 29 additions & 0 deletions app/src/main/java/com/jblend/media/smaf/phrase/AudioPhrase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

import java.io.IOException;

public class AudioPhrase extends PhraseBase {
public AudioPhrase(byte[] data) {
super(data);
}

public AudioPhrase(String url) throws IOException {
super(url);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

public class AudioPhraseTrack extends PhraseTrackBase {
private AudioPhrase phrase;

AudioPhraseTrack(int id) {
super(id);
}

public void setPhrase(AudioPhrase p) {
phrase = p;
}

public AudioPhrase getPhrase() {
return phrase;
}
}
29 changes: 29 additions & 0 deletions app/src/main/java/com/jblend/media/smaf/phrase/Phrase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

import java.io.IOException;

public class Phrase extends PhraseBase {
public Phrase(byte[] data) {
super(data);
}

public Phrase(String url) throws IOException {
super(url);
}
}
33 changes: 33 additions & 0 deletions app/src/main/java/com/jblend/media/smaf/phrase/PhraseBase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

import java.io.IOException;

abstract class PhraseBase {
public PhraseBase(byte[] data) {}

public PhraseBase(String url) throws IOException {}

public int getSize() {
return 0;
}

public int getUseTracks() {
return 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

public interface PhraseEventType {
int EV_END = -1;
int EV_LOOP = -2;
int EV_PAUSE = -3;
int EV_USER_0 = 0;
int EV_USER_1 = 1;
int EV_USER_2 = 2;
int EV_USER_3 = 3;
int EV_USER_4 = 4;
int EV_USER_5 = 5;
int EV_USER_6 = 6;
int EV_USER_7 = 7;
int EV_USER_8 = 8;
int EV_USER_9 = 9;
int EV_USER_10 = 10;
int EV_USER_11 = 11;
int EV_USER_12 = 12;
int EV_USER_13 = 13;
int EV_USER_14 = 14;
int EV_USER_15 = 15;
}
64 changes: 64 additions & 0 deletions app/src/main/java/com/jblend/media/smaf/phrase/PhrasePlayer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

public class PhrasePlayer {
private static final PhrasePlayer phrasePlayer = new PhrasePlayer();

protected int trackCount;
protected int audioTrackCount;

public static PhrasePlayer getPlayer() {
return phrasePlayer;
}

public void disposePlayer() {}

public PhraseTrack getTrack() {
return new PhraseTrack(trackCount++);
}

public AudioPhraseTrack getAudioTrack() {
return new AudioPhraseTrack(audioTrackCount++);
}

public int getTrackCount() {
return 16;
}

public int getAudioTrackCount() {
return 16;
}

public PhraseTrack getTrack(int track) {
return null;
}

public AudioPhraseTrack getAudioTrack(int track) {
return null;
}

public void disposeTrack(PhraseTrack t) {}

public void disposeAudioTrack(AudioPhraseTrack t) {}

public void kill() {}

public void pause() {}

public void resume() {}
}
37 changes: 37 additions & 0 deletions app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

public class PhraseTrack extends PhraseTrackBase {
PhraseTrack(int id) {
super(id);
}

public void setPhrase(Phrase p) {}

public Phrase getPhrase() {
return null;
}

public void removePhrase() {}

public void setSubjectTo(PhraseTrack master) {}

public PhraseTrack getSyncMaster() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2023 Yury Kharchenko
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.jblend.media.smaf.phrase;

abstract class PhraseTrackBase {
public static final int NO_DATA = 1;
public static final int READY = 2;
public static final int PLAYING = 3;
public static final int PAUSED = 5;
public static final int DEFAULT_VOLUME = 100;
public static final int DEFAULT_PANPOT = 64;

PhraseTrackBase(int id) {}

public void removePhrase() {}

public void play() {}

public void play(int loop) {}

public void stop() {}

public void pause() {}

public void resume() {}

public int getState() {
return PLAYING;
}

public void setVolume(int value) {}

public int getVolume() {
return 0;
}

public void setPanpot(int value) {}

public int getPanpot() {
return 0;
}

public void mute(boolean mute) {}

public boolean isMute() {
return true;
}

public int getID() {
return 0;
}

public void setEventListener(PhraseTrackListener l) {}
}
Loading

0 comments on commit 693743c

Please sign in to comment.