From 693743c6bb9e9fdb7ada407c2c017800745c0f09 Mon Sep 17 00:00:00 2001 From: woesss Date: Thu, 7 Dec 2023 11:44:22 +0300 Subject: [PATCH] Add stub classes of com.jblend.media.smaf.phrase --- .../com/j_phone/system/DeviceControl.java | 41 +++++++++++ .../jblend/media/smaf/phrase/AudioPhrase.java | 29 ++++++++ .../media/smaf/phrase/AudioPhraseTrack.java | 33 +++++++++ .../com/jblend/media/smaf/phrase/Phrase.java | 29 ++++++++ .../jblend/media/smaf/phrase/PhraseBase.java | 33 +++++++++ .../media/smaf/phrase/PhraseEventType.java | 39 +++++++++++ .../media/smaf/phrase/PhrasePlayer.java | 64 +++++++++++++++++ .../jblend/media/smaf/phrase/PhraseTrack.java | 37 ++++++++++ .../media/smaf/phrase/PhraseTrackBase.java | 68 +++++++++++++++++++ .../smaf/phrase/PhraseTrackListener.java | 21 ++++++ 10 files changed, 394 insertions(+) create mode 100644 app/src/main/java/com/j_phone/system/DeviceControl.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/AudioPhrase.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/AudioPhraseTrack.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/Phrase.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhraseBase.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhraseEventType.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhrasePlayer.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrack.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackBase.java create mode 100644 app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackListener.java diff --git a/app/src/main/java/com/j_phone/system/DeviceControl.java b/app/src/main/java/com/j_phone/system/DeviceControl.java new file mode 100644 index 00000000..15b6ecfc --- /dev/null +++ b/app/src/main/java/com/j_phone/system/DeviceControl.java @@ -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; + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhrase.java b/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhrase.java new file mode 100644 index 00000000..5536f114 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhrase.java @@ -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); + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhraseTrack.java b/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhraseTrack.java new file mode 100644 index 00000000..2659ecf9 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/AudioPhraseTrack.java @@ -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; + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/Phrase.java b/app/src/main/java/com/jblend/media/smaf/phrase/Phrase.java new file mode 100644 index 00000000..38821ce7 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/Phrase.java @@ -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); + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhraseBase.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseBase.java new file mode 100644 index 00000000..54a6ebcb --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseBase.java @@ -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; + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhraseEventType.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseEventType.java new file mode 100644 index 00000000..74786763 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseEventType.java @@ -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; +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhrasePlayer.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhrasePlayer.java new file mode 100644 index 00000000..2a02d0f0 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhrasePlayer.java @@ -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() {} +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrack.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrack.java new file mode 100644 index 00000000..4e4d5e45 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrack.java @@ -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; + } +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackBase.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackBase.java new file mode 100644 index 00000000..5cad6653 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackBase.java @@ -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) {} +} diff --git a/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackListener.java b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackListener.java new file mode 100644 index 00000000..ecfbb6f5 --- /dev/null +++ b/app/src/main/java/com/jblend/media/smaf/phrase/PhraseTrackListener.java @@ -0,0 +1,21 @@ +/* + * 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 PhraseTrackListener { + void eventOccurred(int event); +}