Skip to content

Commit 30d9ef9

Browse files
committed
v2.2.0
1 parent cbff728 commit 30d9ef9

26 files changed

+489
-402
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,8 @@ cython_debug/
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
#.idea/
163163

164-
# From SyntaxticSugr
165-
in/**/*.zip
164+
# Ignore everything in the input folder
165+
in/*
166+
# But keep README.md and download.py
167+
!in/README.md
168+
!in/download.py

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
`Preset(.xml)` are patched _as & if_ necessary to work on the latest ViPER4Android.
1515

16-
Values of `Master Limiter` & `Playback Gain Control` are set to [ViPER Defaults](https://github.com/syntaxticsugr/ViPER4Android-Presets/tree/main/src/utils/default_presets) for all `Preset(.xml)`.
16+
Values of `Master Limiter` & `Playback Gain Control` are set to [ViPER Defaults](https://github.com/syntaxticsugr/ViPER4Android-Presets/tree/main/default_presets) for all `Preset(.xml)`.
1717

1818
<br>
1919

2020
### Release Info
2121

22-
| [v2.1.0](https://github.com/syntaxticsugr/ViPER4Android-Presets/releases/latest) | Full | Lite | Recommended |
22+
| [v2.2.0](https://github.com/syntaxticsugr/ViPER4Android-Presets/releases/latest) | Full | Lite | Recommended |
2323
| --- | --- | --- | --- |
2424
|| All `Preset`s<br>All `Kernel`s<br>All `DDC`s | Unique `Preset`s<br>Required `Kernel`s<br>Required `DDC`s | Unique `Preset`s<br>Unique `Kernel`s<br>Unique `DDC`s |
2525
| **Preset** | 1685 | 851 | 851 |
26-
| **Kernel** | 1868 | 196 | 1557 |
27-
| **DDC** | 562 | 45 | 540 |
26+
| **Kernel** | 2306 | 197 | 1716 |
27+
| **DDC** | 626 | 45 | 580 |
2828

2929
<br>
3030

default_presets/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div align="center">
2+
+-----------+-----------------+------------------------------------------+<br>
3+
| m1 | Mode 1 | Headset, Bluetooth, USB |<br>
4+
+-----------+-----------------+------------------------------------------+<br>
5+
| m2 | Mode 2 |      Speaker      |<br>
6+
+-----------+-----------------+------------------------------------------+<br>
7+
</div>

default_presets/default_m2.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
2+
<map>
3+
<int name="32775" value="2" />
4+
<boolean name="36868" value="false" />
5+
<int name="65586" value="11" />
6+
<int name="65588" value="5" />
7+
<boolean name="65565" value="false" />
8+
<int name="65566" value="0" />
9+
<int name="65567" value="3" />
10+
<int name="65568" value="3" />
11+
<boolean name="65610" value="false" />
12+
<int name="65611" value="100" />
13+
<int name="65612" value="100" />
14+
<int name="65613" value="0" />
15+
<boolean name="65614" value="true" />
16+
<int name="65615" value="0" />
17+
<boolean name="65616" value="true" />
18+
<int name="65617" value="20" />
19+
<boolean name="65618" value="true" />
20+
<int name="65619" value="50" />
21+
<boolean name="65620" value="true" />
22+
<int name="65621" value="0" />
23+
<int name="65622" value="80" />
24+
<int name="65623" value="100" />
25+
<int name="65624" value="100" />
26+
<int name="65625" value="50" />
27+
<boolean name="65626" value="true" />
28+
<boolean name="65551" value="false" />
29+
<string name="65552">0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;</string>
30+
<boolean name="65538" value="false" />
31+
<string name="65540;65541;65542"></string>
32+
<int name="65543" value="0" />
33+
<boolean name="65559" value="false" />
34+
<int name="65560" value="0" />
35+
<int name="65561" value="0" />
36+
<int name="65562" value="0" />
37+
<int name="65563" value="0" />
38+
<int name="65564" value="50" />
39+
<boolean name="65603" value="false" />
40+
</map>

src/utils/default_presets/m1_keys.txt renamed to default_presets/m1_keys.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mode 1 (M1) = Headset, Bluetooth, USB
1+
m1 (Mode 1) = Headset, Bluetooth, USB
22
-------------------------------------
33

44
# Mode

src/utils/default_presets/m2_keys.txt renamed to default_presets/m2_keys.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mode 2 (M2) = Speaker
1+
m2 (Mode 2) = Speaker
22
---------------------
33

44
# Mode

in/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ S.No. | Author | DDC, Kernel & Preset
99
**1** | [Jadilson Guedes](https://github.com/jadilson12) | [Viper4Android-presets](https://github.com/jadilson12/Viper4Android-presets)
1010
**2** | [Joe0Bloggs](https://github.com/Joe0Bloggs) | [IRS](https://www.dropbox.com/sh/vbnj47jcnbgrvkv/AAAcAP6ypyGJa0995Nq37PEFa)
1111
**3** | [John Fawkes](https://github.com/JohnFawkes) | [ViperIRS](https://drive.google.com/file/d/1Bii6ER0cNgHMspVozMIfYfFAu3l16d_-/view?usp=sharing)
12+
**4** | [programminghoch10](https://github.com/programminghoch10) | [ViPER4AndroidRepackaged](https://github.com/programminghoch10/ViPER4AndroidRepackaged)
13+
**5** | [WSTxda](https://github.com/WSTxda) | [ViperFX-RE-Releases](https://github.com/WSTxda/ViperFX-RE-Releases)
1214

1315
Special thanks to the respective developers for their contributions.

in/download.py

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,54 @@
1-
import os
21
import gdown
2+
from pathlib import Path
3+
from utils import create_directories
34

5+
def download_files(download_dir: Path, file_ids: dict) -> None:
6+
"""
7+
Downloads files from Google Drive using their file IDs and saves them into
8+
a specified directory. It organizes the files by author, creating a separate
9+
folder for each author.
410
11+
Args:
12+
download_dir (str): The directory where the files should be saved.
13+
file_ids (dict): A dictionary where each key is an author name and the value
14+
is another dictionary with file names as keys and Google Drive file IDs as values.
15+
"""
516

6-
def download_files(download_dir, file_ids):
7-
8-
for author, file_id in file_ids.items():
9-
10-
download_dir = f'{download_dir}/{author}'
11-
os.makedirs(download_dir, exist_ok=True)
12-
13-
output = f'{download_dir}/{author}.zip'
14-
15-
gdown.download(id=file_id, output=output)
16-
17+
for author, files in file_ids.items():
18+
author_dir = download_dir/author
19+
create_directories([author_dir])
1720

21+
for file_name, file_id in files.items():
22+
out_file = author_dir/f'{file_name}.zip'
23+
gdown.download(id=file_id, output=out_file)
1824

1925
if __name__ == "__main__":
2026

21-
download_dir = 'in'
27+
download_dir = Path('in')
2228

29+
# {
30+
# 'author': {
31+
# 'file_name': 'file_id'
32+
# }
33+
# }
2334
file_ids = {
24-
'jadilson12': '19pn29medRLzy8m9uPzkPmpvPSgHIsbz7',
25-
'Joe0Bloggs': '19rEUl8QlBUWpgWrpaMxv2XnEVpZxXavV',
26-
'JohnFawkes': '19thPV8G2eOohh-ihUJadEL3bwqwgvd-G'
35+
'jadilson12': {
36+
'Viper4Android-presets': '19pn29medRLzy8m9uPzkPmpvPSgHIsbz7'
37+
},
38+
'Joe0Bloggs': {
39+
'IRS': '19rEUl8QlBUWpgWrpaMxv2XnEVpZxXavV'
40+
},
41+
'JohnFawkes': {
42+
'ViperIRS': '19thPV8G2eOohh-ihUJadEL3bwqwgvd-G'
43+
},
44+
'programminghoch10': {
45+
'ViperIRS': '1mu3l2mLuRlpuIIKUoA6a6Eg2Y27xEcrl',
46+
'ViperVDC': '1oojAJp8ze7SzC5KHoGGGb6x1MIuSekjL'
47+
},
48+
'WSTxda': {
49+
'DDC': '1CKByuHZ_6AMHDC2NIo2H92ZEkR6Cv1SR',
50+
'Kernel': '1y1HiV-SvzmqoYEzAIuztV-tya6DkYQzO'
51+
}
2752
}
2853

2954
download_files(download_dir, file_ids)

main.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import os
2+
import sys
3+
from pathlib import Path
4+
from pipe.convert import convert_presets
5+
from pipe.extract import extract_archives
6+
from pipe.filter import filter_irs_vdc_xml
7+
from pipe.release import create_release
8+
from utils.create_directories import create_directories
9+
10+
def process(input_dir: Path, output_dir: Path, version: str):
11+
extract_dir = extract_archives(input_dir, output_dir)
12+
irs_dir, vdc_dir, xml_dir = filter_irs_vdc_xml(extract_dir, output_dir)
13+
preset_converted_dir = convert_presets(xml_dir, output_dir)
14+
release_dir = create_release(irs_dir, vdc_dir, preset_converted_dir, output_dir, version)
15+
print(f"Files Saved In: {release_dir}")
16+
17+
def main(input_dir: Path, output_dir: Path, version: str):
18+
if not os.path.isdir(input_dir):
19+
print(f"Error: The input directory '{input_dir}' does not exist.")
20+
sys.exit(1)
21+
22+
create_directories([output_dir])
23+
process(input_dir, output_dir, version)
24+
25+
if __name__ == "__main__":
26+
27+
version = '2.2.0'
28+
29+
input_dir = Path('in')
30+
output_dir = Path('build/output')
31+
32+
main(input_dir, output_dir, version)

0 commit comments

Comments
 (0)