1 From 0e4808a1513ea9f7a7d7c24911ec7dd0e7ccc02f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
3 Date: Wed, 8 Jul 2020 11:34:01 +0200
4 Subject: [PATCH] Add support for conversion and selection of OPUS audios. #65
7 src/Configs/Constants.vala | 3 ++-
8 src/Controllers/ConverterController.vala | 13 ++++++++++++-
9 src/Widgets/SourceListSidebar.vala | 4 +++-
10 3 files changed, 17 insertions(+), 3 deletions(-)
12 diff --git a/src/Configs/Constants.vala b/src/Configs/Constants.vala
13 index 64143c9..f163ff5 100644
14 --- a/src/Configs/Constants.vala
15 +++ b/src/Configs/Constants.vala
16 @@ -61,6 +61,7 @@ namespace Ciano.Configs {
17 public abstract const string TEXT_AAC = "AAC";
18 public abstract const string TEXT_MMF = "MMF";
19 public abstract const string TEXT_M4A = "M4A";
20 + public abstract const string TEXT_OPUS = "OPUS";
21 public abstract const string TEXT_WAV = "WAV";
22 public abstract const string TEXT_FLAC = "FLAC";
23 public abstract const string TEXT_AIFF = "AIFF";
24 @@ -76,4 +77,4 @@ namespace Ciano.Configs {
25 public abstract const string [] ABOUT_AUTHORS = { "Robert San <robertsanseries@gmail.com>" };
26 public abstract const Gtk.License ABOUT_LICENSE_TYPE = Gtk.License.GPL_3_0;
29 \ No newline at end of file
31 diff --git a/src/Controllers/ConverterController.vala b/src/Controllers/ConverterController.vala
32 index b639d11..756a7cb 100644
33 --- a/src/Controllers/ConverterController.vala
34 +++ b/src/Controllers/ConverterController.vala
35 @@ -721,6 +721,12 @@ namespace Ciano.Controllers {
36 get_array_formats_videos (StringUtil.EMPTY)
39 + case Constants.TEXT_OPUS:
40 + formats = ArrayUtil.join_generic_string_arrays (
41 + get_array_formats_music (Constants.TEXT_OPUS),
42 + get_array_formats_videos (StringUtil.EMPTY)
46 case Constants.TEXT_JPG:
47 formats = get_array_formats_image (Constants.TEXT_JPG);
48 @@ -894,6 +900,11 @@ namespace Ciano.Controllers {
49 array.add (Constants.TEXT_M4A.up());
52 + if(format_music != Constants.TEXT_OPUS) {
53 + array.add (Constants.TEXT_OPUS);
54 + array.add (Constants.TEXT_OPUS.up());
60 diff --git a/src/Widgets/SourceListSidebar.vala b/src/Widgets/SourceListSidebar.vala
61 index eeaba78..129d525 100644
62 --- a/src/Widgets/SourceListSidebar.vala
63 +++ b/src/Widgets/SourceListSidebar.vala
64 @@ -117,6 +117,7 @@ namespace Ciano.Widgets {
65 var aiff_item = new SourceList.Item (Constants.TEXT_AIFF);
66 var mmf_item = new SourceList.Item (Constants.TEXT_MMF);
67 var m4a_item = new SourceList.Item (Constants.TEXT_M4A);
68 + var opus_item = new SourceList.Item (Constants.TEXT_OPUS);
70 music_list.add (mp3_item);
71 music_list.add (wma_item);
72 @@ -127,6 +128,7 @@ namespace Ciano.Widgets {
73 music_list.add (aiff_item);
74 music_list.add (mmf_item);
75 music_list.add (m4a_item);
76 + music_list.add (opus_item);
78 this.type_list.add (music_list);
80 @@ -161,4 +163,4 @@ namespace Ciano.Widgets {
81 this.type_list.add (image_list);
85 \ No newline at end of file